|
-
February 22nd, 2008, 11:24 AM
#2
Re: Events on WinApi C++
There are several problems I can see here.
1) You should use the resource editor to create a dialog resource and then use CreateDialog vs CreateWindow when creating a dialog. You can put the button control in the dialog resource so you don't have to create it in code.
2) A button does not have a dialogproc. It has a wndproc which for what you are trying to do should be sufficient. What you need to do is have the dialog (parent of the button) handle WM_COMMAND message for BN_CLICK with the id of the button.
3) Before you start pumping messages, call ShowWindow(hDlg) and UpdateWindow(hDlg).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|