Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

Intercepting WM_COMMAND in QuickWin

isn-removed200637
418 Views
I would like to be able to intercept and process F1 help messages WM_COMMAND ID_HELP when menu items in a QuickWin application are selected. To do this I need to change the window procedure.
I should be able to do this using SetWindowLong (to change the window procedure) and CallWindowProc to send messages to the original default procedure (handle obtained using GetWindowLong).
However, the documentation refers to

"Reserv[ing] extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASS structure used with the RegisterClass function".

Since the QuickWin window was set up without my being able to do this, does this mean that any attempt to do what I want will fail because of failure to alot extra memory?
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
418 Views
That sentence in the documentation has nothing special to do with subclassing; it refers to the situation when you want some application-specific data to be allocated and associtated with the window in order to avoit global data (i.e when nIndex argument is not one of predefined ones). It's connected with the sentence from the beginning of the doc on GetWindowLong:


Specifies the zero-based offset to the value to be retrieved. Valid values are in the range zero through the number of bytes of extra window memory, minus four; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To retrieve any other value, specify one of the following values:...


Subclassing of QW windows works quite fine without any messing with cbWndExtra -- just use global data instead of this memory area.

Jugoslav
0 Kudos
Reply