Guest Posted October 4, 2013 Posted October 4, 2013 (edited) hello, i want to detect if this window: is exists. so i used Au3Info to get the CLASS name and this is the CLASS name that is unique only for this window: so i did this test: While 1 $state = WinExists("[CLASS:DolphinEmuWnd]") ToolTip($state) Sleep(1000) WEnd and the test failed. WinExists does not return 1 when the window is exists. what i did wrong? thanks for helpers! Edited October 5, 2013 by Guest
JohnOne Posted October 4, 2013 Posted October 4, 2013 wxWindowNR is the window class AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Guest Posted October 4, 2013 Posted October 4, 2013 On 10/4/2013 at 7:48 PM, JohnOne said: wxWindowNR is the window class yes but this class also the class name of the main window and i want to check for this specific window
JohnOne Posted October 4, 2013 Posted October 4, 2013 Post whole content of summary tab. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Guest Posted October 4, 2013 Posted October 4, 2013 On 10/4/2013 at 7:56 PM, JohnOne said: Post whole content of summary tab. Quote >>>> Window <<<< Title: Dolphin 3.5-367 | JIT64IL DC | FPS: 1 - VPS: 15 - SPEED: 25% Class: wxWindowNR Position: 577, 233 Size: 780, 481 Style: 0x16CF0000 ExStyle: 0x00440108 Handle: 0x000D0882 >>>> Control <<<< Class: DolphinEmuWnd Instance: 1 ClassnameNN: DolphinEmuWnd1 Name: Advanced (Class): [CLASS:DolphinEmuWnd; INSTANCE:1] ID: Text: Dolphin 3.5-367 | OpenGL | JIT64IL DC | FPS: 1 - VPS: 15 - SPEED: 25% Position: 764, 0 Size: 764, 443 ControlClick Coords: 297, 135 Style: 0x50000000 ExStyle: 0x00400000 Handle: 0x000B094C >>>> Mouse <<<< Position: 882, 398 Cursor ID: 0 Color: 0x292929 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< panel Dolphin 3.5-367 | OpenGL | JIT64IL DC | FPS: 1 - VPS: 15 - SPEED: 25% >>>> Hidden Text <<<<
JohnOne Posted October 4, 2013 Posted October 4, 2013 Try using text "panel". AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Guest Posted October 4, 2013 Posted October 4, 2013 On 10/4/2013 at 8:53 PM, JohnOne said: Try using text "panel". It's not a good idea because the text content is not the same on different cases when using another graphics plugin in this emulator.. It is indeed possible. But that's is lesser good option. I wanted to know if it is possible to do it with the good way.I know how to do it with the bad way..
JohnOne Posted October 4, 2013 Posted October 4, 2013 I'm only offering options, and it's not a "bad way". I'm not the one sitting in front of those windows to know all possibilities, you are. Try Getting the main window handle and enumerate it's children, or using WinList() etc... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators Melba23 Posted October 5, 2013 Moderators Posted October 5, 2013 gil900,Do you really think it was a good idea to post a picture proving that you are dealing with a game window? Has the attitude of this forum to games threads not yet got through to you? And this despite you having been previously banned for posting about games and warned about this particular emulator before? However, given that the question relates solely to the recognition of the window and not to any automation of it, I am prepared to let this thread run. But posting any code or asking any questions that go beyond pure recognition will lead to an instant lock and sanctions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Guest Posted October 5, 2013 Posted October 5, 2013 On 10/5/2013 at 8:02 AM, Melba23 said: gil900, Do you really think it was a good idea to post a picture proving that you are dealing with a game window? Has the attitude of this forum to games threads not yet got through to you? And this despite you having been previously banned for posting about games and warned about this particular emulator before? However, given that the question relates solely to the recognition of the window and not to any automation of it, I am prepared to let this thread run. But posting any code or asking any questions that go beyond pure recognition will lead to an instant lock and sanctions. M23 I know you will say it's okay.. Do not worry ..I will not ask questions about game automation.I know this thread is not about game automation so I opened the thread .. Do not think I forgot the previous cases.I assumed you understand that in this case it is clear that it is not about game automation
Guest Posted October 5, 2013 Posted October 5, 2013 someone know how Au3Info.exe or ?do=embed' frameborder='0' data-embedContent>>Control Viewer gets the "DolphinEmuWnd" Class ? i have looked in the Source code of ?do=embed' frameborder='0' data-embedContent>>Control Viewer and the only thing i found is that it first the his software get the handles list of the selected window and then it send each handle to _WinAPI_GetClassName($hwnd). so i treied to do the same trick but unfortunately it does not work. the only Class Names i get is the main class name "wxWindowNR" this is what I tried: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Include <GuiListBox.au3> #include <ListboxConstants.au3> #include <WinAPI.au3> $Form1_1 = GUICreate("Form1", 256, 240, 242, 150) $Group4 = GUICtrlCreateGroup("Window", 8, 0, 241, 233) $List1 = GUICtrlCreateList("", 16, 16, 225, 175,$GUI_SS_DEFAULT_LIST-$LBS_SORT) $Button1 = GUICtrlCreateButton("Get Handle", 16, 200, 105, 25) $Button2 = GUICtrlCreateButton("Refresh", 136, 200, 105, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $temp = _GUICtrlListBox_GetCurSel($List1) If $temp <> -1 Then ControlSend($aPL[$temp+1][1], "", "Edit1", "This is a text") Case $Button2 GUICtrlSetData($List1, '') $aPL = WinList("[CLASS:wxWindowNR]") For $iCC = 1 To UBound($aPL) - 1 $sLoadList = $aPL[$iCC][0] & ' :: Handle: ' & $aPL[$iCC][1] ConsoleWrite( _WinAPI_GetClassName($aPL[$iCC][1])&@CRLF) GUICtrlSetData($List1, $sLoadList) Next EndSwitch WEnd Maybe I missed something ..Anyone know how Yashied's software get that clase name? this is the key to detect the window with the "good way"
Guest Posted October 5, 2013 Posted October 5, 2013 even this code not return that class name "DolphinEmuWnd" in the list: #AutoIt3Wrapper_UseX64=y #include <Array.au3> #include <WinAPI.au3> Local $aWinListRow = WinList() , $aWinList[1] For $a = 1 To $aWinListRow[0][0] ; Only display visble windows that have a title $ClassName = _WinAPI_GetClassName($aWinListRow[$a][1]) ConsoleWrite($ClassName&@CRLF) Next ;_ArrayDisplay($aWinList) I do not know how Yashied did this
Guest Posted October 6, 2013 Posted October 6, 2013 (edited) thanks very much to Yashied for his >source code and for thanks also for BrewManNH for his >solution that fixed the source code so i could explore how it works. I managed to figure out how Yashied did this! i worte working function for detect Child window i share it with you: expandcollapse popup#AutoIt3Wrapper_UseX64=y ;#include <WinAPI.au3> #Include <Array.au3> #Include <WinAPIEx.au3> While 1 $test = WinExists2("Dolphin 3.5-144","DolphinEmuWnd") ToolTip($test) Sleep(1000) WEnd ; #FUNCTION# ==================================================================================================================== ; Name ..........: WinExists2 ; Description ...: ; Syntax ........: WinExists2($Title[, $SubbWin = ""]) ; Parameters ....: $Title - the title of the main window. ; $SubbWin - [optional] the child window to look for. Default is "". ; Return values .: return 1 if the window is exist and return 0 if the window not exist ; Author ........: gil900 ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WinExists2($Title,$SubbWin = "") $Output = 0 $handle = WinGetHandle($Title, "") If Not @error Then If $SubbWin = "" Then $Output = 1 Else $list = _WinAPI_EnumChildWindows($handle, 0) If UBound($list) > 0 Then If _ArraySearch($list,$SubbWin) > 0 Then $Output = 1 EndIf EndIf EndIf Return $Output EndFunc Edited October 6, 2013 by Guest
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