[WINAPI] Window in D

Phil Lavoie maidenphil at hotmail.com
Fri Dec 28 08:25:29 PST 2012


> Ouch! What does this function return? Shouldn't typeof(return) 
> be LRESULT?
>
> extern(Windows):
What he says is good, but I believe you should add nothrow to 
that:
extern( Windows ) nothrow:
> LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM 
> lParam)
> {
> switch (message)
> {
>     case WM_DESTROY:
>         PostQuitMessage (0);
>         break;
>     default:
>        break;
> }
>
> return DefWindowProcA (hwnd, message, wParam, lParam);
> }



More information about the Digitalmars-d-dtl mailing list