on 2007 Sep 19 2:40 PM
hi,
i active the printer dialog by menu 520 and want to send some keys.
moSBOApplication.ActivateMenuItem("520")
...
i fetch the printer dialogue by the MENU-EVENT
Select Case pVal.MenuUID
Case "520":
SendKeys.SendWait("E")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{ENTER}")
My code worked well in vb6, but now i need the same behaviour in vb.net, but it don't seem to work.
In vb6 i used sendkeys.send("E")
when i use this in vb.net there is the following error:
SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method.
But when i use sendkeys.sendwait("E") the systems will stay in deadlock and i get no controll anymore.
Does anybody knows how to solve this?
thanks
Markus
I posted a new message for you...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nobody an idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi together,
I had the same problem. But I solved it by using a new thread.
1st) The major problem is, that the printer dialog is modal to SBO and you are not able to send commands like sendkeys. One possibility is to fill the keyboard buffer with hundred of TAB and ENTER Keys but that's not very nice.
2nd) In my first try I started a new thread before activating the SBO Menu Item. The Thread looked by using WinAPI for the printer window (you should look for the child windows of your SBO application, to verify that your get the right window) and then send TAB and ENTER. It works fine.
3rd) In my last try and this is the way I am doing print jobs now, is to post a new click message into the windows message queue. So my program simulates a mouseclick to the Print button.
If you want to get some code... feel free to ask!
Regard,
Sebastian
User | Count |
---|---|
102 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.