How to make Create Window Work?

Ruby The Roobster michaeleverestc79 at gmail.com
Wed Dec 9 17:25:10 UTC 2020


Here is the code im using:

extern(Windows)
LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM 
lParam) nothrow
{
     scope (failure) assert(0);

     HDC hdc;
     PAINTSTRUCT ps;
     RECT rect;

     switch (message)
     {
         case WM_CREATE:
              CreateWindow("BUTTON".toUTF16z,      // window class 
name
                          "The Hello Program",  // window caption
                          WS_CHILD | WS_VISIBLE,  // window style
                          CW_USEDEFAULT,        // initial x 
position
                          CW_USEDEFAULT,        // initial y 
position
                          250,        // initial x size
                          250,        // initial y size
                          hwnd,                 // parent window 
handle
                          0,                 // window menu handle
                          NULL,            // program instance 
handle
                          NULL);
                          return 0;
         case WM_COMMAND:
         case WM_DESTROY:
             PostQuitMessage(0);
             return 0;

         default:
     }

     return DefWindowProc(hwnd, message, wParam, lParam);
}


This gives an error saying: Cannot pas argument of type 'int' to 
argument of type 'void*'. How is this fixed?


More information about the Digitalmars-d-learn mailing list