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.
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.
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.
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...
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.
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
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
How can I pass a paramater "Yes" to a sy
Reply me on guru@tough.com