Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2012 in all areas

  1. You need to form an array of structures. The problem is variable length of the array so you have to create raw binary structure tha wraps complete MIB_IPNETTABLE structure. Once you do that it's only a matter of collecting by interpretting chunks of raw structure as array of MIB_IPNETROW's and printing interesting data. I understand that there might be difficulties for you to understand what I'm talking about here so I wrote a function to show you how that few sentences look written in AutoIt as opposed to English: PrintIpNetTable() Func PrintIpNetTable() ; Start with initial call to calculate the size of the sructure Local $aCall = DllCall("iphlpapi.dll", "dword", "GetIpNetTable", _ "ptr*", 0, _ "dword*", 0, _ "bool", 1) ; Check for errors If @error Then Return SetError(1, 0, 0) If $aCall[0] <> 122 Then Return SetError(2, 0, 0) ; ERROR_INSUFFICIENT_BUFFER ; Read the size Local $iSize = $aCall[2] ; Allocate that much Local $tByteStructure = DllStructCreate("byte[" & $iSize & "]") ; Get pointer Local $pPointer = DllStructGetPtr($tByteStructure) ; Now fill the struct $aCall = DllCall("iphlpapi.dll", "dword", "GetIpNetTable", _ "ptr", $pPointer, _ "dword*", $iSize, _ "bool", 1) ; Interpret as modified MIB_IPNETTABLE structure to read the number of entries Local $tMIB_IPNETTABLE_NumEnries = DllStructCreate("dword dwNumEntries;", $pPointer) ; Read that number Local $iNumEntries = DllStructGetData($tMIB_IPNETTABLE_NumEnries, "dwNumEntries") $pPointer += 4 ; skip the size of that dword Local Const $MAXLEN_PHYSADDR = 8 Local $tMIB_IPNETROW ; Loop through the array of structures printing read data For $i = 0 To $iNumEntries - 1 $tMIB_IPNETROW = DllStructCreate("dword dwIndex;" & _ "dword dwPhysAddrLen;" & _ "byte bPhysAddr[" & $MAXLEN_PHYSADDR & "];" & _ "dword dwAddr;" & _ "dword dwType;", _ $pPointer) ; Print read ConsoleWrite("+Index " & DllStructGetData($tMIB_IPNETROW, "dwIndex") & ":" & @CRLF & _ @TAB & "Physical address = " & BinToMAC(DllStructGetData($tMIB_IPNETROW, "bPhysAddr"), DllStructGetData($tMIB_IPNETROW, "dwPhysAddrLen")) & @CRLF & _ @TAB & "IPv4 address = " & NumToIP(DllStructGetData($tMIB_IPNETROW, "dwAddr")) & @CRLF & _ @TAB & "Type = " & ARPType(DllStructGetData($tMIB_IPNETROW, "dwType")) & @CRLF & @CRLF) ; Skip this struct and continue looping $pPointer += DllStructGetSize($tMIB_IPNETROW) Next ; Bye, bye... EndFunc ;==>PrintIpNetTable ; Few helper functions Func NumToIP($iIP) Return Int(BinaryMid($iIP, 1, 1)) & "." & Int(BinaryMid($iIP, 2, 1)) & "." & Int(BinaryMid($iIP, 3, 1)) & "." & Int(BinaryMid($iIP, 4, 1)) EndFunc Func BinToMAC($bIn, $iSeg) If $iSeg = 0 Then Return "00-00-00-00-00-00" Local $sOut For $i = 1 To $iSeg $sOut &= Hex(BinaryMid($bIn, $i, 1)) & "-" Next Return StringTrimRight($sOut, 1) EndFunc Func ARPType($iType) Local Static $aType[5] = ["", "Unknown", "Invalid", "Dynamic", "Static"] If $iType < 1 Or $iType > 4 Then $iType = 1 Return $aType[$iType] EndFunc
    2 points
  2. Function Reference _AutoItErrorTrap.au3 UDF to intercept the error window of AutoIt, showing more details about the error, including ability to save and send by email! (Detection and treatment of errors in the AutoIt scripts!) Sintax: ; Adding the directives below, will cause your program be compiled with the indexing of the original lines shown in SciTE: #AutoIt3Wrapper_Run_Before=ShowOriginalLine.exe %in% #AutoIt3Wrapper_Run_After=ShowOriginalLine.exe %in% ;Or you can use the program "ShowOriginalLine.exe" directly and choose the script you want to add support to show the original lines! #include "_AutoItErrorTrap.au3" ; _AutoItErrorTrap ([sTitle [, sText [, fUseCallBack]]]) _AutoItErrorTrap()Supports: ;Error detection in your AutoIt script and local #Includes! ;According to the AutoIt Help, the definition for "local Includes" is: ;------------------------------------------------------------------------------ ;If "..." is used, the filename is taken to be relative to the current script. ;------------------------------------------------------------------------------ ;This means that for you to have your UDF or other external module with support to show the original lines, one should use as follows: #include "[path] filename" ; See the AutoIt help for more details.Downloads: Version: 0.11 _AutoItErrorTrap_(RedirectLink).html Note: The error detection is performed in the same executable, does not requiring opening two .exes for this action! Works with CUI too. Usage example is included! (You need to compile first, but it also work with non compiled scripts using context menu [Run Script...]) Sample: More sample: Fixes: #ShowLine_Off $hForm = GUICreate("My GUI menu", 480, 360) $iFileMenu = GUICtrlCreateMenu("&File") $iFileItem = GUICtrlCreateMenuItem("Open", $iFileMenu) GUICtrlSetState(-1, $GUI_DEFBUTTON) $iHelpMenu = GUICtrlCreateMenu("?") GUICtrlCreateMenuItem("Save", $iFileMenu) GUICtrlSetState(-1, $GUI_DISABLE) #ShowLine_OnWithout them the rows above would be as follows: $__iLineNumber=1 & " - " & '$hForm = GUICreate("My GUI menu", 480, 360)...' $hForm = GUICreate("My GUI menu", 480, 360) $__iLineNumber=3 & " - " & '$iFileMenu = GUICtrlCreateMenu("&File")' $iFileMenu = GUICtrlCreateMenu("&File") $__iLineNumber=4 & " - " & '$iFileItem = GUICtrlCreateMenuItem("Ope...' $iFileItem = GUICtrlCreateMenuItem("Open", $iFileMenu) $__iLineNumber=5 & " - " & 'GUICtrlSetState(-1, $GUI_DEFBUTTON)' GUICtrlSetState(-1, $GUI_DEFBUTTON) $__iLineNumber=6 & " - " & '$iHelpMenu = GUICtrlCreateMenu("?")' $iHelpMenu = GUICtrlCreateMenu("?") $__iLineNumber=7 & " - " & 'GUICtrlCreateMenuItem("Save", $iFileMenu)' GUICtrlCreateMenuItem("Save", $iFileMenu) $__iLineNumber=8 & " - " & 'GUICtrlSetState(-1, $GUI_DISABLE)' GUICtrlSetState(-1, $GUI_DISABLE) And the directive #ShowOriginalLine_Param with the following options: /SV or /SkipAllVars ; Skip all Variables to show original line numbers. /SG or /SkipGlobalVars ; Skip Global Variables to show original line numbers. /SL or /SkipLocalVars ; Skip Local Variables to show original line numbers.29/10/2012 -> *Adding the directives below, will cause your program be compiled with the indexing of the original lines shown in SciTE: #AutoIt3Wrapper_Run_Before=ShowOriginalLine.exe %in% #AutoIt3Wrapper_Run_After=ShowOriginalLine.exe %in%*Or you can use the program ShowOriginalLine.exe directly and choose the script you want to add support to show the original lines!*It was added #region Translations with the variables available for translation! 0.10.2312.2600b 25/10/2012 -> Added support for viewing the last screen before the error! Now the window can expand and retract again...Change the hook CALLWNDRETPROC to CALLWNDPROC (better...). Added a help button [?] In the main window and minor changes in the code. 0.10.2312.2600b 23/10/2012 -> *Added support to display the original line numbers in the scripts compiled! Thanks to @FireFox for this tip! $hAET_GETERROR = StringRegExpReplace($hAET_GETERROR, "d+[0-9]", Eval("__iLineNumber") & @CRLF)*Additional information suggested by @ricky03, thank you!*Some bugs were fixed and the file ShowOriginalLineNumbers.au3 was added in zip file. 0.10.2112.2600b 21/10/2012 -> Bugs were fixed and a few functions have been rewritten!0.10.1912.2600b 19/10/2012 -> The UDF was almost completely rewritten, now no longer need to include _AdlibEnhance.au3.The detection of error is instant and does not consume more CPU. Interface compatibility with Windows XP 0.10.1812.2600b 18/10/2012 -> Improvements such as icons on the buttons and added a button to save the error information!0.10.1712.2600b 17/10/2012 -> First release!Regards, João Carlos.
    1 point
  3. Mp3SearchEngine v2.0.0.6 May be some of you know Songr . This script do the same job, it can find more mp3 files but is not as fast as Songr. Sites used are music search engine Websites designed for LEGAL entertainment purposes only. Thanks to Brett Francis, Prog@ndy and Eukalyptus for >Bass Udf, trancex for >WinHttp Udf and the AutoIt Community for his help. Changes of v1.0.8.5 Three websites replaced cause they are dead or use now js. All search engines updated ( not without difficulties for audiodump) I use RAGrid.dll for the first listview (more fast and stable, but with some inconvenients to manage the no-edit of cells) Input queries are saved ( the twenty latest) I use now an mp3 pre-Load management before playing and a double progressbar for visualize pre-load and play, where you can click for directly go play in the loaded part. Most includes needed are embedded and all external files are embedded in script with >BinaryToAu3Kompressor . Multi downloads available with embedded downloader.exe Changes of v1.0.8.8 Search on audiodump and myfreemp3 fixed. New buttons. Added Gui Menu. Titles are no more editable. New "About" with >TaskDialog (Thanks Prog@andy) Query button permit now to check / uncheck all checkboxes And some few fixes and cleaning. Really more stable now. Changes of v1.0.9.2 Dilandau is replaced by mp3chief and mp3ili by mp3clan Search on mp3juices, baseofmp3 and soundcloud fixed. Soso now provide m4a (aac) instead of mp3 ( m4a can be played by MSE) Added possibility to encode automaticaly to mp3, aac or ogg ( at the end of download) using bassenc.dll and command line tools : lame, faac and oggenc. Changes of v1.0.9.3 mp3skull fixed mp3chief fixed myfreemp3 fixed mp3clan changed to tusmp3 mp3juices changed to emp3world baseofmp3 changed to imp3 and some minor improvements. Version 2.0.0.6 Most previous websites used are dead or have changed the way to get links, so instead of try to repair the previous version, i have created a complete new version. The main tendency is the simplification : Only one website : audiodump (Up to 500 results by request) Script use now the little pearl created by Ward : curl.au3 It permit to create tasks (get source and get multi mp3) in asynchronous mode. So now, no need to use several executables and no more gui who do not respond in case of connection problems. Script use Bass.dll X86 loaded in memory for play songs. Result is light and fast, but don't abuse of audiodump servers who are not beasts of race. Warning : For avoid errors with curl.au3, you'll need to comment the line 63 : ;~ #Include <BinaryCall.au3> @AutoItX64 not supported and only tested on Win7X64 and Win8.1X64. As your browser, use Ctrl+w for remove the current Tab.(if there is no search or download running from it) And also Ctrl+q for set/remove Gridlines. Events are displayed to the bottom of the Gui. Version 2.0.1.1 Added a Paste Button. Querry list is now correctly saved. Querry Combo is now sorted in alphabetical order After a 'No match', the next search will use the previous empty listview. Bug when removing tabs is corrected. Added string correction for the request that, in the previous version, was not always able to return a correct result. A big thanks to Ward for his great UDF, and Nina my favorite tester, (who between us is also my third daughter), for his precious advices . previous downloads : 1703 As there is no more script downloads count, source and executable are available in the downloads section Enjoy ! July 2017 Project Discontinued due to website changes
    1 point
  4. PhoenixXL

    Remote Gmail (UDF)

    Remote Gmail UDF Working It uses the Google atom API to get the Summary of the mail, The Summary of the mail is enough to get a direct link or a single function with parameters Execute any Function (or Script) and get the Return Values in your E-mail Requirements Gmail (Email) Account A Remote Computer with Internet Access Representation Functions You can now use you Gmail account to use Autoit Functions in a remote computer Can execute a function through reading the email. Can Email back the return values of an executed function. The parameter can even be a variable present in the script [see Syntax] Execute a Script through Direct Link. Execute multiple scripts zipped together through Direct Link. Can Email back the PID of the running executables with the scripts. Attach any file and get it in your email. Able to send the multiple attachments zipped together. Writes all the return values in a Log file. No email is executed twice, the Message IDs are stored for this purpose. Future Updates Support single line nesting Get the attachment, to execute the script Syntax Syntax for Functions PXL<FuncName>: (<data type>)<first param part a>+(<data type>)<first param part b>|(<data type>)<secondparam>/PXL Colon[:] - Separation of Function Name with the Parameters Bar [ | ] - Separation of different parameters Plus [+] - To Concatenate Values PXL /PXL - The tags where the code is enclosed Brackets [ () ] - For specifying the type of the parameter DataTypes - Always Preceded by any parameter and are enclosed with brackets ; | (s) - String ; | (n) - Number ; | (f) - Floating Number ; | (i) - Integer ; | (b ) - Binary ; | (v) - Variable ; | (h) - Hex ; | (m) - macro ; | (w) - Handle ; | (p) - Pointer Syntax for Direct Links PXL<DirectLink>^<Type>/PXL PXL /PXL - The tags where the code is enclosed Caret [ ^ ] - To Separate the Link and the Type Type - Either Zip or au3 DirectLink WebServer Some of webservers providing Direct Links DropBox [Tested - Recommended] Herosh [Tested]* FileToLink FileDen * DirectLink from Herosh changes therefore Example 4 wont work after a while Credits CaptainClucks - Atom Feed Jos - SMTP Mailer wraithdu - Zip UDF Change Log v1.0 - First Release v1.1 - Added Script Execution with Zipping Functionality v1.2 - Fixed some Minor bugs v1.3 - Added RemoteGmail_Startup v1.4 - Fixed Compiling Issues v1.5 - Added flexibility for execution of scripts from any email. The UDF - Download The UDF is currently tested on x86 All Comments ,Queries , Feedback and Advice are welcomed... The UDF with the Examples have been compiled in the following Zip v1.5 RemoteGmail.7z Previous Downloads : 1119 Regards Phoenix XL
    1 point
  5. LarsJ

    The Favorites Menu

    (The title of this example was originally "The Shell/Custom Favorites/Programs Menus".) This is an implementation of the Shell Favorites and Programs menus with the IShellMenu interface. The purpose of this menu system is to create a popup menu from a directory structure consisting of subfolders and internet or program links. The menu will look like the Favorites menu in Internet or Windows Explorer (as it looked when XP SP2 was released in August 2004). The IShellMenu interface can generally be used to create a menu from a directory structure. The menu items will be supplied with the same icons as the link files and they will be supplied with tooltips too. When you click a menu item the command associated with the internet or program link will be executed. The Favorites and Programs menus will create popup menus from the directory structures given by $CSIDL_FAVORITES, $CSIDL_PROGRAMS, $CSIDL_STARTMENU, $CSIDL_COMMON_PROGRAMS, $CSIDL_COMMON_STARTMENU. The Custom Favorites and Custom Programs menus can be used to create custom popup menus from custom directory structures. Note that the context (right click) menu is working in the Favorites menu. Update #4 2014-05-03: AutoIt 3.3.10 This example was created under 3.3.8 and based on APIConstants.au3 and WinAPIEx.au3 by Yashied. The original example runs under 3.3.10 without any changes at all. But a lot of unused constants and functions are included. In 3.3.10 the two UDFs are divided into several smaller UDFs. This makes it much easier to just include, what is needed. This update only includes the necessary UDFs. You find the new and old zip in bottom of the post. Update #3 2012-11-06: Programs menus Added the Programs menus from the directory structures given by $CSIDL_PROGRAMS, $CSIDL_STARTMENU, $CSIDL_COMMON_PROGRAMS, $CSIDL_COMMON_STARTMENU. To create a menu like the "All Programs" menu copy the two "Start Menu" folders (your own + "All Users") to the "Custom Programs 1" folder and overwrite the existing "Start Menu" folder. Then select the menu item "Custom Programs | Custom Programs 1". Update #2 2012-11-03: Custom Favorites menus If you are creating an AutoIt program and want to add a custom Favorites menu with relevant internet links all you have to do is to create a directory structure, add the subfolders (optional) and links and call the ShowFavsProgsMenu() function with a path to the directory. And you will get a menu that looks like and works like the Favorites menu in Internet Explorer. You can see two custom Favorites menus in the examples. Added two small directory structures to the zip to be used for the custom Favorites menus. Fixed an error: OleInitialize() is used to initialize COM in stead of CoInitialize() (necessary to make the Copy command in the context menu work). Update #1 2012-11-01: Window procedure Because a popup menu like the Favorites menu is modal, it's necessary to use some kind of a window procedure to catch the menu messages. When it's a popup menu it should be enough to have the window procedure running while the popup menu is displayed. In the original scripts the window procedure was created with these commands: $hNewWinProc = DllCallbackRegister( "NewWindowProc", "int", "hwnd;uint;wparam;lparam" ) ; New window procedure $hOldWinProc = _WinAPI_SetWindowLong( $hGui, $GWL_WNDPROC, DllCallbackGetPtr( $hNewWinProc ) ) ; Old window procedureThe procedure was started in the main script in the example and was running as long as the script was running. In this update the menu messages is catched with a hook procedure: $hFavMenuMsg = DllCallbackRegister( "FavMenuMsg", "long", "int;wparam;lparam" ) $hFavMenuMsgHook = _WinAPI_SetWindowsHookEx( $WH_MSGFILTER, DllCallbackGetPtr( $hFavMenuMsg ), 0, _WinAPI_GetCurrentThreadId() ) ; $WH_MSGFILTER installs a hook procedure that monitors messages generated as a ; result of an input event in a dialog box, message box, menu, or scroll bar.The procedure is started in the bottom of the ShowFavoritesMenu() function immediately after the Favorites menu is displayed on the screen, and the procedure is stopped when the menu disappears from the screen. Either because the menu is cancelled or a selection is made. (If you comment out these commands in ShellFavoritesMenu.au3 the Favorites menu will still show up. But the submenus will not be expanded if you keep the mouse steady over a submenu or use the arrow keys.) This hook procedure is much better than the original window procedure. It's much easier to integrate the Favorites menu in other programs when it isn't depending on a "global" window procedure. A "global" window procedure can also have some influence on the GUI (at least on XP, I think it's better on 7). In the original example you saw it clearly when the GUI lost focus. When the GUI got focus back the upper line of the edit box could be behind the toolbar. This is not a problem with a hook procedure only running when the Favorites menu is displayed. Added an example with a menu. Zip updated. First post 2012-10-30 This is an implementation of the Favorites menu primary with the IShellMenu interface but several other interfaces are used as well. The main function: Func ShowFavoritesMenu( $hWnd, $hMenu, $xCoord, $yCoord ) ; --- Create a menu band object and the IShellMenu interface --- Local $oIShellMenu, $pIShellMenu ; Create a menu band object and get a pointer to the IShellMenu interface CoCreateInstance( $tCLSID_MenuBand, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IShellMenu, $pIShellMenu ) $oIShellMenu = ObjCreateInterface( $pIShellMenu, $sIID_IShellMenu, $dtag_IShellMenu ) If Not IsObj( $oIShellMenu ) Then Return SetError(1,0,0) ; --- Initialize the interface --- If $oIShellMenu.Initialize( $NULL, -1, $ANCESTORDEFAULT, BitOR( $SMINIT_TOPLEVEL, $SMINIT_VERTICAL ) ) <> $S_OK Then Return SetError(2,0,0) ; --- Specify the folder for the menu band to browse --- ; Get a pointer to the IShellFolder interface for the desktop Local $pIShellFolder = $NULL, $oIShellFolderDesktop, $pIShellFolderDesktop, $pidlRel SHGetDesktopFolder( $pIShellFolderDesktop ) SHGetSpecialFolderLocation( $NULL, $CSIDL_FAVORITES, $pidlRel ) $oIShellFolderDesktop = ObjCreateInterface( $pIShellFolderDesktop, $sIID_IShellFolder, $dtag_IShellFolder ) $oIShellFolderDesktop.BindToObject( $pidlRel, $NULL, $tRIID_IShellFolder, $pIShellFolder ) If $pIShellFolder = $NULL Then Return SetError(3,0,0) ; Get the registry key with the "Order" value of the Favorites folder Local $hRegOrder = _WinAPI_RegOpenKey( $HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites", $KEY_READ ) If $hRegOrder = 0 Then Return SetError(4,0,0) ; Specify the folder for the menu band to browse If $oIShellMenu.SetShellFolder( $pIShellFolder, $pidlRel, $hRegOrder, BitOR( $SMSET_BOTTOM, $SMSET_USEBKICONEXTRACTION ) ) <> $S_OK Then Return SetError(5,0,0) _WinAPI_CoTaskMemFree( $pidlRel ) _WinAPI_RegCloseKey( $hRegOrder ) ; --- Append a static menu to the menu band --- If $oIShellMenu.SetMenu( $hMenu, $hWnd, $SMSET_TOP ) <> $S_OK Then Return SetError(6,0,0) ; --- Get access to IMenuPopup, IDeskBar and IDeskBand interfaces --- Local $pIMenuPopup, $pIDeskBar, $pIDeskBand ; The IMenuPopup interface If $pIShellMenu Then If $oIShellMenu.QueryInterface( $tRIID_IMenuPopup, $pIMenuPopup ) <> $S_OK Then Return SetError(7,0,0) EndIf ; The IDeskBar interface If $pIMenuPopup Then Local $oIMenuPopup = ObjCreateInterface( $pIMenuPopup, $sIID_IMenuPopup, $dtag_IMenuPopup ) If $oIMenuPopup.QueryInterface( $tRIID_IDeskBar, $pIDeskBar ) <> $S_OK Then Return SetError(8,0,0) EndIf ; The IDeskBand interface If $pIDeskBar Then Local $oIDeskBar = ObjCreateInterface( $pIDeskBar, $sIID_IDeskBar, $dtag_IDeskBar ) If $oIDeskBar.QueryInterface( $tRIID_IDeskBand, $pIDeskBand ) <> $S_OK Then Return SetError(9,0,0) EndIf ; --- Create a menu desk bar object and the IMenuPopup interface --- Local $oIUnknown, $pIUnknown, $oIMenuPopup, $pIMenuPopup ; Create a menu desk bar object and get a pointer to the IUnknown interface CoCreateInstance( $tCLSID_MenuDeskBar, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IUnknown, $pIUnknown ) $oIUnknown = ObjCreateInterface( $pIUnknown, $sIID_IUnknown, $dtag_IUnknown ) ; Create the IMenuPopup interface $oIUnknown.QueryInterface( $tRIID_IMenuPopup, $pIMenuPopup ) $oIMenuPopup = ObjCreateInterface( $pIMenuPopup, $sIID_IMenuPopup, $dtag_IMenuPopup ) If Not IsObj( $oIMenuPopup ) Then Return SetError(10,0,0) ; --- Create a menu band site object and the IBandSite interface --- Local $oIBandSite, $pIBandSite ; Create a menu band site object and get a pointer to the IBandSite interface CoCreateInstance( $tCLSID_MenuBandSite, $NULL, $CLSCTX_INPROC_SERVER, $tRIID_IBandSite, $pIBandSite ) $oIBandSite = ObjCreateInterface( $pIBandSite, $sIID_IBandSite, $dtag_IBandSite ) If Not IsObj( $oIBandSite ) Then Return SetError(11,0,0) ; --- Set the band site object as client for the desk bar object --- If $oIMenuPopup.SetClient( $pIBandSite ) <> $S_OK Then Return SetError(12,0,0) ; --- Add the desk band object to the band site object --- If $oIBandSite.AddBand( $pIDeskBand ) <> $S_OK Then Return SetError(13,0,0) ; --- Show the Favorites menu --- Local $tPOINT = DllStructCreate( $tagPOINT ) DllStructSetData( $tPOINT, "X", $xCoord ) DllStructSetData( $tPOINT, "Y", $yCoord ) Local $tRECT = DllStructCreate( $tagRECT ) DllStructSetData( $tRECT, "Left", $xCoord ) DllStructSetData( $tRECT, "Top", $yCoord+1 ) DllStructSetData( $tRECT, "Right", $xCoord ) DllStructSetData( $tRECT, "Bottom", $yCoord+1 ) $oIMenuPopup.Popup( $tPOINT, $tRECT, $MPPF_ALIGN_RIGHT ) ; --- Create the IMenuBand interface --- Local $oIDeskBand $oIDeskBand = ObjCreateInterface( $pIDeskBand, $sIID_IDeskBand, $dtag_IDeskBand ) $oIDeskBand.QueryInterface( $tRIID_IMenuBand, $pIMenuBand ) $oIMenuBand = ObjCreateInterface( $pIMenuBand, $sIID_IMenuBand, $dtag_IMenuBand ) If Not IsObj( $oIMenuBand ) Then Return SetError(14,0,0) ; $oIMenuBand and $pIMenuBand are global variables ; $oIMenuBand is used to handle the messages from the Favorites menu in the function below ; $pIMenuBand is used to test if the Favorites menu is open ($pIMenuBand <> $NULL) Return 0 EndFunc Example The zip contains the example as you can see in the picture. There are two versions of the example: A version based on a toolbar (ExShellFavsProgsMenus.au3), and a version based on a menu bar (ExShellFavsProgsMenus2.au3). The purpose of the text box is just to have something to put in the window. The zip contains also the ShellFavsProgsMenus.au3 UDF. This zip contains the original scripts for 3.3.8. You need APIConstants.au3 and WinAPIEx.au3 by Yashied. The UDFs are not included in the zip. The zip can be opened with 7-Zip. ShellFavsProgsMenus.zip This zip contains the updated scripts for 3.3.10. Only a matter of UDFs. These scripts will not run under 3.3.8. TheFavoritesMenu.7z Testet on XP 32 bit and Win 7 32/64 bit.
    1 point
  6. LurchMan

    FileWrite Problem

    Why not use an INI file rather than trying to read / write specific lines within the file? Look at the INIWrite and INIRead Functions in the help menu.
    1 point
  7. Were added the following directives: #ShowLine_Off #ShowLine_On They form a block that will not be indexed with the original lines, example: And the following directive: #ShowOriginalLine_Param With the following options: /SV ; Skip all Variables to show original line numbers;/SG ; Skip Global Variables to show original line numbers;/SL ; Skip Local Variables to show original line numbers.The version remains the same! Regards, João Carlos.
    1 point
  8. This is the solution for our friend : #include "Skype.au3" Global $aChat = _Skype_ChatGetActive(), $oChat For $iChat = 0 To UBound($aChat) -1 $oChat = $aChat[$iChat] If _Skype_ChatGetName($oChat) = "#abc.def/$febc24a082b613eb" Then ExitLoop ;we've found the chat name Next _Skype_ChatSendMessage($oChat, "test") ;send test to the chatBe reminded that you must store the object in a variable before using it ! (it won't work if you use it directly with the array) @everybody New version available ! (see first post for update)
    1 point
  9. Robjong

    Proxy Problems - RegExp

    I wrote this SRE version based on the same rules your snippet enforces, as far as I can tell it works. ;=============================================================================== ; Description.......: Check if a given IP address is a valid IPv4 address. ; Parameter(s)......: $sIP - The IPv4 address to validate. ; Requirement.......: ; Return Value(s)...: Success - 1 ; Failure - 0, and sets @error to 1 ; Author(s).........: Robjong (SRE version of _ValidIP by BrewManNH : http://www.autoitscript.com/wiki/Snippets_%28_Internet_%29#ValidIP.28.29_.7E_Author_-_BrewManNH) ; Remarks ..........: This will accept an IP address that is 4 octets long, and contains only numbers and falls within ; valid IP address values. Class A networks can't start with 0 or 127. 169.xx.xx.xx is reserved and is ; invalid and any address that starts above 239, ex. 240.xx.xx.xx is reserved. The address range ; 224-239 is reserved as well for Multicast groups but can be a valid IP address range if you're using ; it as such. Any IP address ending in 0 or 255 is also invalid for an IP. ;=============================================================================== Func _IsValidIPv4($sIP) Local $fRes = StringRegExp($sIP, "\A(?!(127|169|0{1,3})\.)(2[0-3]\d|[01]?\d\d?)(\.(25[0-5]|2[0-4]\d|[01]?\d\d?)){2}\.(25[0-4]|2[0-4]\d|1\d\d|0?[1-9]\d?|0{0,2}[1-9])\z") Return SetError(Not $fRes, 0, $fRes) EndFunc ;==>_IsValidIPv4 I also noticed your version allows addresses like 01.02.03.04, that should not be allowed should it? (it should, see next post) Another thing I was curious about was this line: $dString &= StringRight(Hex($aArray[$I]), 2) ... is there a reason you are not using it like this..? Hex($aArray[$I], 2) To get back on topic, to use this to parse the proxy list this should help: Func _ParseProxyList($sString) Return StringRegExp($sIP, "\b(?!(?:127|169|0{1,3})\.)(?:2[0-3]\d|1\d\d|0?\d\d?)(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)){2}\.(?:25[0-4]|2[0-4]\d|[01]?[1-9]\d?|0{0,2}[1-9]):(?:[8-9]\d|[1-9]\d\d|[1-7]\d{3}|80(?:[0-7]\d|8[01]))\b", 3) EndFunc ;==>_ParseProxyList Edit 1: credits + cleaning Edit 2: made groups non-capturing Edit 3: updated source to allow for leading zero (see next posts) Edit 4: cleaned patterns up a bit
    1 point
  10. Hi, You can get the treeview control ID with the au3info then manipulate it with the _GUICtrlTreeView_* functions. Br, FireFox.
    1 point
×
×
  • Create New...