WM_SYSCOMMAND does not work when the child form is maximized

I have an MDI application and a window procedure for processing formChild messages. In this case, intercept the WM_SYSCOMMAND message to display the text. When the form is minimized, show the message.

Everything works fine, but

The problem is when the child form is maximized and then I try to minimize the form, WM_SYSCOMMAND is not working, ShowMessage not showing.

What message can be caught in this case?

 //TCHild Form Child function MDIChildProc(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; var F: TChild; begin F := TChild(FindControl(hwnd)); begin case uMsg of WM_SYSCOMMAND: begin case wParam and $FFF0 of SC_MINIMIZE: begin {First Minimize then show text} CallWindowProc(Pointer(F.Tag), hwnd, uMsg, wParam, lParam); ShowMessage('form minimized'); end; end; end; end; Result := CallWindowProc(Pointer(F.Tag), hwnd, uMsg, wParam, lParam); end; end; 
+4
source share

Source: https://habr.com/ru/post/1440821/


All Articles