Winapi:getclassname-Gets the class name//declaration of the specified window: GetClassName (Hwnd:hwnd; {Specify window handle} Lpclassname:pchar; {buffer} nmaxcount:integer {buffer size}): Integer; {Returns the class name size; failure returns 0}--------------------------------------------------------------------------------//Test 1: Create a new project, The class name of the main window is TForm1 by default, using the program to get a look at Var ps:array[0..254] of Char; Begin GetClassName (Handle, PS, 255); ShowMessage (PS); {TForm1} end; --------------------------------------------------------------------------------//Test 2: Look at the class name of the Calculator window (start calculator first) var H:hwnd; PS:ARRAY[0..254] of Char; Begin H: = FindWindow (nil, ' calculator '); {This is the handle to get the calculator window} GetClassName (H, PS, 255); ShowMessage (PS); {Scicalc} end; --------------------------------------------------------------------------------//Test 3: Look at the class name of the Notepad window (restart Notepad first): Var H:hwnd; PS:ARRAY[0..254] of Char; Begin H: = FindWindow (Nil, ' Untitled-Notepad '); {This is the handle to get the Notepad window} GetClassName (H, PS, 255); ShowMessage (PS); {Notepad} end;
Winapi:getclassname-Gets the class name of the specified window