关于枚举窗口
来源:互联网 发布:ubuntu无法用中文 编辑:程序博客网 时间:2024/06/02 02:18
EnumWindows
The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.
BOOL EnumWindows(
WNDENUMPROC lpEnumFunc, // callback function
LPARAM lParam // application-defined value
);
EnumWindowsProc
The EnumWindowsProc function is an application-defined callback function used with the EnumWindows or EnumDesktopWindows function. It receives top-level window handles. The WNDENUMPROC type defines a pointer to this callback function. EnumWindowsProc is a placeholder for the application-defined function name.
BOOL CALLBACK EnumWindowsProc(
HWND hwnd, // handle to parent window
LPARAM lParam // application-defined value
);
GetWindowLong
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.
If you are retrieving a pointer or a handle, this function has been superseded by the GetWindowLongPtr function. (Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.) To write code that is compatible with both 32-bit and 64-bit versions of Windows, use GetWindowLongPtr.
LONG GetWindowLong(
HWND hWnd, // handle to window
int nIndex // offset of value to retrieve
);
GetWindowThreadProcessId
The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
DWORD GetWindowThreadProcessId(
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // process identifier
);
OpenProcess
The OpenProcess function opens an existing process object.
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance option
DWORD dwProcessId // process identifier
);
GetModuleFileName
The GetModuleFileName function retrieves the fully qualified path for the specified module.
To specify the process that contains the module, use the GetModuleFileNameEx function.
DWORD GetModuleFileName(
HMODULE hModule, // handle to module
LPTSTR lpFilename, // path buffer
DWORD nSize // size of buffer
);
GetClassName
The GetClassName function retrieves the name of the class to which the specified window belongs.
int GetClassName(
HWND hWnd, // handle to window
LPTSTR lpClassName, // class name
int nMaxCount // size of class name buffer
);
GetWindowText
The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.
int GetWindowText(
HWND hWnd, // handle to window or control
LPTSTR lpString, // text buffer
int nMaxCount // maximum number of characters to copy
);
实例一:
实例二:
- 关于枚举窗口
- 窗口枚举
- 枚举窗口
- 枚举窗口
- 枚举进程,枚举窗口
- 关于使用 EnumWindows 枚举应用程序窗口的技巧(转)
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 关于枚举
- 枚举所有窗口
- 枚举浏览器窗口
- 常见的宏定义,要记住
- 服务器监视软件:munin
- java基础之对象的排序
- baodao
- OpenGL ES
- 关于枚举窗口
- Java语言基础:异常机制
- 浅谈iphone开发中关于第三方对象执行回调的方法
- Android开发环境搭建(ADT)
- 深度剖析消息反射机制
- C++如何运行时从字符串创建一个类
- 数据库——存储过程(C#实现)
- 2011年1月-4月项目日记_3.27
- 2440init.s文件分析