Leaderboard
Popular Content
Showing content with the highest reputation on 04/30/2016 in all areas
-
Hello, I just made another TCP server. I will use the server for data collection and a lot of clients can get the data from TCP. I now use it for UDP broadcast some devices to get their IP's. You can also use it for chat's. It is very low level, but so you have more options than with the pure AutoIt functions. Just start the server in SciTE to see the console outputs. Then you can start up to 63 clients to talk to the server. I hope you like it. Server script: #include "socket_UDF.au3" ;funkey 2013.06.21 _WSAStartup() Global $iSocket Global $iReturn Global $iPort = 20500 Global $sIP_Connected Global $iPort_Connected Global $tBuffer = DllStructCreate("char buffer[512]") $iSocket = _socket($AF_INET, $SOCK_STREAM, $IPPROTO_TCP) ConsoleWrite("Listen Socket: " & $iSocket & @CRLF) Global $tReUse = DllStructCreate("BOOLEAN reuse") DllStructSetData($tReUse, "reuse", True) ; enable reusing the same port $iReturn = _setsockopt($iSocket, $SOL_SOCKET, $SO_REUSEADDR, $tReUse) ; set reusing option for the port If $iReturn Then ConsoleWrite("SetSockOpt error setting reusing the same port!. Windows Sockets Error Codes: " & _WSAGetLastError() & @CRLF) EndIf $iReturn = _bind($iSocket, @IPAddress1, $iPort) ;local IP-Address and port to use If $iReturn Then ConsoleWrite("Bind error: " & $iReturn & @CRLF) ; 0 is OK EndIf $iReturn = _listen($iSocket, 1) If $iReturn Then ConsoleWrite("Listen error: " & $iReturn & @CRLF) ; 0 is OK EndIf Global $iNewSocket Global $tReadFds = DllStructCreate($tagFd_set) Global $tReadFds_Copy = DllStructCreate($tagFd_set) _FD_ZERO($tReadFds) _FD_SET($iSocket, $tReadFds) Global $iSocketMax = $iSocket Global $iSocketNow Global $sDataRcv While 1 DllCall('ntdll.dll', 'none', 'RtlMoveMemory', 'struct*', $tReadFds_Copy, 'struct*', $tReadFds, 'ULONG_PTR', DllStructGetSize($tReadFds)) $iReturn = _select($iSocketMax + 1, $tReadFds_Copy, 2000) ;timeout 2 seconds If _FD_ISSET($iSocket, $tReadFds_Copy) Then $iNewSocket = _accept($iSocket, $sIP_Connected, $iPort_Connected) _FD_SET($iNewSocket, $tReadFds) _FD_SHOW($tReadFds) If $iNewSocket > $iSocketMax Then $iSocketMax = $iNewSocket ConsoleWrite("New connected socket: " & $iNewSocket & @TAB & "IP: " & $sIP_Connected & @TAB & "Port: " & $iPort_Connected & @LF) EndIf For $i = 2 To DllStructGetData($tReadFds, "fd_count") $iSocketNow = DllStructGetData($tReadFds, "fd_array", $i) If _FD_ISSET($iSocketNow, $tReadFds_Copy) Then DllCall('ntdll.dll', 'none', 'RtlZeroMemory', 'struct*', $tBuffer, 'ULONG_PTR', DllStructGetSize($tBuffer)) If _recv($iSocketNow, $tBuffer) = $SOCKET_ERROR Then _closesocket($iSocketNow) _FD_CLR($iSocketNow, $tReadFds) Else $sDataRcv = DllStructGetData($tBuffer, 1) ConsoleWrite("Data received: " & $sDataRcv & @LF) If $sDataRcv == "CloseServer!" Then ExitLoop 2 EndIf EndIf EndIf Next WEnd For $i = 1 To DllStructGetData($tReadFds, "fd_count") _closesocket(DllStructGetData($tReadFds, "fd_array", $i)) Next _WSACleanup() Func _FD_SHOW(ByRef $tFd_set) For $i = 1 To DllStructGetData($tFd_set, "fd_count") ConsoleWrite($i & ":" & @TAB & DllStructGetData($tFd_set, "fd_array", $i) & @LF) Next EndFunc ;==>_FD_SHOWsocket_UDF and example.rar1 point
-
Link to pages with general resources description MSDN - Resources OverView & Reference You can embed any binary data into your AutoIt compiled EXE files in it's resources at compile time. As opposite to FileInstall() with resources you can use your embedded data directly without any temporary files on disk. If you wish you can save resources to disk with _ResourceSaveToFile() however. Adding data to resources can be done simply by AutoIt3Wrapper directive: #AutoIt3Wrapper_Res_File_Add=FileName, ResType, ResName As data can be used for example images,cursors,texts,sounds,videos,binary files etc. For loading/using data from resources at run time I made this tiny helper Resources UDF. Functions inside UDF: _ResourceGet($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsString($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsStringW($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsBytes($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsImage($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceGetAsBitmap($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceSaveToFile($FileName, $ResName, $ResType = $RT_RCDATA, $ResLang = 0, $CreatePath = 0, $DLL = -1) _ResourceSetImageToCtrl($CtrlId, $ResName, $ResType = $RT_RCDATA, $DLL = -1) _SetBitmapToCtrl($CtrlId, $hBitmap) _ResourcePlaySound($ResName, $Flag = 0, $DLL = -1) Notes: * to compile all script examples you must have installed Scite4AutoIt3 --> you must compile script by F7 from full Scite * for using #AutoIt3Wrapper_Res_File_Add directive you must have AutoIt3Wrapper at least version 2.0.1.22 (it's part of latest Scite4AutoIt3) * to compile all script examples must be apropriate resource data files in script directory (from resource_data.zip) * _ResourceGet() always returns pointer to data (for RT_BITMAP returns hBitmap), returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes() * _ResourceGetAsStringW() is for Unicode strings (Widechar) * you can use also #number instead of resource name, see examples * general supported resource types are listed in UDF as constants ($RT_BITMAP, $RT_RCDATA, ...) * information about playing video files (AVI) from resources is here thanks matrixnz * information/examples about using animated GIFs from resources is here and here thanks smashly/ProgAndy * information about running EXE files/DLL functions directly from resources is here thanks trancexx/Ward Known problems/limitations: * _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP * _ResourceSetImageToCtrl() works with "static/button" type of controls (picture,label,icon,button,checkbox,radiobutton,groupbox) * _ResourcePlaySound() plays only WAV files (not MP3 files) * _ResourceGetAsBytes() doesn't work for RT_BITMAP type because _ResourceGet() returns hBitmap instead of memory pointer in this case there could be used _ResourceGetAsImage() as workaround * _ResourceGet() has potential memory leak releasing of resources UnlockResource,FreeResource (opposite of LoadResource,LockResource) is not done because it must be done after using of resources at the end and not inside UDF * _GDIPlus_Startup() is called once at start of whole include --> no _GDIPlus_Shutdown() is called History: 2011-06-20 - fixed x64 compatibility (type: int->ptr) - internal change: FindResourceA -> FindResourceW (& type: str->wstr) - _SetBitmapToCtrl() --> $CtrlId parameter now supports also -1 (thanks guinness) - _WinAPI_LoadLibraryEx($DLL, $LOAD_LIBRARY_AS_DATAFILE) instead of _WinAPI_LoadLibrary($DLL) (thanks arcker) - added au3.user.calltips.api, au3.userudfs.properties (thanks guinness) - merged resource_au3.zip + resource_data.zip to one file resources.zip 2010-02-12 - all examples now use fixed #AutoIt3Wrapper_Res_File_Add directive from latest Scite4Autoit3 (no need for ResHacker.exe) - added support for buttons (also checkboxes,radiobuttons,groupboxes) in _ResourceSetImageToCtrl()/_SetBitmapToCtrl() thanks Melba 2009-08-25 - fixed corrupted topic (appeared after forum upgrade) - removed some AU3 tags from topic, note: all AU3 code is untouched inside attached ZIP 2008-11-27 - added _ResourceGetAsStringW() --> for Unicode strings (Widechar) 2008-11-10 - added two very simple examples 2008-08-14 - change: _GDIPlus_Startup() is called once at start of whole include--> no _GDIPlus_Shutdown() is called - fixed support for animated GIFs in _ResourceGetAsImage() --> removed_MemGlobalFree($hData) - used simpler UDF syntax (from WinAPI) instead of DllCall() where possible - added new example for animated GIF image 2008-07-08 - just corrected some typos in this topic (no code changes) 2008-06-25 - big thanks to ProgAndy for ideas,improvements! - added _ResourceGetAsImage(), _ResourceGetAsBitmap() - added optional $DLL parameter to all functions - for loading resources from external EXE,DLL files - fixed previous limitation in _ResourceSaveToFile() - now supports also RT_BITMAP type - new examples in resource_test.au3 2008-05-02 - added new RT,SND constants - fixed bad order of parameters ResName x ResType in FindResourceExA (thanks SmOke_N) - added DeleteObject of oldBmp from STM_SETIMAGE in _SetBitmapToCtrl (thanks ProgAndy) - added settinng SS_BITMAP style to control before STM_SETIMAGE in_SetBitmapToCtrl (support for labels) 2008-04-24 - added support for JPG,GIF,PNG in _ResourceSetImageToCtrl() using GDI+ - thanks ProgAndy - reverted all examples back from #AutoIt3Wrapper_Res_File_Add= to#AutoIt3Wrapper_run_after=ResHacker.exe -add - updated both ZIP archives 2007-10-16 - added _ResourcePlaySound() - thanks Larry - corrected local declaration of $struxt - was problem when Opt("MustDeclareVars",1) - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-14 - added optional parameter $CreatePath in _ResourceSaveToFile() - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-11 - in examples used new AutoIt3Wrapper directive#AutoIt3Wrapper_Res_File_Add from latest Scite4AutoIt3 (instead of #AutoIt3Wrapper_run_after=ResHacker.exe -add ...) - updated resource_test.au3 and resource_test_ie.au3 in resource_au3.zip 2007-09-05 - in #AutoIt3Wrapper_run_after=ResHacker.exe -add ... directive can be resource type in text form -->rcdata instead of 10, bitmap instead of 2 and so on (note: but for htmlmust be used 23 still) - updated only resource_test.au3 in resource_au3.zip 2007-09-04 - added description at top of this topic - added _ResourceSaveToFile() - source is also example for using _ResourceGetAsBytes() - more error checking in UDF and error codes are now differrent todistinguish possible problem - default ResType = 10 ($RT_RCDATA) in all functions - updated both ZIP archives 2007-08-29 - added TODO list - removed not used local variables in _ResourceSetImageToCtrl() - ziparchive not updated yet - revisited WWW links and TODO list and added list of functions 2007-08-10 - first version resource_test_min1.au3 - very simple example script of using UDF #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_1 #include "resources.au3" $gui = GUICreate("Data from resources simple example 1",400,150) $pic1 = GUICtrlCreatePic("",0,0,400,150) _ResourceSetImageToCtrl($pic1, "TEST_JPG_1") ; set JPG image to picture control from resource GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = -3 Then Exit WEnd resource_test.au3 - complex example script of using UDF #AutoIt3Wrapper_Res_File_Add=test_1.txt, rt_rcdata, TEST_TXT_1 #AutoIt3Wrapper_Res_File_Add=image1.bmp, rt_bitmap, TEST_BMP_1 #AutoIt3Wrapper_Res_File_Add=image2.bmp, rt_bitmap, TEST_BMP_2 #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_3 #AutoIt3Wrapper_Res_File_Add=binary1.dat, rt_rcdata, TEST_BIN_1 #AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1 #include "resources.au3" $gui = GUICreate("Data from resources example",820,400) $pic1 = GUICtrlCreatePic("",0,0,400,300) $pic2 = GUICtrlCreatePic("",400,0,400,150) $pic3 = GUICtrlCreatePic("",400,150,400,150) $pic4 = GUICtrlCreatePic("",600,320,400,100) $label1 = GUICtrlCreateLabel("",20,320,380,100) $label2 = GUICtrlCreateLabel("",400,320,200,100) GUISetState(@SW_SHOW) ; get string from resource $string = _ResourceGetAsString("TEST_TXT_1") GUICtrlSetData($label1, $string) ; set BMP image to picture control from resource bitmap _ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP) ; get bitmap from resource (as pointer) $hBmp = _ResourceGet("TEST_BMP_2", $RT_BITMAP) ; and use it for whatever you like _SetBitmapToCtrl($pic2, $hBmp) ; set JPG image to picture control from resource _ResourceSetImageToCtrl($pic3, "TEST_JPG_3") ; set image to picture control from external DLL resource _ResourceSetImageToCtrl($pic4, "#14355", $RT_BITMAP, @SystemDir & "\shell32.dll") ; get/use picture from resources as hImage type $size1 = _ResourceGetImageSize("TEST_BMP_1", $RT_BITMAP) $size2 = _ResourceGetImageSize("TEST_JPG_3") GUICtrlSetData($label2, $size1 & @CRLF & $size2) ; save binary data or another type (image) from resource to file and get its size in bytes $size1 = _ResourceSaveToFile(@ScriptDir & "\binary_data1.dat", "TEST_BIN_1") $size2 = _ResourceSaveToFile(@ScriptDir & "\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP) ; save binary data from resource to file (create not existing directory) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data1.dat", "TEST_BIN_1", $RT_RCDATA, 0, 1) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP, 0, 1) ; play WAV from resource (sync/async) _ResourcePlaySound("TEST_WAV_1") _ResourcePlaySound("TEST_WAV_1", $SND_ASYNC) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _ResourceGetImageSize($ResName, $ResType = 10) ; $RT_RCDATA = 10 ; get/use picture from resources as hImage type $hImage = _ResourceGetAsImage($ResName, $ResType) $width = _GDIPlus_ImageGetWidth ($hImage) $height = _GDIPlus_ImageGetHeight($hImage) Return "Size of " & $ResName & " is: " & $width & "x" & $height EndFunc resources.zip - UDF + examples + sample resource data for examples Previous downloads: 7195 resources.zip1 point
-
LOL, OK, this script may have been more useful 8 years ago, but better late than never....... I had a client today who was still using a Juno email program and her replacement was switching over to Outlook. I did some Googling and found very little help on converting the Juno address book to CSV so banged this out real quick: #include <Array.au3> $Input = @ScriptDir & "\addrbook.nv" $Import = FileRead($Input) $Break = StringSplit($Import, "Type:Entry", 1) $Output = @ScriptDir & "\export.csv" $Export = FileOpen($Output, 1) FileWriteLine($Export, Chr(34) & "First Name" & Chr(34) & "," & Chr(34) & "Last Name" & Chr(34) & "," & Chr(34) & "Company" & Chr(34) & "," & Chr(34) & "Company Main Phone" & Chr(34) & "," & Chr(34) & "Business Phone" & Chr(34) & "," & Chr(34) & "Business Phone 2" & Chr(34) & "," & Chr(34) & "E-mail Address" & Chr(34)) For $a = 1 To $Break[0] $Line = $Break[$a] $Split = StringSplit($Line, @CR) If $Split[0] == 14 Then $Name = $Split[4] If StringInStr($Name, ",") Then If StringLen($Name) > 3 Then $NameSplit = StringSplit($Name, ", ", 1) If $NameSplit[0] > 1 Then $FirstName = $NameSplit[2] $LastName = StringReplace(StringTrimLeft($NameSplit[1], 1), "Name:", "") Else $FirstName = $Name $LastName = "" EndIf EndIf Else $FirstName = "" $LastName = "" EndIf $Company = StringReplace($Split[3], "Alias:", "") $CompanyMainPhone = StringReplace($Split[5], "Work Phone:", "") $BusinessPhone = StringReplace($Split[6], "Primary Phone:", "") $BusinessPhone2 = StringReplace($Split[7], "Mobile Phone:", "") $EmailAddress = StringReplace($Split[2], "Email:", "") FileWriteLine($Export, Chr(34) & $FirstName & Chr(34) & "," & Chr(34) & $LastName & Chr(34) & "," & Chr(34) & $Company & Chr(34) & "," & Chr(34) & $CompanyMainPhone & Chr(34) & "," & Chr(34) & $BusinessPhone & Chr(34) & "," & Chr(34) & $BusinessPhone2 & Chr(34) & "," & Chr(34) & $EmailAddress & Chr(34)) EndIf Next Note the name of the Juno address book is addrbook.nv, you may find that in the ProgramFiles or ProgramData \Juno folder depending on OS. For my purposes I just copied it to the user's desktop, so adjust accordingly. Hopefuly this will help SOMEONE else SOMEDAY! Ian1 point
-
BetaLeaf, Using your ini format I have recast the script and I believe it now does what you require: ;#RequireAdmin;needed to work in some games. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This does not make me very happy <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #include "Misc.au3" #include "Array.au3" Opt("WinTitleMatchMode", -2) If @OSArch = "x64" Then Global $VLC_Path = "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" Global $VLC_WorkingDir = "C:\Program Files (x86)\VideoLAN\VLC\" Else Global $VLC_Path = "C:\Program Files\VideoLAN\VLC\vlc.exe" Global $VLC_WorkingDir = "C:\Program Files\VideoLAN\VLC\" EndIf $sIniName = @ScriptDir & "\SoundBoard.ini" ; Read ini section names Global $aSectionList = IniReadSectionNames($sIniname) ; Create data array to hold ini data for each HotKey Global $aHotKeyData[UBound($aSectionList)][5] ;_ArrayDisplay($aHotKeyData, "", Default, 8) If @error Then IniWriteSection($sIniname, "Sound1", 'File="' & @UserProfileDir & '\Music\SampleTrack.mp3"' & @CRLF & 'StartTime="12"' & @CRLF & 'EndTime="34"' & @CRLF & 'PlaybackDevice="Microsoft Soundmapper"' & @CRLF & 'Hotkey="+{numpad9}"') MsgBox(16, "SoundBoard", "SoundBoard.ini is missing. It has been created for you.") ShellExecute($sIniname, "", "", "edit") InputBox("SoundBoard", "Notes:" & @CRLF & "StartTime and EndTime are in seconds. Available Hotkeys can be found at the following url:", "https://www.autoitscript.com/autoit3/docs/functions/Send.htm") Exit EndIf ; For each section For $i = 1 To $aSectionList[0] ; Read ini section $aSection = IniReadSection($sIniname, $aSectionList[$i]) ; Fill HotKey data array ; example content $aHotKeyData[$i][0] = IniRead($sIniName, $aSectionList[$i], "HotKey", "Error") ; !{numpad8} $aHotKeyData[$i][1] = IniRead($sIniName, $aSectionList[$i], "File", "Error") ; C:\Users\BetaL\Music\SampleTrack1.mp3 $aHotKeyData[$i][2] = IniRead($sIniName, $aSectionList[$i], "StartTime", "Error") ; 12 $aHotKeyData[$i][3] = IniRead($sIniName, $aSectionList[$i], "EndTime", "Error") ; 34 $aHotKeyData[$i][4] = IniRead($sIniName, $aSectionList[$i], "PlayBackDevice", "Error") ; Microsoft Soundmapper ; Set HotKey to common function HotKeySet($aHotKeyData[$i][0], "_HotKeyFunc") Next ;_ArrayDisplay($aHotKeyData, "", Default, 8) While 1 Sleep(10);idle to prevent unnecessary work. 10 is the minimal we can set this value to. WEnd Func _HotKeyFunc() ;Get HotKey pressed $sHotKeyPressed = @HotKeyPressed ;ConsoleWrite($sHotKeyPressed & @CRLF) ; Find HotKey pressed in the data array $iIndex = _ArraySearch($aHotKeyData, $sHotKeyPressed) ; Check found If $iIndex <> -1 Then ; Create parameter using the data in the array $sParam = '--qt-start-minimized --play-and-exit --start-time="' & $aHotKeyData[$iIndex][2] & '" --stop-time="' & $aHotKeyData[$iIndex][3] & '" --aout=waveout --waveout-audio-device="' & _ $aHotKeyData[$iIndex][4] & '" "' & $aHotKeyData[$iIndex][1] & '"' ; Simulate passing commandline to VLC ConsoleWrite("ShellExecuteWait:" & @CRLF & $VLC_Path & @CRLF & $sParam & @CRLF & $VLC_WorkingDir & @CRLF & @CRLF) Beep(500, 200) Else ConsoleWrite("Not a valid HotKey" & @CRLF) EndIf EndFunc I have commented out a number of _ArrayDisplay/ConsoleWrite lines - just uncomment them to see what happens at the various stages. M231 point
-
general programming tips and good habits
Synapsee reacted to InunoTaishou for a topic
For starters, there's this https://www.autoitscript.com/wiki/Best_coding_practices Some things I try to keep consistent: Definitely use Hungarian notation in autoit (the reason I specifically state "autoit" is because in languages like C++ the editor will, usually, catch the error when using the wrong expression on a variable of the wrong type. I.e., multiplying the string literal "1234" by an int 0). This helps because variables can be of any type. Useful in some instances but I find it to be annoying in more cases than not. ; Obvious int type Local $iArrayIndex ; Probably an int type Local $arrayIndex ; Obvious Bool type Local $bMyTest ; Could be string, could be float, could be int, could be bool Local $myTest ; Button Global $btnStop ; Maybe bool, could be a string Global $stop Const variables are all caps, and I don't use Hungarian on these. Since I usually have less const variables than non const it's easier to remember what it is and, 99% of the time, they're int types (since int variables execute, slightly, faster than any other type). Always declare and initialize variables at the top of a function. (Sometimes I get lazy and create a temporary variable in the middle of a function but I'll usually go back and move it to the top when I'm done with the function). Initialize so you know that that variable is initialized to something. Sometimes you can create a variable and it will have some weird value. Always use Local/Global. Never use magic numbers. Always release your resources when you're done with them. Especially true for dllstructs, GDI+ objects, and WinApi objects. I remember a project I was not deleting a HBitmap object and my ram shot up to 1gig before the script crashed. In a project that was reaching 2k lines, it was a treat trying to find that memory leak. Lastly, self documenting functions and variables.1 point -
If think, that is not possible for all devices, but for some devices you could get the MAC address from IP address and then look what company made the device (for example use http://wintelguy.com/index.pl to find this out). Here is a script to receive the MAC address via ARP request: #include "socket_UDF.au3" _WSAStartup() Global $MAC = _SendARP(@IPAddress1) ConsoleWrite("Local MAC address: " & $MAC & @LF) Global $MAC = _SendARP("192.168.3.4") ConsoleWrite("Remote MAC address: " & $MAC & @LF) _WSACleanup() Func _SendARP($DestIP) Local $DestAddress = _inet_addr($DestIP) Local $tMacAddr = DllStructCreate("BYTE[8]") Local $aRet = DllCall("Iphlpapi.dll", "DWORD", "SendARP", "ULONG", $DestAddress, "ULONG", 0, "struct*", $tMacAddr, "ULONG*", 8) Local $sMAC = "" Switch $aRet[0] Case 0 For $i = 1 To $aRet[4] - 1 $sMAC &= Hex(DllStructGetData($tMacAddr, 1, $i), 2) & "-" Next $sMAC &= Hex(DllStructGetData($tMacAddr, 1, $i), 2) Return $sMAC Case 31 Return "ERROR_GEN_FAILURE" Case 87 Return "ERROR_INVALID_PARAMETER" Case 1784 Return "ERROR_INVALID_USER_BUFFER" Case 67 Return "ERROR_BAD_NET_NAME" Case 1168 Return "ERROR_NOT_FOUND" EndSwitch EndFunc1 point
-
URL Encoding
GuyFromNJo reacted to guinness for a topic
babailiica, This would have been best suited in the examples section and not digging up an old post such as this. Secondly, the best version I've seen has be ProgAndy's which features in the WinHTTP UDF. Thanks for your contribution and welcome to the Forum.1 point