Groupbox is static control
Your button must be a child of main window.
HWND button = CreateWindow("Button", main) //button is not a child of groupbox
https://stpetrus27.wordpress.com/2018/06/04/vc-vc-dialog-without-the-resource-file/
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This is my gui structure (pseudocode):
WNDCLASS.lpfnWndProc = WindowProcessMessages; // all my messages are processed here
HWND main = CreateWindow() //this is my main window, a 500x500 box, messages are processed in WindowProcessMessages
HWND groupBox = CreateWindow(BS_GROUPBOX, main) //groupbox is a child of main
HWND button = CreateWindow("Button", groupbox) //button is a child of groupbox
However when I try to catch button click event in WindowProcessMessages
It doesn't work. So I tried to use SetWindowLongPtr(button, GWLP_WNDPROC, WindowProcessMessages)
. Now the button doesn't even show up! Any ideas? or is this simply not possible and I misunderstood SetWindowLongPtr
with GWLP_WNDPROC
?
My goal is to have button click event in WindowProcessMessages
. Thanks!
Groupbox is static control
Your button must be a child of main window.
HWND button = CreateWindow("Button", main) //button is not a child of groupbox
https://stpetrus27.wordpress.com/2018/06/04/vc-vc-dialog-without-the-resource-file/