Results 1 to 7 of 7

Thread: Stopping The Flood

  1. #1

    Thread Starter
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Let me see the code you're using.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  2. #2
    AutoBot
    Guest
    Private Sub mnuSend_Click()

    Dim thunderrtmdiform As Long
    Dim mdiclient As Long
    Dim thunderrtformdc As Long
    Dim thunderrttextbox As Long

    Do

    thunderrtmdiform = FindWindow("thunderrt6mdiform", vbNullString)
    mdiclient = FindWindowEx(thunderrtmdiform, 0&, "mdiclient", vbNullString)
    thunderrtformdc = FindWindowEx(mdiclient, 0&, "thunderrt6formdc", vbNullString)
    thunderrttextbox = FindWindowEx(thunderrtformdc, 0&, "thunderrt6textbox", vbNullString)
    Call SendMessageByString(thunderrttextbox, WM_SETTEXT, 0&, Text.Text

    thunderrtmdiform = FindWindow("thunderrt6mdiform", vbNullString)
    mdiclient = FindWindowEx(thunderrtmdiform, 0&, "mdiclient", vbNullString)
    thunderrtformdc = FindWindowEx(mdiclient, 0&, "thunderrt6formdc", vbNullString)
    thunderrttextbox = FindWindowEx(thunderrtformdc, 0&, "thunderrt6textbox", vbNullString)
    Call SendMessageLong(thunderrttextbox, WM_CHAR, 13, 0&)

    Loop Until 'what would go here

    If thunderrttextbox = 0 Then

    MsgBox "You Must Have Window Open First"
    Exit Sub

    End If

    End Sub

  3. #3

    Thread Starter
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Well, using your above example of a 100 time limit:

    Private Sub mnuSend_Click()

    Dim thunderrtmdiform As Long
    Dim mdiclient As Long
    Dim thunderrtformdc As Long
    Dim thunderrttextbox As Long
    Dim I As integer

    For I = 1 to 100

    thunderrtmdiform = FindWindow("thunderrt6mdiform", vbNullString)
    mdiclient = FindWindowEx(thunderrtmdiform, 0&, "mdiclient", vbNullString)
    thunderrtformdc = FindWindowEx(mdiclient, 0&, "thunderrt6formdc", vbNullString)
    thunderrttextbox = FindWindowEx(thunderrtformdc, 0&, "thunderrt6textbox", vbNullString)
    Call SendMessageByString(thunderrttextbox, WM_SETTEXT, 0&, Text.Text

    thunderrtmdiform = FindWindow("thunderrt6mdiform", vbNullString)
    mdiclient = FindWindowEx(thunderrtmdiform, 0&, "mdiclient", vbNullString)
    thunderrtformdc = FindWindowEx(mdiclient, 0&, "thunderrt6formdc", vbNullString)
    thunderrttextbox = FindWindowEx(thunderrtformdc, 0&, "thunderrt6textbox", vbNullString)
    Call SendMessageLong(thunderrttextbox, WM_CHAR, 13, 0&)

    Next I

    If thunderrttextbox = 0 Then

    MsgBox "You Must Have Window Open First"
    Exit Sub

    End If

    End Sub
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  4. #4
    AutoBot
    Guest
    That worked great, I just replaced the For I = 1 To 100 with

    For I = 1 To Text1.Text

    One other question, how would I keep the user from inputting anything other than numbers. I know it would be a message box but how would I go about it. And thank you for your help.

  5. #5

    Thread Starter
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If Val(Chr(KeyAscii)) = 0 And KeyAscii <> Asc("0") Then KeyAscii = 0
    End Sub
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  6. #6
    AutoBot
    Guest
    So I was wrong but you solved my entire problem and I thank you very much it's good to see someone willing to help someone new to vb.

  7. #7

    Thread Starter
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Heck, that's what this site is for!
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

Posting Permissions

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



Click Here to Expand Forum to Full Width