• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 646
  • Last Modified:

Age Old AppActivate/GetForgroundWindow Question. Send data from my app to another. ie focus problem

Greetings,

I know this subject has been beaten half-to-death but I am confused and could use some help. I am creating an application will send text data to another running program. The problem is how do I determine which program/application HAD the focus just before I set the focus to my application.

What I want to do is to initiate/create some text from within my program that can be sent to the LAST program that had the PREVIOUS focus without knowing what that program was or is.

How do I use Get/SetForeGroundWindow and AppActivate to perform thi function. Also I have seen some earlier responses that use a TIMER, is this required? do I need to change focus manually?

Thanks in advance,
rrbecker
0
rrbecker
Asked:
rrbecker
  • 21
  • 13
  • 5
2 Solutions
 
rrbeckerAuthor Commented:
Hi Mikal613,

Thanks for the quick response. Could you help me decipher the information in the links you provided.
Example, the links tell/show how to get a Handle to the program that CURRENTLY has the focus. How do I get a
handle to program that LAST had the focus? (or am I reading that it can't be done reliably?)

Is it possible to SEND my application to the background and then use GetForegroundWindow? Or will that just
create a situation whereby NO application will have focus?

Thanks for your input,

rrbecker
0
 
Mikal613Commented:
LAST had the focus??

You will get the current

GetForegroundWindow does not take your window in effect
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rrbeckerAuthor Commented:
Hi Mikal613,

Hmmm, OK, let me try again... I'll get back in a bit.

rrbecker
0
 
rrbeckerAuthor Commented:
Hi Mikal613,

Thanks, You are well on your way to being awarded the points. I could have sworn that I
received the handle to MY application the last time I tried it, but this time it return the handle to
a different application.

I may have a couple of other question (directly related to the current topic) so I'll hold off a while
before awarding the points.

Thanks for you help and quick response,

rrbecker
0
 
rrbeckerAuthor Commented:
Hi Mikal613,

Ok I think things are getting better. I have the following code implemented:

------------------------------------------------
Clipboard.SetText CurrentContents$
                 
hwdWindowHandle = GetForegroundWindow()
SetForegroundWindow hwdWindowHandle
DoEvents
SetActiveWindow hwdWindowHandle
DoEvents
SendKeys "^v", False
----------------------------------------------

I have my application running along with 'Notepad'. What I expect to have happen is the following:

(1) Text contained in CurrentContents$ sent to Clipboard - works
(2) get handle to foreground window - appears to work ?
(3) set handle to foreground window - appears to work ?
(4) make foreground the Active  window - appears to work?

(5) PASTE the contents of the Clipboard into Notepad - doesn't work - Help

Question: Do I still need to use AppActivate or is SetActiveWindow equivelant.  If I still need to use AppActivate how do I get the 'Name' of the application to pass to AppActivate"

Thanks again,

rrbecker
0
 
Mikal613Commented:
SendKeys("{appactivate Notepad}hello")
0
 
rrbeckerAuthor Commented:
Hi Mikal613,

I implemented the following code but when I execute it it returns the Title of my application
and Not the name of the application that I expected ie. Notepad WHY?

NOTE: I click a command button on my application.


hwdWindowHandle = GetForegroundWindow()

TitleTmp = Space(256)
nRet = GetWindowText(hwdWindowHandle, TitleTmp, Len(TitleTmp))
MsgBox (Trim(TitleTmp))

rrbecker
0
 
Mikal613Commented:
sorry i forgot it does get the most top form which happens to be your form
0
 
rrbeckerAuthor Commented:
Hi Mikal613,

Ok, Is there a way to Force my Application to the Background?

rrbecker
0
 
Mikal613Commented:
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

Private Const WM_KILLFOCUS = &H8

lngHwndToFocus = 0&
  SendMessage me.hwnd, WM_KILLFOCUS, lngHwndToFocus, 0&

'Before you call the GetFoeground function
 
0
 
rrbeckerAuthor Commented:
Hi Mikal613,

I can't seem to get your function to work,

".....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

Private Const WM_KILLFOCUS = &H8

lngHwndToFocus = 0&
  SendMessage me.hwnd, WM_KILLFOCUS, lngHwndToFocus, 0&

'Before you call the GetFoeground function...."

But I can do the following which is clumsy and a hack. I would rather get your Idea working:


Please Note the Comment Marks and the fact that I 'Minimize' my program first. What am I doing wrong
with your suggestion?
----------------------------------------------------------

'lngHwndToFocus = 0&
'lngHwndToFocus = GetForegroundWindow()
'SendMessage Me.hwnd, WM_KILLFOCUS, lngHwndToFocus, 0&

Me.WindowState = 1
TimerSet = 1
Pause 3
DoEvents

hwdWindowHandle = GetForegroundWindow()
'SetForegroundWindow hwdWindowHandle
'DoEvents
'SetActiveWindow hwdWindowHandle
TitleTmp = Space(256)
nRet = GetWindowText(hwdWindowHandle, TitleTmp, Len(TitleTmp))
'MsgBox (Trim(TitleTmp))

AppActivate TitleTmp$
DoEvents
SendKeys "^v", False

Me.WindowState = 0
----------------------------------------------

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Another approach is to make it so your app cannot be activated...just like an Onscreen Keyboard.

Create a new project and add a Button.  Set its Index property to 0 (zero).  Copy the button and paste it several times to make a control array.  Change the caption of each button so it only has one letter on it.  So you have one button with A on it and another with B on it and so forth.  Paste the code below.  Run the appplication.  Open up NotePad.  Now switch back to this application and press one of the buttons.  The caption of that button should be sent to Notepad.

~IM

Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, Y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE

Private Const WS_EX_NOACTIVATE = &H8000000
Private Const GWL_EXSTYLE = (-20)

Private Sub Form_Load()
    Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
    Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_NOACTIVATE)
End Sub

Private Sub Command1_Click(Index As Integer)
    SendKeys Command1(Index).Caption
End Sub
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Hmmm, Your approach looks a lot cleaner than what I currently have in place. I will try you approach later
tonight. I have to leave for a while right now but I'll look at your suggestion when I get back.

Thanks for the input,

rrbecker
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Well It works... Now I am an emotional wreak, I don't know how I should divey up the points. I received some
initial help from Mikal613 and had a margin of success but your solution is clean and works as expected. (There is a caviate that I will ask you about later though)

I thought what I would do is up the poins to 350 then split them between you and Mikal613. I will award you 200 points, because I a going to use your solution, and 150 will go to Mikal613 for all the initial help.

How do you and Mikal613 feel about this?

Thanks for the help and solution

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
I wouldn't fret over points rrbecker since both Mikal613 and myself have points coming out our ears.  ;)

Just split the existing points as you see fit.

What other questions do you have for me or Mikal613?

~IM
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Ok Thanks, I'll sleep better tonight knowing that.. :)

The extended question is this,

While you soultion works quite well, the form that I have created is allowed to move and be re-shaped.
Your example WILL allow the form to be moved and re-shaped but not in Real-Time. I can click on the
form and move the mouse pointer to another position but the form will not actually move until the
mouse button is released.

I assume that the Defined Constants  Private Const SWP_NOMOVE = &H2 and Private Const SWP_NOSIZE = &H1
control this action. My question is what values do I need in order to allow the form to be moved and re-shaped
in real time. (NOTE: I tried setting TOPMOST_FLAGS  to 0 but the form would not display. - wrong thing to do)

Thanks again

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
There is a fix to allow the form to be moved in real time.  We have to subclass the form and trap the WM_MOVING message.  I've done it in VB.Net code but need to convert it over to VB6 code.  I'll post the solution for you as soon as its done.

~IM
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Great, I can't thank you enough.

I quess I'll "Close" (Accept) this question for now, but how will I know when you have posted your conversion.

Will you add a comment to this question so that I get notification or???

Thanks again, you've been great.

BTW, I've tinkered with VB.NET, maybe I should try to duplicate my little project in .NET.... Just a thopught.

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can close it now or when I post the complete code.  Even after a question is closed, you still get notifications.

Some things are so easy in .Net.  The code for subclassing the message is literally a couple of lines.  In VB6 we have to jump through hoops to get it done.

~IM
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Here is the fix.  Add this line to the Form_Load() event:

    HookWindow Me.hWnd

And this code to a Module:

Option Explicit

Public Type RECT
   left As Long
   top As Long
   right As Long
   bottom As Long
End Type

Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
    (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, _
    ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
    (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)

Public Const GWL_WNDPROC As Long = (-4)
Public Const WM_MOVING = &H216

Public lPrevProc As Long

Public Sub HookWindow(ByVal lHandle As Long)
    If lPrevProc = 0 Then
        lPrevProc = SetWindowLong(lHandle, GWL_WNDPROC, AddressOf HookProc)
    Else
        Call SetWindowLong(lHandle, GWL_WNDPROC, lPrevProc)
    End If
End Sub

Public Function HookProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Dim rc As RECT

    Select Case uMsg
        Case WM_MOVING
            CopyMemory rc, ByVal lParam, LenB(rc)
            Form1.Move Form1.ScaleX(rc.left, vbPixels, vbTwips), Form1.ScaleY(rc.top, vbPixels, vbTwips)
            HookProc = 1
            Exit Function
           
    End Select
   
    HookProc = CallWindowProc(lPrevProc, hWnd, uMsg, wParam, lParam)
End Function
0
 
rrbeckerAuthor Commented:
Hi again ~IM,

Ok, I'll leave it open for now. (a day or two anyway)

I've been wanting to get more involved in .NET for a while now. Once I have complete this little VB6 project I
might just use it as a "First Time" project in .NET. At least that way I'll know what it is 'suposed' to do, before
I start.

Thanks for all your help,

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
I already posted the fix that allows you to move the form in realtime.

Let me know if you need help with the VB.Net conversion or just want to see the code up front.

~IM
0
 
rrbeckerAuthor Commented:
WOW,

I'm more than a little impressed. You posted the code before I had a chance to respond to
your previous post..... Boy I don't know what to say... Thanks!

I'll pull it down and work on it in the morning. It's Midnight here and I have to be up and
going at 6:00am

Thanks so very much.

rrbecker
0
 
rrbeckerAuthor Commented:
Hi ~IM,

I lied...I'm still up... I just had to try the new code and (of course) it works well. The form moves as expected
and looks good. The re-size/re-shape is still an issue but what can I say.... I'm tickled to death.

This is great stuff and I appreciate everything done and offered.

So this time I'm headed to bed for real. I'll just catch you all later.

Again, Thanks

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
I'll see what I can do about the resize part...haven't tried that yet.

~IM
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Here is the module code modified to handle the sizing as well (I'm off too bed as well...):

Option Explicit

Public Type RECT
   left As Long
   top As Long
   right As Long
   bottom As Long
End Type

Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
    (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal msg As Long, _
    ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
    (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)

Public Const GWL_WNDPROC As Long = (-4)
Public Const WM_MOVING = &H216
Public Const WM_SIZING = &H214

Public lPrevProc As Long

Public Sub HookWindow(ByVal lHandle As Long)
    If lPrevProc = 0 Then
        lPrevProc = SetWindowLong(lHandle, GWL_WNDPROC, AddressOf HookProc)
    Else
        Call SetWindowLong(lHandle, GWL_WNDPROC, lPrevProc)
    End If
End Sub

Public Function HookProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Dim rc As RECT

    Select Case uMsg
        Case WM_MOVING
            CopyMemory rc, ByVal lParam, LenB(rc)
            Form1.Move Form1.ScaleX(rc.left, vbPixels, vbTwips), Form1.ScaleY(rc.top, vbPixels, vbTwips)
            HookProc = 1
            Exit Function
           
        Case WM_SIZING
            CopyMemory rc, ByVal lParam, LenB(rc)
            Form1.Move Form1.ScaleX(rc.left, vbPixels, vbTwips), Form1.ScaleY(rc.top, vbPixels, vbTwips), _
                Form1.ScaleX(rc.right, vbPixels, vbTwips) - Form1.ScaleX(rc.left, vbPixels, vbTwips), _
                Form1.ScaleY(rc.bottom, vbPixels, vbTwips) - Form1.ScaleY(rc.top, vbPixels, vbTwips)
           
            HookProc = 1
            Exit Function
    End Select
   
    HookProc = CallWindowProc(lPrevProc, hWnd, uMsg, wParam, lParam)
End Function

0
 
rrbeckerAuthor Commented:
Good Morning ~IM,

Thank you so very much for your solution. I am very please and impressed. Words cannot
express my appreciation. I am very happy with the resuls and even happier with having
"Met" you. It makes me feel good to know that there are people like yourself out there.

Thanks again,

rrbecker (Rick)
0
 
rrbeckerAuthor Commented:
Greetings ~IM,

I have a related question that I would like to ask and would be happy to post a New Question.
Since it is related to the solution in this thread, how do you want me direct the question?

Thanks in advance,

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can post it in here first if you want.  If we can't solve it, then you can make a new question.

~IM
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Thanks for the reply.

My little application is running just fine and I am tickled-to-death with it, howerver there is a very
minor ocurrence that may or may not be easily worked.

I have added my own 'Right-Click' menu to the application which allows me to 'Set' and 'Re-Set' certain options.
This works fine 'Except' after selecting one of these options the 'Focus' moves away from the 'Current application'
and gives Focus back to 'My Program'.

This anomaly does not ocurr at any other time, only when a 'Right-Click' menu item is selected.

This is not a big deal because a user should not have to change options that often.

Thanks for any input,

rrbecker

ps - sorry for the delay in submitting this....
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Hmm...haven't tried adding a context menu to a NoActivate app.  Will have to experiment with it.

I'll take a look into it.

Another option is to use system wide hotkeys to for your 'Set' and 'Re-Set' actions.  Let me know if you want to see code on how to do that.

~IM
0
 
rrbeckerAuthor Commented:
Hi ~IM,

Thanks for the response.

It really isn't a big deal, but would be nice.

As far as 'System Wide' HotKey.... Yea that might be an iteresting addition, I'm alway open to new ideas
and I for sure won't turn down an offer like this.

Thanks,

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Here is the system wide hotkey example:

' ***********************************
' Form1
' ***********************************
Option Explicit
' ***********************************
' Author : Imran Zaheer
' Email  : imraanz@mail.com
' Web    : www.imraanz.com
' Y2K

Dim retVal0 As Boolean, retVal1 As Boolean, retVal2 As Boolean

Private Sub Form_Load()
    MsgBox "Registering CTRL+F10, CTRL+F11, CTRL+F12 as hot keys..."
   
    retVal0 = RegisterHotKey(Me.hwnd, 0, MOD_CTRL, VK_F10)
    If Not retVal0 Then
        MsgBox "Can not register all or one of the hotkeys CTRL+F10 ... Try other keys this key is already registered by some other running applications.", vbCritical
    End If
   
    retVal1 = RegisterHotKey(Me.hwnd, 1, MOD_CTRL, VK_F11)
    If Not retVal1 Then
        MsgBox "Can not register all or one of the hotkeys CTRL+F11 ... Try other keys this key is already registered by some other running applications.", vbCritical
    End If
   
    retVal2 = RegisterHotKey(Me.hwnd, 2, MOD_CTRL, VK_F12)
    If Not retVal2 Then
        MsgBox "Can not register all or one of the hotkeys CTRL+F12 ... Try other keys this key is already registered by some other running applications.", vbCritical
    End If
   
    If (retVal0 = False And retVal1 = False And retVal2 = False) Then
        MsgBox "No Hotkey could be registered ...!", vbCritical
        End
    End If
   
    ' Subclassing the form to get the Windows callback msgs.
    glWinRet = SetWindowLong(Me.hwnd, GWL_WNDPROC, AddressOf CallbackMsgs)
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ' If first hotkey is registered then
    ' unregister it.
    If retVal0 Then
        UnregisterHotKey Me.hwnd, 0
    End If
   
    ' If second hotkey is registered then
    ' unregister it.
    If retVal1 Then
        UnregisterHotKey Me.hwnd, 1
    End If
   
    ' If third hotkey is registered then
    ' unregister it.
    If retVal2 Then
        UnregisterHotKey Me.hwnd, 2
    End If
End Sub

' ***********************************
' Module1
' ***********************************
Option Explicit
' ***********************************
' Author : Imran Zaheer
' Email  : imraanz@mail.com
' Web    : www.imraanz.com
' Y2K
' Module : Contains declarations and functions for
'          vHotKeys.

Public Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, _
    ByVal ID As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
   
Public Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, _
    ByVal ID As Long) As Long

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
    (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Const WM_HOTKEY = &H312
Public Const GWL_WNDPROC = -4

Public Const MOD_CTRL = &H2
Public Const MOD_SHFT = &H4
Public Const MOD_ALT = &H1

Public Const VK_NUMPAD0 = &H60
Public Const VK_NUMPAD1 = &H61
Public Const VK_NUMPAD2 = &H62
Public Const VK_NUMPAD3 = &H63
Public Const VK_NUMPAD4 = &H64
Public Const VK_NUMPAD5 = &H65
Public Const VK_NUMPAD6 = &H66
Public Const VK_NUMPAD7 = &H67
Public Const VK_NUMPAD8 = &H68
Public Const VK_NUMPAD9 = &H69
Public Const VK_MULTIPLY = &H6A
Public Const VK_ADD = &H6B
Public Const VK_SEPARATOR = &H6C
Public Const VK_SUBTRACT = &H6D
Public Const VK_DECIMAL = &H6E
Public Const VK_DIVIDE = &H6F
Public Const VK_F1 = &H70
Public Const VK_F2 = &H71
Public Const VK_F3 = &H72
Public Const VK_F4 = &H73
Public Const VK_F5 = &H74
Public Const VK_F6 = &H75
Public Const VK_F7 = &H76
Public Const VK_F8 = &H77
Public Const VK_F9 = &H78
Public Const VK_F10 = &H79
Public Const VK_F11 = &H7A
Public Const VK_F12 = &H7B
Public Const VK_F13 = &H7C
Public Const VK_F14 = &H7D
Public Const VK_F15 = &H7E
Public Const VK_F16 = &H7F
Public Const VK_F17 = &H80
Public Const VK_F18 = &H81
Public Const VK_F19 = &H82
Public Const VK_F20 = &H83
Public Const VK_F21 = &H84
Public Const VK_F22 = &H85
Public Const VK_F23 = &H86
Public Const VK_F24 = &H87
Public Const VK_END = &H23

Public glWinRet As Long

' Function : CallbackMsgs
' This functions is used as a parameter in the
' API SetWindowLong(), by AddresOf operator, so as to
' Subclass the form to get the Windows Callback msgs...
Public Function CallbackMsgs(ByVal wHwnd As Long, ByVal wmsg As Long, ByVal wp_id As Long, ByVal lp_id As Long) As Long
    If wmsg = WM_HOTKEY Then
        Call DoFunctions(wp_id)
        CallbackMsgs = 1
        Exit Function
    End If
    CallbackMsgs = CallWindowProc(glWinRet, wHwnd, wmsg, wp_id, lp_id)
End Function

' Sub : DoFunction
' Activated by the Function "CallbackMsgs()" whenever
' a hotkey is pressed.
Public Sub DoFunctions(ByVal vKeyID As Byte)
    If vKeyID = 0 Then
        Form1.Label1.Caption = "1st HotKey Pressed !"
    Else
        If vKeyID = 1 Then
            Form1.Label1.Caption = "2nd HotKey Pressed !"
        Else
            Form1.Label1.Caption = "3rd HotKey Pressed !"
        End If
    End If
End Sub
0
 
rrbeckerAuthor Commented:
Greetings ~IM,

Well I have started work on a VB.NET version of the application mentioned in this question.

I am now at the point where I need to create the same 'FOCUS' and 'FORM MOVE' fuctionality that you helped me
with in the VB6 implementation.

I will gladly post another question in VB.NET just let me know if there is any particular 'Way' that you want me to
address the post.

Thanks,

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Here ya go:

Imports System.Runtime.InteropServices

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents Button6 As System.Windows.Forms.Button
    Friend WithEvents Button7 As System.Windows.Forms.Button
    Friend WithEvents Button8 As System.Windows.Forms.Button
    Friend WithEvents Button9 As System.Windows.Forms.Button
    Friend WithEvents Button10 As System.Windows.Forms.Button
    Friend WithEvents Button11 As System.Windows.Forms.Button
    Friend WithEvents Button12 As System.Windows.Forms.Button
    Friend WithEvents Button13 As System.Windows.Forms.Button
    Friend WithEvents Button15 As System.Windows.Forms.Button
    Friend WithEvents Button16 As System.Windows.Forms.Button
    Friend WithEvents Button17 As System.Windows.Forms.Button
    Friend WithEvents Button18 As System.Windows.Forms.Button
    Friend WithEvents Button19 As System.Windows.Forms.Button
    Friend WithEvents Button20 As System.Windows.Forms.Button
    Friend WithEvents Button21 As System.Windows.Forms.Button
    Friend WithEvents Button22 As System.Windows.Forms.Button
    Friend WithEvents Button23 As System.Windows.Forms.Button
    Friend WithEvents Button24 As System.Windows.Forms.Button
    Friend WithEvents Button25 As System.Windows.Forms.Button
    Friend WithEvents Button26 As System.Windows.Forms.Button
    Friend WithEvents Button29 As System.Windows.Forms.Button
    Friend WithEvents Button30 As System.Windows.Forms.Button
    Friend WithEvents Button31 As System.Windows.Forms.Button
    Friend WithEvents Button32 As System.Windows.Forms.Button
    Friend WithEvents Button33 As System.Windows.Forms.Button
    Friend WithEvents Button34 As System.Windows.Forms.Button
    Friend WithEvents Button35 As System.Windows.Forms.Button
    Friend WithEvents Button36 As System.Windows.Forms.Button
    Friend WithEvents Button37 As System.Windows.Forms.Button
    Friend WithEvents Button38 As System.Windows.Forms.Button
    Friend WithEvents Button14 As System.Windows.Forms.Button
    Friend WithEvents Button28 As System.Windows.Forms.Button
    Friend WithEvents Button39 As System.Windows.Forms.Button
    Friend WithEvents Button40 As System.Windows.Forms.Button
    Friend WithEvents Button41 As System.Windows.Forms.Button
    Friend WithEvents Button42 As System.Windows.Forms.Button
    Friend WithEvents Button43 As System.Windows.Forms.Button
    Friend WithEvents Button44 As System.Windows.Forms.Button
    Friend WithEvents Button45 As System.Windows.Forms.Button
    Friend WithEvents Button46 As System.Windows.Forms.Button
    Friend WithEvents Button47 As System.Windows.Forms.Button
    Friend WithEvents Button48 As System.Windows.Forms.Button
    Friend WithEvents Button49 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.Button4 = New System.Windows.Forms.Button
        Me.Button5 = New System.Windows.Forms.Button
        Me.Button6 = New System.Windows.Forms.Button
        Me.Button7 = New System.Windows.Forms.Button
        Me.Button8 = New System.Windows.Forms.Button
        Me.Button9 = New System.Windows.Forms.Button
        Me.Button10 = New System.Windows.Forms.Button
        Me.Button11 = New System.Windows.Forms.Button
        Me.Button12 = New System.Windows.Forms.Button
        Me.Button13 = New System.Windows.Forms.Button
        Me.Button15 = New System.Windows.Forms.Button
        Me.Button16 = New System.Windows.Forms.Button
        Me.Button17 = New System.Windows.Forms.Button
        Me.Button18 = New System.Windows.Forms.Button
        Me.Button19 = New System.Windows.Forms.Button
        Me.Button20 = New System.Windows.Forms.Button
        Me.Button21 = New System.Windows.Forms.Button
        Me.Button22 = New System.Windows.Forms.Button
        Me.Button23 = New System.Windows.Forms.Button
        Me.Button24 = New System.Windows.Forms.Button
        Me.Button25 = New System.Windows.Forms.Button
        Me.Button26 = New System.Windows.Forms.Button
        Me.Button29 = New System.Windows.Forms.Button
        Me.Button30 = New System.Windows.Forms.Button
        Me.Button31 = New System.Windows.Forms.Button
        Me.Button32 = New System.Windows.Forms.Button
        Me.Button33 = New System.Windows.Forms.Button
        Me.Button34 = New System.Windows.Forms.Button
        Me.Button35 = New System.Windows.Forms.Button
        Me.Button36 = New System.Windows.Forms.Button
        Me.Button37 = New System.Windows.Forms.Button
        Me.Button38 = New System.Windows.Forms.Button
        Me.Button14 = New System.Windows.Forms.Button
        Me.Button28 = New System.Windows.Forms.Button
        Me.Button39 = New System.Windows.Forms.Button
        Me.Button40 = New System.Windows.Forms.Button
        Me.Button41 = New System.Windows.Forms.Button
        Me.Button42 = New System.Windows.Forms.Button
        Me.Button43 = New System.Windows.Forms.Button
        Me.Button44 = New System.Windows.Forms.Button
        Me.Button45 = New System.Windows.Forms.Button
        Me.Button46 = New System.Windows.Forms.Button
        Me.Button47 = New System.Windows.Forms.Button
        Me.Button48 = New System.Windows.Forms.Button
        Me.Button49 = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(16, 32)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(24, 24)
        Me.Button1.TabIndex = 0
        Me.Button1.Text = "Q"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(40, 32)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(24, 24)
        Me.Button2.TabIndex = 1
        Me.Button2.Text = "W"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(64, 32)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(24, 24)
        Me.Button3.TabIndex = 2
        Me.Button3.Text = "E"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(88, 32)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(24, 24)
        Me.Button4.TabIndex = 3
        Me.Button4.Text = "R"
        '
        'Button5
        '
        Me.Button5.Location = New System.Drawing.Point(112, 32)
        Me.Button5.Name = "Button5"
        Me.Button5.Size = New System.Drawing.Size(24, 24)
        Me.Button5.TabIndex = 4
        Me.Button5.Text = "T"
        '
        'Button6
        '
        Me.Button6.Location = New System.Drawing.Point(136, 32)
        Me.Button6.Name = "Button6"
        Me.Button6.Size = New System.Drawing.Size(24, 24)
        Me.Button6.TabIndex = 5
        Me.Button6.Text = "Y"
        '
        'Button7
        '
        Me.Button7.Location = New System.Drawing.Point(160, 32)
        Me.Button7.Name = "Button7"
        Me.Button7.Size = New System.Drawing.Size(24, 24)
        Me.Button7.TabIndex = 6
        Me.Button7.Text = "U"
        '
        'Button8
        '
        Me.Button8.Location = New System.Drawing.Point(184, 32)
        Me.Button8.Name = "Button8"
        Me.Button8.Size = New System.Drawing.Size(24, 24)
        Me.Button8.TabIndex = 7
        Me.Button8.Text = "I"
        '
        'Button9
        '
        Me.Button9.Location = New System.Drawing.Point(208, 32)
        Me.Button9.Name = "Button9"
        Me.Button9.Size = New System.Drawing.Size(24, 24)
        Me.Button9.TabIndex = 8
        Me.Button9.Text = "O"
        '
        'Button10
        '
        Me.Button10.Location = New System.Drawing.Point(232, 32)
        Me.Button10.Name = "Button10"
        Me.Button10.Size = New System.Drawing.Size(24, 24)
        Me.Button10.TabIndex = 9
        Me.Button10.Text = "P"
        '
        'Button11
        '
        Me.Button11.Location = New System.Drawing.Point(256, 32)
        Me.Button11.Name = "Button11"
        Me.Button11.Size = New System.Drawing.Size(24, 24)
        Me.Button11.TabIndex = 10
        Me.Button11.Text = "["
        '
        'Button12
        '
        Me.Button12.Location = New System.Drawing.Point(280, 32)
        Me.Button12.Name = "Button12"
        Me.Button12.Size = New System.Drawing.Size(24, 24)
        Me.Button12.TabIndex = 11
        Me.Button12.Text = "]"
        '
        'Button13
        '
        Me.Button13.Location = New System.Drawing.Point(304, 32)
        Me.Button13.Name = "Button13"
        Me.Button13.Size = New System.Drawing.Size(24, 24)
        Me.Button13.TabIndex = 12
        Me.Button13.Text = "\"
        '
        'Button15
        '
        Me.Button15.Location = New System.Drawing.Point(288, 56)
        Me.Button15.Name = "Button15"
        Me.Button15.Size = New System.Drawing.Size(40, 24)
        Me.Button15.TabIndex = 24
        Me.Button15.Text = "Enter"
        '
        'Button16
        '
        Me.Button16.Location = New System.Drawing.Point(264, 56)
        Me.Button16.Name = "Button16"
        Me.Button16.Size = New System.Drawing.Size(24, 24)
        Me.Button16.TabIndex = 23
        Me.Button16.Text = "'"
        '
        'Button17
        '
        Me.Button17.Location = New System.Drawing.Point(240, 56)
        Me.Button17.Name = "Button17"
        Me.Button17.Size = New System.Drawing.Size(24, 24)
        Me.Button17.TabIndex = 22
        Me.Button17.Text = ";"
        '
        'Button18
        '
        Me.Button18.Location = New System.Drawing.Point(216, 56)
        Me.Button18.Name = "Button18"
        Me.Button18.Size = New System.Drawing.Size(24, 24)
        Me.Button18.TabIndex = 21
        Me.Button18.Text = "L"
        '
        'Button19
        '
        Me.Button19.Location = New System.Drawing.Point(192, 56)
        Me.Button19.Name = "Button19"
        Me.Button19.Size = New System.Drawing.Size(24, 24)
        Me.Button19.TabIndex = 20
        Me.Button19.Text = "K"
        '
        'Button20
        '
        Me.Button20.Location = New System.Drawing.Point(168, 56)
        Me.Button20.Name = "Button20"
        Me.Button20.Size = New System.Drawing.Size(24, 24)
        Me.Button20.TabIndex = 19
        Me.Button20.Text = "J"
        '
        'Button21
        '
        Me.Button21.Location = New System.Drawing.Point(144, 56)
        Me.Button21.Name = "Button21"
        Me.Button21.Size = New System.Drawing.Size(24, 24)
        Me.Button21.TabIndex = 18
        Me.Button21.Text = "H"
        '
        'Button22
        '
        Me.Button22.Location = New System.Drawing.Point(120, 56)
        Me.Button22.Name = "Button22"
        Me.Button22.Size = New System.Drawing.Size(24, 24)
        Me.Button22.TabIndex = 17
        Me.Button22.Text = "G"
        '
        'Button23
        '
        Me.Button23.Location = New System.Drawing.Point(96, 56)
        Me.Button23.Name = "Button23"
        Me.Button23.Size = New System.Drawing.Size(24, 24)
        Me.Button23.TabIndex = 16
        Me.Button23.Text = "F"
        '
        'Button24
        '
        Me.Button24.Location = New System.Drawing.Point(72, 56)
        Me.Button24.Name = "Button24"
        Me.Button24.Size = New System.Drawing.Size(24, 24)
        Me.Button24.TabIndex = 15
        Me.Button24.Text = "D"
        '
        'Button25
        '
        Me.Button25.Location = New System.Drawing.Point(48, 56)
        Me.Button25.Name = "Button25"
        Me.Button25.Size = New System.Drawing.Size(24, 24)
        Me.Button25.TabIndex = 14
        Me.Button25.Text = "S"
        '
        'Button26
        '
        Me.Button26.Location = New System.Drawing.Point(24, 56)
        Me.Button26.Name = "Button26"
        Me.Button26.Size = New System.Drawing.Size(24, 24)
        Me.Button26.TabIndex = 13
        Me.Button26.Text = "A"
        '
        'Button29
        '
        Me.Button29.Location = New System.Drawing.Point(248, 80)
        Me.Button29.Name = "Button29"
        Me.Button29.Size = New System.Drawing.Size(24, 24)
        Me.Button29.TabIndex = 34
        Me.Button29.Text = "/"
        '
        'Button30
        '
        Me.Button30.Location = New System.Drawing.Point(224, 80)
        Me.Button30.Name = "Button30"
        Me.Button30.Size = New System.Drawing.Size(24, 24)
        Me.Button30.TabIndex = 33
        Me.Button30.Text = "."
        '
        'Button31
        '
        Me.Button31.Location = New System.Drawing.Point(200, 80)
        Me.Button31.Name = "Button31"
        Me.Button31.Size = New System.Drawing.Size(24, 24)
        Me.Button31.TabIndex = 32
        Me.Button31.Text = ","
        '
        'Button32
        '
        Me.Button32.Location = New System.Drawing.Point(176, 80)
        Me.Button32.Name = "Button32"
        Me.Button32.Size = New System.Drawing.Size(24, 24)
        Me.Button32.TabIndex = 31
        Me.Button32.Text = "M"
        '
        'Button33
        '
        Me.Button33.Location = New System.Drawing.Point(152, 80)
        Me.Button33.Name = "Button33"
        Me.Button33.Size = New System.Drawing.Size(24, 24)
        Me.Button33.TabIndex = 30
        Me.Button33.Text = "N"
        '
        'Button34
        '
        Me.Button34.Location = New System.Drawing.Point(128, 80)
        Me.Button34.Name = "Button34"
        Me.Button34.Size = New System.Drawing.Size(24, 24)
        Me.Button34.TabIndex = 29
        Me.Button34.Text = "B"
        '
        'Button35
        '
        Me.Button35.Location = New System.Drawing.Point(104, 80)
        Me.Button35.Name = "Button35"
        Me.Button35.Size = New System.Drawing.Size(24, 24)
        Me.Button35.TabIndex = 28
        Me.Button35.Text = "V"
        '
        'Button36
        '
        Me.Button36.Location = New System.Drawing.Point(80, 80)
        Me.Button36.Name = "Button36"
        Me.Button36.Size = New System.Drawing.Size(24, 24)
        Me.Button36.TabIndex = 27
        Me.Button36.Text = "C"
        '
        'Button37
        '
        Me.Button37.Location = New System.Drawing.Point(56, 80)
        Me.Button37.Name = "Button37"
        Me.Button37.Size = New System.Drawing.Size(24, 24)
        Me.Button37.TabIndex = 26
        Me.Button37.Text = "X"
        '
        'Button38
        '
        Me.Button38.Location = New System.Drawing.Point(32, 80)
        Me.Button38.Name = "Button38"
        Me.Button38.Size = New System.Drawing.Size(24, 24)
        Me.Button38.TabIndex = 25
        Me.Button38.Text = "Z"
        '
        'Button14
        '
        Me.Button14.Location = New System.Drawing.Point(64, 104)
        Me.Button14.Name = "Button14"
        Me.Button14.Size = New System.Drawing.Size(152, 24)
        Me.Button14.TabIndex = 35
        Me.Button14.Text = "Space"
        '
        'Button28
        '
        Me.Button28.Location = New System.Drawing.Point(272, 8)
        Me.Button28.Name = "Button28"
        Me.Button28.Size = New System.Drawing.Size(56, 24)
        Me.Button28.TabIndex = 47
        Me.Button28.Text = "Back"
        '
        'Button39
        '
        Me.Button39.Location = New System.Drawing.Point(248, 8)
        Me.Button39.Name = "Button39"
        Me.Button39.Size = New System.Drawing.Size(24, 24)
        Me.Button39.TabIndex = 46
        Me.Button39.Text = "="
        '
        'Button40
        '
        Me.Button40.Location = New System.Drawing.Point(224, 8)
        Me.Button40.Name = "Button40"
        Me.Button40.Size = New System.Drawing.Size(24, 24)
        Me.Button40.TabIndex = 45
        Me.Button40.Text = "-"
        '
        'Button41
        '
        Me.Button41.Location = New System.Drawing.Point(200, 8)
        Me.Button41.Name = "Button41"
        Me.Button41.Size = New System.Drawing.Size(24, 24)
        Me.Button41.TabIndex = 44
        Me.Button41.Text = "9"
        '
        'Button42
        '
        Me.Button42.Location = New System.Drawing.Point(176, 8)
        Me.Button42.Name = "Button42"
        Me.Button42.Size = New System.Drawing.Size(24, 24)
        Me.Button42.TabIndex = 43
        Me.Button42.Text = "8"
        '
        'Button43
        '
        Me.Button43.Location = New System.Drawing.Point(152, 8)
        Me.Button43.Name = "Button43"
        Me.Button43.Size = New System.Drawing.Size(24, 24)
        Me.Button43.TabIndex = 42
        Me.Button43.Text = "7"
        '
        'Button44
        '
        Me.Button44.Location = New System.Drawing.Point(128, 8)
        Me.Button44.Name = "Button44"
        Me.Button44.Size = New System.Drawing.Size(24, 24)
        Me.Button44.TabIndex = 41
        Me.Button44.Text = "6"
        '
        'Button45
        '
        Me.Button45.Location = New System.Drawing.Point(104, 8)
        Me.Button45.Name = "Button45"
        Me.Button45.Size = New System.Drawing.Size(24, 24)
        Me.Button45.TabIndex = 40
        Me.Button45.Text = "5"
        '
        'Button46
        '
        Me.Button46.Location = New System.Drawing.Point(80, 8)
        Me.Button46.Name = "Button46"
        Me.Button46.Size = New System.Drawing.Size(24, 24)
        Me.Button46.TabIndex = 39
        Me.Button46.Text = "4"
        '
        'Button47
        '
        Me.Button47.Location = New System.Drawing.Point(56, 8)
        Me.Button47.Name = "Button47"
        Me.Button47.Size = New System.Drawing.Size(24, 24)
        Me.Button47.TabIndex = 38
        Me.Button47.Text = "3"
        '
        'Button48
        '
        Me.Button48.Location = New System.Drawing.Point(32, 8)
        Me.Button48.Name = "Button48"
        Me.Button48.Size = New System.Drawing.Size(24, 24)
        Me.Button48.TabIndex = 37
        Me.Button48.Text = "2"
        '
        'Button49
        '
        Me.Button49.Location = New System.Drawing.Point(8, 8)
        Me.Button49.Name = "Button49"
        Me.Button49.Size = New System.Drawing.Size(24, 24)
        Me.Button49.TabIndex = 36
        Me.Button49.Text = "1"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(336, 134)
        Me.Controls.Add(Me.Button28)
        Me.Controls.Add(Me.Button39)
        Me.Controls.Add(Me.Button40)
        Me.Controls.Add(Me.Button41)
        Me.Controls.Add(Me.Button42)
        Me.Controls.Add(Me.Button43)
        Me.Controls.Add(Me.Button44)
        Me.Controls.Add(Me.Button45)
        Me.Controls.Add(Me.Button46)
        Me.Controls.Add(Me.Button47)
        Me.Controls.Add(Me.Button48)
        Me.Controls.Add(Me.Button49)
        Me.Controls.Add(Me.Button14)
        Me.Controls.Add(Me.Button29)
        Me.Controls.Add(Me.Button30)
        Me.Controls.Add(Me.Button31)
        Me.Controls.Add(Me.Button32)
        Me.Controls.Add(Me.Button33)
        Me.Controls.Add(Me.Button34)
        Me.Controls.Add(Me.Button35)
        Me.Controls.Add(Me.Button36)
        Me.Controls.Add(Me.Button37)
        Me.Controls.Add(Me.Button38)
        Me.Controls.Add(Me.Button15)
        Me.Controls.Add(Me.Button16)
        Me.Controls.Add(Me.Button17)
        Me.Controls.Add(Me.Button18)
        Me.Controls.Add(Me.Button19)
        Me.Controls.Add(Me.Button20)
        Me.Controls.Add(Me.Button21)
        Me.Controls.Add(Me.Button22)
        Me.Controls.Add(Me.Button23)
        Me.Controls.Add(Me.Button24)
        Me.Controls.Add(Me.Button25)
        Me.Controls.Add(Me.Button26)
        Me.Controls.Add(Me.Button13)
        Me.Controls.Add(Me.Button12)
        Me.Controls.Add(Me.Button11)
        Me.Controls.Add(Me.Button10)
        Me.Controls.Add(Me.Button9)
        Me.Controls.Add(Me.Button8)
        Me.Controls.Add(Me.Button7)
        Me.Controls.Add(Me.Button6)
        Me.Controls.Add(Me.Button5)
        Me.Controls.Add(Me.Button4)
        Me.Controls.Add(Me.Button3)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.MaximizeBox = False
        Me.Name = "Form1"
        Me.Text = "OnScreen KeyBoard"
        Me.TopMost = True
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Const WS_EX_NOACTIVATE = &H8000000
    Private Const WM_MOVING = &H216

    Private Structure RECT
        Public Left As Integer
        Public Top As Integer
        Public Right As Integer
        Public Bottom As Integer
    End Structure

    Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or WS_EX_NOACTIVATE
            Return cp
        End Get
    End Property

    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        If m.Msg = WM_MOVING Then
            Dim r As RECT
            r = DirectCast(Marshal.PtrToStructure(m.LParam, GetType(RECT)), RECT)
            Me.Location = New Point(r.Left, r.Top)
        End If

        MyBase.WndProc(m)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim c As Control
        Dim b As Button
        For Each c In Me.Controls
            If TypeOf c Is Button Then
                b = CType(c, Button)
                AddHandler b.Click, AddressOf Me.Button_Click
            End If
        Next
    End Sub

    Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim t As String = sender.text
        If t = "Back" Then
            SendKeys.Send("{BACKSPACE}")
        ElseIf t = "Enter" Then
            SendKeys.Send("{ENTER}")
        ElseIf t = "Space" Then
            SendKeys.Send(" ")
        Else
            SendKeys.Send(t)
        End If
    End Sub

End Class
   
0
 
rrbeckerAuthor Commented:
Hi,

Thanks ~IM, got what I needed. I'm still willing to create a question in .NET and award you some points, just
let me know.

Have a great Holiday....

rrbecker
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
No need...

Don't eat too much Turkey  =)

Mike
0
 
rrbeckerAuthor Commented:
Hi Mike,

Thanks again..... and no promises

Rick
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 21
  • 13
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now