Leaderboard
Popular Content
Showing content with the highest reputation on 08/08/2025 in all areas
-
Open all files starting with "0" in subfolder?
pixelsearch and 2 others reacted to Diana (Cda) for a topic
Thank you so much for everyone's kind help! Apologies in delay in replying, I don't know what I was doing wrong, but it was like beating my head against the wall somehow (my mom passed away 3 months ago, so suspect I was also just having trouble with details, who knows <sigh>). But I came back to this again. When I leave my apartment, I like to shut down all things running apps in the systray except what's there "automatically", as it were. Then when I come home, start up those extra things I like to have running when I'm around. Ultimately, pixelsearch kindly wrote up the code to include that TRUE statement which escaped me because of the presentation before as just describing what to do (and I see now I must still have been affected by mom's passing as I just couldn't make heads or tails of that). Here is the what worked just now, but I removed the suggested "_ArrayDisplay($array)" line as that created some havoc, too, and I find it's not really necessary, just an extra confusing step, it seems. #include <file.au3> #include <Array.au3> Local $array = _FileListToArray(@ScriptDir & "\Startup\", "0*.*", 1, TRUE) ;_ArrayDisplay($array) For $i = 1 To $array[0] ShellExecute($array[$i]) Next Thank you!3 points -
@pixelsearch let me think tomorrow about it. I changed a lot of internal functions from str to wstr to support unicode filenames and all examples must be touched otherwise crash. Currently I'm writing on an example in Freebasic (WebP Encoder GUI) how to use the DLL. Freebasic WebP DLL source code (my written DLL stuff, Google WebP dll will be linked as static library to my DLL) and other stuff can be found on my OneDrive, if you want to have a look under the hood.2 points
-
GUICtrlCreateListView Problem loading data, first line of column # is deleted
pixelsearch reacted to angel83 for a topic
Thank you so much, Pixelsearch. Your solution is fantastic. It worked wonders for me, and my problem was solved. I was desperate after trying so many things and nothing. I really appreciate your help, Pixelsearch.1 point -
Hour AM/PM ( yes, one more of these )
Numeric1 reacted to argumentum for a topic
; #FUNCTION# ==================================================================================================================== ; Name...........: HourAmPm ; Description....: Converts a time in 24-hour format to AM/PM format. ; Syntax.........: HourAmPm( $sDateTime [, $sAmPm = "AM|PM" [, $iTrimRight = 0]] ) ; Parameters.....: $sDateTime - The time (with date or not) string with "HH:" in it. ; $sAmPm - [optional] The AM/PM representation (default is "AM|PM"). ; $iTrimRight - [optional] The number of characters to trim from the right of the result (default is 0). ; $iNoDate - [optional] Whether to omit the date from the output. Defaults to False. ; Return values .: Success: Returns the formatted date and time in AM/PM format. ; Failure: None. ; Author ........: argumentum ; Modified ......: ; Remarks .......: This function takes a 24-hour time string, converts it to AM or PM format, and returns the result with optional trimming. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=213061 ; Example .......: MsgBox(64, "Converted Time", HourAmPm("12/31/1999 18:59:59")) ; =============================================================================================================================== Func HourAmPm($sDateTime, $sAmPm = Default, $iTrimRight = Default, $iNoDate = Default) Local $aAmPm = StringSplit((StringInStr($sAmPm, "|") ? $sAmPm : "AM|PM"), "|"), $sFormat = $aAmPm[2] Local $iHourPos = StringInStr($sDateTime, ":"), $sHour = StringMid($sDateTime, $iHourPos - 2, 2) Local $sDate = StringLeft($sDateTime, $iHourPos - 3), $sTime = StringTrimLeft($sDateTime, $iHourPos - 1) If $sHour < 12 Then $sFormat = $aAmPm[1] ; https://www.autoitscript.com/forum/index.php?showtopic=213061 $sHour = Mod($sHour, 12) If Not $sHour Then $sHour = 12 Return StringTrimRight((Int($iNoDate) ? "" : $sDate) & StringRight('0' & $sHour, 2) & $sTime, Int($iTrimRight)) & " " & $sFormat EndFunc ;==>HourAmPm ...am always looking for these ( because am disorganized ) and when I find them they are more than needed so, I decided to simplify it and flexibly-cate** it. All that's needed is the hour, the rest of the date-time string should be anything as long as there is a "HH:" in it. ; Examples: ConsoleWrite('- ' & HourAmPm("18:59") & @CRLF) ; - 06:59 PM ConsoleWrite('- ' & HourAmPm("18:59:59.999") & @CRLF) ; - 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999") & @CRLF) ; - 1999/12/31 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59", Default, 3) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("12/31/1999 18:59", "a|p") & @CRLF) ; - 12/31/1999 06:59 p ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7, True) & @CRLF) ; - 06:59 PM Don't remember seeing this approach anywhere so I decided to share it **flexibly-cate [verb] To make it flexible1 point -
A Non-Strict JSON UDF (JSMN)
DonChunior reacted to TheXman for a topic
I apologize. I just rechecked my version. It looks like I did make a small change back in 2022 that fixed this (and other) issues. I haven't used this UDF for processing JSON datasets in several years, so I must have forgotten about the modification. Here is the version I used: Json(2022.09.18).au31 point -
GUICtrlCreateListView Problem loading data, first line of column # is deleted
angel83 reacted to pixelsearch for a topic
Good news I found a way to display the vertical line constantly while dragging the horizontal scrollbar, with very few flickering. To do this : 1) Add the extended style $LVS_EX_DOUBLEBUFFER to your line _GUICtrlListView_SetExtendedListViewStyle(...) 2) In the code of my preceding post, please change one line as indicated below : ; If BitAND($wParam, 0xFFFF) = 0x4 Then ; LoWord . $SB_THUMBPOSITION = 0x4 . Msdn : "the user has dragged the scroll box (thumb) and released the mouse button" If BitAND($wParam, 0xFFFF) = 0x5 Then ; LoWord . $SB_THUMBTRACK = 0x5 . Msdn : "the user is dragging the scroll box"1 point -
GUICtrlCreateListView Problem loading data, first line of column # is deleted
angel83 reacted to pixelsearch for a topic
@angel83 you did well posting a picture of the issue. I could reproduce your issue : there is a bad redrawing of the listview, when it got $LVS_EX_GRIDLINES in its extended styles. Now the vertical gridline can disappear momentarily when you scroll horizontally. I just found a very old thread (from 2007) where the issue was described. Now I just scripted a workaround which seems to help. It involves subclassing the listview scrollbars (which are child windows of the listview) but the result seems encouraging. My workaround is : when you release the mouse button from the scrollbar, then the listview is immediately redrawn and the vertical gridline reappears. If you absolutely want the vertical line to appear constantly while using the horizontal scrollbar, then it is possible but the listview will flicker because of too many redraws while scrolling. To keep it simple, I suggest to redraw the listview only once, when you release the mouse button from the scrollbar. The lines for subclassing the listview scrollbars are : #include <WinAPIShellEx.au3> ... Local $pListViewCallback = DllCallbackGetPtr(DllCallbackRegister("ListViewCallback", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr")) _WinAPI_SetWindowSubclass(GUICtrlGetHandle($hListView), $pListViewCallback, 9999, 0) GUISetState(@SW_SHOW) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Button206 ExitLoop Case $OkButton _FillList() EndSwitch WEnd _WinAPI_RemoveWindowSubclass(GUICtrlGetHandle($hListView), $pListViewCallback, 9999) ;============================================== Func ListViewCallback($hWnd, $iMsg, $wParam, $lParam, $iSubclassId, $pData) #forceref $iSubclassId, $pData Switch $iMsg Case $WM_HSCROLL ; , $WM_VSCROLL If BitAND($wParam, 0xFFFF) = 0x4 Then ; LoWord . $SB_THUMBPOSITION = 0x4 . Msdn : "the user has dragged the scroll box (thumb) and released the mouse button" _WinAPI_RedrawWindow($hWnd) EndIf EndSwitch Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>ListViewCallback Good luck1 point