I wonder if you help me out on an issue.
WM_INITDIALOG seems to getting ignored.
Here is a piece from your CWindow Template in Paul's WinFBE.
I have added Case WM_INITDIALOG with a Messagebox and a MessageBox within the Escape key capture.
Pressing the Escape key gives us "I am at Escape key."
However, I should be getting "I am at WM_INITDIALOG." before the Dialog is drawn but I am not getting anything.
I have been scratching my head over this for a few days and double checked WM_INITDIALOG at MSDN.
I have used WM_INITDIALOG quite a lot with PowerBASIC GUIs and need to do some subclassing initialization with a new project. Obviously, a static variable approach can be used as a workaround but I don't want to have an 'If/End If' construct executed everytime we enter WndProc.
Cheers.
Code: Select all
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
SELECT CASE uMsg
Case WM_INITDIALOG
MessageBox HWnd, "I am at WM_INITDIALOG.", "Test", MB_OK
CASE WM_COMMAND
SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
CASE IDCANCEL
' // If ESC key pressed, close the application by sending an WM_CLOSE message
IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
MessageBox HWnd, "I am at Escape key.", "Test", MB_OK
SendMessageW hwnd, WM_CLOSE, 0, 0
EXIT FUNCTION
END IF
END SELECT