Jump to content
Sign in to follow this  
jcpetu

ListView Row number

Recommended Posts

Hi people,

I'm trying to implement ListView row number visualization in another ListView, but so far I'm stuck. Here the code, if someone could help I'll appreciate it.

 

#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <GuiScrollBars.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>

Opt("GUIOnEventMode", 1)

Global $MainGui, $MsgOk, $MainGuiRefresh, $MainGuiLabelInfo

Global $MainGuiW = @DesktopWidth - 10, $MainGuiH = @DesktopHeight - 90

_GDIPlus_Startup()
Global $Notebook = _GDIPlus_BitmapCreateFromMemory(ScanNew32x32(), True) ;GDI bitmap
Global $Computer = _GDIPlus_BitmapCreateFromMemory(Computer32x32(), True) ;GDI bitmap
_GDIPlus_Shutdown()
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$MainGui = GUICreate("Test Sort", 800, 500, 10, 10, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPSIBLINGS)) ;
GUISetOnEvent($GUI_EVENT_CLOSE, "EventsCtrl")

$MMenuLVAD = GUICtrlCreateListView("", 60, 82, 661, 321, -1, BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
$hLVMMenu = GUICtrlGetHandle($MMenuLVAD);
GUICtrlSetOnEvent($MMenuLVAD, "_Setsort")
_GUICtrlListView_RegisterSortCallBack($MMenuLVAD)


$MMenuLVidx = GUICtrlCreateListView("#", 4, 82, 55, 321,  BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
_GUICtrlListView_SetExtendedListViewStyle(-1,BitOR($LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
$hLVidx = GUICtrlGetHandle($MMenuLVidx);
;_GUIScrollBars_ShowScrollBar($hLVidx, $SB_BOTH, False) ;not working !!!
;;------------------------------------------------------------------------------------------------------------------------------------------------------------------------

;Add columns
_GUICtrlListView_AddColumn($MMenuLVAD, "", 30)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 1", 80, 3)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 2", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 3", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 4", 80)

; Load images
Global $hImage = _GUIImageList_Create(32, 32, 5, 3)
_GUIImageList_Add($hImage, $Computer)
_GUIImageList_Add($hImage, $Notebook)
_GUIImageList_AddIcon($hImage, @SystemDir&"\"&"shell32.dll", 146)
 _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($MMenuLVAD, 0xff442211, 32, 32))

_GUICtrlListView_SetImageList($MMenuLVAD, $hImage, 1) ;   1 - Image list with small icons

GUISetState(@SW_SHOW)

For $i = 0 To 50
    _GUICtrlListView_AddItem($MMenuLVAD, "", 777) ;777 should be an index that not exists in the array
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "Computer" & Random(13467, 23452, 1), 1, 0)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "User" & Random(100, 500, 1), 2, 1)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(25, 5000, 1), 3,2)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(1, 800, 1), 4,3)
_GUICtrlListView_AddItem($MMenuLVidx, $i + 1)
Next

$Recidx = _GUICtrlListView_GetItemRect($MMenuLVidx, 0)
$RecidxDim= $Recidx[3] - $Recidx[1]


While 1
    Sleep(10)
WEnd


Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $tNMHDR, $hWndFrom, $iCode
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hLVMMenu,$hLVidx
            ;This two lines to sincronize ListViewRowNumbers------------------------------------------------------------------
            Local $Lines = _SendMessage($hLVMMenu, $LVM_GETTOPINDEX) - _SendMessage($hLVidx, $LVM_GETTOPINDEX)
            _SendMessage($hLVidx, $LVM_SCROLL, 0, $Lines * $RecidxDim)
EndSwitch
EndFunc

Func _Setsort()
    _GUICtrlListView_SortItems($MMenuLVAD, GUICtrlGetState($MMenuLVAD))
EndFunc   ;==>_Setsort

Func EventsCtrl()
    Local $Msg = @GUI_CtrlId
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            _GUICtrlListView_UnRegisterSortCallBack($MMenuLVAD)
            _WinAPI_DeleteObject($Notebook)
            _WinAPI_DeleteObject($Computer)
            GUIDelete()
            Exit
    EndSwitch
EndFunc   ;==>EventsCtrl

Func ScanNew32x32()
    Local $ScanNew32x32png = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUAQsnNhcJAQAACIhJREFUWMOtlklwHNUZx/+vt5lpzWg2SSNpLI0sC1k2XoSMwSCM7bCYShVlpTiQrTA4JLmEYCpJkVtcSVVOWZTKjUoAlUOASlIRwVV4iVFiULBiywvY1u4ZjUbbjGbt7untve4cjCkOkDCO+/IO3a9/v/5//b73CG7DNfzO8YOMsQHG2ABlDIwyUEZBKQOldJgyNvzcs4eGPmsu+X/Ax06eOsCYMyjLvo5IKASPJIE5Dmzbhm3bMEwTZUVBNreGiqKkKGOHf/z97711WwSOnTz1a0kUD3d2dED2eXF1chofnB+H6/GYVcKZLqV80GV1XevXIxoJo1QuIzmfhqbrg0d+9IMXbr6Hv1W4v67u8M67erGaW8NLf3yTcuFgZcfDewvp1tjsamPTSrUlkd+xtRcVtYqpiWtCUzjMNTc1Il8s7brngd2h9989feKWEjh28tQBjyQN775vF959bxTnpqa0x77ye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gCtAGIAqgAyAJIAFAAigFCsdR0rXy9fzDfo92qN/H2bdkjw8FOo2ENg7gLCdQqyJQ/yk0YhO2m8wUv2OQBUWFxcwNE3Zj4K1YfC4WBw9OXfDf2yf9/+hwF0AGgDsAbgOoAUgDOjIydyn7ECFj8ek5GYJzfzb+k7QSruETsnwiSyBN0wkV4uODOT9rWZ89pfi2k2VFi80Q3Jzv7+g4SIg5IoLrvgznwMSgOYBjA3OnKiWMtuyXsg3/+QuL37DvnBTd3CpmiYhAzLpQuL7sLktHX+wrj6fuoKPmnj/wG1Jc98TP5pLwAAAABJRU5ErkJggg=='
    Return Binary(_Base64Decode($ScanNew32x32png))
EndFunc   ;==>_ScanNew32x32png

Func Computer32x32() ;Original OK
    Local $Base64String = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAHJElEQVR42s1Xa1CU1xl+vt3losDqslwUF1EakYtCDGY0SWupyeRHbDsJ40x+GNtqvf6o2kFTM0a8zBgFjBU0JHa8hEmmrXQ06WSIF8DlskSTWpOYcQi1Y2HIAMtV2F32/p2+53z7wccCNtOZjj0zh3POfmfO+7zP877nvEh4zE36vwXQ0tKidzqdJxwOR67YKEmia+fatbYxxkTXzsPXkZGRcnJy8sVpAdy6dWtlVVXVzfb2dgSDQeh0OtG5Me2oBcDHcEOyLE85BgIB7N271zMtAJvN9uPz58832JkRL79+bNw7lTSJz9kEMpmk7gkbmTLn3S8z3GpuhPfTSmzduhXSgwcPIuOMcYZgIBgcGRnxZWRksBADBWfOnLH2yEZsOFA66SCmWY99k5QRmj3a+Ygf6HDJ6LjdhMCnpxUAV69fc81LmTczNiaG6yI2Dg0Owmg0ori4GHY2G6+9WTLBYLgRLbCpjJPT6Bll6PMq/HV9RQCuhADcaGhgP1i4EHq9HvHx8ULvK1euoKCgAEVFRQTAhFffKBk/mH0Pw5rfvTLQ6ZDhDnLjkpCu524zgldPYcuWLZCabM1s0ROLIJPh2bNnw0/BcbW2DgU/fA67d++GXTah8H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E9kXpREW5eIzSUueDajQ4Hz7E7cYG/OTlV1D1/vtwkiRxs4ycHf36da/J4aesWLHi+Z07d9ap5RZ/zom55+/cuXPj+zAhHT/5e7YwLY30N2POnGTofD50f3ETi176Oe7du4ceux2DQ4O8htMV7fqtYKCwsHBmSkrKk7Gxsbk5OTm/pr7c7/djeHgYvb29uH///t/sdvs5iou7/f39X1dXV49OC6D0xNtsvsUCC8UAl8Dn'
    $Base64String &= 'dMDxj1Yk5K9AX18f/tXRjp4eO4p27ZLWrl0blZ2dvXfNmjW/mTFjhlktPAcGBpT3IbTmr6paxNLbMlhTU/NOa2vrEQLinQTgWFmZMzkpKSZt/nyYzWZxHwh9iYkh8ryd4oBYcN396uu4eJPpDaqSjvDvqgHeeOao1TBPtRgq71RJ1Cq4vLz8zcuXL79FMTMhjkRW0xsQu/6Xvxj58s6XUovNhjiqB1evXs0vI/ZeZaWxq6vL+VR+vmTQ69dRpXyOvI9UDxbRJE8MDW25HmLBt5FaW1vbH0mmyQBoU7TBYEijcZHP5zNRirCIiIgBCqh/Uu8k/T18H2XBDCpWnyUpNq5ateo50t5CcaDnKaUa5WB4zU+sBCmGvqNb1Xbp0qULlF0tBMQzSYIp5uoYXt6rXunIc55fs8jwHGIvnQqZJAIWxxmh/6QcFDv27u7uBwS+h/aPUPfI4TRNAeC/aVJYVwGHV2qPPOCxtscO4N+zbf1+lKO2XAAAAABJRU5ErkJggg=='
    Return Binary(_WinAPI_Base64Decode($Base64String))
EndFunc   ;==>_Base64String

Func _Base64Decode($input_string)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
EndFunc   ;==>_Base64Decode

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Maybe this will help us understand, do you mean like the _ArrayDisplay function, how it displays a column of numbers for the rows?

ex:Capture.thumb.PNG.4ca5e650754aa4681a3247

 

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Try this:

 

#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <GuiScrollBars.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>

Opt("GUIOnEventMode", 1)

Global $MainGui, $MsgOk, $MainGuiRefresh, $MainGuiLabelInfo

Global $MainGuiW = @DesktopWidth - 10, $MainGuiH = @DesktopHeight - 90

_GDIPlus_Startup()
Global $Notebook = _GDIPlus_BitmapCreateFromMemory(ScanNew32x32(), True) ;GDI bitmap
Global $Computer = _GDIPlus_BitmapCreateFromMemory(Computer32x32(), True) ;GDI bitmap
_GDIPlus_Shutdown()
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$MainGui = GUICreate("Test Sort", 800, 500, 10, 10, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPSIBLINGS)) ;
GUISetOnEvent($GUI_EVENT_CLOSE, "EventsCtrl")

$MMenuLVAD = GUICtrlCreateListView("", 80, 82, 661, 321, -1, BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
$hLVMMenu = GUICtrlGetHandle($MMenuLVAD);
GUICtrlSetOnEvent($MMenuLVAD, "_Setsort")
_GUICtrlListView_RegisterSortCallBack($MMenuLVAD)


$MMenuLVidx = GUICtrlCreateListView("", 4, 82, 76, 321,  BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
_GUICtrlListView_SetExtendedListViewStyle(-1,BitOR($LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_SUBITEMIMAGES))
$hLVidx = GUICtrlGetHandle($MMenuLVidx);
_GUICtrlListView_AddColumn($hLVidx, "#", 52, 1, -1)

;_GUIScrollBars_ShowScrollBar($hLVidx, $SB_BOTH, False) ;not working !!!
;;------------------------------------------------------------------------------------------------------------------------------------------------------------------------

;Add columns
_GUICtrlListView_AddColumn($MMenuLVAD, "", 30)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 1", 80, 3)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 2", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 3", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 4", 80)

; Load images
Global $hImage = _GUIImageList_Create(32, 32, 5, 3)
_GUIImageList_Add($hImage, $Computer)
_GUIImageList_Add($hImage, $Notebook)
_GUIImageList_AddIcon($hImage, @SystemDir&"\"&"shell32.dll", 146)
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($MMenuLVAD, 0xff442211, 32, 32))

_GUICtrlListView_SetImageList($MMenuLVAD, $hImage, 1) ;   1 - Image list with small icons
_GUICtrlListView_SetImageList($MMenuLVidx, $hImage, 1) ;   1 - Image list with small icons


For $i = 0 To 50
    _GUICtrlListView_AddItem($MMenuLVAD, "", 777) ;777 should be an index that not exists in the array
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "Computer" & Random(13467, 23452, 1), 1, 0)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "User" & Random(100, 500, 1), 2, 1)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(25, 5000, 1), 3,2)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(1, 800, 1), 4,3)
    _GUICtrlListView_AddItem($MMenuLVidx, $i, 4)
Next

GUISetState(@SW_SHOW)

$Recidx = _GUICtrlListView_GetItemRect($MMenuLVidx, 0)
$RecidxDim1 = $Recidx[3] - $Recidx[1]

$Recidx = _GUICtrlListView_GetItemRect($MMenuLVAD, 0)
$RecidxDim2 = $Recidx[3] - $Recidx[1]

GUIRegisterMsg($WM_NOTIFY, "WM_Notify")

While 1
    Sleep(10)
WEnd


Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $tNMHDR, $hWndFrom, $iCode
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hLVMMenu
            ;This two lines to sincronize ListViewRowNumbers------------------------------------------------------------------
            Local $Lines = _SendMessage($hLVMMenu, $LVM_GETTOPINDEX) - _SendMessage($hLVidx, $LVM_GETTOPINDEX)
            _SendMessage($hLVidx, $LVM_SCROLL, 0, $Lines * $RecidxDim1)
            Return 0
        Case $hLVidx
            Local $Lines = _SendMessage($hLVidx, $LVM_GETTOPINDEX) - _SendMessage($hLVMMenu, $LVM_GETTOPINDEX)
            _SendMessage($hLVMMenu, $LVM_SCROLL, 0, $Lines * $RecidxDim2)
            Return 0
    EndSwitch
EndFunc

Func _Setsort()
    _GUICtrlListView_SortItems($MMenuLVAD, GUICtrlGetState($MMenuLVAD))
EndFunc   ;==>_Setsort

Func EventsCtrl()
    Local $Msg = @GUI_CtrlId
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            _GUICtrlListView_UnRegisterSortCallBack($MMenuLVAD)
            _WinAPI_DeleteObject($Notebook)
            _WinAPI_DeleteObject($Computer)
            GUIDelete()
            Exit
    EndSwitch
EndFunc   ;==>EventsCtrl

Func ScanNew32x32()
    Local $ScanNew32x32png = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUAQsnNhcJAQAACIhJREFUWMOtlklwHNUZx/+vt5lpzWg2SSNpLI0sC1k2XoSMwSCM7bCYShVlpTiQrTA4JLmEYCpJkVtcSVVOWZTKjUoAlUOASlIRwVV4iVFiULBiywvY1u4ZjUbbjGbt7untve4cjCkOkDCO+/IO3a9/v/5//b73CG7DNfzO8YOMsQHG2ABlDIwyUEZBKQOldJgyNvzcs4eGPmsu+X/Ax06eOsCYMyjLvo5IKASPJIE5Dmzbhm3bMEwTZUVBNreGiqKkKGOHf/z97711WwSOnTz1a0kUD3d2dED2eXF1chofnB+H6/GYVcKZLqV80GV1XevXIxoJo1QuIzmfhqbrg0d+9IMXbr6Hv1W4v67u8M67erGaW8NLf3yTcuFgZcfDewvp1tjsamPTSrUlkd+xtRcVtYqpiWtCUzjMNTc1Il8s7brngd2h9989feKWEjh28tQBjyQN775vF959bxTnpqa0x77yeNkny3S8tLa4bOgWD867K9w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FCsdR0rXy9fzDfo92qN/H2bdkjw8FOo2ENg7gLCdQqyJQ/yk0YhO2m8wUv2OQBUWFxcwNE3Zj4K1YfC4WBw9OXfDf2yf9/+hwF0AGgDsAbgOoAUgDOjIydyn7ECFj8ek5GYJzfzb+k7QSruETsnwiSyBN0wkV4uODOT9rWZ89pfi2k2VFi80Q3Jzv7+g4SIg5IoLrvgznwMSgOYBjA3OnKiWMtuyXsg3/+QuL37DvnBTd3CpmiYhAzLpQuL7sLktHX+wrj6fuoKPmnj/wG1Jc98TP5pLwAAAABJRU5ErkJggg=='
    Return Binary(_Base64Decode($ScanNew32x32png))
EndFunc   ;==>_ScanNew32x32png

Func Computer32x32() ;Original OK
    Local $Base64String = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAHJElEQVR42s1Xa1CU1xl+vt3losDqslwUF1EakYtCDGY0SWupyeRHbDsJ40x+GNtqvf6o2kFTM0a8zBgFjBU0JHa8hEmmrXQ06WSIF8DlskSTWpOYcQi1Y2HIAMtV2F32/p2+53z7wccCNtOZjj0zh3POfmfO+7zP877nvEh4zE36vwXQ0tKidzqdJxwOR67YKEmia+fatbYxxkTXzsPXkZGRcnJy8sVpAdy6dWtlVVXVzfb2dgSDQeh0OtG5Me2oBcDHcEOyLE85BgIB7N271zMtAJvN9uPz58832JkRL79+bNw7lTSJz9kEMpmk7gkbmTLn3S8z3GpuhPfTSmzduhXSgwcPIuOMcYZgIBgcGRnxZWRksBADBWfOnLH2yEZsOFA66SCmWY99k5QRmj3a+Ygf6HDJ6LjdhMCnpxUAV69fc81LmTczNiaG6yI2Dg0Owmg0ori4GHY2G6+9WTLBYLgRLbCpjJPT6Bll6PMq/HV9RQCuhADcaGhgP1i4EHq9HvHx8ULvK1euoKCgAEVFRQTAhFffKBk/mH0Pw5rfvTLQ6ZDhDnLjkpCu524zgldPYcuWLZCabM1s0ROLIJPh2bNnw0/BcbW2DgU/fA67d++GXTah8Hcl0xqexIYGzEPyuNslK3t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Hz7E7cYG/OTlV1D1/vtwkiRxs4ycHf36da/J4aesWLHi+Z07d9ap5RZ/zom55+/cuXPj+zAhHT/5e7YwLY30N2POnGTofD50f3ETi176Oe7du4ceux2DQ4O8htMV7fqtYKCwsHBmSkrKk7Gxsbk5OTm/pr7c7/djeHgYvb29uH///t/sdvs5iou7/f39X1dXV49OC6D0xNtsvsUCC8UAl8Dn'
    $Base64String &= 'dMDxj1Yk5K9AX18f/tXRjp4eO4p27ZLWrl0blZ2dvXfNmjW/mTFjhlktPAcGBpT3IbTmr6paxNLbMlhTU/NOa2vrEQLinQTgWFmZMzkpKSZt/nyYzWZxHwh9iYkh8ryd4oBYcN396uu4eJPpDaqSjvDvqgHeeOao1TBPtRgq71RJ1Cq4vLz8zcuXL79FMTMhjkRW0xsQu/6Xvxj58s6XUovNhjiqB1evXs0vI/ZeZaWxq6vL+VR+vmTQ69dRpXyOvI9UDxbRJE8MDW25HmLBt5FaW1vbH0mmyQBoU7TBYEijcZHP5zNRirCIiIgBCqh/Uu8k/T18H2XBDCpWnyUpNq5ateo50t5CcaDnKaUa5WB4zU+sBCmGvqNb1Xbp0qULlF0tBMQzSYIp5uoYXt6rXunIc55fs8jwHGIvnQqZJAIWxxmh/6QcFDv27u7uBwS+h/aPUPfI4TRNAeC/aVJYVwGHV2qPPOCxtscO4N+zbf1+lKO2XAAAAABJRU5ErkJggg=='
    Return Binary(_WinAPI_Base64Decode($Base64String))
EndFunc   ;==>_Base64String

Func _Base64Decode($input_string)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
EndFunc   ;==>_Base64Decode

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

Currently I don't know to how to set the height of the cells in the left listview properly. I did it by adding also icons to the listview with the same size as in the right listview.

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Uez, thanks a lot.

yes this is what I was trying to do.

is it possible to hide the scroll bars?

Share this post


Link to post
Share on other sites

Both scrollbars of row listview, I attempeted to use without results:

_GUIScrollBars_ShowScrollBar($hLVidx, $SB_BOTH, False) ;not working !!!

Share this post


Link to post
Share on other sites

Try this:

#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <GuiScrollBars.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>

Opt("GUIOnEventMode", 1)

Global $MainGui, $MsgOk, $MainGuiRefresh, $MainGuiLabelInfo

Global $MainGuiW = @DesktopWidth - 10, $MainGuiH = @DesktopHeight - 90

_GDIPlus_Startup()
Global $Notebook = _GDIPlus_BitmapCreateFromMemory(ScanNew32x32(), True) ;GDI bitmap
Global $Computer = _GDIPlus_BitmapCreateFromMemory(Computer32x32(), True) ;GDI bitmap
_GDIPlus_Shutdown()
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$MainGui = GUICreate("Test Sort", 800, 500, 10, 10, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPSIBLINGS)) ;
GUISetOnEvent($GUI_EVENT_CLOSE, "EventsCtrl")

$MMenuLVAD = GUICtrlCreateListView("", 80, 82, 661, 321, -1, BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
$hLVMMenu = GUICtrlGetHandle($MMenuLVAD);
GUICtrlSetOnEvent($MMenuLVAD, "_Setsort")
_GUICtrlListView_RegisterSortCallBack($MMenuLVAD)


$MMenuLVidx = GUICtrlCreateListView("", 4, 82, 76, 321,  BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
_GUICtrlListView_SetExtendedListViewStyle(-1,BitOR($LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_SUBITEMIMAGES))
$hLVidx = GUICtrlGetHandle($MMenuLVidx);

$iDLLUser32 = DllOpen("user32.dll")
$wProcNewLV = DllCallbackRegister("_LVWndProc", "ptr", "hwnd;uint;wparam;lparam")
$wProcOldLV = _WinAPI_SetWindowLong($hLVMMenu, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLV))
$wProcOldLV2 = _WinAPI_SetWindowLong($hLVidx, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLV))


_GUICtrlListView_AddColumn($hLVidx, "#", 52, 1, -1)

;_GUIScrollBars_ShowScrollBar($hLVidx, $SB_BOTH, False) ;not working !!!
;;------------------------------------------------------------------------------------------------------------------------------------------------------------------------

;Add columns
_GUICtrlListView_AddColumn($MMenuLVAD, "", 30)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 1", 80, 3)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 2", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 3", 80)
_GUICtrlListView_AddColumn($MMenuLVAD, "Title 4", 80)

; Load images
Global $hImage = _GUIImageList_Create(32, 32, 5, 3)
_GUIImageList_Add($hImage, $Computer)
_GUIImageList_Add($hImage, $Notebook)
_GUIImageList_AddIcon($hImage, @SystemDir&"\"&"shell32.dll", 146)
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($MMenuLVAD, 0xff442211, 32, 32))

_GUICtrlListView_SetImageList($MMenuLVAD, $hImage, 1) ;   1 - Image list with small icons
_GUICtrlListView_SetImageList($MMenuLVidx, $hImage, 1) ;   1 - Image list with small icons


For $i = 0 To 50
    _GUICtrlListView_AddItem($MMenuLVAD, "", 777) ;777 should be an index that not exists in the array
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "Computer" & Random(13467, 23452, 1), 1, 0)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "User" & Random(100, 500, 1), 2, 1)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(25, 5000, 1), 3,2)
    _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(1, 800, 1), 4,3)
    _GUICtrlListView_AddItem($MMenuLVidx, $i, 4)
Next

GUISetState(@SW_SHOW)

$Recidx = _GUICtrlListView_GetItemRect($MMenuLVidx, 0)
$RecidxDim1 = $Recidx[3] - $Recidx[1]

$Recidx = _GUICtrlListView_GetItemRect($MMenuLVAD, 0)
$RecidxDim2 = $Recidx[3] - $Recidx[1]

GUIRegisterMsg($WM_NOTIFY, "WM_Notify")

While 1
    Sleep(10)
WEnd


Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam
    Local $tNMHDR, $hWndFrom, $iCode
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hLVMMenu
            ;This two lines to sincronize ListViewRowNumbers------------------------------------------------------------------
            Local $Lines = _SendMessage($hLVMMenu, $LVM_GETTOPINDEX) - _SendMessage($hLVidx, $LVM_GETTOPINDEX)
            _SendMessage($hLVidx, $LVM_SCROLL, 0, $Lines * $RecidxDim1)
            Return 0
        Case $hLVidx
            Local $Lines = _SendMessage($hLVidx, $LVM_GETTOPINDEX) - _SendMessage($hLVMMenu, $LVM_GETTOPINDEX)
            _SendMessage($hLVMMenu, $LVM_SCROLL, 0, $Lines * $RecidxDim2)
            Return 0
    EndSwitch
EndFunc

Func _LVWndProc($hWnd, $Msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $wParam, $lParam
    Switch $Msg
        Case $WM_NCCALCSIZE
            _RemoveVHScroll($hWnd)
        Case $WM_WINDOWPOSCHANGING
            Local $tWINDOWPOS = DllStructCreate($tagWINDOWPOS, $lParam)
            ;uncomment for mouse scrolling - no mouse scrolling without, but border is not erased (vertical key scrolling flickers visibly))
            DllStructSetData($tWINDOWPOS, "Flags", BitAND(DllStructGetData($tWINDOWPOS, "Flags"), BitNOT($SWP_FRAMECHANGED)))
    EndSwitch
    ;pass the unhandled messages to default WindowProc
    Local $aResult = DllCall($iDLLUser32, "lresult", "CallWindowProcW", "ptr", $wProcOldLV, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam)
    If @error Then Return -1
    Return $aResult[0]
EndFunc   ;==>_LVWndProc

Func _RemoveVHScroll($hWnd)
    Local $iLVStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
    $iLVStyle = BitAND($iLVStyle, BitNOT($WS_VSCROLL))
    $iLVStyle = BitAND($iLVStyle, BitNOT($WS_HSCROLL))
    _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iLVStyle)
EndFunc   ;==>_RemoveVHScroll


Func _Setsort()
    _GUICtrlListView_SortItems($MMenuLVAD, GUICtrlGetState($MMenuLVAD))
EndFunc   ;==>_Setsort

Func EventsCtrl()
    Local $Msg = @GUI_CtrlId
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            If $wProcOldLV Then _WinAPI_SetWindowLong($hLVMMenu, $GWL_WNDPROC, $wProcOldLV)
            If $wProcOldLV2 Then _WinAPI_SetWindowLong($hLVidx, $GWL_WNDPROC, $wProcOldLV2)
            DllCallbackFree($wProcNewLV)
            GUIDelete($MainGui)
            DllClose($iDLLUser32)
            _GUICtrlListView_UnRegisterSortCallBack($MMenuLVAD)
            _WinAPI_DeleteObject($Notebook)
            _WinAPI_DeleteObject($Computer)
            Exit
    EndSwitch
EndFunc   ;==>EventsCtrl

Func ScanNew32x32()
    Local $ScanNew32x32png = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUAQsnNhcJAQAACIhJREFUWMOtlklwHNUZx/+vt5lpzWg2SSNpLI0sC1k2XoSMwSCM7bCYShVlpTiQrTA4JLmEYCpJkVtcSVVOWZTKjUoAlUOASlIRwVV4iVFiULBiywvY1u4ZjUbbjGbt7untve4cjCkOkDCO+/IO3a9/v/5//b73CG7DNfzO8YOMsQHG2ABlDIwyUEZBKQOldJgyNvzcs4eGPmsu+X/Ax06eOsCYMyjLvo5IKASPJIE5Dmzbhm3bMEwTZUVBNreGiqKkKGOHf/z97711WwSOnTz1a0kUD3d2dED2eXF1chofnB+H6/GYVcKZLqV80GV1XevXIxoJo1QuIzmfhqbrg0d+9IMXbr6Hv1W4v67u8M67erGaW8NLf3yTcuFgZcfDewvp1tjsamPTSrUlkd+xtRcVtYqpiWtCUzjMNTc1Il8s7brngd2h9989feKWE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yMlaquOJeWM/M5oadrw/+KvQ3AOgCtAGIAqgAyAJIAFAAigFCsdR0rXy9fzDfo92qN/H2bdkjw8FOo2ENg7gLCdQqyJQ/yk0YhO2m8wUv2OQBUWFxcwNE3Zj4K1YfC4WBw9OXfDf2yf9/+hwF0AGgDsAbgOoAUgDOjIydyn7ECFj8ek5GYJzfzb+k7QSruETsnwiSyBN0wkV4uODOT9rWZ89pfi2k2VFi80Q3Jzv7+g4SIg5IoLrvgznwMSgOYBjA3OnKiWMtuyXsg3/+QuL37DvnBTd3CpmiYhAzLpQuL7sLktHX+wrj6fuoKPmnj/wG1Jc98TP5pLwAAAABJRU5ErkJggg=='
    Return Binary(_Base64Decode($ScanNew32x32png))
EndFunc   ;==>_ScanNew32x32png

Func Computer32x32() ;Original OK
    Local $Base64String = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAHJElEQVR42s1Xa1CU1xl+vt3losDqslwUF1EakYtCDGY0SWupyeRHbDsJ40x+GNtqvf6o2kFTM0a8zBgFjBU0JHa8hEmmrXQ06WSIF8DlskSTWpOYcQi1Y2HIAMtV2F32/p2+53z7wccCNtOZjj0zh3POfmfO+7zP877nvEh4zE36vwXQ0tKidzqdJxwOR67YKEmia+fatbYxxkTXzsPXkZGRcnJy8sVpAdy6dWtlVVXVzfb2dgSDQeh0OtG5Me2oBcDHcEOyLE85BgIB7N271zMtAJvN9uPz58832JkRL79+bNw7lTSJz9kEMpmk7gkbmTLn3S8z3GpuhPfTSmzduhXSgwcPIuOMcYZgIBgcGRnxZWRksBADBWfOnLH2yEZsOFA66SCmWY99k5QRmj3a+Ygf6HDJ6LjdhMCnpxUAV69fc81LmTczNiaG6yI2Dg0Owmg0ori4GHY2G6+9WTLBYLgRLbCpjJPT6Bll6PMq/HV9RQCuhADcaGhgP1i4EHq9HvHx8ULvK1euoKCgAEVFRQTAhFffKBk/mH0Pw5rfvTLQ6ZDhDnLjkpCu524zgldPYcuWLZCabM1s0ROLIJPh2b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yMM5lM+drfh4aGblssFmd0dPSjMMjE9kXpREW5eIzSUueDajQ4Hz7E7cYG/OTlV1D1/vtwkiRxs4ycHf36da/J4aesWLHi+Z07d9ap5RZ/zom55+/cuXPj+zAhHT/5e7YwLY30N2POnGTofD50f3ETi176Oe7du4ceux2DQ4O8htMV7fqtYKCwsHBmSkrKk7Gxsbk5OTm/pr7c7/djeHgYvb29uH///t/sdvs5iou7/f39X1dXV49OC6D0xNtsvsUCC8UAl8Dn'
    $Base64String &= 'dMDxj1Yk5K9AX18f/tXRjp4eO4p27ZLWrl0blZ2dvXfNmjW/mTFjhlktPAcGBpT3IbTmr6paxNLbMlhTU/NOa2vrEQLinQTgWFmZMzkpKSZt/nyYzWZxHwh9iYkh8ryd4oBYcN396uu4eJPpDaqSjvDvqgHeeOao1TBPtRgq71RJ1Cq4vLz8zcuXL79FMTMhjkRW0xsQu/6Xvxj58s6XUovNhjiqB1evXs0vI/ZeZaWxq6vL+VR+vmTQ69dRpXyOvI9UDxbRJE8MDW25HmLBt5FaW1vbH0mmyQBoU7TBYEijcZHP5zNRirCIiIgBCqh/Uu8k/T18H2XBDCpWnyUpNq5ateo50t5CcaDnKaUa5WB4zU+sBCmGvqNb1Xbp0qULlF0tBMQzSYIp5uoYXt6rXunIc55fs8jwHGIvnQqZJAIWxxmh/6QcFDv27u7uBwS+h/aPUPfI4TRNAeC/aVJYVwGHV2qPPOCxtscO4N+zbf1+lKO2XAAAAABJRU5ErkJggg=='
    Return Binary(_WinAPI_Base64Decode($Base64String))
EndFunc   ;==>_Base64String

Func _Base64Decode($input_string)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
EndFunc   ;==>_Base64Decode

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

 

I'm not sure whether I initialized the callback properly but it works for me. 


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

  • Similar Content

    • By Miliardsto
      I have the following code. You can see there are $color_normal and $color_trans
      In my case normal is too dark . And color trans is to much violet.
      If you run it you will see how its looks. I want gui with listView have the same color like taskbar in windows 10.
      How to achieve that?
       
       
      #include <Date.au3> #include <MsgBoxConstants.au3> #include <GuiListBox.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> HotKeySet("{ESC}", "Terminate") $color_normal = "0x" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 24), 6) $color_trans = "0x" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 16), 6) $trans = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") ConsoleWrite("Transpart = " & $trans & @CRLF) ConsoleWrite("Color normal = " & $color_normal & @CRLF) ConsoleWrite("Color trans = " & $color_trans & @CRLF) ConsoleWrite(_Get_taskbar_color()); It return AARRGGBB $taskbarColor = _Get_taskbar_color() Global $gui = GUICreate("Test", 150, 58,@DesktopWidth-300,@DesktopHeight-58,$WS_POPUP,BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) Global $idListview = GUICtrlCreateListView("", 0, 0, 150, 58,BitOR($LBS_NOTIFY,$LBS_SORT), 0) ;_GuiCtrlMakeTrans(-1,100) ; Add column _GUICtrlListView_AddColumn($idListview, "Msgs", 100) GUICtrlSetFont(-1, 7, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x470C4F) GUICtrlSetBkColor($idListview, 0x310638) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Terminate() Exit EndFunc Func _Get_taskbar_color() If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "ColorPrevalence") Then If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") Then Return "0xD9" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 16), 6) Else Return "0xFF" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 24), 6) EndIf Else If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") Then Return "0xD9000000" Else Return "0xFF000000" EndIf EndIf EndFunc  
    • By Slipk
      Hello everybody,
      #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GUIListViewEx.au3> $Form1 = GUICreate("Form1", 539, 350, 192, 124) $ListView1 = GUICtrlCreateListView("CLM1|CLM2", 0, 0, 538, 326) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 150) Local $dynamic = GUICtrlCreateListViewItem("Example1|Example2", $ListView1) $SubMenu = GUICtrlCreateContextMenu($dynamic) $Run = GUICtrlCreateMenuItem("Run", $SubMenu) $Edit = GUICtrlCreateMenuItem("Edit", $SubMenu) $Delete = GUICtrlCreateMenuItem("Delete", $SubMenu) Local $dynamic2 = GUICtrlCreateListViewItem("Example3|Example6", $ListView1) $SubMenu = GUICtrlCreateContextMenu($dynamic2) $Run = GUICtrlCreateMenuItem("Run", $SubMenu) $Edit = GUICtrlCreateMenuItem("Edit", $SubMenu) $Delete = GUICtrlCreateMenuItem("Delete", $SubMenu) _GUIListViewEx_Init($ListView1, "", 0, 0, True, 64) _GUIListViewEx_MsgRegister() GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I use GUIListViewEx.au3 for position of items in listview but when I move one the context menu disappear. Any solution of this?
      Any method than array it is possible?
      Thank you, appreciate it.
       
       
    • By Slipk
      Hello everybody,
      I download the GUIListViewEx.au3 by Melba23 in order to move up or down my items from a listview.
      Everything it's looking good in script but when I move an item it will crash.
      Any suggestions?
      Thank you! 

    • By Slipk
      Hello everybody,
      Sorry for my bad english.
       
      I try to figure out if I have a dynamic listview with as many items as I want, how to save to a text file all the data listview contains in the same form that you put when you create a listviewitem. I will give you an example.
      When the script is running it will show you the listview and some items. How to take the items data "Data1|Data1_Sub1|Data1_Sub2" in this format and paste into a text file? All of them.
      I tried to explain as good as I can.
      Thank you for your attention!
      #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> $Form_Menu = GUICreate("Form Example", 351, 234, -1, -1) $Form_Menu_ListView1 = GUICtrlCreateListView("Column #1|Column #2|Column #3", 0, 0, 346, 230) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 75) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 75) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 75) GUICtrlCreateListViewItem("Data1|Data1_Sub1|Data1_Sub2", $Form_Menu_ListView1) GUICtrlCreateListViewItem("Data2|Data2_Sub1|Data2_Sub2", $Form_Menu_ListView1) GUICtrlCreateListViewItem("DataN|DataN_SubN|DataN_SubN", $Form_Menu_ListView1) ;The data that appear in the listview be saved in a file like that : #cs Data1|Data1_Sub1|Data1_Sub2 Data2|Data2_Sub1|Data2_Sub2 DataN|DataN_SubN|DataN_SubN #ce GUISetState(@SW_SHOW, $Form_Menu) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    • By Slipk
      Hello,
      I tried with many methods and searched a lot for items to move up and down but couldn't find it.
      Sorry for my bad english.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 307, 247, 192, 124) GUISetFont(10, 400, 0, "Arial") $ListView1 = GUICtrlCreateListView("C1|C2|C3", 0, 0, 250, 246) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100) GUICtrlCreateListViewItem("Test1|Test2|Test3", $ListView1) GUICtrlCreateListViewItem("Cat|Dog|Fish", $ListView1) GUICtrlCreateListViewItem("ABC|DEF|GHI", $ListView1) $Button1 = GUICtrlCreateButton("/\", 264, 8, 27, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Button2 = GUICtrlCreateButton("\/", 264, 40, 27, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Button1 ;up         Case $Button2 ;down     EndSwitch WEnd  
      Thank you for your help!
×
×
  • Create New...