title: Citrix Xenapp - Sendkeys
body: <p>I have been trying (with limited resources) to use VBScript and VBA commands to send keyboard functions to a remote citrix terminal. - This, as I've discovered is a known restriction and I've found various articles which give an alternative method via C++ and scancodes to overcome the restriction. </p>
  
  <p>The main issue is, I don't have access to C++. </p>
  
  <ul>
  <li>Is there a solution that will allow this with VBScripts and/or VBA?</li>
  </ul>
  
  <p>I've considered many options, including using the windows virtual keyboard (this didn't work) and installing a virtual keyboard driver in windows (well out of my depth).</p>
  
  <p>Here is one of the articles which discuses the scancodes, using C++:</p>
  
  <p><a href="http://www.codeproject.com/Tips/310817/SendKeys-using-ScanCodes-to-Citrix" rel="nofollow">http://www.codeproject.com/Tips/310817/SendKeys-using-ScanCodes-to-Citrix</a></p>
  
  <p>I am at a loss and anyone who can help would be a super hero...If a super heroes' main appeal was to be a geek god. :)</p>
  
  <p>Any help is appreciated!!!</p>
  
  <p>Cheers.</p>
  
  <p>****UPDATE****</p>
  
  <p>Hello,</p>
  
  <p>I've done a little more digging...</p>
  
  <p>...The Citrix ICA Client terminal window isn't receiving the VBScript sendkeys commands but if I manually press alt in the terminal after executing the script (with a 2 second pause), for example:</p>
  
  <pre><code>*Set objShell = WScript.CreateObject("WScript.Shell")
  WScript.Sleep 2000
  objShell.SendKeys ("e")
  objShell.SendKeys "(P)"*
  </code></pre>
  
  <p>The above can access the 'file', 'edit', etc menu options on the tool bar within the terminal window.</p>
  
  <p>This to me suggests that the issue isn't a privilege issue and I'd think that there is perhaps hope yet for the sendkeys method? </p>
  
  <p>Having looked further into this, there is some documentation re: ini file settings on the Citrix site with regards to Citrix ICA clients. </p>
  
  <p>One of the articles can be found below:</p>
  
  <p><a href="http://support.citrix.com/article/CTX129166" rel="nofollow">http://support.citrix.com/article/CTX129166</a></p>
  
  <p>I've had a play around and there does seem to be a few ini files which list keyboard mappings, DLL files, virtual key passthrough as well?</p>
  
  <p>One of the sections of the 'module' ini file contained the following:</p>
  
  <pre><code>[KeyboardLayout]
  (User Profile)=0x00000000
  (Server Default)=0xFFFFFFFF
  </code></pre>
  
  <p>There were other codes, including various languages, British, US-International etc.</p>
  
  <p>This was then followed by a list of DLL codes e.g:</p>
  
  <pre><code>kbduk.dll=0x00000809
  </code></pre>
  
  <p>And finally, Language IDs, e.g:</p>
  
  <pre><code>eng=0x00000809
  </code></pre>
  
  <p>I am guessing (hoping) that there would be a way to amend the ini settings that will allow for the sendkeys to be received in the terminal fields and not just the toolbar menus.</p>
  
  <p>As before, any help is appreciated....I am slowly going insane over this one!!!</p>
  
  <p>Cheers! </p>