General discussion

Locked

How can I pass a paramater "Yes" to a sy

By nrc1 ·
How can I pass a paramater "Yes" to a system generated msgbox, so after that user will not be pressing "Yes" key on every time. thanks
Reply me on guru@tough.com

This conversation is currently closed to new comments.

13 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How can I pass a paramater "Yes" to a sy

by javierrosado In reply to How can I pass a paramate ...

Never have done this myself but I guess you could do it by getting the object reference fo the activecontrol in the screen. The check whether it is a button and whether it has the default property set to true. Maybe this way you could call it click event.

Perhaps another way could be using the sendkeys procedure but I am not quite sure about this one.

Collapse -

How can I pass a paramater "Yes" to a sy

by nrc1 In reply to How can I pass a paramate ...

The question was auto-closed by TechRepublic

Collapse -

How can I pass a paramater "Yes" to a sy

by kratka.eric.d In reply to How can I pass a paramate ...

As far as I know, any system message box holds control of the program until manually pressed, so you cannot use send keys or get it's window handle using the same program. It would be theoretically possible to run another program that would deal with the message boxes, but my solution would be to build your own message boxes with a built in timer or a way to make it non-modal.

Collapse -

How can I pass a paramater "Yes" to a sy

by nrc1 In reply to How can I pass a paramate ...

The question was auto-closed by TechRepublic

Collapse -

How can I pass a paramater "Yes" to a sy

by amasson In reply to How can I pass a paramate ...

In a vb program, first thing to do is:
- give focus to the application generating the message box. Ex: if your program title bar is "Window's name", do this with:
AppActivate "Window's name".
- after, send the correct keystrokes. For "Yes" (the Yis usualy underlined), you can send the string corresponding to Alt-Y
SendKey "!Y" or something like this (y am not sure of the corresponding char for Alt key, but there is one (like "!").
- This work one time. If you want it to work always, Create a shortcut that start your program instead of the real program. Then your vb program start the desired application with:
Shell "path_name.exe", vbNormal
DoEvents
and then send keystrokes via SendKey...

Collapse -

How can I pass a paramater "Yes" to a sy

by nrc1 In reply to How can I pass a paramate ...

The question was auto-closed by TechRepublic

Collapse -

How can I pass a paramater "Yes" to a sy

by mmercer In reply to How can I pass a paramate ...

If I were you I would look to trapping the error generated and inhibiting the production of the system generated msgbox (you can intercept errors at will if you know the errors 'handle') ... I am pressuming that this is a response to a specific error - it would be unwise to just OK all system errors.

Unfortunately I am unsure as to how to do this (except in Oracle), but as I know you can intercept errors (set up an exception/error trap for this this may need to be through the API) it should not be too hard to find in your user documentation.

Collapse -

How can I pass a paramater "Yes" to a sy

by nrc1 In reply to How can I pass a paramate ...

The question was auto-closed by TechRepublic

Collapse -

How can I pass a paramater "Yes" to a sy

by hotpro_99 In reply to How can I pass a paramate ...

Trap the message. This is done by finding out what causes it, and then writing your own method of dealing with it. Example "divide by zero"
you must work out something like :
{p = ((d-t)/c) * 100}
if c = 0 then p := 0
else
p = ((d-t)/c * 100You syntax will depend on the language you use, therefor I've idn't include most of the syntax. Also find out the handle, and then you can either suppress, or control the error. Windows can be contolled, in a mean way, so just do a bit of research, like reading the "help" in your Development Language. Good Luck

Collapse -

How can I pass a paramater "Yes" to a sy

by nrc1 In reply to How can I pass a paramate ...

The question was auto-closed by TechRepublic

Back to Web Development Forum
13 total posts (Page 1 of 2)   01 | 02   Next

Software Forums