Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29245 討論

Trapping Window messages in full screen mode

alfredwodell
初學者
595 檢視
I have a routine which traps keyboard & mouse messages to a window by
subclassing.
This works ok except when I use it with standard graphics in full screen mode.
How can I get it to work in full screen mode?
Also how can I detect if I am in full screen mode & can I change the mode
by program (rather than Alt+Enter)?
0 積分
2 回應
Jugoslav_Dujic
傑出貢獻者 II
595 檢視

Brief examination with Spy++ shows that in "Full Screen Mode" the output doesn't go to the normal child window. Instead, QW creates another window, with style WS_POPUP, without title, and with class name AppName//"FullWnd". Mechanics of it are not well documented, of course, so you could start some reverse-engineering :-(.

I guess you can try to FindWindow("AppName"//"FullWnd"C, NULL) to see if there's one; if it is, you're in full screen mode. Perhaps you could subclass the FullWnd window right after you find one *)

Another undocumented trick to toggle fullscreen is to

call ClickMenuQQ(LOC(WinFullScreen))

An alternate approach to subclassing is hooking. It is similar, except that hook procedure (WH_KEYBOARD or WH_MOUSE) is called before the message reaches message loop (thus,before subclassing procedure), and it catches messages for all windows in the thread rather than just one. See SetWindowsHookEx (I posted some examples in the past here, so you could do a Forum search for it).

Jugoslav

*) FindWindow is not reliable if there are several instances of your program running simultaneously -- it will detect if any instance is in full screen. A better approach is to EnumThreadWindows(GetCurrentThreadID()...) and check whether GetClassName of one matches.

alfredwodell
初學者
595 檢視

Thanks for pointing me in the right direction.

I eventually looked for the foreground window and checked if it was a pop up,

then subclassed that window.

回覆