This is giving me an error 'Invalid Window Handle' but I can't figure out why.
Code:
LRESULT CALLBACK MainWinProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch (Msg)
{
case WM_CREATE:
{
char str[80];
if (DialogBoxParam(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_NEWUSER),
hWnd,
NewUserDlgProc,
(LPARAM)str) <= 0)
{
ShowWinError();
}
}
break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc (hWnd, Msg, wParam, lParam);
}
return 0;
}
I am tring to opn a dialog for the user to enter a user name and have the dialog pass that back to the main window
The call to DialogBoxParam is throwing the invalid handle error. Any ideas?