venom_only Posted July 21, 2017 Share Posted July 21, 2017 hello. i need your help. im using this voip sip program named EyeBeam so problem is that i can detect the name of the program itself but i need autoit to detect that little square window during call. i need to detect when that call window appears at the bottom. and then autoit will redirect or Hold that call. when i try to detect CLASS:funky window usig this Local $hWnd = WinWait("[CLASS:Funky Window]", "", 10) Local $aClientSize = WinGetClientSize($hWnd) MsgBox($MB_SYSTEMMODAL, "", "Width: " & $aClientSize[0] & @CRLF & "Height: " & $aClientSize[1]) autoit detecting the main window of the program not the little call class at the bottom. any suggestions ? welcomed Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 21, 2017 Moderators Share Posted July 21, 2017 Does the small "funky window" have unique text you can key in on (second parameter in winwait)? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
venom_only Posted July 22, 2017 Author Share Posted July 22, 2017 i thought that too but no hidden nor visible text. : ( Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2017 Share Posted July 22, 2017 How about this? 1. Using WinList to get an array of windows of class "Funky Window" 2. Process the array and find the window without a title 3. Use that window's hWnd in subsequent code Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
InunoTaishou Posted July 22, 2017 Share Posted July 22, 2017 (edited) See what this does when the call starts expandcollapse popup#include <WinAPI.au3> #include <GUIConstants.au3> #include <WinAPISys.au3> AutoItSetOption("GUIOnEventMode", 1) AutoItSetOption("GUICloseOnESC", 0) AutoItSetOption("MustDeclareVars", 1) Global $hMain = GUICreate("Test", 420, 220) Global $edtConsole = GUICtrlCreateEdit("", 10, 10, 400, 200, BitOR($ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)) Global $trToggleGui = Null GUICtrlSetColor($edtConsole, 0xF1F1F1) GUICtrlSetBkColor($edtConsole, 0x1F1F1F) GUICtrlSetFont($edtConsole, 11, 400, "", "Consolas") GUISetOnEvent($GUI_EVENT_CLOSE, Close) GUISetState(@SW_SHOW, $hMain) GUIRegisterMsg(_WinAPI_RegisterWindowMessage("SHELLHOOK"), WM_SHELLHOOK) _WinAPI_RegisterShellHookWindow($hMain) OnAutoItExitRegister(OnAutoItExit) While (True) Sleep(100) WEnd Func Close() Exit (0) EndFunc ;==>Close Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($hMain) EndFunc ;==>OnAutoItExit Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam If ($wParam = $HSHELL_WINDOWCREATED) Then GUICtrlSetData($edtConsole, GUICtrlRead($edtConsole) & 'Created: ' & @CRLF & _ @TAB & 'Title: ' & WinGetTitle($lParam) & @CRLF & _ @TAB & 'PID: ' & WinGetProcess($lParam) & @CRLF & _ @TAB & 'ClassName: ' & _WinAPI_GetClassName($lParam) & @CRLF) ; This will be the handle of the window closed. EndIf EndFunc ;==>WM_SHELLHOOK Might be able to recognize the window on creation and do whatever you want with it. Edited July 22, 2017 by InunoTaishou Link to comment Share on other sites More sharing options...
venom_only Posted July 22, 2017 Author Share Posted July 22, 2017 thanks for replays . but did nt show anything. about "Funky window" but show some info abount sniffing tool : ) and internet explorer. also uploading screenshot from Au3Info Link to comment Share on other sites More sharing options...
InunoTaishou Posted July 22, 2017 Share Posted July 22, 2017 Okay, next step. Let's try everything expandcollapse popup#include <WinAPI.au3> #include <GUIConstants.au3> #include <WinAPISys.au3> #include <GuiEdit.au3> AutoItSetOption("GUIOnEventMode", 1) AutoItSetOption("GUICloseOnESC", 0) AutoItSetOption("MustDeclareVars", 1) Global $hMain = GUICreate("Test", 620, 320) Global $edtConsole = GUICtrlCreateEdit("", 10, 10, 600, 300, BitOR($ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)) Global $hEdit = GUICtrlGetHandle($edtConsole) Global $aShell[$HSHELL_FLASH + 1] $aShell[$HSHELL_WINDOWCREATED] = "HSHELL_WINDOWCREATED" $aShell[$HSHELL_WINDOWDESTROYED] = "HSHELL_WINDOWDESTROYED" $aShell[$HSHELL_ACTIVATESHELLWINDOW] = "HSHELL_ACTIVATESHELLWINDOW" $aShell[$HSHELL_WINDOWACTIVATED] = "HSHELL_WINDOWACTIVATED" $aShell[$HSHELL_GETMINRECT] = "HSHELL_GETMINRECT" $aShell[$HSHELL_REDRAW] = "HSHELL_REDRAW" $aShell[$HSHELL_TASKMAN] = "HSHELL_TASKMAN" $aShell[$HSHELL_LANGUAGE] = "HSHELL_LANGUAGE" $aShell[$HSHELL_SYSMENU] = "HSHELL_SYSMENU" $aShell[$HSHELL_ENDTASK] = "HSHELL_ENDTASK" $aShell[$HSHELL_ACCESSIBILITYSTATE] = "HSHELL_ACCESSIBILITYSTATE" $aShell[$HSHELL_APPCOMMAND] = "HSHELL_APPCOMMAND" $aShell[$HSHELL_WINDOWREPLACED] = "HSHELL_WINDOWREPLACED" $aShell[$HSHELL_WINDOWREPLACING] = "HSHELL_WINDOWREPLACING" $aShell[$HSHELL_RUDEAPPACTIVATED] = "HSHELL_RUDEAPPACTIVATED" $aShell[$HSHELL_FLASH] = "HSHELL_FLASH" GUICtrlSetColor($edtConsole, 0xF1F1F1) GUICtrlSetBkColor($edtConsole, 0x1F1F1F) GUICtrlSetFont($edtConsole, 11, 400, "", "Consolas") GUISetOnEvent($GUI_EVENT_CLOSE, Close) GUISetState(@SW_SHOW, $hMain) GUIRegisterMsg(_WinAPI_RegisterWindowMessage("SHELLHOOK"), WM_SHELLHOOK) _WinAPI_RegisterShellHookWindow($hMain) OnAutoItExitRegister(OnAutoItExit) While (True) Sleep(100) WEnd Func Close() Exit (0) EndFunc ;==>Close Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($hMain) EndFunc ;==>OnAutoItExit Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam GUICtrlSetData($edtConsole, GUICtrlRead($edtConsole) & 'Shell Command: ' & ($aShell[$wParam] ? $aShell[$wParam] : "Unknown Command (" & Int($wParam) & ")") & @CRLF & _ @TAB & 'hWnd: ' & $lParam & @CRLF & _ @TAB & 'Title: ' & WinGetTitle($lParam) & @CRLF & _ @TAB & 'PID: ' & WinGetProcess($lParam) & @CRLF & _ @TAB & 'ClassName: ' & _WinAPI_GetClassName($lParam) & @CRLF & @CRLF) _GUICtrlEdit_Scroll($hEdit, 4) EndFunc ;==>WM_SHELLHOOK Link to comment Share on other sites More sharing options...
venom_only Posted July 24, 2017 Author Share Posted July 24, 2017 (edited) yea nice try but Shell Command: HSHELL_WINDOWACTIVATED hWnd: 0x00020310 Title: eyeBeam PID: 5140 ClassName: Funky Window Shell Command: HSHELL_WINDOWACTIVATED hWnd: 0x002804C2 Title: Test PID: 4252 ClassName: AutoIt v3 GUI its detecting only main window of the program : ) the during call program still does not show anywhere. its part of the main program and probably working as popup without window title. im thinking another way of detecting it. maybe desktop corner color chainging or somthing. Edited July 24, 2017 by venom_only Link to comment Share on other sites More sharing options...
Danp2 Posted July 24, 2017 Share Posted July 24, 2017 @venom_only Did you try detecting the window using WinList as I previously suggested? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
venom_only Posted July 24, 2017 Author Share Posted July 24, 2017 yea. nothing. only shows main window of the EyeBeam program itself. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 24, 2017 Moderators Share Posted July 24, 2017 Have a look at the IUIAutomation thread in the examples forum. I know it can detect a lot more than the native Window Info tool. Xandy 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now