Jump to content

C# program calling ControlSend Issue with multiple keys


r2maker
 Share

Recommended Posts

OK. First post.

I have a C# program and I am calling ControlSend.

            int d=au3.AutoItSetOption("SendKeyDownDelay", 1000);
            if (au3.error != 0)
            {
                Console.WriteLine(" <debug info=\"ControlSend FAILED\"/>");
            }
            Console.WriteLine(" <debug info=\"old down delay {0}\"/>",d);

            au3.ControlFocus("[HANDLE:" + handle + "]", "", Constants.menuControl);
            if(au3.error != 0)
            {
                Console.WriteLine(" <debug info=\"ControlFocus FAILED\"/>");
            }

            String c=au3.ControlGetFocus("[HANDLE:" + handle +"]");
            if (au3.error != 0)
            {
                Console.WriteLine(" <debug info=\"ControlGetFocus FAILED\"/>");
            }

            Console.WriteLine(" <debug info=\"{0}\"/>",c);
        
            au3.ControlSend("[HANDLE:" + handle + "]", "", "[CLASSNN:" + c + "]", "{F5}");
            if (au3.error != 0)
            {
                Console.WriteLine(" <debug info=\"ControlSend FAILED\"/>");
            }

If I send "{F5}" this works.

If I send any single key this works.

If I try multiple keys such as "^q" it does not work.

I tried searching the forum where folks mention making sure the control is active and forcing a longer key hold. Which I've added.

Very frustrated and hoping its something silly that I cant see because I've been staring at it for too long.

Anyone have any suggestions?

 

 

 

 

 

Link to comment
Share on other sites

Any combination of two or more keys does not seem to work. Any single key seems to work.

I have some ALT+key that I want to send and some CTRL+key that I want to send. I have one CTRL+ALT+key that I need to send.

None of them work. 

But all of the function {key} seem to work. 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...