Jump to content
Sign in to follow this  
NTBM

get msgbox to stay on top

Recommended Posts

NTBM

I have a script that opens a scanned graphic and then asks for a file number. i want the inputbox to stay on top but the user can click on the program behind to rotate the doc as required, to stop the user from having to alt tab (or mouse) back to the question. i have tried searching for this but i dont even know ehat it would be called ("stay on top").

------------------Part of code-------------------------------------------

WinWait("Microsoft Office Document Imaging","",5)

If Not WinActive("Microsoft Office Document Imaging","") Then WinActivate("Microsoft Office Document Imaging","")

WinWaitActive("Microsoft Office Document Imaging","",5)

If Not WinActive("Microsoft Office Document Imaging","")Then

MsgBox(4096,"ERROR","Please report error #2 to Andrew or Ben" &@CR&"This message will disapear in 10 seconds",10)

Exit

EndIf

WinActivate("job number","")

BlockInput(0)

$jobnum=InputBox("Job number", "What is the Job Number")

------------------End of part-------------------------------------------

Any assistance appreciated.

Share this post


Link to post
Share on other sites
fowmow

I have a script that opens a scanned graphic and then asks for a file number. i want the inputbox to stay on top but the user can click on the program behind to rotate the doc as required, to stop the user from having to alt tab (or mouse) back to the question. i have tried searching for this but i dont even know ehat it would be called ("stay on top").

Well, there is $WS_EX_TOPMOST. However, it is a common extended style (useful for GUIs for example).

It has no effect on MsgBox's or InputBox's.

And to be honest... since you are already attempting to block input, perhaps that is best. You can wind up causing people to kind of get "locked out" by controlling too much.

One thing you could do is check if your InputBox is the active window in the message loop. If it isn't, make it so.

Or notify them when your InputBox loses focus so they know that is *not* the desired effect and strange things could happen.

*Another* example would be to make this a GUI. Then regardless of where they *attempt* to go, your window will always be on top and you can block input in all but your GUI.

There may be even better alternatives... I am relatively new to AutoIt.

Share this post


Link to post
Share on other sites
Generator

You cannot make your inputbox or msgbox stay on top if you don't use a GUI for it, the script will wait till the msg box or inputbox is finished and then proceed the next line. What you can do is make a GUI and do a check to make it stay on top.

Share this post


Link to post
Share on other sites
NTBM

Thanks guys.

i did know it could be done. but was pretty sure it was to GUI's but it is allways worth asking.

Share this post


Link to post
Share on other sites
Gif

for msgbox:

MsgBox(262144, '', '')

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  

×