Results 1 to 8 of 8
  1. #1
    WTX-HACK's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0

    If (GetAsyncKeyState && Label Forecolor)

    Hi EveryBody ;

    For Visual Basic ;

    If GetAsyncKeyState (Keys.Down) And Label1.Forecolor = Color.Green Then

    Label1.ForeColor = Color.Red
    Label2.ForeColor = Color.Green

    Elseif GetAsyncKeyState (Keys.Down) And Label2.Forecolor = Color.Green Then

    Label2.ForeColor = Color.Red
    Label3.ForeColor = Color.Green

    End If


    For C++ ;

    if(GetAsyncKeyState(VK_DOWN) && Label1->ForeColor = System:rawing::Color::Green
    {
    Label1.Forecolor -> ...
    Label2.Forecolor -> ....
    }




    But , && ; Operand SHORT && System:rawing::Color Issiues

    How Can I Do It ?

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    You can't implicitly convert a short to a boolean... (well, in C++ you can).

    If (GetAsyncKeyState(Keys.Down) And &H1) = &H1 AndAlso Label1.Forecolor = Color.Green Then

    if((GetAsyncKeyState(VK_DOWN) & 1) == 1 && Label1->ForeColor == System:rawing::Color::Green)
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by master131 View Post
    You can't implicitly convert a short to a boolean... (well, in C++ you can).

    If (GetAsyncKeyState(Keys.Down) And &H1) = &H1 AndAlso Label1.Forecolor = Color.Green Then

    if((GetAsyncKeyState(VK_DOWN) & 1) == 1 && Label1->ForeColor == System:rawing::Color::Green)
    You should really be testing against the most significant bit, not the least.

    i.e

    Code:
    If (GetAsyncKeyState(Keys.Down) And &H8000) <> 0 AndAlso Label1.Forecolor = Color.Green Then
    
    if((GetAsyncKeyState(VK_DOWN) & 0x8000) && Label1->ForeColor == System::Drawing::Color::Green)
    From MSDN:
    Quote Originally Posted by msdn
    If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Remarks.

    Remarks:
    Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive multitasking nature of Windows, another application can call GetAsyncKeyState and receive the "recently pressed" bit instead of your application. The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications (which are non-preemptive) and should not be relied upon.
    So yeah LSB is less reliable and is really only there for backwards compatibility, the MSB check is more accurate.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. #4
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by master131 View Post
    You can't implicitly convert a short to a boolean... (well, in C++ you can).
    You can change the P/Invoke to a boolean.. always worked out for me
    C#
    Code:
    [DllImport("user32.dll")]
    static extern bool GetAsyncKeyState(System.Windows.Forms.Keys vKey);
    
    VB
    Code:
    <DllImport("user32.dll")> _
    Public Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Boolean
    End Function


    And @Jason, correct if I'm wrong but doing an AND with 0x8000 will actually check if the key is down at the current moment. 0x1 checks if it was pressed since the last call to GetAsyncKeyState. Usually, the last option is better for loops cause the user might have pressed the key to, let's say, change the select option on a menu, when you're drawing the menu, so when you actually call GetAsyncKeyState the key is not down anymore, but it was down a few milliseconds ago.
    Last edited by MarkHC; 01-17-2013 at 06:00 PM.


    CoD Minion from 09/19/2012 to 01/10/2013

  5. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by -InSaNe- View Post
    You can change the P/Invoke to a boolean.. always worked out for me
    C#
    Code:
    [DllImport("user32.dll")]
    static extern bool GetAsyncKeyState(System.Windows.Forms.Keys vKey);
    
    VB
    Code:
    <DllImport("user32.dll")> _
    Public Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Boolean
    End Function


    And @Jason, correct if I'm wrong but doing an AND with 0x8000 will actually check if the key is down at the current moment. 0x1 checks if it was pressed since the last call to GetAsyncKeyState. Usually, the last option is better for loops cause the user might have pressed the key to, let's say, change the select option on a menu, when you're drawing the menu, so when you actually call GetAsyncKeyState the key is not down anymore, but it was down a few milliseconds ago.
    Did you even read the MSDN reference mate?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. The Following User Says Thank You to Jason For This Useful Post:

    [MPGH]master131 (01-18-2013)

  7. #6
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Jason View Post


    Did you even read the MSDN reference mate?
    that's why I said correct if I'm wrong


    CoD Minion from 09/19/2012 to 01/10/2013

  8. #7
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by -InSaNe- View Post

    that's why I said correct if I'm wrong
    If you only check the lower bit, another application may call GetAsyncKeyState before you and unset the lower bit. For example, if you have 2 concurrent applications that are both polling GetAsyncKeyState for key presses, potentially half of the user's keypresses will go undetected by either one application or the other as the other app may have "stolen" the bit. AFAIK, even if the applications aren't checking the same key, the lower bit will still be unset regardless.

    You *could* check both the low bit and high bit if you want, though.
    Code:
    if (GetAsyncKeyState(VK_INSERT) & 0x8001)
    {
        // either the key is down now, or the user pressed it since the last call to GetAsyncKeyState.
    }

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  9. The Following User Says Thank You to Jason For This Useful Post:

    MarkHC (01-18-2013)

  10. #8
    WTX-HACK's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    Not Working Two Methods

Similar Threads

  1. [Help Request] Lv 20 Karok get Amp?
    By roylytammy in forum Vindictus Help
    Replies: 5
    Last Post: 06-25-2011, 02:33 PM
  2. free amp (almost)
    By goalie6263 in forum General
    Replies: 2
    Last Post: 04-19-2011, 07:24 PM
  3. [Info] Clan{AMp}
    By n1kko in forum CrossFire Clan Recruitment & Advertising
    Replies: 2
    Last Post: 11-25-2009, 05:23 PM
  4. Replies: 10
    Last Post: 07-21-2009, 10:48 PM
  5. AMP Energy Drink Coupon - Free 4 PK of AMP
    By I Am Cornholio in forum General
    Replies: 6
    Last Post: 07-13-2009, 09:00 PM