Jump to content

DLL calls in 64 bit? (resolved)


Recommended Posts

edit: resolved in a much easier way. I used "_WinAPI_GetKeyState" as a kind user suggested on this topic. It will immediately check the status of scroll, num, and caps lock. To revert the functions (so off instead of on) simply put "if not" in front of it.

 

:old post

edited post from my original question which was about using scroll lock status. I ended up using this which worked for my needs.

                     $scrolllock = DllCall("user32.dll", "long", "GetKeyState", "long", 0x91)
                        If NOT @error Then
                           If $scrolllock[0] = 0 Then
                                     ElseIf $scrolllock[0] = 1 Then

However, this code doesn't seem to work when compiled in 64 bit, only 32.

Is there a way to use DLLs like this in 64 bit or no? The DLL called here exists in 64 bit, but its under the same name so I'm not sure if there's a way to call it instead.

If no, is there another way I can remake this code? I like the lock keys because you get a light as an indicator :)

Edited by autoside
Link to comment
Share on other sites

Link to comment
Share on other sites

3 hours ago, Nine said:

Yes it is possible to do it.  But I am not sure it is the right way to go.  Can you please explain what kind of application you are trying to automate this way ?

Trying to create a custom mouse tool because the official software for it isn't very good. Lets me rebind my mouse keys and some other simple things.

I particularly like the lock keys just because they give lights as indicators.

Edited by autoside
Link to comment
Share on other sites

Thank you! I was familiar with the sync version of that (where you hold a key down) but not that one (I'm still new). I didn't expect it to so easily check for the locks being on or off.

Works perfectly! Appreciate it!

Edited by autoside
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...