WINDOWINFO結構,用於保存視窗信息。GetWindowInfo API(檢索有關指定視窗的信息)的輸出參數。
基本介紹
- 中文名:WINDOWINFO
- 外文名:WINDOWINFO
結構原型,結構成員,C#定義語法,
結構原型
typedef struct tagWINDOWINFO {
DWORD cbSize;
RECT rcWindow;
RECT rcClient;
DWORD dwStyle;
DWORD dwExStyle;
DWORD dwWindowStatus;
UINT cxWindowBorders;
UINT cyWindowBorders;
ATOM atomWindowType;
WORD wCreatorVersion;
} WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO;
結構成員
- cbSize
- Type:DWORD
- The size of the structure, in bytes. The caller must set this member tosizeof(WINDOWINFO).
- rcWindow
- Type:RECT
- The coordinates of the window.
- rcClient
- Type:RECT
- The coordinates of the client area.
- dwStyle
- Type:DWORD
- The window styles. For a table of window styles, seeWindow Styles.
- dwExStyle
- Type:DWORD
- The extended window styles. For a table of extended window styles, seeExtended Window Styles.
- dwWindowStatus
- Type:DWORD
- The window status. If this member isWS_ACTIVECAPTION(0x0001), the window is active. Otherwise, this member is zero.
- cxWindowBorders
- Type:UINT
- The width of the window border, in pixels.
- cyWindowBorders
- Type:UINT
- The height of the window border, in pixels.
- atomWindowType
- Type:ATOM
- The window class atom (seeRegisterClass).
- wCreatorVersion
- Type:WORD
- The Windows version of the application that created the window.
C#定義語法
/// <summary>
/// WINDOWINFO結構,用於保存視窗信息。
/// </summary>
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct WINDOWINFO
{
/// DWORD->unsigned int
public uint cbSize;
/// RECT->tagRECT
public tagRECT rcWindow;
/// RECT->tagRECT
public tagRECT rcClient;
/// DWORD->unsigned int
public uint dwStyle;
/// DWORD->unsigned int
public uint dwExStyle;
/// DWORD->unsigned int
public uint dwWindowStatus;
/// UINT->unsigned int
public uint cxWindowBorders;
/// UINT->unsigned int
public uint cyWindowBorders;
/// ATOM->WORD->unsigned short
public ushort atomWindowType;
/// WORD->unsigned short
public ushort wCreatorVersion;
}
/// <summary>
/// RECT結構,用於保存視窗或客戶區的位置及大小。
/// </summary>
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tagRECT
{
/// LONG->int
public int left;
/// LONG->int
public int top;
/// LONG->int
public int right;
/// LONG->int
public int bottom;
}