BrewManNH Posted December 13, 2012 Author Posted December 13, 2012 This quote is from the Help for Dim: I have found that there is another use for DIm: where a vector may have 0 or >0 elements.Let's say it starts with 0 elements. So I code Global $vec = 0.It then acquires 2 elements, so I code Dim $vec[2].It then goes back to 0 elements, so I code $vec = 0It acquires 5 elements, so I code Dim $vec[5]Case 3 above is covered by the Help for Dim, but the other cases are not covered. Any thoughts about how to document this? $vec = 0$vec is now a 1D array with 2 elements$vec is now a simple variable again, and equals 0, array contents lost$vec is again a 1D array but now with 5 elementsAll of this is covered in the help file. To erase an array (maybe because it is a large global array and you want to free the memory), simply assign a single value to it: If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
czardas Posted December 13, 2012 Posted December 13, 2012 (edited) What's going on with Dim? All I know is that it's been superceeded. Are there plans to remove it altogether eventually? Edited December 13, 2012 by czardas operator64 ArrayWorkshop
guinness Posted December 13, 2012 Posted December 13, 2012 What's going on with Dim? All I know is that it's been superceeded. Are there plans to remove it altogether eventually?This question should be asked in the AutoIt beta thread. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Mat Posted December 13, 2012 Posted December 13, 2012 "Local scope if the variable name doesn't already exist globally (in which case it reuses the global variable!)" People started using it in lieu of Global or Local, which are preferred as they are more specific, so the "Don't use Dim" warning was given. Nobodies complained, so even old-ish members like Czardas have never seen it used (apart from when used incorrectly). I don't think I've ever seen a case where it was needed. AutoIt Project Listing
JohnOne Posted December 13, 2012 Posted December 13, 2012 Don't see the point in removing it really, perhaps it might come in handy some day. It would not really matter if it were removed from the help file though (which I suspect czardas meant) , if no-one felt like supporting it. Would not be the first undocumented something or other would it? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
czardas Posted December 13, 2012 Posted December 13, 2012 I've only ever used Dim if I wished to explicitly decalre a variable without being specific about its scope - in the event of future modifications that may determine or change the scope from global to local.This question should be asked in the AutoIt beta thread.Okay operator64 ArrayWorkshop
AZJIO Posted December 13, 2012 Posted December 13, 2012 VarGetTypeRemarksIsInt can return different results as it tries to convert from a string or float. I don't understand that. VarGetType does not distinguish between types? My other projects or all
Mat Posted December 13, 2012 Posted December 13, 2012 (edited) VarGetType I don't understand that. VarGetType does not distinguish between types?Try it with a variable you set to 1.0, VarGetType should return Double and IsInt will return true.Edit: It doesn't seem to attempt any conversion from a string though, IsInt("2") still returns 0. Edited December 13, 2012 by Mat AutoIt Project Listing
AZJIO Posted December 14, 2012 Posted December 14, 2012 (edited) Mat, Add for such numbers as 1.0string This will help to quickly understand _WinAPI_PostMessage expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> Global $k = 0 $Gui = GUICreate("WM_COMMAND", 390, 220) $iButton = GUICtrlCreateButton("Button", 10, 15, 90, 28, 0) $hButton = GUICtrlGetHandle(-1) $Label = GUICtrlCreateEdit('', 115, 5, 270, 210, $ES_MULTILINE) GUICtrlSetFont(-1, -1, -1, 0, 'Courier') ; Крупный шрифт GUICtrlSetBkColor(-1, 0xfffbd7) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") AdlibRegister("_Test", 1000) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _Test() _WinAPI_PostMessage($Gui, $WM_COMMAND, _WinAPI_MakeLong($iButton, $BN_DBLCLK), $hButton) EndFunc ;==>_Test Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $nID = BitAND($wParam, 0xFFFF) ; _WinAPI_LoWord Local $nNotifyCode = BitShift($wParam, 16) ; _WinAPI_HiWord GUICtrlSetData($Label, _ ' Parameters:' & @CRLF & _ ' -----------------------------' & @CRLF & _ ' $hWnd .: ' & $hWnd & @CRLF & _ ' $Msg ..: ' & Hex(Int($Msg), 4) & @CRLF & _ ' $wParam: ' & $wParam & @CRLF & _ ' $lParam: ' & $lParam & @CRLF & @CRLF & _ ' Info:' & @CRLF & _ ' -----------------------------' & @CRLF & _ ' NotifyCode : ' & $nNotifyCode & @CRLF & _ ' CtrlID ....: ' & $nID & @CRLF & _ ' CtrlHWnd ..: ' & $lParam) $k += 1 WinSetTitle($Gui, '', 'Count ' & $k) Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Edited December 16, 2012 by AZJIO My other projects or all
AZJIO Posted December 16, 2012 Posted December 16, 2012 _WinAPI_SetWindowTextString to be used as the new title or control te My other projects or all
guinness Posted December 16, 2012 Posted December 16, 2012 _WinAPI_SetWindowTextString to be used as the new title or control teFixed. Thanks. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
guinness Posted December 16, 2012 Posted December 16, 2012 _WinAPI_PostMessageWas this for me or Mat? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Mat Posted December 16, 2012 Posted December 16, 2012 (edited) Was this for me or Mat? you, it was the stuff about VarGetType and IsInt that was directed at me.Edit: Which is done by the way. Edited December 17, 2012 by Mat AutoIt Project Listing
guinness Posted December 16, 2012 Posted December 16, 2012 (edited) Ah OK. Well AZJIO would need to tidy the function before I commit it to SVN. Otherwise wait until I have time to do it. Edited December 16, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
AZJIO Posted December 16, 2012 Posted December 16, 2012 (edited) Was this for me or Mat? This is for someone who can make amendments That's how many examples do _WinAPI_GetWindowRect _WinAPI_ShowCursor _WinAPI_ShowError _WinAPI_ShowMsg _WinAPI_MsgBox _WinAPI_SetWindowText _WinAPI_GetWindowHeight _WinAPI_GetWindowWidth _WinAPI_MoveWindow _WinAPI_SetFocus _WinAPI_InProcess _WinAPI_FindWindow _WinAPI_AttachConsole _WinAPI_AttachThreadInput _WinAPI_BitBlt _WinAPI_CallNextHookEx _WinAPI_CommDlgExtendedError _WinAPI_CopyIcon _WinAPI_CreateBitmap _WinAPI_CreateCompatibleBitmap _WinAPI_CreateCompatibleDC _WinAPI_CreateEvent _WinAPI_CreateFontIndirect _WinAPI_CreateProcess _WinAPI_CreateWindowEx _WinAPI_DefWindowProc _WinAPI_DeleteDC _WinAPI_DestroyIcon _WinAPI_DestroyWindow _WinAPI_DrawFrameControl _WinAPI_FatalAppExit _WinAPI_FillRect _WinAPI_FlushFileBuffers _WinAPI_FormatMessage _WinAPI_GetAsyncKeyState _WinAPI_GetCurrentProcess _WinAPI_GetCurrentThread _WinAPI_GetDeviceCaps _WinAPI_GetDIBits _WinAPI_GetGuiResources _WinAPI_GetLastError _WinAPI_GetLastErrorMessage _WinAPI_GetObject _WinAPI_GetOverlappedResult _WinAPI_GetParent _WinAPI_GetProcessAffinityMask _WinAPI_GetStdHandle _WinAPI_GetStockObject _WinAPI_GetSysColorBrush _WinAPI_GetTextExtentPoint32 _WinAPI_GetWindow _WinAPI_GetWindowLong _WinAPI_GetWindowRect _WinAPI_GetWindowRgn _WinAPI_GUIDFromString _WinAPI_GUIDFromStringEx _WinAPI_InvalidateRect _WinAPI_IsClassName _WinAPI_LoadImage _WinAPI_LocalFree _WinAPI_MakeLong _WinAPI_MakeQWord _WinAPI_Mouse_Event _WinAPI_MulDiv _WinAPI_MultiByteToWideCharEx _WinAPI_OpenProcess _WinAPI_ReadProcessMemory _WinAPI_RedrawWindow _WinAPI_RegisterWindowMessage _WinAPI_ReleaseCapture _WinAPI_SetCapture _WinAPI_SetCursor _WinAPI_SetDefaultPrinter _WinAPI_SetDIBits _WinAPI_SetEvent _WinAPI_SetFont _WinAPI_SetHandleInformation _WinAPI_SetLastError _WinAPI_SetProcessAffinityMask _WinAPI_SetWindowLong _WinAPI_SetWindowPos _WinAPI_StringFromGUID _WinAPI_SystemParametersInfo _WinAPI_TwipsPerPixelX _WinAPI_TwipsPerPixelY _WinAPI_UpdateLayeredWindow _WinAPI_UpdateWindow _WinAPI_WaitForInputIdle _WinAPI_WaitForMultipleObjects _WinAPI_WaitForSingleObject _WinAPI_WriteConsole _WinAPI_WriteProcessMemory examples.7z Edited December 16, 2012 by AZJIO My other projects or all
guinness Posted December 17, 2012 Posted December 17, 2012 (edited) OK, thanks AZJIO. Edit: Looking at some of the examples, my only concern is the structure in which you present the examples, don't forget the help file is there for new users to AutoIt. For example in _WinAPI_ShowCursor you use -3 instead of $GUI_EVENT_CLOSE, which to the experienced is well known, but to those of us who have limited knowledge, this isn't so obvious at what it does. Edited December 17, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Mat Posted December 17, 2012 Posted December 17, 2012 OK, thanks AZJIO.Edit: Looking at some of the examples, my only concern is the structure in which you present the examples, don't forget the help file is there for new users to AutoIt. For example in _WinAPI_ShowCursor you use -3 instead of $GUI_EVENT_CLOSE, which to the experienced is well known, but to those of us who have limited knowledge, this isn't so obvious at what it does.Users of magic numbers will be shot. My new years resolution has become the complete abolition of magic numbers in the helpfile, and I'm merging a lot of the changes needed to do that already.People using MsgBox(0, ...), which is probably everyone, you are going to have to change your ways. AutoIt Project Listing
AZJIO Posted December 17, 2012 Posted December 17, 2012 (edited) This text: ###ReturnValue### Success: True Failure: False I replaced with it ###ReturnValue### @@ReturnTable@@ Success: True Failure: False @@End@@ By means of regular expression $test = StringRegExpReplace($test, '(###rn)(Success:.+?rnFailure:.+?rn)(rn)', '1@@ReturnTable@@' & @CRLF & '2@@End@@' & @CRLF & '3') you use -3 instead of $GUI_EVENT_CLOSEI can correct it at any time for couple of seconds at once in all files (by means of TextReplace). I use the " There are old pieces of code that can be updated. Importantly make examples and then improve. I'm not afraid of the aura of these numbers, because they still have to be used, such as FileOpen. Edited December 17, 2012 by AZJIO My other projects or all
guinness Posted December 17, 2012 Posted December 17, 2012 This text: I replaced with it By means of regular exp<b></b>ression $test = StringRegExpReplace($test, '(###rn)(Success:.+?rnFailure:.+?rn)(rn)', '1@@ReturnTable@@' & @CRLF & '2@@End@@' & @CRLF & '3')Done. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
AZJIO Posted December 17, 2012 Posted December 17, 2012 examples.7z_WinAPI_CopyIcon (_WinAPI_LoadShell32Icon, _WinAPI_DrawIconEx, _WinAPI_DestroyIcon)_WinAPI_CreateWindowEx_WinAPI_DestroyWindow_WinAPI_GetWindow (_WinAPI_GetWindowLong)_WinAPI_MakeLong (_WinAPI_LoWord, _WinAPI_HiWord)_WinAPI_MulDiv My other projects or all
Recommended Posts