Leaderboard
Popular Content
Showing content with the highest reputation on 06/09/2014 in all areas
-
While we're practicing necromancy, I'll alert you that sometimes when copying code to the forum it removes the includes. It's either a text editing mode and or quotes verse <> include openers. It may even be fixed by now, I have no idea.1 point
-
It doesnt look like anyone has pointed this out, but you have 5 includes with no value. EDIT: This code works. #include <GUIConstantsEx.au3> $TFarbe = 0xC0C0C0 $HFarbe = 0x000000 $TFarbeH = 7 $HFarbeH = 0 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Test", 692, 211, 175, 144) $Button1 = GUICtrlCreateButton("", 8, 32, 25, 25) GUICtrlSetBkColor(-1, 0x000000) $Button3 = GUICtrlCreateButton("", 40, 32, 25, 25) GUICtrlSetBkColor(-1, 0x000080) $Button4 = GUICtrlCreateButton("", 72, 32, 25, 25) GUICtrlSetBkColor(-1, 0x008000) $Button5 = GUICtrlCreateButton("", 104, 32, 25, 25) GUICtrlSetBkColor(-1, 0x008080) $Button6 = GUICtrlCreateButton("", 136, 32, 25, 25) GUICtrlSetBkColor(-1, 0x800000) $Button7 = GUICtrlCreateButton("", 168, 32, 25, 25) GUICtrlSetBkColor(-1, 0x800080) $Button8 = GUICtrlCreateButton("", 200, 32, 25, 25) GUICtrlSetBkColor(-1, 0x808000) $Button9 = GUICtrlCreateButton("", 232, 32, 25, 25) GUICtrlSetBkColor(-1, 0xC0C0C0) $Button10 = GUICtrlCreateButton("", 264, 32, 25, 25) GUICtrlSetBkColor(-1, 0x808080) $Button11 = GUICtrlCreateButton("", 296, 32, 25, 25) GUICtrlSetBkColor(-1, 0x0000FF) $Button12 = GUICtrlCreateButton("", 328, 32, 25, 25) GUICtrlSetBkColor(-1, 0x00FF00) $Button13 = GUICtrlCreateButton("", 360, 32, 25, 25) GUICtrlSetBkColor(-1, 0x00FFFF) $Button14 = GUICtrlCreateButton("", 392, 32, 25, 25) GUICtrlSetBkColor(-1, 0xFF0000) $Button15 = GUICtrlCreateButton("", 424, 32, 25, 25) GUICtrlSetBkColor(-1, 0xFF00FF) $Button16 = GUICtrlCreateButton("", 456, 32, 25, 25) GUICtrlSetBkColor(-1, 0xFFFF00) $Button17 = GUICtrlCreateButton("", 488, 32, 25, 25) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button2 = GUICtrlCreateButton("", 488, 100, 25, 25) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button18 = GUICtrlCreateButton("", 104, 100, 25, 25) GUICtrlSetBkColor(-1, 0x008080) $Button19 = GUICtrlCreateButton("", 168, 100, 25, 25) GUICtrlSetBkColor(-1, 0x800080) $Button20 = GUICtrlCreateButton("", 136, 100, 25, 25) GUICtrlSetBkColor(-1, 0x800000) $Button21 = GUICtrlCreateButton("", 8, 100, 25, 25) GUICtrlSetBkColor(-1, 0x000000) $Button22 = GUICtrlCreateButton("", 40, 100, 25, 25) GUICtrlSetBkColor(-1, 0x000080) $Button23 = GUICtrlCreateButton("", 72, 100, 25, 25) GUICtrlSetBkColor(-1, 0x008000) $Button24 = GUICtrlCreateButton("", 200, 100, 25, 25) GUICtrlSetBkColor(-1, 0x808000) $Button25 = GUICtrlCreateButton("", 232, 100, 25, 25) GUICtrlSetBkColor(-1, 0xC0C0C0) $Button26 = GUICtrlCreateButton("", 264, 100, 25, 25) GUICtrlSetBkColor(-1, 0x808080) $Button27 = GUICtrlCreateButton("", 296, 100, 25, 25) GUICtrlSetBkColor(-1, 0x0000FF) $Button28 = GUICtrlCreateButton("", 328, 100, 25, 25) GUICtrlSetBkColor(-1, 0x00FF00) $Button29 = GUICtrlCreateButton("", 360, 100, 25, 25) GUICtrlSetBkColor(-1, 0x00FFFF) $Button30 = GUICtrlCreateButton("", 392, 100, 25, 25) GUICtrlSetBkColor(-1, 0xFF0000) $Button31 = GUICtrlCreateButton("", 424, 100, 25, 25) GUICtrlSetBkColor(-1, 0xFF00FF) $Button32 = GUICtrlCreateButton("", 456, 100, 25, 25) GUICtrlSetBkColor(-1, 0xFFFF00) $Label1 = GUICtrlCreateLabel("Wähle die Textfarbe", 8, 8, 125, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Wähle die Hintergrundfarbe", 9, 71, 168, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Button34 = GUICtrlCreateButton("", 536, 32, 137, 97) GUICtrlSetBkColor(-1, $HFarbe) GUICtrlSetState(-1, $GUI_DISABLE) $Label3 = GUICtrlCreateLabel("AaBbCc", 544, 64, 122, 41) GUICtrlSetFont(-1, 27, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, $TFarbe) GUICtrlSetBkColor(-1, $HFarbe) $OK = GUICtrlCreateButton("OK", 224, 160, 105, 33) $Abbrechen = GUICtrlCreateButton("Abbrechen", 352, 160, 105, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Abbrechen Exit Case $OK GUICtrlDelete($Form1) Run("cmd.exe") $cmdpromptwintitle = WinGetTitle( "cmd.exe" , "" ) Sleep(100) WinSetState( $cmdpromptwintitle, "", @SW_ENABLE ) WinWaitActive($cmdpromptwintitle) Sleep(100) Send("color ") Send($HFarbeH) Send($TFarbeH) Send("{ENTER}") Exit Case $Button1 $TFarbe = 0x000000 $TFarbeH = 0 GUICtrlSetColor($Label3, $TFarbe) Case $Button3 $TFarbe = 0x000080 $TFarbeH = 1 GUICtrlSetColor($Label3, $TFarbe) Case $Button4 $TFarbe = 0x008000 $TFarbeH = 2 GUICtrlSetColor($Label3, $TFarbe) Case $Button5 $TFarbe = 0x008080 $TFarbeH = 3 GUICtrlSetColor($Label3, $TFarbe) Case $Button6 $TFarbe = 0x800000 $TFarbeH = 4 GUICtrlSetColor($Label3, $TFarbe) Case $Button7 $TFarbe = 0x800080 $TFarbeH = 5 GUICtrlSetColor($Label3, $TFarbe) Case $Button8 $TFarbe = 0x808000 $TFarbeH = 6 GUICtrlSetColor($Label3, $TFarbe) Case $Button9 $TFarbe = 0xC0C0C0 $TFarbeH = 7 GUICtrlSetColor($Label3, $TFarbe) Case $Button10 $TFarbe = 0x808080 $TFarbeH = 8 GUICtrlSetColor($Label3, $TFarbe) Case $Button11 $TFarbe = 0x0000FF $TFarbeH = 9 GUICtrlSetColor($Label3, $TFarbe) Case $Button12 $TFarbe = 0x00FF00 $TFarbeH = 0x41 GUICtrlSetColor($Label3, $TFarbe) Case $Button13 $TFarbe = 0x00FFFF $TFarbeH = 0x42 GUICtrlSetColor($Label3, $TFarbe) Case $Button14 $TFarbe = 0xFF0000 $TFarbeH = 0x43 GUICtrlSetColor($Label3, $TFarbe) Case $Button15 $TFarbe = 0xFF00FF $TFarbeH = 0x44 GUICtrlSetColor($Label3, $TFarbe) Case $Button16 $TFarbe = 0xFFFF00 $TFarbeH = 0x45 GUICtrlSetColor($Label3, $TFarbe) Case $Button17 $TFarbe = 0xFFFFFF $TFarbeH = 0x46 GUICtrlSetColor($Label3, $TFarbe) Case $Button2 $HFarbe = 0xFFFFFF $HFarbeH = 0x46 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button18 $HFarbe = 0x008080 $HFarbeH = 3 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button19 $HFarbe = 0x800080 $HFarbeH = 5 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button20 $HFarbe = 0x800000 $HFarbeH = 4 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button21 $HFarbe = 0x000000 $HFarbeH = 0 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button22 $HFarbe = 0x000080 $HFarbeH = 1 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button23 $HFarbe = 0x008000 $HFarbeH = 2 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button24 $HFarbe = 0x808000 $HFarbeH = 6 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button25 $HFarbe = 0xC0C0C0 $HFarbeH = 7 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button26 $HFarbe = 0x808080 $HFarbeH = 8 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button27 $HFarbe = 0x0000FF $HFarbeH = 9 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button28 $HFarbe = 0x00FF00 $HFarbeH = 0x41 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button29 $HFarbe = 0x00FFFF $HFarbeH = 0x42 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button30 $HFarbe = 0xFF0000 $HFarbeH = 0x43 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button31 $HFarbe = 0xFF00FF $HFarbeH = 0x44 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) Case $Button32 $HFarbe = 0xFFFF00 $HFarbeH = 0x45 GUICtrlSetBkColor($Button34, $HFarbe) GUICtrlSetBkColor($Label3, $HFarbe) EndSwitch WEnd I added a Wingettitle code for you so that your program will work better as well as the include. I should let you know that not all colors are going to work as long as you are using the hex values. I do not have time to completely re-write the code for you, but I hope this at least helps and answers your question. Ich hoffe, dass die oben genannte Lösung für Sie arbeitet. Das Problem ist, dass Sie wissen, die Codes für die Eingabeaufforderung nicht. Aber das Skript funktioniert. Ich bin mit einem Übersetzer. Ich hoffe, das bedeutet auch.1 point
-
There is a bug in >_GDIPlus_Startup() for Vista and Server 2008. Use _GDIPlus_Startup("gdiplus.dll") and it should work. #include <ScreenCapture.au3> Example() Func Example() ; Capture full screen _GDIPlus_Startup("gdiplus.dll") _ScreenCapture_Capture("C:\blap\GDIPlus_Image1.jpg") ShellExecute("C:\blap\GDIPlus_Image1.jpg") ; Capture region _ScreenCapture_Capture("c:\blap\GDIPlus_Image2.jpg", 0, 0, 796, 596) ShellExecute("c:\blap\GDIPlus_Image2.jpg") _GDIPlus_Shutdown() EndFunc ;==>Example Br, UEZ1 point
-
This could be interesting: ;declare main array that will hold your values: dim $mainArray[20] ;set 20 different data on each element of the array (you'll have 20) $mainArray[0] = _CreateNewObject(1, 0, 1);250 $mainArray[1] = _CreateNewObject(0, 1, 1);500 $mainArray[2] = _CreateNewObject(0, 1, 0);750 $mainArray[3] = _CreateNewObject(0, 1, 0);1000 $mainArray[4] = _CreateNewObject(0, 1, 0);etc... $mainArray[5] = _CreateNewObject(0, 1, 0) $mainArray[6] = _CreateNewObject(0, 1, 0) $mainArray[7] = _CreateNewObject(0, 1, 0) $mainArray[8] = _CreateNewObject(0, 1, 0) $mainArray[9] = _CreateNewObject(0, 1, 0) $mainArray[10] = _CreateNewObject(0, 1, 0) $mainArray[11] = _CreateNewObject(0, 1, 0) $mainArray[12] = _CreateNewObject(0, 1, 0) $mainArray[13] = _CreateNewObject(0, 1, 0) $mainArray[14] = _CreateNewObject(0, 1, 0) $mainArray[15] = _CreateNewObject(0, 1, 0) $mainArray[16] = _CreateNewObject(0, 1, 0) $mainArray[17] = _CreateNewObject(0, 1, 0) $mainArray[18] = _CreateNewObject(0, 1, 0) $mainArray[19] = _CreateNewObject(0, 1, 0) ;----------------------------------------------------------- ;how to pull data out of this? $randNumber = Random(250, 5000, 1) $div = Round($randNumber / 250, 0) - 1; ConsoleWrite("!!!--------------------------------" & @CRLF & ">> Our number is: " & $randNumber & " (div is: " & $div & ", for var " & ($div+1)*250 & ")" & @CRLF & @CRLF) $readData = _ReadObject($mainArray[$div]); ConsoleWrite("!> RED: " & @TAB & $readData[0] & @CRLF) ConsoleWrite(".> BLACK: " & @TAB & $readData[1] & @CRLF) ConsoleWrite("-> YELLOW: " & @TAB & $readData[2] & @CRLF) ;----------------------------------------------------------- ;Release the resources used by the structure. _ClearArray($mainArray) ;================================================================================ Func _ReadObject($tSTRUCT1) Local $_red = DllStructGetData($tSTRUCT1, "red") Local $_black = DllStructGetData($tSTRUCT1, "black") Local $_yellow = DllStructGetData($tSTRUCT1, "yellow") dim $retArray[3] = [$_red, $_black, $_yellow] Return $retArray; EndFunc Func _CreateNewObject($_red, $_black, $_yellow) Local Const $tagSTRUCT1 = "struct;int red;int black;int yellow;endstruct" Local $tSTRUCT1 = DllStructCreate($tagSTRUCT1) DllStructSetData($tSTRUCT1, "red", $_red) DllStructSetData($tSTRUCT1, "black", $_black) DllStructSetData($tSTRUCT1, "yellow", $_yellow) Return $tSTRUCT1 EndFunc Func _ClearArray(ByRef $_array) if (UBound($_array) <= 0) Then Return For $singleStruct in $_array $singleStruct = 0 Next ReDim $_array[0] EndFunc1 point
-
murabio, Welcome to the AutoIt forums. As JohnOne has demonstrated, GUICtrlSetData will accept @CRLF. Your problem was that an Input control is an Edit control forced to show only a single-line - using the $ES_MULTILINE style overrides this limitation and creates a standard multi-line Edit control which will show the additional lines. M231 point
-
Kovacic, Glad you like the UDF. M23 P.S. If you were referring to funkey's excellent code, then please do not reply and let me keep my illusions.1 point
-
1 point
-
AutoIt v3.3.12.0 has been released. Thanks to everyone involved - there's been a lot of effort in the help file, UDF library and build scripts by many under-appreciated individuals. Download it here. Complete list of changes: History1 point
-
How do I get just the directories that contains .inf files?
doestergaard reacted to DXRW4E for a topic
official way will have to be this #include <Array.au3> If Not IsDeclared("arDllCall") Then Global Static $arDllCall EndIf Global Const $hSetupApiDll = DllOpen("SetupApi.dll") Global Const $hKernel32DLL = DllOpen("Kernel32.dll") Global Const $ERROR_INSUFFICIENT_BUFFER = 122 ;(0x7A) - The data area passed to a system call is too small. Local $aInfFieList =_FileListToArrayEx(@WindowsDir & "\inf", "*.Inf", 13) _ArrayDisplay($aInfFieList) MsgBox(0, 1, _SetupGetInfFileList(Null)) Local $sInfFieList, $aDirectoryPath = _FileListToArrayEx(@WindowsDir & "\inf", "*", 14) If Not @Error Then For $i = 1 To $aDirectoryPath[0] $sInfFieList &= _SetupGetInfFileList($aDirectoryPath[$i]) Next EndIf MsgBox(0, 1, $sInfFieList) ; #FUNCTION# ======================================================================================================================================================= ; Name...........: _FileListToArrayEx ; Description ...: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) ; Syntax.........: _FileListToArrayEx($sPath[, $sFilter = "*"[, $iFlag = 0]]) ; Parameters ....: $sPath - Path to generate filelist for. ; $sFilter - Optional the filter to use, default is *. (Multiple filter groups such as "All "*.png|*.jpg|*.bmp") Search the Autoit3 helpfile for the word "WildCards" For details. ; $iFlag - Optional: specifies whether to return files folders or both Or Full Path (add the flags together for multiple operations): ; |$iFlag = 0 (Default) Return both files and folders ; |$iFlag = 1 Return files only ; |$iFlag = 2 Return Folders only ; |$iFlag = 4 Search SubDirectory ; |$iFlag = 8 Return Full Path ; |$iFlag = 16 $sFilter do Case-Sensitive matching (By Default $sFilter do Case-Insensitive matching) ; |$iFlag = 32 Disable the return the count in the first element - effectively makes the array 0-based (must use UBound() to get the size in this case). ; By Default the first element ($array[0]) contains the number of file found, the remaining elements ($array[1], $array[2], etc.) ; |$iFlag = 64 $sFilter is REGEXP Mod, See Pattern Parameters in StringRegExp (Can not be combined with flag 16) ; |$iFlag = 128 Return Backslash at the beginning of the file name, example Return "\Filename1.xxx" (Can not be combined with flag 8) ; Return values .: Failure - @Error ; |1 = Path not found or invalid ; |2 = Invalid $sFilter ; |3 = No File(s) Found ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: The array returned is one-dimensional and is made up as follows: ; $array[0] = Number of Files\Folders returned ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; Related .......: ; Link ..........: ; Example .......: Yes ; Note ..........: Special Thanks to SolidSnake & Tlem ; ================================================================================================================================================================== Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0) Local Const $hSR = StringRegExpReplace $sPath = $hSR($sPath & "\", "(?!\A)[\\/]+\h*", "\\") If Not FileExists($sPath) Then Return SetError(1, 1, "") If StringRegExp($sFilter, (BitAND($iFlag, 64) ? '^\s*$|\v|[\\/:><"]|^\||\|\||\|$' : '^\s*$|\v|\\')) Then Return SetError(2, 2, "") Local $hSearch, $sFile, $sFileList, $sSubDir = BitAND($iFlag, 4), $sDelim = (BitAND($iFlag, 128) ? "|\" : (BitAND($iFlag, 8) ? "|" & $sPath : "|")) $hSearch = FileFindFirstFile($sPath & "*") If @Error Then Return SetError(3, 3, "") Local $hWSearch = $hSearch, $hWSTMP, $SearchWD, $iExtended, $iFlags = (BitAND($iFlag, 3) = 3 ? 0 : BitAND($iFlag, 3)), $iFilter = $sFilter = "*" ? 0 : 1 If Not BitAND($iFlag, 64) Then $sFilter = (BitAND($iFlag, 16) ? "(" : "(?i)(") & $hSR($hSR($hSR($hSR($sFilter, "[^*?|]+", "\\Q$0\\E"), "\\E(?=\||$)", "$0\$"), "(?<=^|\|)\\Q", "^$0"), "\*+", ".*") & ")" While 1 $sFile = FileFindNextFile($hWSearch) If @Error Then If $hWSearch = $hSearch Then ExitLoop FileClose($hWSearch) $hWSearch -= 1 $SearchWD = StringLeft($SearchWD, StringInStr($SearchWD, "\", 1, -2)) ElseIf $sSubDir Then $iExtended = @Extended If ($iFlags + $iExtended <> 2) Then If $iFilter Then If StringRegExp($sFile, $sFilter) Then $sFileList &= $sDelim & $SearchWD & $sFile Else $sFileList &= $sDelim & $SearchWD & $sFile EndIf EndIf If Not $iExtended Then ContinueLoop $hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*") If $hWSTMP = -1 Then ContinueLoop $hWSearch = $hWSTMP $SearchWD &= $sFile & "\" ElseIf ($iFlags + @Extended) <> 2 And StringRegExp($sFile, $sFilter) Then $sFileList &= $sDelim & $sFile EndIf WEnd FileClose($hSearch) If Not $sFileList Then Return SetError(3, 3, "") Return StringSplit(StringTrimLeft($sFileList, 1), "|", StringReplace(BitAND($iFlag, 32), "32", 2)) EndFunc ;==>_FileListToArrayEx ; #FUNCTION# ============================================================================================================================================== ; Name...........: _SetupGetInfFileList ; Description ...: The SetupGetInfFileList function returns a list of INF files located in a caller-specified directory to a call-supplied buffer. ; Syntax.........: _SetupGetInfFileList($DirectoryPath, $InfStyle) ; Parameters ....: $DirectoryPath - Optional pointer to a null-terminated string containing the path of the directory in which to search. ; If this value is NULL, the %windir%\inf directory is used. ; $InfStyle - Type of INF file to search for. May be a combination of the following flags. ; |$INF_STYLE_OLDNT (1) - A legacy INF file format. ; |$INF_STYLE_WIN4 (2) - A Windows INF file format. ; Return values .: If the function succeeds, the return value is a String Inf file List value. ; Remarks .......: ; Related .......: ; Author ........: DXRW4E ; ========================================================================================================================================================= Func _SetupGetInfFileList($sDirectoryPath, $InfStyle = 2) $arDllCall = DllCall($hSetupApiDll, "BOOL", "SetupGetInfFileListW", "WSTR", $sDirectoryPath, "DWORD", $InfStyle, "WSTR", "", "DWORD", Null, "DWORD*", 0) If @Error Then Return SetError(@Error, 0, 0) ;If Not $arDllCall[0] And _WinAPI_GetLastErrorEx() = $ERROR_INSUFFICIENT_BUFFER Then $arDllCall = DllCall($hSetupApiDll, "BOOL", "SetupGetInfFileListW", "WSTR", $sDirectoryPath, "DWORD", $InfStyle, "WSTR", "", "DWORD", $arDllCall[5], "DWORD*", 0) ;If $arDllCall[0] Then Return SetError(0, $arDllCall[5], $arDllCall[3]) Local $ReturnBuffer = DllStructCreate("BYTE[" & $arDllCall[5] * 2 & "]") $arDllCall = DllCall($hSetupApiDll, "BOOL", "SetupGetInfFileListW", "WSTR", $sDirectoryPath, "DWORD", $InfStyle, "STRUCT*", $ReturnBuffer, "DWORD", $arDllCall[5], "DWORD*", 0) If $arDllCall[0] Then Return SetError(0, $arDllCall[5], StringRegExpReplace(BinaryToString(DllStructGetData($ReturnBuffer, 1), 2), "\x00+", @LF)) Return SetError(_WinAPI_GetLastErrorEx(), 0, -1) EndFunc ;==>_SetupGetInfFileList Func _WinAPI_GetLastErrorEx() $arDllCall = DllCall($hKernel32DLL, "long", "GetLastError") Return $arDllCall[0] EndFunc ;==>_WinAPI_GetLastErrorEx Ciao.1 point -
Use the proper hex notation as described in the HelpFile.1 point
-
Having a "browse" button in a GUI?
IhaVeNoCluE reacted to i542 for a topic
#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Browse Button Example", 303, 141, 193, 115) $Input1 = GUICtrlCreateInput("", 21, 19, 201, 21) $Button1 = GUICtrlCreateButton("Browse...", 235, 16, 64, 25, 0) $Group1 = GUICtrlCreateGroup("Browse what", 20, 44, 279, 63) $Radio1 = GUICtrlCreateRadio("Folder", 26, 60, 113, 17) $Radio2 = GUICtrlCreateRadio("File to open", 26, 74, 113, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button2 = GUICtrlCreateButton("Exit", 166, 111, 75, 25, 0) $Label1 = GUICtrlCreateLabel("i542 ", 0, 0, 27, 17, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $Button2 Exit Case $nMsg = $Button1 If GuiCtrlRead($Radio1) = $GUI_CHECKED Then $txt=FileSelectFolder( "Open", "C:\") GUICtrlSetData($Input1,$txt) ElseIf GuiCtrlRead($Radio2) = $GUI_CHECKED Then $txt=FileOpenDialog("Open", "C:\","Text files (*.txt)") GUICtrlSetData($Input1,$txt) Else MsgBox(64,"Browse button example","You must select something.") EndIf EndSelect WEnd Sony Ericsson T290i and J210i owner. i5421 point