Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/13/2014 in all areas

  1. A simple example of listing installed applications using ObjCreateInterface. Update. 10/09/2014 ;Danyfirex 06/09/2014 #include <Array.au3> Opt("MustDeclareVars", 1) Global Const $sTagAppInfoData = "UINT cbSize;UINT dwMask;ptr pszDisplayName;ptr pszVersion;ptr pszPublisher;ptr pszProductID;" & _ "ptr pszRegisteredOwner;ptr pszRegisteredCompany;ptr pszLanguage;ptr pszSupportUrl;ptr pszSupportTelephone;" & _ "ptr pszHelpLink;ptr pszInstallLocation;ptr pszInstallSource;ptr pszInstallDate;ptr pszContact;ptr pszComments;" & _ "ptr pszImage;ptr pszReadmeUrl;ptr pszUpdateInfoUrl" Global Const $sCLSID_EnumInstalledApps = "{0B124F8F-91F0-11D1-B8B5-006008059382}" Global Const $sIID_IEnumInstalledApps = "{1BC752E1-9046-11D1-B8B3-006008059382}" Global Const $sTagIEnumInstalledApps = "Next hresult(ptr*);Reset hresult();" Global Const $sIID_IShellApp = "{A3E14960-935F-11D1-B8B8-006008059382}" Global Const $sShellApp = "GetAppInfoData hresult(ptr);" Global Const $AIM_DISPLAYNAME = 0x00000001 Global Const $AIM_VERSION = 0x00000002 Global Const $AIM_PUBLISHER = 0x00000004 Global Const $AIM_PRODUCTID = 0x00000008 Global Const $AIM_REGISTEREDOWNER = 0x00000010 Global Const $AIM_REGISTEREDCOMPANY = 0x00000020 Global Const $AIM_LANGUAGE = 0x00000040 Global Const $AIM_SUPPORTURL = 0x00000080 Global Const $AIM_SUPPORTTELEPHONE = 0x00000100 Global Const $AIM_HELPLINK = 0x00000200 Global Const $AIM_INSTALLLOCATION = 0x00000400 Global Const $AIM_INSTALLSOURCE = 0x00000800 Global Const $AIM_INSTALLDATE = 0x00001000 Global Const $AIM_CONTACT = 0x00004000 Global Const $AIM_COMMENTS = 0x00008000 Global Const $AIM_IMAGE = 0x00020000 Global Const $AIM_READMEURL = 0x00040000 Global Const $AIM_UPDATEINFOURL = 0x00080000 Local $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_INSTALLDATE)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "NAME|INSTALLDATE") $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_UPDATEINFOURL)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "DISPLAYNAME|UPDATEINFOURL") $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_INSTALLDATE, $AIM_INSTALLLOCATION)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "DISPLAYNAME|INSTALLLOCATION|INSTALLDATE") Func GetInstalledApps($iMask = $AIM_DISPLAYNAME) Local $oEnumInstalledApps = ObjCreateInterface($sCLSID_EnumInstalledApps, $sIID_IEnumInstalledApps, $sTagIEnumInstalledApps) If @error Then Return 0 Local $pShellApp = 0 Local $oShellApp = 0 Local $AppInfoData = DllStructCreate($sTagAppInfoData) Local $pAppInfoData = DllStructGetPtr($AppInfoData) Local $i = 0 Local $aArray[0][0] Local $iF = 1 Local $tData = 0 Local $sData = "" Local $aMax = nCol($iMask) While $oEnumInstalledApps.Next($pShellApp) = 0 And $pShellApp <> 0 $oShellApp = ObjCreateInterface($pShellApp, $sIID_IShellApp, $sShellApp) If @error Then Return 0 DllStructSetData($AppInfoData, "cbSize", DllStructGetSize($AppInfoData)) DllStructSetData($AppInfoData, "dwMask", $iMask) $oShellApp.GetAppInfoData($pAppInfoData) ReDim $aArray[$iF][UBound($aMax)] For $i = 0 To UBound($aMax) - 1 $tData = DllStructCreate("wchar[260]", DllStructGetData($AppInfoData, $aMax[$i] + 2)) $sData = DllStructGetData($tData, 1) If $aMax[$i] = 13 Then $sData = StringMid($sData, 7, 2) & "/" & StringMid($sData, 5, 2) & "/" & StringMid($sData, 1, 4) $aArray[$iF - 1][$i] = ($sData = "0") ? "" : $sData DllStructSetData($tData, 1, "") Next $oShellApp = Null $iF += 1 WEnd $oEnumInstalledApps = Null Return $aArray EndFunc ;==>GetInstalledApps Func nCol($iMask) Local $aFlag[18] = [$AIM_DISPLAYNAME, $AIM_VERSION, $AIM_PUBLISHER, $AIM_PRODUCTID, $AIM_REGISTEREDOWNER, $AIM_REGISTEREDCOMPANY, _ $AIM_LANGUAGE, $AIM_SUPPORTURL, $AIM_SUPPORTTELEPHONE, $AIM_HELPLINK, $AIM_INSTALLLOCATION, $AIM_INSTALLSOURCE, _ $AIM_INSTALLDATE, $AIM_CONTACT, $AIM_COMMENTS, $AIM_IMAGE, $AIM_READMEURL, $AIM_UPDATEINFOURL] Local $iCol = 0 Local $x = 0 Local $aCol[18] For $i = 0 To UBound($aFlag) - 1 If BitAND($iMask, $aFlag[$i]) Then $aCol[$x] = $i + 1 $x += 1 EndIf Next ReDim $aCol[$x] Return $aCol EndFunc ;==>nCol Saludos
    1 point
  2. Bert

    ControlSend errors

    I can tell you I've seen this problem for years and the only work around I've found when it resist ControlSetText is to do a control read after I sent the text to the control and then do a string match between what is returned and what I intended the control to have. If the string does not match I will resend to the control again and verify. It is messy but it works. 1. COntrolsend 2. Read the control I just sent data to 3. compare the data from the "read" to what I want the data to be. If they do not match, go back to step 1 and try again. If they match, then the control has the correct data.
    1 point
  3. Bert

    ControlSend errors

    Take a look here:
    1 point
  4. Easiest route...have a common dir...in that dir, add user dirs. Have each session create files in their specific dir, with whatever your message is. Have your base script loop for, and read those files, and do whatever is needed. Or, just have them all output to one dir, as an ini|xml|etc, and logically set values to know where it's coming from, and what to do.
    1 point
  5. I compiled with latest AutoIT version 3.3.10.2 and lots of compile issues fixed in app.au3 see code changed below and added the search path in the registry to the location of the needed packages There is a special registry value that can be created at "HKEY_CURRENT_USERSoftwareAutoIt v3AutoIt" called "Include". It should be a REG_SZ (string) value. The contents of this value are a semi-colon delimited list of directories that should be searched for files when resolving #include's in addition to the standard locations. ..downloadsau3_TLIDirect_1.0.6;..downloadsAutoItObject Package 1.2.8.3 fixes in start of app.au3 file ; ------------------------------------------------------------------------------ ; ; Version: 0.1.0 ; AutoIt Version: 3.3.4.0 ; Language: English ; Author: doudou ; License: GNU/GPL, s. LICENSE.txt ; Description: Main executable for TypeLibInspector. ; $Revision: 1.4 $ ; $Date: 2010/07/29 14:24:18 $ ; ; ------------------------------------------------------------------------------ ;~ All below moved to top before includes Global $app_objTLI = 0 ; moved up Global $app_objIE = 0 ; moved up Global $app_optResDir = @ScriptDir & "\..\..\res\" ; moved up If @compiled Then $app_optResDir = @ScriptDir & "\" ; moved up Global $app_optIconDir = $app_optResDir & "icons\" ; moved up Global $app_history = 0 ; moved up Global $app_historyCurr = -1 ; moved up Global $app_objTypeLib = 0 ; moved up ;~ end moved up Global $frmMain_status Global $node Global $frmMain #NoTrayIcon Opt("TrayIconHide", 1) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <GuiStatusBar.au3> #include <GuiTreeView.au3> #include <GuiImageList.au3> #include <GuiMenu.au3> #include <WinAPILangConstants.au3> ; added #include <TLIInterfaces.au3> ; added #include <TLI.au3> Global Const $APPMB_FATAL = BitOr($MB_OK, $MB_ICONHAND) ; moved up Global Const $APPMB_ERROR = BitOr($MB_OK, $MB_ICONEXCLAMATION) ; moved up Global Const $APPMB_INFO = BitOr($MB_OK, $MB_ICONASTERISK) ; moved up Global Const $APPMB_YESNO = BitOr($MB_YESNO, $MB_ICONQUESTION) ; moved up #include "Product.au3" #include "Utils.au3" #include "TypeDoc.au3" #include "FrmMain.au3" #include "Plugin.au3" #include "PagingStack.au3" Global Const $PROGID_MSXMLDOC = "MSXML2.DOMDocument" Global Const $OBJ_NULL = 0 Global Const $APP_PARAM_SELTYPE = "--selectType=" Global $app_tviRoot = 0 Global $app_hImlTypes = 0 Global $app_objXSLProc = 0 Global $app_objFoundNodes = 0 Global $app_iFindNext = 0 Global $app_strFind ="" Global $app_objError = ObjEvent("AutoIt.Error", "App_OnError") Global $app_objIEEvent = 0 Global $app_historyNav = False Global $app_optXSLDir = $app_optResDir & "xsl\" Global $app_optUseTLBINF = 1 Global $app_optHistoryMax = 10 Main()
    1 point
×
×
  • Create New...