Hi Chip: That Foreground constant seems to have done the trick for the MsgBox on my couple initial tests this morning - hooray! I am calling one of the event modules manually in my App to avoid having to generate an event just to have something to use as a indicator of an action and that is working as well. PS: If GW or anyone ever gets External Scripts working well enough and documented for me to figure out how to use them that VBScript code might prove useful in my VB.net language Apps where the same problem as with the MsgBox happened trying to display a Windows Form. Thanks and thanks again! Rick USA ----- Original Message ----- From: Chip Orange To: [email protected] Sent: Thursday, April 28, 2011 5:24 PM Subject: RE: MsgBox VBS Function under WE
Hi Rick, all of these numeric values btw, are available as predefined constants in VBScript, so you don't have to guess if 4096 is what you wanted, you could put vbOKOnly+vbInformation instead for instance. the documentation I have lists another constant which I didn't see in what Jeff sent you; and it looks like it's the one you may want; it's: vbMsgBoxSetForeground = 65536 so, I'd try adding it to the others you wish to use (and not modal). please let me know if it makes any difference. Chip ------------------------------------------------------------------------------ From: RicksPlace [mailto:[email protected]] Sent: Wednesday, April 27, 2011 10:45 AM To: [email protected] Subject: Re: MsgBox VBS Function under WE Hi Jeff: OK, I just put up the same info from the manual for David to peek at - I haden't seen your post yet. That is why I asked about the We Custom MsgBox- perhaps GW has addressed this problem with their xml controls and how they work within WE itself. This also happened when I tried to display a Windows Form from within my VB.net External script which scripted VWD and I couldn't figure out a work around at that time. I would like to hear from gw on this to find out exactly what is going on. I will fix my problem if I can but, if not, perhaps GW needs to fix something. Rick USA ----- Original Message ----- From: Jeff Weiss To: [email protected] Sent: Wednesday, April 27, 2011 10:30 AM Subject: RE: MsgBox VBS Function under WE I have also found that, sometimes, the MSGBox doesn't get focus when you want it to. It does seem to help if you specify a title, and if the WindowMaximizer script is running. Here is info on the MSGBox, which shows all of the options- you may have this already. Jeff Weiss ' MsgBox Function ' Displays a message in a dialog box, waits for the user to click a button, and ' returns a value indicating which button the user clicked. Return = MsgBox("MyPrompt", 4161, "MyTitle") If Return = 1 Then Result = "the OK button was pressed, and this button has a value of " & Return Else Result = "The cancel button was pressed, and this button has a value of " & Return End If MsgBox Result, , "Title" ' add 1, 64, 0, and 4096 ' MsgBox(prompt[, buttons][, title][, helpfile, context]) ' prompt String expression displayed as the message in the dialog box. ' buttons Numeric expression that is the sum of values specifying the number and type of ' buttons to display, the icon style to use, the identity of the default button, ' and the modality of the message box. ' title String expression displayed in the title bar of the dialog box. ' helpfile String expression that identifies Help file to use to provide context-sensitive Help ' context Numeric expression identifies the Help context number assigned by Help author ' The buttons argument settings are: ' Constant Value Description ' vbOKOnly 0 Display OK button only. ' vbOKCancel 1 Display OK and Cancel buttons. ' vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons. ' vbYesNoCancel 3 Display Yes, No, and Cancel buttons. ' vbYesNo 4 Display Yes and No buttons. ' vbRetryCancel 5 Display Retry and Cancel buttons. ' vbCritical 16 Display Critical Message icon. ' vbQuestion 32 Display Warning Query icon. ' vbExclamation 48 Display Warning Message icon. ' vbInformation 64 Display Information Message icon. ' vbDefaultButton1 0 First button is default. ' vbDefaultButton2 256 Second button is default. ' vbDefaultButton3 512 Third button is default. ' vbDefaultButton4 768 Fourth button is default. ' vbApplicationModal 0 Application modal; the user must respond to the ' message box before continuing work in the current application. ' vbSystemModal 4096 System modal; all applications are suspended until the ' user responds to the message box. ' The first group of values (05) describes the number and type of buttons displayed in the dialog box; ' the second group (16, 32, 48, 64) describes the icon style; ' the third group (0, 256, 512, 768) determines which button is the default; and ' the fourth group (0, 4096) determines the modality of the message box. ' When adding numbers to create a final value for the argument buttons, use only one number from each group. ' Return Values ' The MsgBox function has the following return values: ' Constant Value Button ' vbOK 1 OK ' vbCancel 2 Cancel ' vbAbort 3 Abort ' vbRetry 4 Retry ' vbIgnore 5 Ignore ' vbYes 6 Yes ' vbNo 7 No From: RicksPlace [mailto:[email protected]] Sent: Wednesday, April 27, 2011 5:51 AM To: [email protected] Subject: MsgBox VBS Function under WE Hi: I am trying to display a standard MsgBox from my script if a message is needed while editing a document in WordPad. The message ping comes up but I have to alt tab to get to the message and the related ok button. I am trying to use The format: Ret = MsgBox( "My Message",4096,"MyTitle" ) So, even with the 4096 specified to indicate this should be on top of any other windows, I think that is what it does, it still is behind the WordPad Window when it pops up. Is there something I am doing wrong or do I need to go to the WindowEyes Custom MessageBox or what can i do to get a message to pop up on top of all other windows to be read as a warning or error? Thanks: Rick USA
