<?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=140608&amp;view=findpost&amp;p=1086075</guid>
        <pubDate>Sat, 22 Apr 2006 14:35:23 +0000</pubDate>
        <title>Как?вставить checkbox в SelectDirectory</title>
        <link>https://forum.sources.ru/index.php?showtopic=140608&amp;view=findpost&amp;p=1086075</link>
        <description><![CDATA[Krid: <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">uses</div><div class="code_line">&nbsp;ShlObj, ActiveX, CommCtrl;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;id:integer;</div><div class="code_line">&nbsp;</div><div class="code_line">function NewDlgProc(Wnd:HWND; uMsg:DWORD; wParam:WPARAM; lParam:LPARAM):integer; stdcall;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if (uMsg=WM_COMMAND) then</div><div class="code_line">&nbsp;&nbsp; &nbsp; if (LOWORD(wParam)=id) then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; if (HIWORD(wParam)=BN_CLICKED) then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if (IsDlgButtonChecked(Wnd,id)=BST_CHECKED) then MessageBox(Wnd,&#39;Checked!&#39;,&#39;&#39;,0) else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; MessageBox(Wnd,&#39;UnChecked!&#39;,&#39;&#39;,0)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; end;</div><div class="code_line">&nbsp;&nbsp;result:=CallWindowProc(Pointer(GetWindowLong(Wnd,GWL_USERDATA)),Wnd,uMsg,wParam,lParam);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function BrowseCallback(Wnd:HWND; uMsg:DWORD; lParam:LPARAM; lpData:LPARAM ):integer; stdcall;</div><div class="code_line">var</div><div class="code_line">&nbsp;hwndCheck:HWND;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if (uMsg=BFFM_INITIALIZED) then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; hwndCheck:=CreateWindow(&#39;BUTTON&#39;,&#39;MyCheckBox&#39;, BS_AUTOCHECKBOX or WS_CHILD or WS_VISIBLE,10,10,100,20,Wnd,id,hInstance,nil);</div><div class="code_line">&nbsp;&nbsp; SendMessage(hwndCheck,WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT),1);</div><div class="code_line">&nbsp;&nbsp; SetWindowLong(Wnd,GWL_USERDATA,SetWindowLong(Wnd, DWL_DLGPROC, Integer(@NewDlgProc)));</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;&nbsp;Result:=0;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.Button1Click(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;bi:TBrowseInfo;</div><div class="code_line">&nbsp;szDir:array[0..MAX_PATH-1] of char;</div><div class="code_line">&nbsp;pidl:PItemIDList;</div><div class="code_line">&nbsp;lpMalloc:IMalloc;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if SUCCEEDED(SHGetMalloc(lpMalloc)) then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;ZeroMemory(@bi,sizeof(bi));</div><div class="code_line">&nbsp;&nbsp; &nbsp;bi.hwndOwner := Handle;</div><div class="code_line">&nbsp;&nbsp; &nbsp;bi.ulFlags := BIF_RETURNONLYFSDIRS or BIF_EDITBOX;</div><div class="code_line">&nbsp;&nbsp; &nbsp;bi.lpfn := BrowseCallback;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pidl := SHBrowseForFolder(bi);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (pidl&#60;&#62;nil) then</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; if SHGetPathFromIDList(pidl,szDir) then MessageBox(Handle,szDir,&#39;Picked&#39;,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; lpMalloc.Free(pidl)</div><div class="code_line">&nbsp;&nbsp; &nbsp;end</div><div class="code_line">&nbsp;&nbsp;end</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>Krid</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=140608&amp;view=findpost&amp;p=1085415</guid>
        <pubDate>Fri, 21 Apr 2006 19:01:42 +0000</pubDate>
        <title>Как?вставить checkbox в SelectDirectory</title>
        <link>https://forum.sources.ru/index.php?showtopic=140608&amp;view=findpost&amp;p=1085415</link>
        <description><![CDATA[Ct757: <strong class='tag-b'>Demona</strong>, после вызова SHBrowseForFolder в callback-процедуре (эта процедура указывается в структуре BROWSEINFO) создается checkbox (CreateWindowEx).]]></description>
        <author>Ct757</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=140608&amp;view=findpost&amp;p=1085315</guid>
        <pubDate>Fri, 21 Apr 2006 16:33:41 +0000</pubDate>
        <title>Как?вставить checkbox в SelectDirectory</title>
        <link>https://forum.sources.ru/index.php?showtopic=140608&amp;view=findpost&amp;p=1085315</link>
        <description><![CDATA[Demona: Подскажите, как можно вставить checkbox в SelectDirectory? (например - как в диалоге открытия директории winamp)]]></description>
        <author>Demona</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	