<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Поиск приложения и запуск его.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14853&amp;type=atom" />
	<updated>2019-07-09T11:51:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14853</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134821#p134821" />
			<content type="html"><![CDATA[<p>Через реестр так вышло:<br /></p><div class="codebox"><pre><code>#NoEnv
SetBatchLines, -1

arr := GetAppsInfo()
for k, v in arr[1]
   headers .= (headers = &quot;&quot; ? &quot;&quot; : &quot;|&quot;) . v.name

Gui, +Resize
Gui, Margin, 0, 0
Gui, Add, ListView, Grid, % headers
listViewArr := []
for k, v in arr
   for i, j in v
      listViewArr[k, i] := j.value
   
for k, v in listViewArr
   LV_Add(&quot;&quot;, v*)

Loop % arr[1].length()
   LV_ModifyCol(A_Index, &quot;AutoHdr&quot;)
LV_ModifyCol(1, &quot;Sort&quot;)
Gui, Show, w1200 h600, % &quot;Найдено &quot; . arr.MaxIndex() . &quot; приложений&quot;
Return

GuiSize:
   GuiControl, Move, SysListView321, w%A_GuiWidth% h%A_GuiHeight%
   Return
   
GuiClose:
   ExitApp

GetAppsInfo() {
   infoNames := [ &quot;DisplayName&quot;  , &quot;DisplayVersion&quot;, &quot;InstallLocation&quot;
                , &quot;InstallDate&quot;  , &quot;DisplayIcon&quot;   , &quot;InstallSource&quot;
                , &quot;Publisher&quot;    , &quot;HelpLink&quot;      , &quot;HelpTelephone&quot;
                , &quot;Contact&quot;      , &quot;Comments&quot;      , &quot;Readme&quot;
                , &quot;URLInfoAbout&quot; , &quot;URLUpdateInfo&quot; ]
   arr := [], used := {}
   Loop % A_Is64bitOS + 1 {
      SetRegView, % 32 * A_Index
      for k, root in [&quot;HKCU&quot;, &quot;HKLM&quot;] {
         Loop, Reg, % root . &quot;\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&quot;, K
         {
            appInfo := [], enumValue := &quot;&quot;
            for k, name in infoNames {
               RegRead, value, % root . &quot;\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\&quot; . A_LoopRegName, % name
               if (name = &quot;DisplayName&quot; &amp;&amp; value = &quot;&quot;)
                  continue 2
               if (name = &quot;DisplayName&quot; || name = &quot;DisplayVersion&quot;)
                  enumValue .= value
               if (name = &quot;DisplayVersion&quot;) {
                  if used.HasKey(enumValue)
                     continue 2
                  used[enumValue] := &quot;&quot;
               }
               appInfo.Push({name: name, value: value})
            }
            arr.Push(appInfo)
         }
      }
   }
   Return arr
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-09T11:51:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134821#p134821</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134816#p134816" />
			<content type="html"><![CDATA[<p>Adobe Premiere CC 2017 точно 64-битный и он у меня показывается на ahk32 бит.<br />Может быть, потому что у меня установлен creative cloud, который управляет всем адобовским софтом, а сам он 32-битный.<br />Кстати, на stackoverflow советуют просто проверять ключ &quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&quot; <br /><a href="https://stackoverflow.com/questions/908850/get-installed-applications-in-a-system">https://stackoverflow.com/questions/908 … n-a-system</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-07-09T00:15:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134816#p134816</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134815#p134815" />
			<content type="html"><![CDATA[<p>У меня вроде нет. А ты уверен, что он 64-битный? Там могут быть 32-битные exe.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-09T00:01:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134815#p134815</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134814#p134814" />
			<content type="html"><![CDATA[<p>Адобовский 64-битный софт на ahk32 бит почему-то показывает.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-07-08T23:52:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134814#p134814</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134813#p134813" />
			<content type="html"><![CDATA[<p>Скорее всего, так и задумано. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> На 32-скрипте показывает только 32-битные приложения.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T23:14:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134813#p134813</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134812#p134812" />
			<content type="html"><![CDATA[<p>Да, разница есть на разных битностях. Пока не вижу в чём причина.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T22:46:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134812#p134812</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134811#p134811" />
			<content type="html"><![CDATA[<p>На ahk 64 бит у меня эксел показывает, также показывает в программах и компонентах (эксел 2016).<br />Другой пример - на ahk32 firefox не показывается, на ahk64 есть.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-07-08T22:36:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134811#p134811</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134810#p134810" />
			<content type="html"><![CDATA[<p>У меня тоже не показывает на 64. Но Excel я так же почему-то не вижу в Программах и компонентах.<br /></p><div class="codebox"><pre><code>Run appwiz.cpl</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T21:43:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134810#p134810</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134809#p134809" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Вся информация об установленных приложениях:</p></blockquote></div><p>На автохотки 32 битах многие приложения не показывает.<br />Например эксел.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-07-08T21:32:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134809#p134809</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134808#p134808" />
			<content type="html"><![CDATA[<p>Подправил SearchExe().</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T21:00:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134808#p134808</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134807#p134807" />
			<content type="html"><![CDATA[<p>Вся информация об установленных приложениях:<br /></p><div class="codebox"><pre><code>#NoEnv
SetBatchLines, -1

arr := GetAppsInfo(&quot;ALL&quot;)
for k, v in arr[1]
   headers .= (headers = &quot;&quot; ? &quot;&quot; : &quot;|&quot;) . v.name

Gui, +Resize
Gui, Margin, 0, 0
Gui, Add, ListView, Grid, % headers
listViewArr := []
for k, v in arr
   for i, j in v
      listViewArr[k, i] := j.value
   
for k, v in listViewArr
   LV_Add(&quot;&quot;, v*)

Loop % arr[1].length()
   LV_ModifyCol(A_Index, &quot;AutoHdr&quot;)
Gui, Show, w1400 h900
Return

GuiSize:
   GuiControl, Move, SysListView321, w%A_GuiWidth% h%A_GuiHeight%
   Return
   
GuiClose:
   ExitApp

GetAppsInfo(infoType)  {
   static CLSID_EnumInstalledApps := &quot;{0B124F8F-91F0-11D1-B8B5-006008059382}&quot;
        , IID_IEnumInstalledApps  := &quot;{1BC752E1-9046-11D1-B8B3-006008059382}&quot;
        , InfoNames := [ {name: &quot;DISPLAYNAME&quot;      , mask: 0x00000001}
                       , {name: &quot;VERSION&quot;          , mask: 0x00000002}
                       , {name: &quot;PUBLISHER&quot;        , mask: 0x00000004}
                       , {name: &quot;PRODUCTID&quot;        , mask: 0x00000008}
                       , {name: &quot;REGISTEREDOWNER&quot;  , mask: 0x00000010}
                       , {name: &quot;REGISTEREDCOMPANY&quot;, mask: 0x00000020}
                       , {name: &quot;LANGUAGE&quot;         , mask: 0x00000040}
                       , {name: &quot;SUPPORTURL&quot;       , mask: 0x00000080}
                       , {name: &quot;SUPPORTTELEPHONE&quot; , mask: 0x00000100}
                       , {name: &quot;HELPLINK&quot;         , mask: 0x00000200}
                       , {name: &quot;INSTALLLOCATION&quot;  , mask: 0x00000400}
                       , {name: &quot;INSTALLSOURCE&quot;    , mask: 0x00000800}
                       , {name: &quot;INSTALLDATE&quot;      , mask: 0x00001000}
                       , {name: &quot;CONTACT&quot;          , mask: 0x00004000}
                       , {name: &quot;COMMENTS&quot;         , mask: 0x00008000}
                       , {name: &quot;IMAGE&quot;            , mask: 0x00020000}
                       , {name: &quot;READMEURL&quot;        , mask: 0x00040000}
                       , {name: &quot;UPDATEINFOURL&quot;    , mask: 0x00080000}
                       , {name: &quot;ALL&quot;              , mask: 0x000EDFFF} ]
        
   pEIA := ComObjCreate(CLSID_EnumInstalledApps, IID_IEnumInstalledApps)
   arr := []
   for k, v in InfoNames
      if (v.name = infoType &amp;&amp; found := true)
         break
   if !found
      throw Exception(&quot;Wrong info type!&quot;)
   ( infoType = &quot;ALL&quot; &amp;&amp; InfoNames.Pop() )
   
   while DllCall(NumGet(NumGet(pEIA+0) + A_PtrSize*3), Ptr, pEIA, PtrP, pINA) = 0  {
      VarSetCapacity(APPINFODATA, size := 4*2 + A_PtrSize*18, 0)
      NumPut(size  , APPINFODATA)
      NumPut(v.mask, APPINFODATA, 4)
      DllCall(NumGet(NumGet(pINA+0) + A_PtrSize*3), Ptr, pINA, Ptr, &amp;APPINFODATA)
      ObjRelease(pINA)
      if (infoType != &quot;ALL&quot;) {
         pData := NumGet(APPINFODATA, 8 + A_PtrSize*(k - 1))
         arr.Push(pData ? StrGet(pData, &quot;UTF-16&quot;) : &quot;&quot;)
      }
      else {
         appInfo := []
         for i, j in InfoNames {
            pData := NumGet(APPINFODATA, 8 + A_PtrSize*(i - 1))
            appInfo.Push({name: j.name, value: pData ? StrGet(pData, &quot;UTF-16&quot;) : &quot;&quot;})
         }
         arr.Push(appInfo)
      }
   }
   Return arr
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T19:32:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134807#p134807</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134806#p134806" />
			<content type="html"><![CDATA[<p>Так можно искать по exe:<br /></p><div class="codebox"><pre><code>SetBatchLines, -1
MsgBox, % SearchExe(&quot;chrome.exe&quot;)

for k, v in SearchExe(&quot;uninstall.exe&quot;, false)
   MsgBox, % v

SearchExe(exeName, firstOnly := true) {
   ( !firstOnly &amp;&amp; foundPaths := [] )
   for k, v in GetAppsInfo(&quot;IMAGE&quot;) {
      RegExMatch(v, &quot;[^,&quot;&quot;]+&quot;, filePath)
      if SubStr(fileName, -2) != &quot;exe&quot;
         continue
      SplitPath, filePath, fileName, dir
      if (exeName = fileName) {
         found := true
         if firstOnly
            break
         foundPaths.Push(filePath)
      }
   }
   if !(found &amp;&amp; firstOnly) {
      for k, v in GetAppsInfo(&quot;INSTALLLOCATION&quot;) {
         if (v = &quot;&quot;)
            continue
         dir := RegExReplace(v, &quot;&quot;&quot;|\\$&quot;)
         Loop, Files, % dir . &quot;\*.exe&quot;, F
         {
            if (A_LoopFileName = exeName) {
               filePath := A_LoopFileLongPath
               found := true
               if firstOnly
                  break 2
               foundPaths.Push(filePath)
            }
         }
      }
   }
   Return found ? (firstOnly ? filePath : foundPaths) : &quot;&quot;
}

GetAppsInfo(infoType)  {
   static CLSID_EnumInstalledApps := &quot;{0B124F8F-91F0-11D1-B8B5-006008059382}&quot;
        , IID_IEnumInstalledApps  := &quot;{1BC752E1-9046-11D1-B8B3-006008059382}&quot;
        , InfoNames := [ {name: &quot;DISPLAYNAME&quot;      , mask: 0x00000001}
                       , {name: &quot;VERSION&quot;          , mask: 0x00000002}
                       , {name: &quot;PUBLISHER&quot;        , mask: 0x00000004}
                       , {name: &quot;PRODUCTID&quot;        , mask: 0x00000008}
                       , {name: &quot;REGISTEREDOWNER&quot;  , mask: 0x00000010}
                       , {name: &quot;REGISTEREDCOMPANY&quot;, mask: 0x00000020}
                       , {name: &quot;LANGUAGE&quot;         , mask: 0x00000040}
                       , {name: &quot;SUPPORTURL&quot;       , mask: 0x00000080}
                       , {name: &quot;SUPPORTTELEPHONE&quot; , mask: 0x00000100}
                       , {name: &quot;HELPLINK&quot;         , mask: 0x00000200}
                       , {name: &quot;INSTALLLOCATION&quot;  , mask: 0x00000400}
                       , {name: &quot;INSTALLSOURCE&quot;    , mask: 0x00000800}
                       , {name: &quot;INSTALLDATE&quot;      , mask: 0x00001000}
                       , {name: &quot;CONTACT&quot;          , mask: 0x00004000}
                       , {name: &quot;COMMENTS&quot;         , mask: 0x00008000}
                       , {name: &quot;IMAGE&quot;            , mask: 0x00020000}
                       , {name: &quot;READMEURL&quot;        , mask: 0x00040000}
                       , {name: &quot;UPDATEINFOURL&quot;    , mask: 0x00080000}
                       , {name: &quot;ALL&quot;              , mask: 0x000EDFFF} ]
        
   pEIA := ComObjCreate(CLSID_EnumInstalledApps, IID_IEnumInstalledApps)
   arr := []
   for k, v in InfoNames
      if (v.name = infoType &amp;&amp; found := true)
         break
   if !found
      throw Exception(&quot;Wrong info type!&quot;)
   ( infoType = &quot;ALL&quot; &amp;&amp; InfoNames.Pop() )
   
   while DllCall(NumGet(NumGet(pEIA+0) + A_PtrSize*3), Ptr, pEIA, PtrP, pINA) = 0  {
      VarSetCapacity(APPINFODATA, size := 4*2 + A_PtrSize*18, 0)
      NumPut(size  , APPINFODATA)
      NumPut(v.mask, APPINFODATA, 4)
      DllCall(NumGet(NumGet(pINA+0) + A_PtrSize*3), Ptr, pINA, Ptr, &amp;APPINFODATA)
      ObjRelease(pINA)
      if (infoType != &quot;ALL&quot;) {
         pData := NumGet(APPINFODATA, 8 + A_PtrSize*(k - 1))
         arr.Push(pData ? StrGet(pData, &quot;UTF-16&quot;) : &quot;&quot;)
      }
      else {
         appInfo := {}
         for i, j in InfoNames {
            pData := NumGet(APPINFODATA, 8 + A_PtrSize*(i - 1))
            appInfo[j] := pData ? StrGet(pData, &quot;UTF-16&quot;) : &quot;&quot;
         }
         arr.Push(appInfo)
      }
   }
   Return arr
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-08T18:01:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134806#p134806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134801#p134801" />
			<content type="html"><![CDATA[<p>Ищите в HKEY_LOCAL_MACHINE\SOFTWARE.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2019-07-08T15:15:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134801#p134801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134800#p134800" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong> Это игра. Она установлена.</p>]]></content>
			<author>
				<name><![CDATA[krabik-1337]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40249</uri>
			</author>
			<updated>2019-07-08T14:49:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134800#p134800</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск приложения и запуск его.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134798#p134798" />
			<content type="html"><![CDATA[<p>А оно установлено или просто скопировано на компьютер? Если установлено, то приложения, как правило, прописываются в реестре.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2019-07-08T14:13:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134798#p134798</id>
		</entry>
</feed>
