Results 1 to 8 of 8

Thread: arrays, variables and sendkeys

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Exclamation arrays, variables and sendkeys

    Hello

    i would like to try and make my own little autokey program with a little help, sure thiers plenty on the web..but i just want to make one realy, only difference is..instead of looping forever, i want to do it a specific amount of times, MAX

    i need help with:

    the interval timer and, (some macros i seen dont even select the process window to send the WORDS too but that would be nice)..but if i dont need it then i guess thats ok too
    any part ppl can help with will be great.

    at the moment i just put a timer control, cmdbutton and texbox on a form.

    Code:
    dim max as integer
    dim words as string
    
    public sub command1_click()
    for a = 0 to max
    
    'how to send WORDS to a specific window and perhaps with a time delay.
    
    next a
    end sub

  2. #2
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: arrays, variables and sendkeys

    I highly suggest checking out AutoIt if you just want an easy and powerful sulution.. Its a POWERFUL macro language that eliminates all the API overhead stuff needed with VB.. Actually, there is an activex dll that allows you to easy use autoit functions in VB lickity split.. Macros compile to itty bitty exe's too..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: arrays, variables and sendkeys

    ive almost finished it now, aint that great cud still need help, ill post in a while

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: arrays, variables and sendkeys

    Code:
    Private Sub SendKeystrokes_Click()
          AppActivate txtprogram.Text
          For a = 0 To maxusers
          SendKeys phrase
          Next a
    End Sub
    this sends the keys to maxusers using an array, however i need help to implement a interval so thiers a delay between sending the next user the phrase.

  5. #5
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: arrays, variables and sendkeys

    There are a few ways.. Sleep(), or a While function like this:
    nowtime = Timer
    While Timer < nowtime + 1
    DoEvents
    Wend

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: arrays, variables and sendkeys

    a gr8 ill come back to that now, i got a new problem

    AppActivate txtprogram.Text

    that line works great, pops my internet explorer window up..but some websites have FRAMES, and my program dont work because..the mouse hasnt selected the input box. setfocus if u know what i mean
    Last edited by troubleshoot; Mar 8th, 2007 at 06:05 PM.

  7. #7
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: arrays, variables and sendkeys

    You're going to need to deal with API's and HWnds etc.. Great learning experience no doubt, but if you just want something working in 5 minutes, check out that AutoIt..

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    69

    Re: arrays, variables and sendkeys

    ill get autoit again now, i got the wrong version for my os, i think ill face the same proble tho

    i also found this, but doesnt seem to help
    http://www.pscode.com/vb/scripts/Sho...d=113&lngWId=1

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