Sign in to follow this  
Followers 0
IvanHristovYanev

How can I insert "numpad 5" but without numpad ON that means "clear KEY"

12 posts in this topic

How can I insert "numpad 5" but without numpad ON that means "clear KEY"

I need to tell a program that i pressed Clear KEY (numpad 5 , but with numpad off) after that i press enter ?

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

Maybe helps.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

no i want a program to press the clear key ... not me (the user)!

Share this post


Link to post
Share on other sites

how to send ("0C") - clear key to a program ?

Share this post


Link to post
Share on other sites

What are you trying to clear? Maybe you could explain to us what you are trying to do or post what you have already done?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Could always roll your own, maybe something like:

Global $gs_AppWindowTitle = "MyApplicationWindowTitle"
Global $gh_Hwnd = WinGetHandle($gs_AppWindowTitle)
Global $gf_PostMessage = _PostKeyDownMessage($gh_Hwnd, 0x0C)

MsgBox(64 + 262144, "Info", "Posted KeyDown 0C = " & ($gf_PostMessage = 1))

Func _PostKeyDownMessage($h_wnd, $i_key)
    ; wm_keydown = 0x0100

    If Not StringIsDigit($i_key) Then
        If Not StringRegExp($i_key, '^0x|X') Then Return SetError(-1, 0, 0)
        $i_key = Number($i_key)
    EndIf

    Local $a_pm = DllCall('user32.dll', 'int', 'PostMessage', _
        'hwnd', $h_wnd, 'uint', 0x0100, 'wparam', $i_key, 'lparam', 0)
    If @error Then Return SetError(@error, @extended, False)

    Return SetError(($a_pm[0] = 0), 0, ($a_pm[0] > 0))
EndFunc

Edit:

Had 0xC0 and not 0x0C ... oops, sorry :( .

I was testing other key codes: http://msdn.microsoft.com/en-us/library/dd375731%28v=vs.85%29.aspx and lost track of the original intent lol.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

ok I will explain.i have a program that ask me to press numpad5(but with numpad off) and then to press enter.

Share this post


Link to post
Share on other sites

HERE IS WHAT I'm DOING

WinActivate("Calypso - Избор на маса")

WinWaitActive("Calypso - Избор на маса")

send("9999")

Send('{enter}')

WinWaitActive("Calypso")

send('9 {enter}')

send("{f10}")

WinWaitActive('Приключване на сметка')

send("{numlock on}")

send("{numpadadd}")

send("{numpad2}")

;here i need numpad 5 but with numpad turned off

sleep(250)

send("{numpad5}")

Share this post


Link to post
Share on other sites

Since you have numlock on at that point, have you tried this?

Send("+{numpad5}")

If that doesn't work, have you tried turning off numlock before sending the numpad5 keystroke?

Share this post


Link to post
Share on other sites

tried that does not work too .... the two ideas dont work ...the first it sends "5" and the second sends numpad5.

Share this post


Link to post
Share on other sites

maybe if someone knows the ascii code of that button it will work

Share this post


Link to post
Share on other sites

I've provided the answer.

1 person likes this

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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