Skip to Content
0
Former Member
Sep 19, 2007 at 01:40 PM

vb.net : SendKeys.Send don't work , SendKeys.SendWait -->deadlock

685 Views

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