Results 1 to 6 of 6

Thread: Problems with button commands (with WndProc)

  1. #1

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    Arrow 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

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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;
    }
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    Talking

    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

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by CornedBee
    Bad manner Abdul
    [/code]
    Me? I have not posted anything in this thread before
    Baaaaaaaaah

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width