Jump to content
r2maker

C# program calling ControlSend Issue with multiple keys

Recommended Posts

r2maker

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?

 

 

 

 

 

Share this post


Link to post
Share on other sites
r2maker

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. 

 

Share this post


Link to post
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

×