New window on button press

I am writting a launcher of sorts for my Windows OS using the WinAPI. I have the code for the button but do not know how to make that button open another Windows window that contains a web browser or a text editor. Any help?

Comments

  • 31 views... Does anyone know how to make a button open another window using the WinAPI?

  • In the default window proc, check WM_COMMAND for the button's messages. If you just want to open a browser or text editor, you can use ShellExecute.

    // default win proc
    
    switch(msg)
    {
        case WM_COMMAND : 
            if(LOWORD(wParam) == button_identifier)
            {
                if(HIWORD(wParam) == BN_CLICKED)
                    // do something like call ShellExecute, 
                    // show a window,  whatever
            }
            break;  
    
       // other code
    } 
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories