New window on button press - Programmers Heaven

Howdy, Stranger!

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


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?


  • MoonClownMoonClown NYPosts: 1Member

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

  • pseudocoderpseudocoder Posts: 693Member ✭✭✭

    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
        case WM_COMMAND : 
            if(LOWORD(wParam) == button_identifier)
                if(HIWORD(wParam) == BN_CLICKED)
                    // do something like call ShellExecute, 
                    // show a window,  whatever
       // other code
Sign In or Register to comment.