Sign in to follow this  
Followers 0
CeMaL

it is not underlined

3 posts in this topic

Fro example I will write

send("!c") for start winzip Classic selcetion but I can't see which key is underlined.I know it is C for winzip because I am learning it from autoit tutorials but how can I see it in the other programmes setup?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If you get the controls text, the "Underlined" character is preceded by an ampersand.

Edit for a "simple" example:

Global $h_control = ControlGetHandle("Window Name or Handle", "", "ClassNameNN or Control ID ...See help")
Global $s_control_text = WinGetText($h_control)
Global $s_altkey = StringRegExpReplace($s_control_text, "(.*?&)(.)(.*?\z)", "2")
If @extended Then
    MsgBox(64, "Info", "Alt Key = " & $s_altkey)
Else
    MsgBox(16, "Error", "No Alt Key")
EndIf

Edit 2:

For the record, this is not how I would approach dealing with controls. I'd deal with the the Control* functions.

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

CeMaL,

If I understand you correctly, you want to know which keys are "accelerated" in various applications. "Accelerated" keys are the ones you can use when that letter is underlined on various contols.

The only way to find out is to press the Alt key with the application active and see! ;)

here is a small example:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)
$hButton = GUICtrlCreateButton("&Exit", 10, 10, 80, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $hButton
            Exit
    EndSwitch
WEnd

If you press the Alt key you can see that the "E" in "Exit" is underlined - so sending Alt-e will action that control.

Does that help - or have I missed your point completely? :blink:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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