Statistical top window
Here is the enumwindows function to traverse all top windows.
Original sound reproduction:
Bool Enumwindows
WndenumProc LpenumFunc, // Callback Function
LParam lParam // Application-Defined Value
);
This function requires a custom callback function ENUMWINDOWSPROC,
Original sound reproduction:
Bool Callback EnumwindowsProc
HWND HWND, // Handle To Parent Window
LParam lParam // Application-Defined Value
);
Ok, now we start counting:
INT IWNDNUMS; // The number of Bool Callback EnumWindowsProc (HWnd Hwnd, // Handle to Parent Window LParam Lparam // Application-Defined Value) {if (hwnd == Null) {Return False; // End Enumeration}
// This hWnd is the number of handles // statistical window of the enumerated current form IWNDNUMS ;
// Continue to enumerate returnography;
} // ----------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------- // Test VOID __FASTCALL TFORM1 :: Testbitbtnclick (Tobject * sender) {LPARAM LMYPARAM; BOOL BRET; IWNDNUMS = 0;
// Enumerate the top window Bret = EnumWindows ((WndenumProc) EnumWindowsProc, LmyParam);
The value of // IWNDNUMS is the quantity of the top layer window.
The above CB5 is compiled.