Leaderboard
Popular Content
Showing content with the highest reputation on 09/14/2025 in all areas
-
I compiled Zint v2.15.09 source and it has 30 functions! ZBarcode_BarcodeName|0x0001CBA0 ZBarcode_Buffer|0x0001CC20 ZBarcode_Buffer_Vector|0x0001CC60 ZBarcode_Cap|0x0001CCA0 ZBarcode_Clear|0x0001D270 ZBarcode_Create|0x0001D390 ZBarcode_Default_Xdim|0x0001D3C0 ZBarcode_Delete|0x0001D5D0 ZBarcode_Dest_Len_ECI|0x0001D630 ZBarcode_Encode|0x0001D6D0 ZBarcode_Encode_File|0x0001D710 ZBarcode_Encode_File_and_Buffer|0x0001DB00 ZBarcode_Encode_File_and_Buffer_Vector|0x0001DB50 ZBarcode_Encode_File_and_Print|0x0001DBA0 ZBarcode_Encode_Segs|0x0001DBE0 ZBarcode_Encode_Segs_and_Buffer|0x0001E890 ZBarcode_Encode_Segs_and_Buffer_Vector|0x0001E8F0 ZBarcode_Encode_Segs_and_Print|0x0001E950 ZBarcode_Encode_and_Buffer|0x0001E990 ZBarcode_Encode_and_Buffer_Vector|0x0001EA10 ZBarcode_Encode_and_Print|0x0001EA90 ZBarcode_HaveGS1SyntaxEngine|0x0001EAF0 ZBarcode_NoPng|0x0001EB00 ZBarcode_Print|0x0001EB10 ZBarcode_Reset|0x0001EC30 ZBarcode_Scale_From_XdimDp|0x0001ECA0 ZBarcode_UTF8_To_ECI|0x0001EE80 ZBarcode_ValidID|0x0001EF40 ZBarcode_Version|0x0001EF80 ZBarcode_XdimDp_From_Scale|0x0001EF90 I will update the code in the next days. I compiled also a x64 Zint DLL but I don't know if it is working yet...3 points
-
Disable combobox selection frame
WildByDesign and one other reacted to argumentum for a topic
#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ComboConstants.au3> Local $hGUI = GUICreate("COMBOBOX", 500, 500) GUISetBkColor(0xE9E6DF) Local $idBttnFocus = GUICtrlCreateButton("=P", -20, -20, 5, 5) ; my trick Local $idComboBox = GUICtrlCreateCombo("Item 1", 100, 200, 260, 20, $CBS_DROPDOWNLIST) GUICtrlSetFont(-1, 18, 700, 0, "Segoe UI", 4) GUICtrlSetData($idComboBox, "COMBOBOX|COMBOBOX1|COMBOBOX2|COMBOBOX3", "COMBOBOX") ; WildByDesign ;~ Global Const $WM_CHANGEUISTATE = 0x0127 ;~ GUICtrlSendMsg($idComboBox, $WM_CHANGEUISTATE, 65537, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) ..am a bit late but, this is what I use.2 points -
Disable combobox selection frame
argumentum and one other reacted to WildByDesign for a topic
GUICtrlSendMsg($idComboBox, $WM_CHANGEUISTATE, 65537, 0) Try this.2 points -
💡 Did You Know AutoIt’s Truthiness Rules Can Surprise You? Did you know that in AutoIt an empty string is considered False, but the string "0" is treated as True? Or that Not $variable might not behave the way you expect? 🔍 Understanding Logical Expression Evaluation in AutoIt When working with AutoIt, one subtle but important point is how values are converted and evaluated in logical expressions. 👉 AutoIt does have a dedicated Boolean type (True/False). True and False are not just integers — they belong to the Boolean type, as VarGetType(True) shows. However, AutoIt is a dynamically typed language and performs implicit type conversions. Numbers, strings, arrays, maps, and other data types can all be converted into a Boolean when required (e.g., in If or While statements). This is why Boolean behavior can sometimes look surprising if you expect stricter typing. 1️⃣ Boolean Values in AutoIt AutoIt defines two Boolean constants: True and False. Internally, they often behave like 1 and 0, but they are a separate data type. Example: Local $v1 = True Local $v2 = False ConsoleWrite(VarGetType($v1) & " / " & VarGetType($v2) & @CRLF) ; Outputs: Boolean / Boolean Compare returning integers vs. Booleans: Func retInt() Return 1 EndFunc Func retBool() Return True EndFunc ConsoleWrite(VarGetType(retInt()) & @CRLF) ; Int32 ConsoleWrite(VarGetType(retBool()) & @CRLF) ; Boolean 2️⃣ Truthiness Rules (Implicit Conversion) When a value is evaluated in a Boolean context (If, While, Not, etc.), AutoIt converts it to a Boolean according to fixed rules. "" (empty string) → False 0 (numeric) → False Any other non-empty string → True Any non-zero number → True But that’s not all. Other types can also convert to False: Empty array Empty map Default Ptr(0) Certain invalid DllStruct values Function pointers when not valid ✅ Examples: If "" Then MsgBox(0, "Test", "This will NOT show") ; False If "hello" Then MsgBox(0, "Test", "This WILL show") ; True If 0 Then MsgBox(0, "Test", "This will NOT show") ; False If -1 Then MsgBox(0, "Test", "This WILL show") ; True Global $aArray[1] If $aArray Then MsgBox(0, "", "Array = True") ; Won’t show, empty array = False 3️⃣ What Does Not Do? The Not operator inverts the Boolean value of its operand. ConsoleWrite(Not "" & @CRLF) ; 1 (True) ConsoleWrite(Not "abc" & @CRLF) ; 0 (False) ConsoleWrite(Not 0 & @CRLF) ; 1 (True) ConsoleWrite(Not 123 & @CRLF) ; 0 (False) 👉 In plain words: Not $variable = “is this variable empty, zero, or otherwise converted to False?” 4️⃣ Real Example: UDF _PathFull In the standard UDF File.au3, the function _PathFull contains this line: If Not $sRelativePath Or $sRelativePath = "." Then Return $sBasePath This handles two cases: $sRelativePath is "" → return the base path. $sRelativePath is "." → return the base path (current directory). It works because AutoIt treats an empty string as False. 5️⃣ Common Pitfalls ❌ Pitfall 1: Thinking False is just 0 Local $x = False If $x Then MsgBox(0, "Result", "Will this show?") ; Will not run, but VarGetType(False) = Boolean, not Int32 ❌ Pitfall 2: Forgetting that "0" (string) is True If "0" Then MsgBox(0, "Result", "This WILL show!") ; Non-empty string = True ; But numeric 0 would be False. ❌ Pitfall 3: Misunderstanding Not Local $val = "hello" If Not $val Then MsgBox(0, "Result", "Will this show?") ; Never runs because "hello" converts to True EndIf ✅ Key Takeaways AutoIt has a Boolean type (True/False). In logical expressions, values of other types are implicitly converted to Boolean. Conversion rules: "" and 0 → False Empty array, empty map, Default, Ptr(0) and similar → False Everything else → True Not $var = “is this variable False after conversion?” 📝 Conclusion Understanding AutoIt’s implicit type conversion to Boolean is essential for writing reliable conditions. 👉 Pro Tip: Use implicit truthiness for quick checks, but when clarity matters, be explicit: Use StringLen() to check if a string is empty. Use =, <>, etc. for precise comparisons. Use VarGetType() to confirm whether you’re working with Boolean or another type. This ensures your intent is clear and avoids bugs caused by AutoIt’s flexible but sometimes surprising rules. 💬 Final Note: If I’ve misunderstood or overlooked something, please share your thoughts — I’d be happy to update and improve this article!1 point
-
Disable combobox selection frame
argumentum reacted to mutleey for a topic
A very good trick too argumentum.1 point -
Disable combobox selection frame
WildByDesign reacted to mutleey for a topic
thanks WildByDesign, it worked perfectly!1 point -
I just came across some odd behavior when automating a third party software app. On this third party app, there's a dialog with an edit control where you can enter an ID number that's 9 digits long. As soon as you enter the 9th digit the app immediately checks to see if it recognizes the ID as being an existing customer and if it does, it pops up a modal Yes/No window asking if you want to autofill the customer's information on the rest of the dialog. This popup correctly occurs whether my AutoIt app fills the edit control with 9 digits using ControlSetText or ControlSend. My AutoIt app needs to know whether the popup happens in order to determine its next action, so I follow the ControlSetText or ControlSend with a WinWait call looking for the popup, with a 2 second timeout. Here's where the odd behavior comes. If I fill the edit control using ControlSetText and the popup window appears, my WinWait doesn't start looking for the popup window until after the user has clicked Yes or No on it (and thereby dismissed the window). The AutoIt app just sits there idle the entire time that the Yes/No window is visible. Then as soon as the user clicks Yes or No (and dismisses the modal window), the WinWait immediately begins looking for that (now dismissed) window and of course never finds it. If I instead fill the edit control with ControlSend, AutoIt doesn't hang while the Yes/No window is visible, and WinWait immediately finds the window as expected. My guess is that the 3rd party app is popping up the modal Yes/No window before the original dialog can provide the return code from ControlSetText's underlying SendMessage command (probably due to some improper subclassing in the 3rd party app that shows the popup dialog before allowing the WndProc function to complete its operation and return a value). As a result, AutoIt is left sitting there waiting for that message before the ControlSetText function completes and it can move on to the next line of the script. Once the user dismisses the modal Yes/No window and the original dialog can continue, the return code gets received by AutoIt, the ControlSetText command finishes, and the script continues. With the ControlSend command, AutoIt apparently doesn't get stuck waiting for a return message, and can proceed with finding the window and acting accordingly. So I'm not looking for a solution, since using ControlSend is the workaround. Just posting here in case someone else comes across something similar and is banging their head on the keyboard as I was.1 point
-
MustReturnArray()
Danyfirex reacted to argumentum for a topic
#include <WinAPIProc.au3> ; for the example Func MustReturnArray($aArray, $iColumns = 0, $iErr = @error, $iExt = @extended) If UBound($aArray) Then Return SetError($iErr, $iExt, $aArray) If $iColumns Then Dim $aArray[1][$iColumns] = [[0]] Else Dim $aArray[1] = [0] EndIf Return SetError($iErr, $iExt, $aArray) EndFunc ;==>MustReturnArray Exit MustReturnArray_Example() Func MustReturnArray_Example() ; worry free return Local $aWinList = WinList("nah, is not there") For $n = 1 To $aWinList[0][0] ConsoleWrite($aWinList[$n][1] & @TAB & $aWinList[$n][0] & @CRLF) Next ; worry free return Local $aProcessList = ProcessList("nah, is not there") For $n = 1 To $aProcessList[0][0] ConsoleWrite($aProcessList[$n][1] & @TAB & $aProcessList[$n][0] & @CRLF) Next ; solution ; create a "worry free return" Local $aArray = MustReturnArray(_WinAPI_EnumProcessWindows(4), 2) For $n = 1 To $aArray[0][0] ConsoleWrite($aArray[$n][1] & @TAB & $aArray[$n][0] & @CRLF) Next ; problem ; not a "worry free return" Local $aArray = _WinAPI_EnumProcessWindows(4) For $n = 1 To $aArray[0][0] ConsoleWrite($aArray[$n][1] & @TAB & $aArray[$n][0] & @CRLF) Next EndFunc ;==>MustReturnArray_Example Before I start with my problem ( and solution ), a big thank you to everyone coding these UDFs. AutoIt would not be what it is without them. ... a coder should always check @error, but is a pain, or not. In any case, the internal AutoIt functions return an array even if nothing there when an array is what it returns on success. Am so used to it, that when I use a UDF function I have to RTFM and I don't like reading ( nor writing but here we are 🤷♂️ ) How should I solve this problem given my coding style that does not include a failing function returning a zero stead of the array I was expecting. AutoIt does it, why does the UDFs not do it ?, ... must be a professional coders thing but, am a scripter. I write scripts. So, if it should return an array, then MustReturnArray() !. I hope this idea/function helps you avoid the " ==> Subscript used on non-accessible variable. " and/or simplify your code1 point