Sign in to follow this  
Followers 0
tomashen

how to know hex or dec or oct value?

4 posts in this topic

ok i found something.I hope im not braking any rules now :|

but how do i know what value to put for other keys

_SendKeys($HWnD , "{0}")

Func _SendKeys($hWnd, $keys)
    If $hWnd <= 0 Or StringLen($keys) = 0 Then
        SetError(-1)
        Return False
    EndIf
    $keys = StringUpper($keys)
    $keys = StringReplace($keys, "`", Chr($VK_OEM_3))
    $keys = StringReplace($keys, "~", Chr($VK_OEM_3))
    $keys = StringReplace($keys, "-", Chr($VK_OEM_MINUS))
    $keys = StringReplace($keys, "=", Chr($VK_OEM_PLUS))
    $keys = StringReplace($keys, "{ENTER}", Chr(0xD))
    $keys = StringReplace($keys, "{TAB}", Chr(0x9))
    $keys = StringReplace($keys, "{ESC}", Chr($VK_ESC))
    $keys = StringReplace($keys, "{F5}", Chr($VK_F5))
    $keys = StringReplace($keys, "{F12}", Chr($VK_F12))
    $keys = StringReplace($keys, "{SHIFT}", "+")
    $keys = StringReplace($keys, ".", Chr($VK_Period))
    $keys = StringReplace($keys, ";", Chr($VK_SEMICOLON))
    $keys = StringReplace($keys, "{0}", Chr(0x48)) ; i put this in myself but doesnt work :/ this dec value
    ;$keys = StringReplace($keys, ":", chr($VK_SEMICOLON))
    Local $i, $ret
    Local $shiftdown = False
    For $i = 1 To StringLen($keys)
        If StringMid($keys, $i, 1) = "+" Then
            DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x100, "int", 0x10, "long", 0x002A0001)
            DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x100, "int", 0x10, "long", 0x402A0001)
            $shiftdown = True
            Sleep(1)
            ContinueLoop
        Else
            $ret = DllCall("user32.dll", "int", "MapVirtualKey", "int", Asc(StringMid($keys, $i, 1)), "int", 0)
            If IsArray($ret) Then
                DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x100, "int", Asc(StringMid($keys, $i, 1)), "long", _MakeLong(1, $ret[0]))
                Sleep(1)
                DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x101, "int", Asc(StringMid($keys, $i, 1)), "long", _MakeLong(1, $ret[0]) + 0xC0000000)
            EndIf
        EndIf
        If $shiftdown Then
            Sleep(1)
            DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x101, "int", 0x10, "long", 0xC02A0001)
            $shiftdown = False
        EndIf
    Next
    Return True
EndFunc

Proud of AutoIt Proud of MySelf :)

Share this post


Link to post
Share on other sites



ok i found something.I hope im not braking any rules now :|

but how do i know what value to put for other keys

So you spend a whole 30 minutes to find this example and research how this is working and what to put in for Hex codes...right?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

i tryed all codes

hex dec and oct non work

when i put _SendKeys($HWnD , "{0}")

please dont be so hard on me lol i barely know this dll stuf i think you should be supportive :/


Proud of AutoIt Proud of MySelf :)

Share this post


Link to post
Share on other sites

please dont be so hard on me lol i barely know this dll stuf i think you should be supportive :/

I am trying to make something clear to you but you seem not to be capable to get the message.

I am going to give you 3 days to do some actual work yourself. during that period you will not be able to post.

Only come back when you demonstrate some effort and actually comprehend the subject.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0