Kolja Märtens wrote:
Ben Voigt [C++ MVP] schrieb:
>>
ShowWindow should have worked fine and set the WS_VISIBLE flag even
when the application runs on a service desktop.
What do you mean by "service desktop"?
The Callback is indeed invoked even when the user is logged of as long
as the Service has the right to interact with the desktop.
Big drawback is, once a user logs in, the Window is displayed and
thats something I definetly dont want.
If you don't check that "Interact with user's desktop" permission (which is
not even available in newer versions of Windows), your service runs in a
separate desktop just for services. This way it can create windows, pass
messages to other services' windows, etc, but there's a security barrier
between windows of trusted services and windows in the user's logon session.
This prevents the "shatter attack".
>
>However, if the callback is triggered by WM_PAINT it will only
happen when the window really is on the screen. However, you can
InvalidateWind ow and SendMessage WM_PAINT to the window yourself.
I tracked all window messages in my dummy window class and passed them
on to the NativeWindow WndProc. Seems like the window was only used
during initialization because when the process starts drawing the
Pictures (in an overlay i suppose) there are no more window messages
coming in.
Heres what WndProc is getting:
36 WM_GETMINMAXINF O
129 WM_NCCREATE
131 WM_NCCALCSIZE
1 WM_CREATE
24 WM_SHOWWINDOW
70 WM_WINDOWPOSCHA NGING
70 WM_WINDOWPOSCHA NGING
28 WM_ACTIVATEAPP
13 WM_GETTEXT
134 WM_NCACTIVATE
642 WM_IME_NOTIFY
641 WM_IME_SETCONTE XT
7 WM_SETFOCUS
6 WM_ACTIVATE
13 WM_GETTEXT
133 WM_NCPAINT
20 WM_ERASEBKGND
71 WM_WINDOWPOSCHA NGED
5 WM_SIZE
3 WM_MOVE
I just realized that there is indeed one WM_PAINT.
From what I know about video overlay I think the Background of the
Window is changed to magenta to mark the aerea to overlay.
Ill have to read about what InvalidateWindo w does...
>>>I suppose I should overwrite the function that is used for
detecting if the window is visible and sinply return true, but i
have no clue what funtion that is.
still looking for that.
Bad idea. The function is provided by Microsoft inside USER32.dll.
I was hoping for something like "bool isVisible()" in the
Windowclass... I know by now this is not the way things work around
here :)
You mean like
http://msdn.microsoft.com/en-us/libr...30(VS.85).aspx ?
Though if you were hoping for "virtual bool isVisible()" that you could
override, you're out of luck. There's one implementation inside USER32.DLL
which is used for all windows, and there's nothing like a v-table that would
allow you to change it. Only the window procedure can be replaced on a
per-window basis (this is called subclassing).