Sign in to follow this  
Followers 0
Guest aryanez

Msgbox Q

9 posts in this topic

Is there a way to define the location of a msgbox?

Share this post


Link to post
Share on other sites



You could have used InputBox instead of MsgBox, but it

wouldn't be the same though...

Though if you choose InputBox you get a "Ok/Cancel"-option

plus that you can define the positioning...

Yeah... I know... :whistle:

Stupid suggestion...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Or you could do this:

MsgBox(0,"title","text")
WinWaitActive("title","text")
WinMove("title","text",100, 100)

create the 'MsgBox' & then 'Move' it.

Edited by w_sp8er

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This won't work, as AutoIt will not do anything until you close the MSGbox

Not even Adlib functions.

MsgBox(0,"title","text")

WinWaitActive("title","text")

WinMove("title","text",100, 100)

You can however have the script write an autoit script, or copy out a premade autoit compiled exe and run that to move your box.

such as:

FileInstall ( "/temp/mymover.exe", "mymove.exe") 
; some script
run("mymove.exe "&$title &" "& $text &" " & $locx&" "&$locy)
MsgBox(0,"title","text")

; end of script
filedelete("mymove.exe")

;mymover.au3  before compile
if $cmdline[0]=4 then
winwaitactive($cmdline[1],$cmdline[2])
WinMove($cmdline[1],$cmdline[2],$cmdline[3],$cmdline[4])
endif

Not tested, but you get the idea.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Given that a message box can be moved by the user, anyway, what's the point in making it appear in a certain place to begin with?

Share this post


Link to post
Share on other sites

Same could be asked why inputbox has location....


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

OR you could something ever better then on ScriptKitty's example :whistle:

In my example you just need one single file :

If $CmdLine[0] = 1 AND $CmdLine[1] = "move"  Then
Sleep(10)
WinWaitActive("MsgBox title")
WinMove ("MsgBox title", "", 100, 100)
Exit
Else
;Continue..
EndIf

Run("MyScript.exe " & "move")
MsgBox(64, "MsgBox title", "This window will be moved to the upper left corner..")
Exit

I've tested it, and it works !

Though you can see the standard position a little time..

Share this post


Link to post
Share on other sites

isnt there a textbox that can be defined to a specic location? would that work inplace of a message box?


:cheer: awww...wheres the chick?

Share this post


Link to post
Share on other sites

You could use imputbox and just remove the imput box with the external program.

; hide inputbox.au3
; hides the Edit1 control on box starting with _e_ and removes the _e_
WinWait("_e_")
ControlHide ( "_e_", "", "Edit1" )
$x=WinGetTitle ( "_e_")
WinSetTitle("_e_","",StringTrimLeft($x,3))

No commandline, and you can call out all your size and location in inputbox()


AutoIt3, the MACGYVER Pocket Knife for computers.

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