<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dialogitem soll focus bekommen]]></title><description><![CDATA[<p>heiho</p>
<p>folgendes,<br />
ich lass hier ein dialog anzeigen wo der benutzer einen namen eingeben soll,<br />
direkt nach erstellung des dialoges, soll das edit feld den focus haben, sodass der benutzer nicht erst reinklicken muss</p>
<p>wie kann ich das bewerkstelligen ?</p>
<p>das habe ich bisher:</p>
<pre><code class="language-cpp">void COwnClass::OnFunc(COwnClass *mainclass)
{
	::DialogBox(mainclass-&gt;GetInstance(), MAKEINTRESOURCE(IDD_GETNAME), mainclass-&gt;GetHandle(), (DLGPROC)GetNameProc);
}
</code></pre>
<pre><code class="language-cpp">BOOL CALLBACK GetNameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
        case WM_INITDIALOG:
            ::SetFocus(::GetDlgItem(hwndDlg, IDC_NEWNAME));  // das bewirkt nichts
            return TRUE;
        case WM_DESTROY:
        case WM_CLOSE:
            ::EndDialog(hwndDlg,0);
            return TRUE;
.
.
.
.
.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/180557/dialogitem-soll-focus-bekommen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 05:25:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180557.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 May 2007 05:56:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dialogitem soll focus bekommen on Fri, 04 May 2007 05:56:12 GMT]]></title><description><![CDATA[<p>heiho</p>
<p>folgendes,<br />
ich lass hier ein dialog anzeigen wo der benutzer einen namen eingeben soll,<br />
direkt nach erstellung des dialoges, soll das edit feld den focus haben, sodass der benutzer nicht erst reinklicken muss</p>
<p>wie kann ich das bewerkstelligen ?</p>
<p>das habe ich bisher:</p>
<pre><code class="language-cpp">void COwnClass::OnFunc(COwnClass *mainclass)
{
	::DialogBox(mainclass-&gt;GetInstance(), MAKEINTRESOURCE(IDD_GETNAME), mainclass-&gt;GetHandle(), (DLGPROC)GetNameProc);
}
</code></pre>
<pre><code class="language-cpp">BOOL CALLBACK GetNameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
        case WM_INITDIALOG:
            ::SetFocus(::GetDlgItem(hwndDlg, IDC_NEWNAME));  // das bewirkt nichts
            return TRUE;
        case WM_DESTROY:
        case WM_CLOSE:
            ::EndDialog(hwndDlg,0);
            return TRUE;
.
.
.
.
.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1278498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278498</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Fri, 04 May 2007 05:56:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogitem soll focus bekommen on Fri, 04 May 2007 07:26:36 GMT]]></title><description><![CDATA[<p>habs eben rausgefunden</p>
<p>mit</p>
<pre><code class="language-cpp">::SendMessage(::GetDlgItem(hwndDlg, IDC_NEWNAME), WM_SETFOCUS, reinterpret_cast&lt;WPARAM&gt;(::GetDlgItem(hwndDlg, IDC_NEWNAME)), 0);
</code></pre>
<p>ging es</p>
<p>args, zu frueh gefreut, wenn ich das so mach werden keine tastatureingaben mehr angenommen+</p>
<p>//nochmal edit</p>
<p>ich habe das jetzt so geloest das ich die TabStops von den beiden buttons Ok, Cancel weggenommen habe {auf false gesetzt}, ich hatte gelesen das das erste automatisch den focus bekommt, vermutlich hatte das ok die ganze zeit den focus erhalten</p>
<p>warum SetFocus selber nicht funktionierte, und bei SendMessage alle weiteren eingaben nicht mehr angenommen werden bleibt mir aber weiterhin ein raesel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278523</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Fri, 04 May 2007 07:26:36 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogitem soll focus bekommen on Fri, 04 May 2007 08:03:33 GMT]]></title><description><![CDATA[<p>Win32 Programmer's Reference schrieb:</p>
<blockquote>
<p><strong>WM_INITDIALOG</strong></p>
<p><strong>Return Values</strong></p>
<p>The dialog box procedure should return TRUE to direct Windows to set the keyboard focus to the control given by hwndFocus. Otherwise, it should return FALSE to prevent Windows from setting the default keyboard focus.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1278557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278557</guid><dc:creator><![CDATA[keksekekse]]></dc:creator><pubDate>Fri, 04 May 2007 08:03:33 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogitem soll focus bekommen on Fri, 04 May 2007 14:58:55 GMT]]></title><description><![CDATA[<p>Der Return-Wert einer DialogProc sollte aber mittlerweile INT_PTR sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278859</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Fri, 04 May 2007 14:58:55 GMT</pubDate></item></channel></rss>