Jump to content
Sign in to follow this  
nynepro

MsgBox without title

Recommended Posts

nynepro

Can somebody tell, how can I push the button on MsgBox without title... There is some program, which sometimes call MsgBox with 2 button's ("OK" and "Cancel") and there is no title here. I need to press Cancel button.

Im trying

ControlClick ("", "Cancel", "[CLASS:Button; INSTANCE:2]")
or
ControlClick ("", "Cancel", "Button2")
or even
ControlClick ("", "Cancel", "Button2", "left", 1, 317, 60)
but its doesnt work...

>>>> Window <<<<

Title:

Class: #32770

Position: 327, 463

Size: 633, 147

Style: 0x940001C5

ExStyle: 0x00010101

Handle: 0x002806C6

>>>> Control <<<<

Class: Button

Instance: 2

ClassnameNN: Button2

Advanced (Class): [CLASS:Button; INSTANCE:2]

ID: 2

Text: Cancel

Position: 317, 60

Size: 75, 23

ControlClick Coords: 17, 12

Style: 0x50010000

ExStyle: 0x00000004

Handle: 0x00300786

>>>> Mouse <<<<

Position: 334, 72

Cursor ID: 2

Color: 0x250875

>>>> StatusBar <<<<

>>>> Visible Text <<<<

OK

Cancel

P.S. sry for my English

Share this post


Link to post
Share on other sites
FireFox

@nynepro

ControlClick("","","button2", 1)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
nynepro

Thx, but still not work :)

As I understand it tries to click in the wrong window.. And I don't know how to select this MsgBox with empty title..

Share this post


Link to post
Share on other sites
FireFox

@nynepro

ControlClick("[CLASS:#32770]", '', "button2", 1)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
nynepro

Thanks again, but main program has the same class name, and it's still don't work.

:)

Share this post


Link to post
Share on other sites
Malkey

The MsgBox() function halts the script until a button is pressed or until the end of the "timeout" parameter,

This is one way the Msgbox button can be pressed.

#include <Timers.au3>
#include <WinAPI.au3>

$hGUI = GUICreate("")
GUISetState()

$msgb = _Timer_SetTimer($hGUI, 500, "_Update"); create timer

MsgBox(1, "", "First MsgBox"); Autoclicks First MsBox

_Timer_KillTimer($hGUI, $msgb)

MsgBox(1, "", "Second MsgBox"); Timer is not working for this MsgBox

; "#32770" being the Class name of the active MsgBox
Func _Update($hWnd, $Msg, $iIDTimer, $dwTime)
    #forceref $hWnd, $Msg, $iIDTimer, $dwTime
;ConsoleWrite(WinGetHandle("") & @CRLF)
    If _WinAPI_GetClassName(WinGetHandle("")) = "#32770" Then ControlSend(WinGetHandle(""), '', "Button2", "{ENTER}");
EndFunc  ;==>_UpdateStatusBarClock

Share this post


Link to post
Share on other sites
SmOke_N

The MsgBox() function halts the script until a button is pressed or until the end of the "timeout" parameter,

This is one way the Msgbox button can be pressed.

#include <Timers.au3>
#include <WinAPI.au3>

$hGUI = GUICreate("")
GUISetState()

$msgb = _Timer_SetTimer($hGUI, 500, "_Update"); create timer

MsgBox(1, "", "First MsgBox"); Autoclicks First MsBox

_Timer_KillTimer($hGUI, $msgb)

MsgBox(1, "", "Second MsgBox"); Timer is not working for this MsgBox

; "#32770" being the Class name of the active MsgBox
Func _Update($hWnd, $Msg, $iIDTimer, $dwTime)
    #forceref $hWnd, $Msg, $iIDTimer, $dwTime
;ConsoleWrite(WinGetHandle("") & @CRLF)
    If _WinAPI_GetClassName(WinGetHandle("")) = "#32770" Then ControlSend(WinGetHandle(""), '', "Button2", "{ENTER}");
EndFunc ;==>_UpdateStatusBarClock
I think you missed the point of him dealing with an application other than his own AutoIt app.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×