Win32 with D: Using RegisterClassExA instead of RegisterClass

John Chapman johnch_atms at hotmail.com
Tue Jan 28 13:27:07 PST 2014


On Tuesday, 28 January 2014 at 21:17:18 UTC, BeschBesch wrote:
> My problem: Using WNDCLASS and RegisterClass works out fine but
> when I try the Ex-versions (RegisterClassExA/WNDCLASSEX) windows
> returns a INVALID_PARAMETER error, though I did not change
> anything besides adding "Ex".
>
> Where is the mistake or is my approach totally wrong?

> 	WNDCLASSEXA wce;

You need to fill in the cbSize field like so:

          wce.cbSize = WNDCLASSEXA.sizeof;

>
> 	wce.cbClsExtra = 0;
> 	wce.cbWndExtra = 0;
> 	wce.hbrBackground = cast(HBRUSH)GetStockObject(WHITE_BRUSH);
> 	wce.hCursor = LoadCursorA(null,IDC_ARROW);
> 	wce.hIcon = LoadIconA(null, IDI_APPLICATION);
> 	wce.hIconSm = LoadIconA(null, IDI_APPLICATION);
> 	wce.hInstance = hInstance;
> 	wce.lpszClassName = cast(char*)("VolumeControl_Main");
> 	wce.style = 0;
> 	wce.lpszMenuName = null;
> 	wce.lpfnWndProc = &WinProc;


More information about the Digitalmars-d-learn mailing list