function SearMirwindow: HWND; var hCurrentWindow: HWnd; AhWnd: HWND; szText: array[0..254] of char; strText: string; begin Result := 0; hCurrentWindow := GetWindow(GetForegroundWindow, GW_HWNDFIRST); while hCurrentWindow <> 0 do begin if GetWindowText(hCurrentWindow, @szText, 255) > 0 then begin // AhWnd := FindWindow('TFRMMAIN', nil); AhWnd := FindWindow('TfrmMainMain', nil); if AhWnd <> 0 then begin GetWindowText(AhWnd, szText, 255); strText := StrPas(szText); if (strText = '传奇客户端') or (UpperCase(Copy(strText, 1, 13)) = UpperCase('legend of mir')) then begin Result := AhWnd; Break; end; end; end; hCurrentWindow := GetWindow(hCurrentWindow, GW_HWNDNEXT); end; end;
|
| |
|
|
|