Results 1 to 6 of 6

Thread: Sendkeys to an embedded app?

  1. #1
    Newbie karrhacker's Avatar
    Join Date
    Jul 2006
    Location
    Ontario Canada
    Posts
    27

    Sendkeys to an embedded app?

    Okay i can't for the life of me, figure out how to sendkeys to an embedded app...I tried using Appactivate, but that only works when the app is not embedded... Any help would be appreciated...

    Ps I code in VB6

    Never Mind i got it..

  2. #2
    Newbie
    Join Date
    Nov 2006
    Location
    Syracuse, NY
    Posts
    15
    What did you do?

    Im sure someone will eventually want to know this and search for it, perhaps even myself if I do my own coding.

    Please share if you can

  3. #3
    Maximum Bitrate jonessc's Avatar
    Join Date
    Nov 2006
    Location
    Wales, UK
    Posts
    787
    Quote Originally Posted by Junglekid27 View Post
    What did you do?

    Im sure someone will eventually want to know this and search for it, perhaps even myself if I do my own coding.

    Please share if you can

    always good to know
    CarPuter Progress:
    Planning:-----> [||||||||||] 100%
    Hardware Buying:-> [||||||||||] 100%
    Software:-----> [||||||||||] 100%
    Installing:-----> [||||||||||] 100%
    Current Project= Making skins in photoshop...

  4. #4
    Newbie karrhacker's Avatar
    Join Date
    Jul 2006
    Location
    Ontario Canada
    Posts
    27

  5. #5
    Variable Bitrate
    Join Date
    Apr 2006
    Location
    Dallas, Texas
    Posts
    264
    I believe you will need to send a windows event message to the application with the keypress event.

    SendMessage(windowHandle, WM_KEYDOWN, Key, 0)

    and the app needs to be wired up to accept the KeyDown event.

  6. #6
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    692
    The keybd_event api is also good for this, if you have strings of key commands you need to pass.

    Code:
    
    ''''''''
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    Private Const KEYEVENTF_EXTENDEDKEY As Long = &H1
    Private Const KEYEVENTF_KEYUP       As Long = &H2
    Private Const VK_SHIFT    As Long = &H10
    Private Const VK_CONTROL  As Long = &H11
    Private Const VK_MENU     As Long = &H12
    Private Const VK_SPACE    As Long = &H20
    Private Const VK_PRIOR    As Long = &H21
    Private Const VK_NEXT     As Long = &H22
    Private Const VK_UP       As Long = &H26
    Private Const VK_DOWN     As Long = &H28
    
    Private Declare Function VkKeyScan Lib "user32" Alias "VkKeyScanA" (ByVal cChar As Byte) As Integer
    ''''''''
    
    
    
    Public Sub Keyboard_PressKey(ByVal key$, Optional ByVal HoldShift As Boolean = False, Optional ByVal HoldCtrl As Boolean = False, Optional ByVal HoldAlt As Boolean = False)
    
    'this procedure uses the byte values for key presses to simulate actual keypresses.
    'for now, it's only set up to handle one character at a time.
    
    Dim k As Byte
    
    On Error Resume Next
    
    Dim holdByte As Byte
    holdByte = CByte(Asc(key$))
    k = VkKeyScan(holdByte) And &HFF
    
    
    If HoldShift <> False Then keybd_event VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY, 0
    If HoldCtrl <> False Then keybd_event VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY, 0
    If HoldAlt <> False Then keybd_event VK_MENU, 0, KEYEVENTF_EXTENDEDKEY, 0
    
    keybd_event k, 0, KEYEVENTF_EXTENDEDKEY, 0
    keybd_event k, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
    
    If HoldShift <> False Then keybd_event VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
    If HoldCtrl <> False Then keybd_event VK_CONTROL, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
    If HoldAlt <> False Then keybd_event VK_MENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
    
    End Sub

    Or, get more code: I posted a bunch at:
    http://www.mp3car.com/vbulletin/soft...-attached.html

Similar Threads

  1. has anyone thought of this for an app or plugin?
    By ikon240 in forum Software & Software Development
    Replies: 16
    Last Post: 03-04-2007, 01:58 AM
  2. Alpine City Cruise
    By Hell-Stopper in forum RR Skins
    Replies: 170
    Last Post: 02-22-2007, 10:05 PM
  3. Disappearing Dialogs in Embedded app
    By darkseid in forum Road Runner
    Replies: 2
    Last Post: 09-07-2006, 05:01 PM
  4. embedded app on top when switching skins
    By kuo in forum RR Bug Tracker
    Replies: 1
    Last Post: 08-21-2005, 07:39 PM
  5. Compro Actionmate TV + FM embedding app
    By CdRsKuLL in forum Road Runner
    Replies: 6
    Last Post: 08-14-2005, 10:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •