Jump to content

MsgBox Move


Recommended Posts

Hello everyone,

I am trying to move a MsgBox but have no luck because at pop up it pauses the script. Any idea how to go about that?

I tried

GUICtrlSetResizing (-1,$GUI_DOCKLEFT+$GUI_DOCKTOP)
with GUICreate still no luck. I tried also

MsgBox(0,"WO", 'Select WO Number and then click "OK"')
    WinMove('',"", 223,78)

and

WinMove(MsgBox(0,"WO", 'Select WO Number and then click "OK"'),"", 223,78)

but no luck. They compile but still do nothing besides pop up the MsgBox.

I am running out of options. Any ideas anyone?

Thanks

Link to comment
Share on other sites

I am running out of options. Any ideas anyone?

Thanks

I'm pretty sure the manual mentions this, but once a message box appears, everything stops. The move command will occur after the message box is dismissed... ;)
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

MsgBox is a blocking function, so adlib won't help.

You could create a specifically-positioned GUI instead of a Messagebox (overkill, arguably).

Or, you could use a helper script...

Save this and compile to WOMove.exe:

#NoTrayIcon
WinWait("WO", "Select WO Number")
WinMove("WO", "Select WO Number", 223, 78)

Then, your main script chunk would look like this:

FileInstall("WOMove.exe", @TempDir & "\")
Run(@TempDir & "\WOMove.exe")
MsgBox(0,"WO", 'Select WO Number and then click "OK"')

; Later on...
FileDelete(@TempDir & "\WOMove.exe")

Please test.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

MsgBox is a blocking function, so adlib won't help.

You could create a specifically-positioned GUI instead of a Messagebox (overkill, arguably).

Or, you could use a helper script...

Save this and compile to WOMove.exe:

#NoTrayIcon
WinWait("WO", "Select WO Number")
WinMove("WO", "Select WO Number", 223, 78)

Then, your main script chunk would look like this:

FileInstall("WOMove.exe", @TempDir & "\")
Run(@TempDir & "\WOMove.exe")
MsgBox(0,"WO", 'Select WO Number and then click "OK"')

; Later on...
FileDelete(@TempDir & "\WOMove.exe")

Please test.

Thank you, I thought of that option. I just wish there was another way to keep everything in one file. But since I am at a standstill I will have to use two separate files. Edited by besnia
Link to comment
Share on other sites

GUIBuilder makes it easy...

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("WO", 212, 107, 223, 78, $WS_EX_TOOLWINDOW)

$Label_1 = GuiCtrlCreateLabel('Select WO Number and then click "OK"', 10, 11, 200, 15)
$Button_1 = GuiCtrlCreateButton("OK", 65, 41, 75, 23)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

GUIBuilder makes it easy...

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("WO", 212, 107, 223, 78, $WS_EX_TOOLWINDOW)

$Label_1 = GuiCtrlCreateLabel('Select WO Number and then click "OK"', 10, 11, 200, 15)
$Button_1 = GuiCtrlCreateButton("OK", 65, 41, 75, 23)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        ExitLoop
    Case Else
;;;
    EndSelect
WEnd
THANKS SCRUDGE! This is in the confines of what I am looking for! Edited by besnia
Link to comment
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
 Share

  • Recently Browsing   0 members

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