Hello Everyone,
I have a small problem that I can't seem to figure out.
I am trying to get the "Program Manager's" hanlde.
I am currently retreiving the title from the handle and making sure its value is "Prgram Manager". My question is the following : is there a better way to retreive the Program Manager's handle without reading the title ? (Something like GetDesktopWindow() for the desktop's handle, or by reading its class?). If there isnt a better way, is this current method safe ?
My goal is to detect, when a hotkey is pressed, if there is a full screen apllication that is focused.
Im retreiving the handle with GetForegroundWindow.
Im retreiving its title to make sure I skip Program Manager.
Im retreiving its size with GetWindowLongA()
And I calculate its width and its height and compare it to the current resolution.
This method works great except for the fact that when the taskbar is set to autohide, the program manager window matches the width and height of the screen resolution. (with a difference of 8 pixels because windows seems to calculate differently on certain screens. If anyone has the answer to this I would like to know why !) That is why I must make sure i skip the program manager.
I also do not detect if its topmost window or not, like some people say I should, for the simple fact that most games are not topmost.
Spy++ give me handle 590018 decimal or 900c2 hex for the program manager.
If anyone has answers for my small questions it would be very appreciated.
Thank you
I have a small problem that I can't seem to figure out.
I am trying to get the "Program Manager's" hanlde.
I am currently retreiving the title from the handle and making sure its value is "Prgram Manager". My question is the following : is there a better way to retreive the Program Manager's handle without reading the title ? (Something like GetDesktopWindow() for the desktop's handle, or by reading its class?). If there isnt a better way, is this current method safe ?
My goal is to detect, when a hotkey is pressed, if there is a full screen apllication that is focused.
Im retreiving the handle with GetForegroundWindow.
Im retreiving its title to make sure I skip Program Manager.
Im retreiving its size with GetWindowLongA()
And I calculate its width and its height and compare it to the current resolution.
This method works great except for the fact that when the taskbar is set to autohide, the program manager window matches the width and height of the screen resolution. (with a difference of 8 pixels because windows seems to calculate differently on certain screens. If anyone has the answer to this I would like to know why !) That is why I must make sure i skip the program manager.
I also do not detect if its topmost window or not, like some people say I should, for the simple fact that most games are not topmost.
Spy++ give me handle 590018 decimal or 900c2 hex for the program manager.
If anyone has answers for my small questions it would be very appreciated.
Thank you