求API函数GetWindowLong的详细说明.

nlpz 2003-05-21 03:44:58
麻烦谁用通俗点的方法说详细些.





我现在只有以下资料.

函数功能:该函数获得有关指定窗口的信息,函数也获得在额外窗口内存中指定偏移位地址的32位度整型值。
函数原型:LONG GetWindowLong(HWND hWnd,int nlndex);
参数:
hWnd:窗口句柄及间接给出的窗口所属的窗口类。
nlndex:指定要获得值的大于等于0的值的偏移量。有效值的范围从0到额外窗口内存空间的字节数一4例如,若指定了12位或多于12位的额外类存储空间,则应设为第三个32位整数的索引位8。要获得任意
hwnd ----------- Long,欲为其获取信息的窗口的句柄
nIndex --------- Long,欲取回的信息,可以是下述任何一个常数:
GWL_EXSTYLE
扩展窗口样式
GWL_STYLE
窗口样式
GWL_WNDPROC
该窗口的窗口函数的地址
GWL_HINSTANCE

拥有窗口的实例的句柄

GWL_HWNDPARENT

该窗口之父的句柄。不要用SetWindowWord来改变这个值

GWL_I
...全文
217 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
joss 2003-05-21
  • 打赏
  • 举报
回复
PB中申明语法
FUNCTION ulong GetWindowulong(ulong hwnd,ulong nIndex) LIBRARY
"user32.dll" ALIAS FOR "GetWindowLongA"
tchatcha 2003-05-21
  • 打赏
  • 举报
回复
The GetWindowLong function retrieves information about the specified window. The function also retrieves the 32-bit (long) value at the specified offset into the extra window memory of a window.

LONG GetWindowLong(

HWND hWnd, // handle of window
int nIndex // offset of value to retrieve
);


Parameters

hWnd

Identifies the window and, indirectly, the class to which the window belongs.

nIndex

Specifies the zero-based offset to the value to be retrieved. Valid values are in the range zero through the number of bytes of extra window memory, minus four; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To retrieve any other value, specify one of the following values:

Value Action
GWL_EXSTYLE Retrieves the extended window styles.
GWL_STYLE Retrieves the window styles.
GWL_WNDPROC Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.
GWL_HINSTANCE Retrieves the handle of the application instance.
GWL_HWNDPARENT Retrieves the handle of the parent window, if any.
GWL_ID Retrieves the identifier of the window.
GWL_USERDATA Retrieves the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.


The following values are also available when the hWnd parameter identifies a dialog box:

Value Action
DWL_DLGPROC Retrieves the address of the dialog box procedure, or a handle representing the address of the dialog box procedure. You must use the CallWindowProc function to call the dialog box procedure.
DWL_MSGRESULT Retrieves the return value of a message processed in the dialog box procedure.
DWL_USER Retrieves extra information private to the application, such as handles or pointers.


Return Values

If the function succeeds, the return value is the requested 32-bit value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASS structure used with the RegisterClass function.

See Also

CallWindowProc, GetWindowWord, RegisterClass, SetParent, SetWindowLong, SetWindowWord, WNDCLASS
joss 2003-05-21
  • 打赏
  • 举报
回复
【别名】
GetWindowLongA
【说明】
从指定窗口的结构中取得信息
【参数】
hwnd ----------- Long,欲为其获取信息的窗口的句柄
nIndex --------- Long,欲取回的信息,可以是下述任何一个常数:
GWL_EXSTYLE
扩展窗口样式
GWL_STYLE
窗口样式
GWL_WNDPROC
该窗口的窗口函数的地址
GWL_HINSTANCE
拥有窗口的实例的句柄
GWL_HWNDPARENT
该窗口之父的句柄。不要用SetWindowWord来改变这个值
GWL_ID
对话框中一个子窗口的标识符
GWL_USERDATA
含义由应用程序规定
DWL_DLGPROC
这个窗口的对话框函数地址
DWL_MSGRESULT
在对话框函数中处理的一条消息返回的值
DWL_USER
含义由应用程序规定
【返回值】
Long,由nIndex决定。零表示出错。会设置GetLastError
API之网络函数1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnection 结束一个网络连接 WNetCancelConnection2 结束一个网络连接 WNetCloseEnum 结束一次枚举操作 WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接 WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接 WNetEnumResource 枚举网络资源 WNetGetConnection 获取本地或已连接的一个资源的网络名称 WNetGetLastError 获取网络错误的扩展错误信息 WNetGetUniversalName 获取网络中一个文件的远程名称以及/或者UNC(统一命名规范)名称 WNetGetUser 获取一个网络资源用以连接的名字 WNetOpenEnum 启动对网络资源进行枚举的过程 2. API之消息函数 BroadcastSystemMessage 将一条系统消息广播给系统中所有的顶级窗口 GetMessagePos 取得消息队列中上一条消息处理完毕时的鼠标指针屏幕位置 GetMessageTime 取得消息队列中上一条消息处理完毕时的时间 PostMessage 将一条消息投递到指定窗口的消息队列 PostThreadMessage 将一条消息投递给应用程序 RegisterWindowMessage 获取分配给一个字串标识符的消息编号 ReplyMessage 答复一个消息 SendMessage 调用一个窗口的窗口函数,将一条消息发给那个窗口 SendMessageCallback 将一条消息发给窗口 SendMessageTimeout 向窗口发送一条消息 SendNotifyMessage 向窗口发送一条消息 3. API之文件处理函数 CloseHandle 关闭一个内核对象。其中包括文件、文件映射、进程、线程、安全和同步对象等 CompareFileTime 对比两个文件的时间 CopyFile 复制文件 CreateDirectory 创建一个新目录 CreateFile 打开和创建文件、管道、邮槽、通信服务、设备以及控制台 CreateFileMapping 创建一个新的文件映射对象 DeleteFile 删除指定文件 DeviceIoControl 对设备执行指定的操作 DosDateTimeToFileTime 将DOS日期和时间值转换成一个 win32 FILETIME 值 FileTimeToDosDateTime 将一个 win32 FILETIME 值转换成DOS日期和时间值 FileTimeToLocalFileTime 将一个FILETIME结构转换成本地时间 FileTimeToSystemTime 根据一个FILETIME结构的内容,装载一个SYSTEMTIME结构 FindClose 关闭由FindFirstFile函数创建的一个搜索句柄 FindFirstFile 根据文件名查找文件 FindNextFile 根据调用FindFirstFile函数时指定的一个文件名查找下一个文件 FlushFileBuffers 针对指定的文件句柄,刷新内部文件缓冲区 FlushViewOfFile 将写入文件映射缓冲区的所有数据都刷新到磁盘 GetBinaryType 判断文件是否可以执行 GetCompressedFileSize 判断一个压缩文件在磁盘上实际占据的字节数 GetCurrentDirectory 在一个缓冲区中装载当前目录 GetDiskFreeSpace 获取与一个磁盘的组织有关的信息,以及了解剩余空间的容量 GetDiskFreeSpaceEx 获取与一个磁盘的组织以及剩余空间容量有关的信息 GetDriveType 判断一个磁盘驱动器的类型 GetExpandedName 取得一个压缩文件的全名 GetFileAttributes 判断指定文件的属性 GetFileInformationByHandle 这个函数提供了获取文件信息的一种机制 GetFileSize 判断文件长度 GetFileTime 取得指定文件的时间信息 GetFileType 在给出文件句柄的前提下,判断文件类型 GetFileVersionInfo 从支持版本标记的一个模块里获取文件版本信息

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧