Jump to content

Recommended Posts

Posted (edited)

hello,

i want to detect if this window:

1zo8get.png

is exists.

so i used Au3Info to get the CLASS name and this is the CLASS name that is unique only for this window:

2vach82.jpg

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 by Guest
Posted
  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

Posted

  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 <<<<

 

Posted

  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..

  • Moderators
Posted

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? :huh:

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. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

Posted

  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? :huh:

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. :naughty:

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

Posted

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"

Posted

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

Posted (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:

#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 by Guest

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...