Results 1 to 4 of 4

Thread: Need help [Almost Resolved]

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    14

    Wink Need help [Almost Resolved]

    Hi, im making a automated recruiter for Dark Throne for who know the game, 350 clicks are to much , i'm done with greater part of the program
    this consist the mouse movement, number of repeats and a delay function if their server is to crowed and have lag

    But my problem is -I need hotkeys for : _A pause function
    _A fast quit function
    Why those hotkeys? well when the programs run you have you mosue moving so you can do anything with the pause function you can

    I searched the API forum and found some topics about it but im newbie on API, so is their anyone that cna help me?
    You can find the project on : Here
    or dload here below

    If you want to test my project you will need to ahve an acconut on dark throne and
    use This frameset
    you will need a screen size of 800 on 600 to ... srry for that

    and browes with that frameset to the recruiter
    Attached Files Attached Files
    Last edited by darkbee; Jul 10th, 2005 at 03:38 AM.
    Latest project:
    --------------

    .

  2. #2
    Hyperactive Member half flung pie's Avatar
    Join Date
    Jun 2005
    Location
    South Carolina, USA
    Posts
    317

    Re: Need help

    So you want to know how to make global hotkeys? is that what you're asking?

    Base 2
    Fcnncu"Nqxgu"Lguug##

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    14

    Re: Need help

    yep so that my program reponse on it
    Latest project:
    --------------

    .

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Need help

    To create a hotkey you can use the RegisterHotKey API (look here : http://www.vbforums.com/showthread.php?t=273458 ). To have multiple hotkeys, you need to check the wParam of the message and then depending on that execute the code you want. Here I changed that example a bit and instead of minimizing the form when you press Ctrl-F, you register another hotkey (Ctrl-E) and depending on what you press you change the caption of the form

    VB Code:
    1. Private Const MOD_ALT = &H1
    2. Private Const MOD_CONTROL = &H2
    3. Private Const MOD_SHIFT = &H4
    4. Private Const PM_REMOVE = &H1
    5. Private Const WM_HOTKEY = &H312
    6. Private Type POINTAPI
    7.     x As Long
    8.     y As Long
    9. End Type
    10. Private Type Msg
    11.     hWnd As Long
    12.     Message As Long
    13.     wParam As Long
    14.     lParam As Long
    15.     time As Long
    16.     pt As POINTAPI
    17. End Type
    18. Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
    19. Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
    20. Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
    21. Private Declare Function WaitMessage Lib "user32" () As Long
    22. Private bCancel As Boolean
    23. Private Sub ProcessMessages()
    24.     Dim Message As Msg
    25.     'loop until bCancel is set to True
    26.     Do While Not bCancel
    27.         'wait for a message
    28.         WaitMessage
    29.         'check if it's a HOTKEY-message
    30.         If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
    31.             If Message.wParam = &HBFFF& Then
    32.                 Me.Caption = "Ctrl+F"
    33.             ElseIf Message.wParam = &HBFFE& Then
    34.                 Me.Caption = "Ctrl+E"
    35.             End If
    36.         End If
    37.         'let the operating system process other events
    38.         DoEvents
    39.     Loop
    40. End Sub
    41. Private Sub Form_Load()
    42.     'KPD-Team 2000
    43.     'URL: [url]http://www.allapi.net/[/url]
    44.     'E-Mail: [email][email protected][/email]
    45.     Dim ret As Long
    46.     bCancel = False
    47.     'register the Ctrl-F hotkey
    48.     ret = RegisterHotKey(Me.hWnd, &HBFFF&, MOD_CONTROL, vbKeyF)
    49.     'register the Ctrl-E hotkey
    50.     ret = RegisterHotKey(Me.hWnd, &HBFFE&, MOD_CONTROL, vbKeyE)
    51.     'show some information
    52.     Me.AutoRedraw = True
    53.     Me.Print "Press CTRL-F or CTRL-E to change the caption"
    54.     'show the form and
    55.     Show
    56.     'process the Hotkey messages
    57.     ProcessMessages
    58. End Sub
    59. Private Sub Form_Unload(Cancel As Integer)
    60.     bCancel = True
    61.     'unregister hotkeys
    62.     Call UnregisterHotKey(Me.hWnd, &HBFFF&)
    63.     Call UnregisterHotKey(Me.hWnd, &HBFFE&)
    64. End Sub


    Has someone helped you? Then you can Rate their helpful post.

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