GetProp(Handle, MakeIntAtom(ControlAtom));
请问各位前辈这个函数的原理是什么呢?
MakeIntAtom这个函数是作什么用的?
谢谢!
请问各位前辈这个函数的原理是什么呢?
MakeIntAtom这个函数是作什么用的?
谢谢!
解决方案 »
- Tdbedit控件显示内容小问题,高手请进,在线急等!!!!
- 关于在delphi中的消息传递,
- 给大家送分的问题
- 为何装了CNPACK源码里有的地方不能显示参数
- 请教这条QUERY1组件的SQL语句怎么写?谢谢!
- 如何解决file not found 'dbf.dcu'。。。。急!!!
- 求救:Windows系统支持对文件操作的外壳扩展功能对应的接口是什么?
- ?zswang(伴水)(需要充充电):
- 类的实例化是什么样的概念,是如何实现的(请举例说明)
- 简单问题,将string类型中的字符转移到char类型数组中去
- DELPHI如何知道MSSQL回滚了?
- GetClientRect,和ClientRect的区别
The GetProp function retrieves a data handle from the property list of the given window. The given character string identifies the handle to be retrieved. The string and handle must have been added to the property list by a previous call to the SetProp function. HANDLE GetProp( HWND hWnd, // handle of window
LPCTSTR lpString // atom or address of string
);
ParametershWndIdentifies the window whose property list is to be searched. lpStringPoints to a null-terminated character string or contains an atom that identifies a string. If this parameter is an atom, it must have been created by using the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of the lpString parameter; the high-order word must be zero. Return ValuesIf the property list contains the given string, the return value is the associated data handle. Otherwise, the return value is NULL.
其实所谓控件的实例也就是一存在和有数据的数据结构。可以通过EnumPropsEx来查询到这一数据结构。
也可以通过GetProp和原子来查找这一数据结构。不过有一点不明白就是EnumPropsEx函数,我在百度上面看到的描述是这样的
函数功能:该函数将窗口属性表中的所有项列举出来,依次传送给指定的回调函数,直到列举到最后一项,或者回调函数返回FALSE为止。
下面代码的nProp值为3,那么就是说这个窗口属性表有三个项,这个项指的是什么呢?unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
function WinPropProc(hSubClass:HWND;lpszString:LPSTR;hData:THandle):Bool;stdcall;
implementation{$R *.dfm}function WinPropProc(hSubClass:HWND;lpszString:LPSTR;hData:THandle):Bool;stdcall;
{$j+}
const
nProp:Integer=1;
{$j-}
var
sAtom:TAtom;
dData:TButton;
begin
sAtom:=GlobalFindAtom(lpszString);
if sAtom<>0 then begin
dData:=TButton(GetProp(hSubClass,lpszString));
ShowMessage(dData.Caption);
end;
nProp:=nProp+1;
result:=True;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumPropsEx(Button2.Handle, @WinPropProc, 0);
end;end.
http://hi.csdn.net/space-24500-do-album-picid-491634.html