Jump to content

Recommended Posts

Hi Everyone,

Is it possible to fetch the Control Type of the spin control button. In my scenario I need to double click on a listview item then the Spin control appears and I need to validate whether that control(Spin Control) is visible or not.

I am not able to use Au3Info tool on the Spin control. The spin control button disappears as soon as I click my mouse outside the application.

Please share if you have any ideas on this

Link to post
Share on other sites

Something like this:

#include <GUIConstants.au3>
#include <WIndowsConstants.au3>
#include <GuiListView.au3>
; Global constants for mousclick detection & ListView Events

GUIRegisterMsg($WM_NOTIFY, "_WM_Notify_Events")
GUICreate("listview items", 220, 250, 100, 200, -1)
$listview = GUICtrlCreateListView("col1|col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_TRACKSELECT, $LVS_EX_TRACKSELECT)
$item1 = GUICtrlCreateListViewItem("Data|Data|Data", $listview)
$item2 = GUICtrlCreateListViewItem("Data|Data|Data", $listview)
$item3 = GUICtrlCreateListViewItem("Data|Data|Data", $listview)
$label = GUICtrlCreateInput("Single,double or right Click any row", 10, 210, 180, 20)
GUISetState()
Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
;----------------------------------------------------------------------------------------------
Func _WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    ;----------------------------------------------------------------------------------------------
    #forceref $hWndGUI, $MsgID, $wParam
    Local $tagNMHDR, $event, $hwndFrom, $code
    $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code)
    If @error Then Return
    $event = DllStructGetData($tagNMHDR, 3)
    If $wParam = $listview Then
        ;ConsoleWrite($Event&@crlf)
        If $event = $NM_DBLCLK Then
            $updown = GuiCtrlCreateUpDown($label)
            GUICtrlSetData($label, "Double Click detected")
            If $updown = 0 then
            msgbox(16, "", "No spin control created.")
            else
            msgbox(64, "", "Success.")
            EndIf
            EndIf
    EndIf
    $tagNMHDR = 0
    $event = 0
    $lParam = 0
EndFunc   ;==>_WM_Notify_Events

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to post
Share on other sites

Start the Autoit window info tool, click options and uncheck freeze. Start your application and hover the mouse over your spin control and the info tool should update with the control details under the mouse.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to post
Share on other sites

Use AutoIt window info tool as suggested by kaotkbliss. If you wish to get info of this control from your script, I suggest reading controlgettext from help-file.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...