Button callback problem

i cant handle button press when the button is child from another window.
when i put the button on main window, works fine, i got the clicks on WM_COMMAND (hwnd)lp

but when i put the button on another window i dont receive message from button click on WM_COMMAND


sorry for the bad english.

ill try explain

window->button works

window->Static Control->Button Fail

if you still dont understand
look this image
https://dl.dropbox.com/u/61491349/FAIL.png
Main window
-- Custom Class
-- -- Button

The button is sending messages to the custom class. If you want to handle the button in your main window, then send the message to the main window from the custom class with PostMessage(). You should have the hwnd to the parent window available in your custom class.

I'm assuming that you're using Win32.
Last edited on
hm, sometimes i got the BUTTON HWND on lParam from MainProc

i did it
1
2
3
HWND MainWindow=CreateWindowA("MyCustomClass","My Window",...
HWND Tab=CreateWindowA("SysTabCtrl32","",...
HWND Button=CreateWindowA("BUTTON","Click",WS_CHILD|WS_VISIBLE,10,10,100,24,Tab,0,0,0,0);

the Tab Window is child from MainWindow
and the Button is child from Tab
Its means which my button is sending messages to default class "BUTTON"?

there are any flag or WM_COMMAND where i can handle the button click ?

I researched a lot on google about it.
it seems I'm the only person on earth to have trouble with buttons.
Topic archived. No new replies allowed.