Since messagebox pauses execution in a script, the only method I've 
found to always works is to use an event before the messagebox.

>From one of my scripts:

;MsgBox.powerpro

@MyMsgBoxOnTop

LOCAL bDebug=(arg(1)=="")

LOCAL OkCancel= IFELSE(bDebug, "yesnocancel question", arg(1))

LOCAL msg= IFELSE(bDebug, "arg(2)= My message", arg(2))

LOCAL cap= IFELSE(arg(3)=="", "arg(3)= My title", arg(3))

LOCAL cmd= ESC(?#EVENT.Destroythis\rWIN.Ontop("#,?"\") ++cap++ ?#")#

EVENT.CreateMS(200,100,cmd, ?#VISIBLEWINDOW("# ++cap++ ?#")#)

IF(bDebug)DO
DEBUG

WIN.Debug("LOCAL ans= ."[EMAIL PROTECTED]
("ok","Msg","Title")#)

WIN.Debug("abortretryignore okcancel retrycancel", ;;+
"yesnocancel yesno ok")

WIN.Debug("ans: Cancel=0, OK=1, Abort=3, Retry=4,", ;;+
"Ignore=5,Yes=6, No=7")

WIN.Debug("icons= (none) exclamation warning information", ;;+
"asterisk stop error question")

WIN.Debug("arg(1)=",OkCancel)
WIN.Debug(msg)
WIN.Debug(cap)

; WIN.Show is needed if trayminimized
WIN.Show("PowerPro Debug")
WIN.OnTop("PowerPro Debug",1)

ENDIF

LOCAL ans=messagebox(OkCancel, msg, cap)

IF(bDebug)
WIN.Debug("Returns ans=",ans)

QUIT(ans)



Ted



--- In [email protected], "davor_petric" wrote:

> Sometimes, my messagebox, when called from the script does not pop 
up 
> as the frontmost window.
> 
> This is caused by TweakUI when General, Focus is set to "Prevent 
> applications from stealing focus". 
> 
> Is there a way to force a messagebox to steal the focus? 





Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to