메뉴 여닫기
개인 메뉴 토글
로그인하지 않음
만약 지금 편집한다면 당신의 IP 주소가 공개될 수 있습니다.

Active Window Title, Class, Size 조회

데브카페

#include <WinAPI.au3>
#include <MsgBoxConstants.au3>
Sleep(500)

CheckWinSize()


Func CheckWinSize()
   Local $hwnd= WinGetHandle("[ACTIVE]")
   Local $aClientSize = WinGetClientSize($hWnd)
   ;MsgBox($MB_SYSTEMMODAL, "", "Width: " & $aClientSize[0] & @CRLF & "Height: " & $aClientSize[1])
   if $aClientSize[0]<280 then
	  ;MsgBox($MB_SYSTEMMODAL, "", "Wrong Password. Width: " & $aClientSize[0] & @CRLF & "Height: " & $aClientSize[1])
	  MsgBox($MB_SYSTEMMODAL, "", "Wrong Password. Please close all XCA windows and contact system admin!")
	  ;WinClose($hWnd)
   Else
	  ;MsgBox($MB_SYSTEMMODAL, "", "Right Password. Width: " & $aClientSize[0] & @CRLF & "Height: " & $aClientSize[1])
   EndIf
EndFunc   ;



Func CheckWinClass()

   Local $hwnd= WinGetHandle("[ACTIVE]")
   if $hwnd = 0x0019081 then
	  MsgBox(4096, "Password Correct", "Password is correct!" & $hwnd)
	  ;MsgBox(4096, "Get ClassName", "ClassName of " & $hwnd & ":" & _WinAPI_GetClassName($hwnd))
   Else
	  MsgBox(4096, "Password Wrong", "Password is wrong! Please close all XCA window and contact system admin" & $hwnd)
   EndIf

EndFunc   ;

Func CheckWinTitle()
    ; Retrieve the window title of the active window.
    Local $sText = WinGetTitle("[ACTIVE]")
   if StringInStr ($sText, "Key management") AND StringInStr ($sText, "X Certificate") Then
	  MsgBox($MB_SYSTEMMODAL, "", "Wrong Password, please close all Windows and contact Thycotic System Admin!")
    ; Display the window title.
   else
	  MsgBox($MB_SYSTEMMODAL, "", $sText+"is correct!")
   EndIf
EndFunc   ;


Func _ThrowError($txt, $exit = 0, $ret = "", $err = 0, $ext = 0, $time = 0)
    If $exit = 0 Then
        MsgBox(48, @ScriptName, $txt, $time) ; Exclamation, return with error code
        Return SetError($err, $ext, $ret)
    Else
        MsgBox(16, @ScriptName, $txt, $time) ; Stop, quit after error
        Exit ($err)
    EndIf
EndFunc


;Finish

Comments