There is no such thing as WS_TOPMOST or WS_SETFOREGROUND - unless you've difined them yourself.

I don't recommend casting any function parameters. The correct signature will be
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM)
or
INT_PTR CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM)
depending on your version of the SDK.

Get rid of WS_CHILD and WS_POPUP and the 3rd parameter to DialogBox() should be 0.

For WM_COMMAND, you need to switch on LOWORD(wParam) and case on ID_DLGOK, not IDOK.

gg