Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

New window on button press

MoonClownMoonClown NYPosts: 1Member

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

  • MoonClownMoonClown NYPosts: 1Member

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

  • pseudocoderpseudocoder Posts: 673Member ✭✭

    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.