<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3839128</guid>
        <pubDate>Sun, 20 Sep 2020 13:31:30 +0000</pubDate>
        <title>Найти все пункты меню Создать?</title>
        <link>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3839128</link>
        <description><![CDATA[Rouse_: <div class="tag-ex"><div class="tag-ex__prefix">!</div><div class="tag-ex__body"><strong class='tag-b'>navodri </strong>- читаем правила&#33; RО неделя.</div></div>]]></description>
        <author>Rouse_</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3839017</guid>
        <pubDate>Fri, 18 Sep 2020 13:34:17 +0000</pubDate>
        <title>Найти все пункты меню Создать?</title>
        <link>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3839017</link>
        <description><![CDATA[^D^ima: Пример обхода ветки реестра, адаптируй под себя<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">procedure TForm1.Button1Click(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;R:TRegistry;</div><div class="code_line">&nbsp;info:TRegKeyInfo;</div><div class="code_line">&nbsp;str:TStringList;</div><div class="code_line">&nbsp;i:Integer;</div><div class="code_line">begin</div><div class="code_line">&nbsp;Memo1.Lines.Clear;</div><div class="code_line">&nbsp;R:=TRegistry.Create;</div><div class="code_line">&nbsp;R.RootKey:=HKEY_CURRENT_USER;</div><div class="code_line">&nbsp;R.OpenKey(&#39;Software&#39;,false);</div><div class="code_line">&nbsp;R.GetKeyInfo(info);</div><div class="code_line">&nbsp;Memo1.Lines.Add(&#39;Кол-во ключей:&#39;+IntToStr(Info.NumSubKeys));</div><div class="code_line">&nbsp;str:=TStringList.Create;</div><div class="code_line">&nbsp;R.GetKeyNames(str);</div><div class="code_line">&nbsp;for I:=0 to str.Count-1 do</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; Memo1.Lines.Add(str[i]);</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;str.Free;</div><div class="code_line">&nbsp;R.Free;</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>^D^ima</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3838943</guid>
        <pubDate>Thu, 17 Sep 2020 11:49:59 +0000</pubDate>
        <title>Найти все пункты меню Создать?</title>
        <link>https://forum.sources.ru/index.php?showtopic=419683&amp;view=findpost&amp;p=3838943</link>
        <description><![CDATA[navodri: Пытаюсь собрать в ListBox все расширения, которые отображаются в меню Windows &quot;Создать&quot;. Все хорошо, но... Если большинство программ содержит ShellNew сразу после расширения:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.txt\ShellNew</div></ol></div></div></div></div><br>
то пакет Microsoft Office прячет ShellNew еще глубже:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docx\Word.Document.12\ShellNew</div></ol></div></div></div></div><br>
Как мне найти и добавить такие ключи?<br>
<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">procedure TForm1.Button1Click(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;i: integer;</div><div class="code_line">&nbsp;iRes: integer;</div><div class="code_line">&nbsp;s: string;</div><div class="code_line">&nbsp;hTemp, hTemp1, hTemp2: HKEY;</div><div class="code_line">&nbsp;Buf: Pointer;</div><div class="code_line">&nbsp;BufSize: Integer;</div><div class="code_line">begin</div><div class="code_line">&nbsp;if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(&#39;SOFTWARE\Classes&#39;), 0,</div><div class="code_line">&nbsp;&nbsp;KEY_READ, hTemp) = ERROR_SUCCESS then begin</div><div class="code_line">&nbsp;&nbsp; BufSize := 1024;</div><div class="code_line">&nbsp;&nbsp; GetMem(buf, BufSize);</div><div class="code_line">&nbsp;&nbsp; i := 0;</div><div class="code_line">&nbsp;&nbsp; iRes := ERROR_SUCCESS;</div><div class="code_line">&nbsp;&nbsp;while iRes = ERROR_SUCCESS do begin</div><div class="code_line">&nbsp;&nbsp; BufSize := 1024;</div><div class="code_line">&nbsp;&nbsp; iRes := RegEnumKeyEx(hTemp, i, buf, BufSize, nil, nil, nil, nil);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if iRes = ERROR_SUCCESS then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; SetLength(s, BufSize);</div><div class="code_line">&nbsp;&nbsp; &nbsp; CopyMemory(@s[1], buf, BufSize);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;//Если нашли ShellNew - добавляем запись в ListBox1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(&#39;SOFTWARE\Classes\&#39; + s + &#39;\ShellNew&#39;),</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0, KEY_READ, hTemp1) = ERROR_SUCCESS then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ListBox1.Items.Add(s);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end; //ERROR_SUCCESS</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;//Если нашли old_ShellNew - добавляем запись в ListBox1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(&#39;SOFTWARE\Classes\&#39; + s + &#39;\old_ShellNew&#39;),</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0, KEY_READ, hTemp2) = ERROR_SUCCESS then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ListBox1.Items.Add(s + &#39; (Отключен)&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end; //ERROR_SUCCESS</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; inc(i);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end; //if iRes = ERROR_SUCCESS then begin</div><div class="code_line">&nbsp;&nbsp; end; //while iRes = ERROR_SUCCESS do begin</div><div class="code_line">&nbsp;&nbsp;FreeMem(buf);</div><div class="code_line">&nbsp;&nbsp;RegCloseKey(hTemp);</div><div class="code_line">&nbsp;end;</div><div class="code_line">end;</div></ol></div></div></div></div>]]></description>
        <author>navodri</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      </channel>
      </rss>
	