Thread: Window procs and the like

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    5

    Talking Window procs and the like

    I have created an application using CreateWindowEx etc to make all of the main windows, however. upon creating buttons, the window messages from them get sent to the parent window in the form of WM_COMMAND, param(BN_CLICKED). i need to move one of the buttons of my form and into another window, which i do not own. i have seen a WindowProc made especially for a button, (named buttonProc), however i cannot remember how to do it. can anyone help???

    many thanks

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    When you create the class for the button specify the buttonproc as the callback

    ie
    WndClassButton.lpfnWndProc=(WNDPROC)ButtonProc;

    or process the messages in the default callback by sending your own user defined message to the other callback with SendMessage()
    Last edited by novacain; 10-26-2001 at 01:08 AM.

  3. #3
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    I don't think that would work, cause you see, a button has its own class predefined, so you can't mess with it.

    Oskilian

  4. #4
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    If the button wasn't of the predefined type then they could do it. Alternatively, you can try and change WinProc's using SetWindowLong().
    zen

Popular pages Recent additions subscribe to a feed