-
August 2nd, 2010, 07:15 PM
#1
Screen change
How can I detect desktop changes ?
I capture it with GetDesktopWindow(), while there are, for example, 4 open windows
Later I close one of them, I'd like to get that change right after I close that window. I mean another HWND should be reported.
Thank you
-
August 2nd, 2010, 07:51 PM
#2
Re: Screen change
GetDesktopWindow() won't help you in that. You should probably not use that API at all. To do what you want (if I understood your right) you will need a system-wide hook. Check description of the SetWindowsHookEx API for more info.
-
August 2nd, 2010, 07:56 PM
#3
Re: Screen change
Thank you but what should I hook ?
-
August 4th, 2010, 11:14 PM
#4
Re: Screen change
So someone could tll me which hook ?
-
August 4th, 2010, 11:22 PM
#5
Re: Screen change
Is this ignored because it is too easy for you ?
-
August 4th, 2010, 11:42 PM
#6
-
August 4th, 2010, 11:50 PM
#7
Re: Screen change
Thanks, I will search if there is another way to do instead of hooking
Until I can get the replies here and on other forums, I will make my skin thicker to asking more and more, I will also test how others mentally think about this too,
Thanks everyone for your time
-
August 4th, 2010, 11:53 PM
#8
-
August 5th, 2010, 02:57 AM
#9
Re: Screen change
Sorry, I didn't get an email notification about this one. I would use WH_CALLWNDPROC hook and try to catch WM_CLOSE messages sent to your windows of interest. But like Turingmachine pointed out, Windows hooks aren't a trivial thing. This one, most certainly, will have to be a global hook to monitor messages for processes other than yours, which means you will have to put it into a DLL. I haven't programmed Windows hooks since XP and I'm sure they added new restrictions to them under Vista and Windows 7. Study the link I gave you above. There's an example on how you can place a Windows hook there.
PS. What exactly are you trying to accomplish? Maybe there's an easier way to do it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|