Leaderboard
Popular Content
Showing content with the highest reputation on 07/26/2023 in Posts
-
Create an svg file https://www.w3schools.com/graphics/svg_line.asp1 point
-
Tester needed ^^
argumentum reacted to UEZ for a topic
You may have a look to the tool on German website which I updated. 🙂1 point -
1 point
-
Tester needed ^^
argumentum reacted to UEZ for a topic
Can you please test if GUI will be resize properly according the amount of icons read to listview? Of course limit is @DesktopWidth / 2. #include <File.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <ListViewConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIShellEx.au3> #include <WindowsConstants.au3> Global $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", "") Global $i, $aShortcutDetails, $hIcon, $aFileList = ReadDesktopIcons() If @error Then Dim $aFileList[1] $aFileList[0] = 0 MsgBox($MB_ICONWARNING, "Warning", "No desktop icons!", 15) EndIf Global $iLen = 0, $l For $i = 1 To $aFileList[0] $l = StringLen(StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1")) $iLen = $l > $iLen ? $l : $iLen Next Global $iW = 0, $iH = 0 Global Const $hGUI = GUICreate("Toolbar Desktop by UEZ", $iW, $iH, $aTaskbar[1] ? -1 : -10000, $aTaskbar[1] ? -10000 : -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX), $WS_EX_TOPMOST) GUISetFont(8, $FW_NORMAL, $GUI_FONTNORMAL, "Arial", $hGUI, $CLEARTYPE_QUALITY) Global $hLV = _GUICtrlListView_Create($hGUI, "", 0, 0, 0, 0, BitOR($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER, $LVS_LIST)), $iLV = _WinAPI_GetDlgCtrlID($hLV) GUICtrlSendMsg($hLV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_TRACKSELECT) _GUICtrlListView_SetExtendedListViewStyle($hLV, $LVS_EX_DOUBLEBUFFER) _GUICtrlListView_InsertColumn($hLV, 0, "Desktop App") Global Const $hImageList = _GUIImageList_Create(16, 16) ConsoleWrite("Added " & $aFileList[0] & " items to the list" & @CRLF) ;~ $aFileList[0] = 6 For $i = 1 To $aFileList[0] $hIcon = _WinAPI_ShellExtractAssociatedIcon($aFileList[$i], True) If $hIcon Then _GUIImageList_Add($hImageList, _WinAPI_Create32BitHBITMAP($hIcon)) Else _GUIImageList_Add($hImageList, _GUICtrlListView_CreateSolidBitMap($hLV, 0xFFFFFF, 16, 16)) EndIf Next Global $aIconAssignment[UBound($aFileList) - 1][2] _GUICtrlListView_SetImageList($hLV, $hImageList, 1) For $i = 1 To $aFileList[0] If StringInStr(FileGetAttrib($aFileList[$i]), "D") Then If StringRegExp($aFileList[$i], ".+\.\{(.*)\}") Then _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".+\\(.+)", "$1"), $i - 1, $i - 1) EndIf Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) EndIf $aIconAssignment[$i - 1][0] = $i - 1 $aIconAssignment[$i - 1][1] = $aFileList[$i] Next ;~ ConsoleWrite("Screen Dimensions: " & @DesktopWidth & " x " & @DesktopHeight & @CRLF) ;~ Global $aDimLV = _GUICtrlListView_ApproximateViewRect($hLV) ;~ ConsoleWrite("Listview Dimensions: " & $aDimLV[0] & " x " & $aDimLV[1] & @CRLF) ;~ Global $aPos = WinGetPos($hGUI), $aWinPos ;~ $iW = $aDimLV[0] / $aDimLV[1] * 2.05 ; ;~ $iW = Max(150, Min(@DesktopWidth / 2, $iW)) ;~ $iH = $iW * 9 / 16 ;~ WinMove($hGUI, "", (@DesktopWidth - $iW) / 2, (@DesktopHeight - $iH) / 2, $iW, $iH) ;~ ConsoleWrite("Calculated GUI size: " & $iW & " x " & $iH & @CRLF) ;~ ConsoleWrite("OS: " & @OSVersion & @CRLF) GUIRegisterMsg($WM_SIZE, "WM_SIZE") If $iW < @DesktopWidth / 2 And BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) Then While BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) $iW += 1.77778 ;ratio 16:9 $iH += 1 WinMove($hGUI, "", (@DesktopWidth - $iW) / 2, (@DesktopHeight - $iH) / 2, $iW, $iH) If $iW > @DesktopWidth / 2 Then ExitLoop WEnd EndIf GUISetState(@SW_SHOW, $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit Func ReadDesktopIcons() Local $aFileList1 = _FileListToArray(@DesktopDir, "*", $FLTA_FILESFOLDERS, True) Local $aFileList2 = _FileListToArray(@DesktopCommonDir, "*", $FLTA_FILESFOLDERS, True) If BitOR(IsArray($aFileList1), IsArray($aFileList2)) = 0 Then Return SetError(1, 0, 0) Local $i, $j, $aFileList[$aFileList1[0] + $aFileList2[0] + 1], $c = 1 For $i = 1 To $aFileList1[0] If StringRight($aFileList1[$i], 4) <> ".ini" Then $aFileList[$c] = $aFileList1[$i] $c += 1 EndIf Next For $j = 1 To $aFileList2[0] If StringRight($aFileList2[$j], 4) <> ".ini" Then $aFileList[$c] = $aFileList2[$j] $c += 1 EndIf Next $aFileList[0] = $c - 1 ReDim $aFileList[$c] Return $aFileList EndFunc ;==>ReadDesktopIcons Func Max($a, $b) Return $a > $b ? $a : $b EndFunc ;==>Max Func Min($a, $b) Return $a < $b ? $a : $b EndFunc ;==>Min Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam ControlMove($hGUI, "", $iLV, 0, 0, _WinAPI_LoWord($lParam), _WinAPI_HiWord($lParam)) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Thanks.1 point -
Tester needed ^^
argumentum reacted to UEZ for a topic
You have all so much icons on your desktop that always $iW = @DesktopWidth / 2 is applied. @AllenAA I can see that the calculated GUI size is not @DesktopWidth / 2. Does the GUI have scrollbar (all icons fit in the GUI)? The problem is that for a few icons the GUI is not set properly. If you set the list to a much smaller amount then ConsoleWrite("Added " & $aFileList[0] & " items to the list" & @CRLF) $aFileList[0] = 6 the GUI will be created too tiny. The goal is to adjust the GUI size so that the icons all fit in the GUI, of course only if the maximum GUI size is not exceeded. @all: thank you for testing!1 point -
Tester needed ^^
argumentum reacted to ioa747 for a topic
@argumentum the first GUICtrlCreateListView return the the identifier (controlID) of the new control. the second _GUICtrlListView_Create return the the the handle to the ListView control. if that helps #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGUI, $aXY, $idListview, $hLV $hGUI = GUICreate("ListView Approximate View Rect", 400, 300, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX), $WS_EX_TOPMOST) ; CASE A ;~ $idListview = GUICtrlCreateListView("", 5, 5, 390, 260, BitOR($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER, $LVS_LIST), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) ; CASE B $idListview = _GUICtrlListView_Create($hGUI, "", 5, 5, 390, 260, BitOR($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER, $LVS_LIST), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) ConsoleWrite("$idListview=" & $idListview & @CRLF) GUICtrlSendMsg($idListview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_TRACKSELECT) _GUICtrlListView_SetExtendedListViewStyle($idListview, $LVS_EX_DOUBLEBUFFER) GUISetState(@SW_SHOW) _GUICtrlListView_InsertColumn($idListview, 0, "Column 1", 100) For $iI = 0 To 9 _GUICtrlListView_AddItem($idListview, "Row (your boat down the street #) " & $iI) Next _GUICtrlListView_SetColumnWidth($idListview, 0, $LVSCW_AUTOSIZE_USEHEADER) MsgBox($MB_SYSTEMMODAL, "Information", "Approximate View Rect") ; Resize view $aXY = _GUICtrlListView_ApproximateViewRect($idListview) ;~ _WinAPI_SetWindowPos(GUICtrlGetHandle($idListview), 0, 2, 2, $aXY[0], $aXY[1], $SWP_NOZORDER) ;This work in CASE A _WinAPI_SetWindowPos($idListview, 0, 2, 2, $aXY[0], $aXY[1], $SWP_NOZORDER) ;This work in CASE B ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example conclusion: if you use _GUICtrlListView_Create then _WinAPI_SetWindowPos($idListview, 0, 2, 2, $aXY[0], $aXY[1], $SWP_NOZORDER) else if you use GUICtrlCreateListView then _WinAPI_SetWindowPos(GUICtrlGetHandle($idListview), 0, 2, 2, $aXY[0], $aXY[1], $SWP_NOZORDER)1 point -
AutoIt Snippets
TheDcoder reacted to argumentum for a topic
..on my side, I'll be putting something like this: to simply add water a prefix _HiDpi_GUICtrlCreateSomething() and make it instantly coffee HiDpi ready ...unless @TheDcoder jumps the gun and gets it done. It'll take me time to get this functional. But the easier the addendum ( so to call it ), the more testers we'll have to know if it ( @UEZ's code ) works everywhere1 point