|
-
Sep 8th, 2001, 09:18 PM
#1
Thread Starter
Lively Member
Problems with button commands (with WndProc)
Tnx to everybody who helped me on that last thread. Now, I would like to learn about each of the specific parts of the wParam and lParam (I am tired of searching for explanations of each of those on the Internet, because no site ever explains it), and also a good command for when you click a button.
Tnx!
- Justin Patrick Butler
Comme je trouve. "As I find."
- Butler family quote
Beneficia sumptos procul superant. "The benefits far exceed the costs."
- Myself
-
Sep 8th, 2001, 09:24 PM
#2
Frenzied Member
wParam and lParam depend of the message and so does the info they cary. When you click a button a WM_COMMAND message is sent. Here is how to handle it:
Code:
switch (message)
{
case WM_COMMAND:
{
if ((HWND)lParam == HWNDofbutton)
//the button is clicked
}
break;
}
-
Sep 8th, 2001, 11:03 PM
#3
Thread Starter
Lively Member
Hey, it works! Tnx!
- Justin Patrick Butler
Comme je trouve. "As I find."
- Butler family quote
Beneficia sumptos procul superant. "The benefits far exceed the costs."
- Myself
-
Sep 9th, 2001, 07:15 AM
#4
Bad manner Abdul
just because the hwnd is the buttons hwnd that does not necessarily mean that the button was clicked.
Actually, with a normal button the only other option is doubleclicked, but just out of principle...
Code:
if(LOWORD(wParam) == BUTTONID && HIWORD(wParam) == BN_CLICKED)...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 9th, 2001, 07:06 PM
#5
PowerPoster
Originally posted by CornedBee
Bad manner Abdul
[/code]
Me? I have not posted anything in this thread before
-
Sep 10th, 2001, 06:36 AM
#6
OOps, sorry ! I meant Vlatko. 
The problem are not buttons, but I have seen the same thing used to see if a edit box was clicked, and they wondered why the response came two times. I think the thread is called "Twins?".
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|