Sign in to follow this  
Followers 0
Tam0r

au3 Lib Listbox and doubleclick

3 posts in this topic

it is possible on one doubleclicks to react with a Listbox ?

Share this post


Link to post
Share on other sites



sry

#include <A3LListbox.au3>

Global $hGUI, $hList, $iI

; Create GUI

$hGUI = GUICreate("List Box", 400, 296)

$hList = _Listbox_Create($hGUI, 2, 2, 396, 294)

GUISetState()

; Capture messages

GUIRegisterMsg($WM_COMMAND, "_Listbox_WM_COMMAND")

; Add strings

_ListBox_BeginUpdate($hList)

for $iI = 1 to 9

$sText = StringFormat("%03d : Random string", Random(1, 100, 1))

_Listbox_AddString($hList, $sText)

next

_ListBox_EndUpdate($hList)

; Click the fourth item in the list

_Listbox_ClickItem($hList, 3)

; Loop until user exits

do

until GUIGetMsg() = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Try this, I got it from Alex Media Player by alexmadman.

$List1 = GUICtrlCreateList("", 248, 24, 241, 336,$LBS_STANDARD)
GUICtrlSetBkColor($List1 , 0x111199)
#include"dclick.au3"

and dclick.au3 is:

Global Const $DebugIt = 1
Global Const $WM_COMMAND = 0x0111
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $nID = BitAND($wParam, 0xFFFF)
    Local $hCtrl = $lParam
    Local Const $LBN_DBLCLK = 2;

    If $nID=$list1 Then
        If $nNotifyCode=$LBN_DBLCLK Then dclick() 
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc;==>MY_WM_COMMAND

It may work with a Listbox the same as a List. I could'nt find the include A3LListbox.au3 to try it out.

Edited by cyanidemonkey

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

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