Ok. Then I guess we'll have to do it the hard way!
vb.net Code:
Public Class Form1 Private Declare Auto Function VkKeyScan Lib "user32" (ByVal ch As Char) As Byte Private Declare Auto Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32) Private Declare Auto Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As UInt32, ByVal dx As UInt32, ByVal dy As UInt32, ByVal cButtons As UInt32, ByVal dwExtraInfo As IntPtr) Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down Const MOUSEEVENTF_LEFTUP = &H4 ' left button up Const VK_LSHIFT = &HA0 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Cursor.Position = PointToScreen(New Point(100, 225)) mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, CType(0, IntPtr)) mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, CType(0, IntPtr)) For Each c In "Computer 123" If Not Char.IsNumber(c) AndAlso Char.ToUpper(c) = c Then keybd_event(VK_LSHIFT, 0, 0, 0) keybd_event(VkKeyScan(c), 0, 0, 0) keybd_event(VkKeyScan(c), 0, 2, 0) If Not Char.IsNumber(c) AndAlso Char.ToUpper(c) = c Then keybd_event(VK_LSHIFT, 0, 2, 0) Next End Sub End Class




Reply With Quote
