谢谢!!我希望使用 WM_MDICREATE 消息在 clientWndProc 中获取 mdi child 的句柄
procedure TFrmMain.ClientWndProc(var Message: TMessage);
var
Hwnd : HWND;
procedure Default;
begin
with Message do
Result := CallWindowProc(FClientWndProc, ClientHandle, Msg, wParam, lParam);
end;
begin
case Message.Msg of
WM_MDICREATE:
begin
hwnd := Message.LParam; //dont' work
hwnd := TWMMDICreate(Message).MDICreateStruct^.lparam; //don't work
Default;
end;
end;
inherited ClientWndProc(Message);
end;
我想在启动 MDICHILD 时将下一个过程(ChildProc)绑定到 MainForm 的 ClientWndProc 过程中
function childProc(hwnd: HWND; msg, wParam,lParam: LongInt): LongInt; stdcall;
begin
if msg = WM_SYSCOMMAND then
begin
CallWindowProc(p,hwnd,msg,wparam,lparam);
if WParam = SC_MINIMIZE then
//do something
end;
result := CallWindowProc(p,hwnd,msg,wparam,lparam);
end;
我需要新儿童形态的手柄,类似的东西
P := Pointer(SetWindowLong(ActiveMDIChild.Handle, GWL_WNDPROC, integer(@Child)));