Click to See Complete Forum and Search --> : Sendkeys


Peitudo
April 16th, 2001, 08:49 AM
Quick question on the sendkeys statement. It seems that the statement can't send to a message box, is this true. or is there a way around this I just can't find?

Iouri
April 16th, 2001, 09:07 AM
You can send keys to the msgbox like any other window. The problem is that the msgbox is shown modal. That means that the execution of the other code is suspended until you replied to the msgbox. You can send keys to the msgbox from another program.
Anyway, why do you need to send keys to the msgbox? There are ways to close msgbox without clicking on it.

Iouri Boutchkine
iouri@hotsheet.com

Peitudo
April 16th, 2001, 09:15 AM
The message box is shown modal, there is two buttons and two radio buttons on the message box, the radio buttons are important as they tell the calling app how to handle the movement of pages from one document to another. This is for a database application. The front end was written in Visual basic, and has some limited scripting support. I am just trying to script on top of the existing program. It seems as if the sendkeys statement is going to the calling window and not the message box. The message box is important, the radio button must be set properly for the movement that this shortcut is trying to perform.

And thanks for the reply.. Where I work I am the only semi knowledgeable programmer here, so there is noone to bounce questions or ideas off of..

Iouri
April 16th, 2001, 09:20 AM
msgbox cannot have radiobuttons. That means that you are using custom form for the msgbox. If this is the case look at the code and modify it. Try to avoid send keys. It is not very reliable.

Good luck

Iouri Boutchkine
iouri@hotsheet.com

Peitudo
April 16th, 2001, 09:59 AM
Sadly I don't have access to the code for the base form, nor the custom form they are using. I was afraid that it wasn't a message box, but I was hoping it would be that easy.. Heh. I have tried to appactivate the little faux message box and that doesn't work... Ohwell, back to the drawing board.. Thanks for the input

cksiow
April 16th, 2001, 07:15 PM
one way to allow ur program still processing code (thus, sendkey will be executed) when u display a modal dialog box, is using multithreading, cause it's not currently supported by vb, but refer
http://vblib.virtualave.net for an example, however. I can't promise that it will work as expected.