[VB] need help! program runs well on win32. . but not on win64. . .

Discussion in 'Mixed Languages' started by andifined, Apr 29, 2012.

  1. andifined

    andifined MDL Novice

    Apr 29, 2012
    5
    0
    0
    I'm still a newbie. anyway, i make le hotkey to quickly cast skills in WC3.. It's run pretty well on win32, but went crazy on win64. . . ==||
    what should i do. Any tips?
    here's my code. . .

    code:


    Public Class Form1

    Private Declare Function key Lib "User32" Alias "GetAsyncKeyState" (ByVal Key As Keys) As Keys

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    '=========================================
    Dim tabKey As Boolean = key(Keys.Tab)
    Dim tKey As Boolean = key(Keys.T)

    If tabKey And tKey = True Then
    SendKeys.Send("(eeer)")
    End If

    End Sub

    End Class

     
  2. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    808
    10
    Why not use RegisterHotKey api?:)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,488
    1,328
    60
    You'll probably need to change your target CPU.

    In the top toolbar in visual studio, if you're using visual studio you should see a box that displays x86, click down on the box and select 'Configuration manager'

    Next step - A dialog box should pop up and at the top click the dropdown list 'Active platform solution' and select '<New...>', once you're in there select platform 'Any CPU' and copy settings from 'x86'. Done.

    This won't work if you're using express edition, please let me know if you encounter problems.

    This may help also
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. stevemk14ebr

    stevemk14ebr MDL Senior Member

    Jun 23, 2010
    267
    48
    10
    he doesn't use that as getasynckeystate still works when the form is not in focus
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. andifined

    andifined MDL Novice

    Apr 29, 2012
    5
    0
    0
    but I already set it to Any CPU. . . should i set it to x64?
     
  6. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,488
    1,328
    60
    Hmm, what's your OS architecture?

    x86 or x64?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. andifined

    andifined MDL Novice

    Apr 29, 2012
    5
    0
    0
    mine is x86. . .
     
  8. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,488
    1,328
    60
    Do you have a 64-Bit WinOS to test it on?

    If not send me the compiled version, not code and I'll test it for you?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. andifined

    andifined MDL Novice

    Apr 29, 2012
    5
    0
    0

    nope... hmm. . PM me your e-mail then... xD
     
  10. andifined

    andifined MDL Novice

    Apr 29, 2012
    5
    0
    0

    I've sent it. . . tq btw. . . XD
     
  11. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,488
    1,328
    60
    #11 QuantumBug, Apr 29, 2012
    Last edited: Apr 29, 2012
    No it's not working correctly, it keep sending the same keystring over and over again...

    Whenever I click on an empty notepad document it repeats this string each click

    "rqwereeereewreeqrqqqrqqwrqqerwwerwwqrwwwrqwer"

    And I forgot to add, when you're posting code don't forget to wrap code tags around it :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...