<?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=173533&amp;view=findpost&amp;p=1469190</guid>
        <pubDate>Wed, 28 Feb 2007 23:41:57 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1469190</link>
        <description><![CDATA[zanneo: Всем большое спасибо за помощь&#33; :)]]></description>
        <author>zanneo</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468223</guid>
        <pubDate>Wed, 28 Feb 2007 09:36:46 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468223</link>
        <description><![CDATA[ElcnU: ага уже вкурил,только это <br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>...=1+MultiByteToWideChar... </div></div><br>
получается мешало]]></description>
        <author>ElcnU</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468219</guid>
        <pubDate>Wed, 28 Feb 2007 09:32:30 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468219</link>
        <description><![CDATA[Hryak: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=173533&view=findpost&p=1468205'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>ElcnU &#064; <time class="tag-quote__quoted-time" datetime="2007-02-28T09:27:13+00:00">28.02.07, 09:27</time></span><div class='quote '>долго доганял эту фразу</div></div><br>
Ну, а приведенная тобой функция lpwAlign() то же самое делает, что и мой код.<br>
<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>если все 4 байта не заняты то добиваем до 4х </div></div><br>
Только наоборот: если все четыре не заняты - то ничего не добивается - указатель не смещается.]]></description>
        <author>Hryak</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468205</guid>
        <pubDate>Wed, 28 Feb 2007 09:27:13 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468205</link>
        <description><![CDATA[ElcnU: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>Hryak, 28.02.2007, 11:01:18, 1468153</span><div class='quote '>Дык, это выравнивание по DWORD... </div></div><br>
долго доганял эту фразу,понял что там система 4х байтных полей, то есть если все 4 байта не заняты то добиваем до 4х]]></description>
        <author>ElcnU</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468153</guid>
        <pubDate>Wed, 28 Feb 2007 09:01:18 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468153</link>
        <description><![CDATA[Hryak: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=173533&view=findpost&p=1468134'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>ElcnU &#064; <time class="tag-quote__quoted-time" datetime="2007-02-28T08:49:50+00:00">28.02.07, 08:49</time></span><div class='quote '>(прибавил 3 , а затем 3 в младших битах убрал,если я ничего не спутал :blink: )</div></div><br>
Дык, это выравнивание по DWORD...]]></description>
        <author>Hryak</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468134</guid>
        <pubDate>Wed, 28 Feb 2007 08:49:50 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468134</link>
        <description><![CDATA[ElcnU: всё понятно работает, только я не понял это зачем(прибавил 3 , а затем 3 в младших битах убрал,если я ничего не спутал :blink: )<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>Hryak, 28.02.2007, 10:37:28, 1468113</span><div class='quote '>    buf = (WORD*)(((DWORD)buf + 3) &amp; ~3);</div></div>]]></description>
        <author>ElcnU</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468113</guid>
        <pubDate>Wed, 28 Feb 2007 08:37:28 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1468113</link>
        <description><![CDATA[Hryak: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=173533&view=findpost&p=1467994'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>ElcnU &#064; <time class="tag-quote__quoted-time" datetime="2007-02-28T07:13:26+00:00">28.02.07, 07:13</time></span><div class='quote '>да так и делал, только в МСДН таким образом делают и тоже не сработало</div></div><br>
Возможно, дело вот в этой твоей строке:<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><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">int nChar=1+MultiByteToWideChar (CP_ACP, 0, &quot;Dialog&quot;, -1, szCaption, 50);</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script></div></div>а именно - в +1 - здесь появляется лишний символ. Вот небольшая доработка твоего кода, чтобы создавать контролы из шаблонов:<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">#define BUTTON_CLASS_ORDINAL 0x0080</div><div class="code_line">WORD* MakeControl(WORD* buf, DLGITEMTEMPLATE* pTempl, WORD classOrdinal, const wchar_t* name)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;buf = (WORD*)(((DWORD)buf + 3) &amp; ~3);</div><div class="code_line">&nbsp;&nbsp; &nbsp;size_t len = wcslen(name);</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(buf, pTempl, sizeof DLGITEMTEMPLATE);</div><div class="code_line">&nbsp;&nbsp; &nbsp;buf += sizeof DLGITEMTEMPLATE / sizeof WORD;</div><div class="code_line">&nbsp;&nbsp; &nbsp;*buf++ = 0xFFFF;</div><div class="code_line">&nbsp;&nbsp; &nbsp;*buf++ = classOrdinal;</div><div class="code_line">&nbsp;&nbsp; &nbsp;memcpy(buf, name, (len+1) * sizeof(wchar_t));</div><div class="code_line">&nbsp;&nbsp; &nbsp;buf += len+1; // подразумеваем для простоты, что sizeof wchar_t == sizeof WORD</div><div class="code_line">&nbsp;&nbsp; &nbsp;*buf++ = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return buf;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">int APIENTRY WinMain(HINSTANCE hInstance,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HINSTANCE hPrevInstance,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LPTSTR &nbsp; &nbsp;lpCmdLine,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int &nbsp; &nbsp; &nbsp; nCmdShow)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;hGlobal= ::GlobalAlloc(GMEM_ZEROINIT, 1024);</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp = (DLGTEMPLATE*)::GlobalLock(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;//=====================создаем диалог=============</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;style=WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION|WS_VISIBLE;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;dwExtendedStyle=0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cdit=0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;x=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;y=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cx=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cy=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPWORD lpw = (LPWORD) (pDlgTemp + 1);</div><div class="code_line">&nbsp;&nbsp; &nbsp;*lpw++=0;//меню отсутствует</div><div class="code_line">&nbsp;&nbsp; &nbsp;*lpw++=0;//класс по умолчанию</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPWSTR szCaption = (LPWSTR) lpw;</div><div class="code_line">&nbsp;&nbsp; &nbsp;int nChar=MultiByteToWideChar (CP_ACP, 0, &quot;Dialog&quot;, -1, szCaption, 50);</div><div class="code_line">&nbsp;&nbsp; &nbsp;lpw+=nChar;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cdit = 2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;DLGITEMTEMPLATE t = { 0 };</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.id = IDOK;</div><div class="code_line">&nbsp;&nbsp; &nbsp;LONG dbux = LOWORD(GetDialogBaseUnits());</div><div class="code_line">&nbsp;&nbsp; &nbsp;LONG dbuy = HIWORD(GetDialogBaseUnits());</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.x = MulDiv(140, 4, dbux);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.y = MulDiv(10, 8, dbuy);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.cx = MulDiv(50, 4, dbux);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.cy = MulDiv(25, 8, dbuy);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON;</div><div class="code_line">&nbsp;&nbsp; &nbsp;lpw = MakeControl(lpw, &amp;t, BUTTON_CLASS_ORDINAL, L&quot;Ok&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.y = MulDiv(40, 8, dbuy);</div><div class="code_line">&nbsp;&nbsp; &nbsp;t.id = IDCANCEL;</div><div class="code_line">&nbsp;&nbsp; &nbsp;lpw = MakeControl(lpw, &amp;t, BUTTON_CLASS_ORDINAL, L&quot;Cancel&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;::GlobalUnlock(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;INT_PTR ret=DialogBoxIndirect(hInstance,pDlgTemp,NULL,DialogProc);</div><div class="code_line">&nbsp;&nbsp; &nbsp;::GlobalFree(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div>]]></description>
        <author>Hryak</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467994</guid>
        <pubDate>Wed, 28 Feb 2007 07:13:26 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467994</link>
        <description><![CDATA[ElcnU: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>Hryak, 28.02.2007, 8:51:11, 1467969</span><div class='quote '>Они в хвостик следом за шаблоном самого диалога дописываются в тот же буфер. </div></div><br>
да так и делал, только в МСДН таким образом делают<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>http://support.microsoft.com/kb/140725</span><div class='quote '><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">&nbsp;&nbsp; &nbsp; &nbsp;/*</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Helper routine. &nbsp;Take an input pointer, return closest</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; pointer that is aligned on a DWORD (4 byte) boundary.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;*/ </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;LPWORD lpwAlign ( LPWORD lpIn)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ULONG ul;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ul = (ULONG) lpIn;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ul +=3;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ul &#62;&#62;=2;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ul &#60;&#60;=2;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; return (LPWORD) ul;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div></div></div><br>
и тоже не сработало]]></description>
        <author>ElcnU</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467969</guid>
        <pubDate>Wed, 28 Feb 2007 06:51:11 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467969</link>
        <description><![CDATA[Hryak: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=173533&view=findpost&p=1467940'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>ElcnU &#064; <time class="tag-quote__quoted-time" datetime="2007-02-28T06:27:32+00:00">28.02.07, 06:27</time></span><div class='quote '>только я пока не врубился как контролы приатачить к &quot;ресурсу&quot;</div></div><br>
Они в хвостик следом за шаблоном самого диалога дописываются в тот же буфер.]]></description>
        <author>Hryak</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467940</guid>
        <pubDate>Wed, 28 Feb 2007 06:27:32 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467940</link>
        <description><![CDATA[ElcnU: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>zanneo, 28.02.2007, 1:49:53, 1467837</span><div class='quote '>Можно небольшой пример как реализовать CreateDialogIndirect с DLGTEMPLATEEX? </div></div><br>
только я пока не врубился как контролы приатачить к &quot;ресурсу&quot;,создал в WM_INITDIALOG<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">#include &#60;windows.h&#62;</div><div class="code_line">&nbsp;</div><div class="code_line">INT_PTR CALLBACK DialogProc(HWND hwndDlg,</div><div class="code_line">&nbsp;&nbsp; &nbsp;UINT uMsg,</div><div class="code_line">&nbsp;&nbsp; &nbsp;WPARAM wParam,</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPARAM lParam</div><div class="code_line">);</div><div class="code_line">&nbsp;</div><div class="code_line">DLGTEMPLATE* pDlgTemp;</div><div class="code_line">HGLOBAL hGlobal;</div><div class="code_line">&nbsp;</div><div class="code_line">int APIENTRY WinMain(HINSTANCE hInstance,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HINSTANCE hPrevInstance,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LPTSTR &nbsp; &nbsp;lpCmdLine,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int &nbsp; &nbsp; &nbsp; nCmdShow)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;hGlobal= ::GlobalAlloc(GMEM_ZEROINIT, 1024);</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp = (DLGTEMPLATE*)::GlobalLock(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;//=====================создаем диалог=============</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;style=WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION|WS_VISIBLE;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;dwExtendedStyle=0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cdit=0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;x=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;y=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cx=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;pDlgTemp-&#62;cy=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPWORD lpw = (LPWORD) (pDlgTemp + 1);</div><div class="code_line">&nbsp;&nbsp; &nbsp;*lpw++=0;//меню отсутствует</div><div class="code_line">&nbsp;&nbsp; &nbsp;*lpw++=0;//класс по умолчанию</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPWSTR szCaption = (LPWSTR) lpw;</div><div class="code_line">&nbsp;&nbsp; &nbsp;int nChar=1+MultiByteToWideChar (CP_ACP, 0, &quot;Dialog&quot;, -1, szCaption, 50);</div><div class="code_line">&nbsp;&nbsp; &nbsp;lpw+=nChar;</div><div class="code_line">&nbsp;&nbsp; &nbsp;::GlobalUnlock(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;INT_PTR ret=DialogBoxIndirect(hInstance,pDlgTemp,NULL,DialogProc);</div><div class="code_line">&nbsp;&nbsp; &nbsp;::GlobalFree(hGlobal);</div><div class="code_line">&nbsp;&nbsp; &nbsp;return 0;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">INT_PTR CALLBACK DialogProc(HWND hwndDlg,</div><div class="code_line">&nbsp;&nbsp; &nbsp;UINT uMsg,</div><div class="code_line">&nbsp;&nbsp; &nbsp;WPARAM wParam,</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPARAM lParam</div><div class="code_line">)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;switch(uMsg)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp;case WM_INITDIALOG:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::CreateWindow(&quot;BUTTON&quot;,&quot;Ok&quot;,WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;140,10,50,25,hwndDlg,(HMENU)IDOK,::GetModuleHandle(NULL),0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::CreateWindow(&quot;BUTTON&quot;,&quot;Cancel&quot;,WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;140,40,50,25,hwndDlg,(HMENU)IDCANCEL,::GetModuleHandle(NULL),0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;case WM_COMMAND:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;switch(LOWORD(wParam))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case IDOK:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::EndDialog(hwndDlg,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case IDCANCEL:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::EndDialog(hwndDlg,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;return 0;</div><div class="code_line">};</div></ol></div></div></div></div><br>
ЗЫ:в МСДН есть более подробный пример :yes: ,только у меня не работает &lt;_&lt; <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-28T06:35:40+00:00">28.02.07, 06:35</time></span></span><br>
а <a class='tag-url' href='http://support.microsoft.com/kb/140725' target='_blank'>DOCERR: Incorrect DialogBoxIndirect() Code in Win32 SDK Docs</a> даже исправлено, только я не пробовал]]></description>
        <author>ElcnU</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467905</guid>
        <pubDate>Wed, 28 Feb 2007 05:32:54 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467905</link>
        <description><![CDATA[Hryak: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=173533&view=findpost&p=1467837'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>zanneo &#064; <time class="tag-quote__quoted-time" datetime="2007-02-27T23:49:53+00:00">27.02.07, 23:49</time></span><div class='quote '>Можно небольшой пример как реализовать CreateDialogIndirect с DLGTEMPLATEEX?</div></div><br>
http://msdn.microsoft.com/msdnmag/issues/05/08/CAtWork/<br>
http://support.microsoft.com/kb/155257]]></description>
        <author>Hryak</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467837</guid>
        <pubDate>Tue, 27 Feb 2007 23:49:53 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467837</link>
        <description><![CDATA[zanneo: <strong class='tag-b'>B.V.</strong><br>
Можно небольшой пример как реализовать CreateDialogIndirect с DLGTEMPLATEEX?]]></description>
        <author>zanneo</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467835</guid>
        <pubDate>Tue, 27 Feb 2007 23:43:35 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467835</link>
        <description><![CDATA[B.V.: CreateDialogIndirect с DLGTEMPLATEEX. Либо пиши стиль руками, в переменной...]]></description>
        <author>B.V.</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467833</guid>
        <pubDate>Tue, 27 Feb 2007 23:19:06 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467833</link>
        <description><![CDATA[ALXR: Так там и написано как создавать. В чем проблема?]]></description>
        <author>ALXR</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467829</guid>
        <pubDate>Tue, 27 Feb 2007 22:42:16 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467829</link>
        <description><![CDATA[zanneo: <strong class='tag-b'>B.V.</strong><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">int DialogBoxIndirect(</div><div class="code_line">&nbsp;&nbsp; &nbsp;HINSTANCE hInstance, &nbsp; &nbsp;// handle to application instance</div><div class="code_line">&nbsp;&nbsp; &nbsp;LPDLGTEMPLATE lpTemplate, &nbsp; // identifies dialog box template</div><div class="code_line">&nbsp;&nbsp; &nbsp;HWND hWndParent, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// handle to owner window</div><div class="code_line">&nbsp;&nbsp; &nbsp;DLGPROC lpDialogFunc &nbsp; &nbsp;// pointer to dialog box procedure &nbsp;</div><div class="code_line">&nbsp;&nbsp; );</div></ol></div></div></div></div>]]></description>
        <author>zanneo</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467826</guid>
        <pubDate>Tue, 27 Feb 2007 22:36:42 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467826</link>
        <description><![CDATA[B.V.: <a class='tag-url' href='http://forum.sources.ru/index.php?showtopic=159498' target='_blank'>[C++] CreateWindowEx</a> ?]]></description>
        <author>B.V.</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467820</guid>
        <pubDate>Tue, 27 Feb 2007 22:24:17 +0000</pubDate>
        <title>Создание диалога</title>
        <link>https://forum.sources.ru/index.php?showtopic=173533&amp;view=findpost&amp;p=1467820</link>
        <description><![CDATA[zanneo: Как создать Dialog при помощи WinAPI (без использования файлов ресурсов).<br>Поделитесь кодом плз. Спасибо.]]></description>
        <author>zanneo</author>
        <category>Visual C++ / MFC / WTL</category>
      </item>
	
      </channel>
      </rss>
	