Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

How to disable Alt+Enter in Qwin?

engineerik
Beginner
1,532 Views
Normally, Alt+Enter will switch an application to full screen mode. Can this be disabled for a quickwin app? How?
Thanks,
Erik
0 Kudos
7 Replies
anthonyrichards
New Contributor III
1,532 Views
You have to use a call to SetWindowLong to sub-class the QuickWin frame window, intersept the command generated by the ALT+ENTER combination in your new window procedure, do what you want with it and return a value for your window procedure to stop the command being passed on to the default window procedure. Meanwhile pass all other commands on to the original window procedure using CallWindowProc , whose location is obtained when you use SetWindowLong to swap the address of your new window procedure with that of the 'old' default window procedure.
0 Kudos
engineerik
Beginner
1,532 Views
Anthony,
Thanks for the detailed explanation.
Erik
0 Kudos
engineerik
Beginner
1,532 Views
Anthony (or anyone else),
Any idea what the Alt+Enter message handle is so I can capture it?
Thanks,
Erik
0 Kudos
anthonyrichards
New Contributor III
1,532 Views
ALT+ anything sends a WM_SYSKEYDOWN message. So I suggest you, write your
subclassing code, run the program and press ALT+ENTER, intercept it
and examine the arguments wparam and lparam that come with the message (I would output them in a message box having written the integers wparam and lparam to a character string using an internal write) and then pass the message on to the default window procedure using CallWindowProc so that the window messages are properly dealt with.
When you know what to look for, you can then proceed.
0 Kudos
anthonyrichards
New Contributor III
1,532 Views
Having experimented, it would appear that ALT+ a key generates a WM_SYSCOMMAND windows message, but NOT a WM_SYSKEYDOWN message, in QuickWin contrary to the SDK HELP information. It would also appear to be true that ALT+ENTER generates neither. It would appear that this combination by-passes the QuickWin window's message queue: ALT+ENTER is therefore probably reserved for the windows system's use.
0 Kudos
engineerik
Beginner
1,532 Views
Anthony,
Thanks for steering me in the right direction.
FYI to anyone else interested in this thread...
The sample project POKER is an excellent resource which demonstrates the SetWindowLong command.
I was ableto capture the Alt+Enter mesg using the following:
if( Msg == WM_SYSKEYDOWN) then
if (wParam == VK_RETURN) then
end if
end if
Erik
0 Kudos
anthonyrichards
New Contributor III
1,532 Views
I see my mistake: you have to subclass the QuickWIn CHILD window, which is the window that gets sent the ALT+ENTER message, and not the FRAME window! All is now clear.
0 Kudos
Reply