tags:

views:

115

answers:

3

I'm trying to send CTRL A (select all to an app in this case word but try as I might it doesn't work) I've tried quite a few combinations but all to no avail, any ideas?

        IntPtr appHandle = FindWindow(null, "Document1 - Microsoft Word");
        if (appHandle == IntPtr.Zero)
        {
            MessageBox.Show("Specified app is not running.");
            return;
        }

        SetForegroundWindow(appHandle);
        System.Threading.Thread.Sleep(500);

        //SendKeys.SendWait("111");
        SendKeys.SendWait("^A");
        //SendKeys.SendWait("^(A)"); //ctrl a
        //SendKeys.SendWait("(^A)");
+1  A: 

Did you try

SendKeys.SendWait("^{A}"); 
efeX
tried this and this doesn't work.Tried use alt key combos and they don't work for me either....
ALI
A: 

SendKeys is case-sensitive. Try this:

SendKeys.Send("^a"); 

I'm not sure, but it seems like

SendKeys.Send("^A"); 

means Ctrl+Shift+A. At least it does work this way in some applications.