How to make Create Window Work?
Ruby The Roobster
michaeleverestc79 at gmail.com
Wed Dec 9 17:45:18 UTC 2020
On Wednesday, 9 December 2020 at 17:42:50 UTC, Adam D. Ruppe
wrote:
> On Wednesday, 9 December 2020 at 17:37:16 UTC, Ruby The
> Roobster wrote:
>> It's not the 'NULL' that's the error.
>
> I know.
>
>> It doesn't compile because of the '0'
>> . That is what I need to fix, since I want to make a
>> WM_COMMAND for that button.
>
> Use lowercase `null` instead.
I did. Still gives an error:
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);
}
More information about the Digitalmars-d-learn
mailing list