Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[57] SendKeys Command

Last post 12-04-2007 7:22 AM by vin25. 33 replies.
Page 2 of 3 (34 items) < Previous 1 2 3 Next >
Sort Posts: Previous Next
  • 07-12-2003 4:34 AM In reply to

    You're opening Notepad on another PC? It won't work then. It only simulates keypresses on your keyboard. You'd have to get it to run an app/script that sends the keys on the other PC.
    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 07-16-2003 3:58 PM In reply to

    • fuadjay1
    • Not Ranked
    • Joined on 04-14-2003
    • New Member
    • Points 45

    SendKeys

    Good Afternoon - I have a VB program that launch the C shell (services for UNIX).  I will like to print some commands at the prompt using the SendKeys but it won't work.  Below is my code:

    Private Declare Function GetForegroundWindow Lib "user32" () As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

    'Public customReportName As String, customReportName2 As String

    Private Const WM_CLOSE = &H10
    Private openCShellExe As Long

    'EXECUTE THE EXECUTABLE FILE ASSOICATED WITH THE MEDTOX REPORTS
    Public Sub cmdOpenCShell()
       
       frmPrinter.WindowState = 1
       If frmPrinter.cmdPrint.Value = True Then
           Call Shell("C:\WINDOWS\SYSTEM32\POSIX.EXE /u /c /bin/csh -l", vbNormalFocus)
           'Call Shell("cmd.exe", vbNormalFocus)
           DoEvents
           openCShellExe = GetForegroundWindow
           SendKeys "cd .." ', True
           SendKeys ("{Enter}")
           SendKeys "ls"
        Else
           Exit Sub
       End If
       
    End Sub
    • Post Points: 0
  • 08-08-2003 11:42 PM In reply to

    Ctrl+Alt+Del

    How can I simulate Ctrl+Alt+Del on WinXP? I tried it and although it sends the keys (and my sort-of-keylogger verified it), Windows ignores it.
    • Post Points: 0
  • 10-16-2003 9:46 AM In reply to

    Shift+tab, Ctrl+tab not working

    Hi

     I am trying to simulate data entry in SAP screen from VB. The Ctrl+tab and Shift+tab are not working.

     I used "^{tab}" , "^(vbtab)" , "^((vbtab))", "^({tab})" but nothing worked.

     Please do clarify
    • Post Points: 0
  • 10-21-2003 10:09 AM In reply to

    • dizzies
    • Not Ranked
    • Joined on 10-20-2003
    • New Member
    • Points 10

    CTRL+TAB

    Hey All,

        I'm having the same problem with sendkeys "^{TAB}". My application treats this command as a TAB - "{TAB}", but I need a CTRL+TAB to skip through a text box. Does anyone have any suggestions? Thanks,

    Steve
    • Post Points: 0
  • 02-09-2004 7:47 AM In reply to

    • drachmad
    • Not Ranked
    • Joined on 02-09-2004
    • New Member
    • Points 10
    I dont know if it will help
    The same case happen when I use ComponentOne Flexgrid, I use to simulate left key to do the shift tab

           ' Left or Shift Tab (65536 + 9)
           If lastkey = 37 Or lastkeydata = 65545 Then
                 System.Windows.Forms.SendKeys.Send("+{TAB}")
           Else
               System.Windows.Forms.SendKeys.Send("{TAB}")
           End If

    I just curious if it work in your case
    • Post Points: 0
  • 02-09-2004 7:53 AM In reply to

    • drachmad
    • Not Ranked
    • Joined on 02-09-2004
    • New Member
    • Points 10
    I dont know if it will help
    The same case happen when I use ComponentOne Flexgrid, I use to simulate left key to do the shift tab

           ' Left or Shift Tab (65536 + 9)
           If lastkey = 37 Or lastkeydata = 65545 Then
                 System.Windows.Forms.SendKeys.Send("+{TAB}")
           Else
               System.Windows.Forms.SendKeys.Send("{TAB}")
           End If

    for a ctrl, try 131072 + 9 instead of 65536 + 9
    I just curious if it work in your case
    • Post Points: 0
  • 03-09-2004 12:01 PM In reply to

    sendkeys

    If you need to use sendkeys to send a combination of keys for example CTRL+C (for copy) you need to use brackets. Sendkeys "^C" sends CTRL and C separately. Use something like Sendkeys "(^C)"
    • Post Points: 0
  • 03-20-2004 9:10 PM In reply to

    • Nimpo
    • Top 25 Contributor
    • Joined on 03-16-2004
    • United States
    • Guru
    • Points 7,520

    Mouse Clicks

    I'm not sure if this can be accomplished with the send keys but how can you simulate a left or right mouse click?

    If you want to know more about me, check out my MySpace.

    Tech & Philosophy - Philosophy in Technology Blog
    Caution, bmp in Road - GDI+ Blog
    • Post Points: 10
  • 05-03-2004 8:31 AM In reply to

    sendkeyx problem

    Hi,

    I've read your post about sendkeys and I have the same issue.

    In a script I want to copy the text selected and it works well on my computer with this code :

    Set Wsh = WScript.CreateObject("WScript.Shell")
    Wsh.SendKeys "^{c}"

    But I installed the program on other computers and there, the script doesn't copy anything !!

    Do you know how can this happen ?
    Are there rights that I need to configure on other computers so that sendkeys can be called ?

    Thanks,

    Jerome
    • Post Points: 0
  • 05-04-2004 2:50 PM In reply to

    • bonny
    • Not Ranked
    • Joined on 07-09-2003
    • New Member
    • Points 20
    Thank you.
    • Post Points: 0
  • 11-17-2004 7:07 AM In reply to

    locking the computer throu VB

    in vb how do I send Ctrl + Alt + Del  followed by an Enter key in VB Code
    this is to lock the system.

    thanks

    /Sunil
    • Post Points: 0
  • 12-20-2004 2:07 PM In reply to

    awsoem, but alt+enter issue??

    Awesoem!, but u kno how when useing  command prompt, u can hit alt+enter to make it go full screen, how would i get it to do tht, its not working i have this so far -
    Shell "C:\WINDOWS\system32\cmd.exe", vbNormalFocus
    SendKeys ("%~")
    SendKeys "@echo off~"
    SendKeys "cd\~"
    SendKeys "cd windows~"
    but i cant get the %~ command to work???? can neone help???
    • Post Points: 0
  • 04-10-2005 8:10 PM In reply to

    Locking the computer

    Hi,

    You can lock a windows nt based computer (2000,Xp,2003 etc) by the following shell command:

    shell "rundll32.exe user32.dll,LockWorkStation",vbhide
    • Post Points: 0
  • 04-11-2005 5:22 AM In reply to

    HI,

    Thanks for replyng.

    Can you explain in detail how this can be done,
    coz im new to all this stuff.

    thanks

    Sunil
    • Post Points: 0
Page 2 of 3 (34 items) < Previous 1 2 3 Next >