1. lparam是指向CREATESTRUCT记录类型的指针,它的结构如下:
tagCREATESTRUCT = packed record
lpCreateParams: Pointer;
hInstance: HINST;
hMenu: HMENU;
hwndParent: HWND;
cy: Integer;
cx: Integer;
y: Integer;
x: Integer;
style: Longint;
lpszName: PWideChar;
lpszClass: PWideChar;
dwExStyle: DWORD;
end;
CREATESTRUCT = tagCREATESTRUCT;
你可以用它们来做一些初始化操作;2.子窗体的WM_CREATE消息是拦截不着的,你只能在自己构造的子类中处理。
tagCREATESTRUCT = packed record
lpCreateParams: Pointer;
hInstance: HINST;
hMenu: HMENU;
hwndParent: HWND;
cy: Integer;
cx: Integer;
y: Integer;
x: Integer;
style: Longint;
lpszName: PWideChar;
lpszClass: PWideChar;
dwExStyle: DWORD;
end;
CREATESTRUCT = tagCREATESTRUCT;
你可以用它们来做一些初始化操作;2.子窗体的WM_CREATE消息是拦截不着的,你只能在自己构造的子类中处理。
在provate中写下 procedure wmcreate(var msg:twmcreate);message wm_create;然后,
procedure tform1.wmcreate(var msg:twmcreate);
begin
....do.....msg.x //等等。。
//对这个消息的处理
end;
这样就可以得到窗体建立的一些信息了。
如果是在使用api所写的窗口中,怎么同其它的消息如:wm_destroy,wm_nchittest等,一起出现在用api所写的窗口的回调函数中时,怎么得到这个参数的值?
呵年龄虽大,人也帅。但是菜鸟一只
var crt1:tcreatestruct;
...............
crt1:=pcreatestruct(lparam)^;