<?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[Einfache Dialog-Anwendung]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich programmiere mit VS2008.</p>
<p>Ich würde gerne ein Programm in C++ schreiben, welches auf einem Dialog statt auf einem normalen Window basiert.</p>
<p>Mein jetziger Code:</p>
<pre><code class="language-cpp">// tool.cpp : Definiert den Einstiegspunkt für die Anwendung.

#include &quot;stdafx.h&quot;
#include &quot;tool.h&quot;

// Vorwärtsdeklarationen der in diesem Codemodul enthaltenen Funktionen:
INT_PTR CALLBACK    DialogProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
    return DialogBox (hInstance, MAKEINTRESOURCE(IDD_MAINDLG), 0, DialogProc);
}

// Meldungshandler für HauptDialog.
INT_PTR CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{    
     switch (message)
     {
     case WM_INITDIALOG:
         return TRUE;

     case WM_CLOSE:
         EndDialog (hwnd,0);
         return TRUE;  
     }
     return FALSE;
}

// Meldungshandler für Infofeld.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}
</code></pre>
<p>Ich weiß nicht, ob der Code vollkommen richtig ist, aber er funktioniert^^.<br />
Vielleicht habt ihr einen besseren Vorchlag..Wäre cool.</p>
<p>Also das eigentliche Problem ist, dass der IDD_MAINDLG im Editor ganz normal aussieht (er beinhaltet ein Tab Control), aber als kompilierte Anwendung das Tab Control nicht funktioniert und anders aussieht:</p>
<p><a href="http://img151.imageshack.us/my.php?image=toolir2.jpg" rel="nofollow">http://img151.imageshack.us/my.php?image=toolir2.jpg</a></p>
<p>Ich hoffe, ihr könnt mir helfen,</p>
<p>MfG,<br />
echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/217751/einfache-dialog-anwendung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 07:29:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/217751.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Jul 2008 18:33:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Thu, 10 Jul 2008 18:33:11 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich programmiere mit VS2008.</p>
<p>Ich würde gerne ein Programm in C++ schreiben, welches auf einem Dialog statt auf einem normalen Window basiert.</p>
<p>Mein jetziger Code:</p>
<pre><code class="language-cpp">// tool.cpp : Definiert den Einstiegspunkt für die Anwendung.

#include &quot;stdafx.h&quot;
#include &quot;tool.h&quot;

// Vorwärtsdeklarationen der in diesem Codemodul enthaltenen Funktionen:
INT_PTR CALLBACK    DialogProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
    return DialogBox (hInstance, MAKEINTRESOURCE(IDD_MAINDLG), 0, DialogProc);
}

// Meldungshandler für HauptDialog.
INT_PTR CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{    
     switch (message)
     {
     case WM_INITDIALOG:
         return TRUE;

     case WM_CLOSE:
         EndDialog (hwnd,0);
         return TRUE;  
     }
     return FALSE;
}

// Meldungshandler für Infofeld.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}
</code></pre>
<p>Ich weiß nicht, ob der Code vollkommen richtig ist, aber er funktioniert^^.<br />
Vielleicht habt ihr einen besseren Vorchlag..Wäre cool.</p>
<p>Also das eigentliche Problem ist, dass der IDD_MAINDLG im Editor ganz normal aussieht (er beinhaltet ein Tab Control), aber als kompilierte Anwendung das Tab Control nicht funktioniert und anders aussieht:</p>
<p><a href="http://img151.imageshack.us/my.php?image=toolir2.jpg" rel="nofollow">http://img151.imageshack.us/my.php?image=toolir2.jpg</a></p>
<p>Ich hoffe, ihr könnt mir helfen,</p>
<p>MfG,<br />
echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1545271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1545271</guid><dc:creator><![CDATA[echo*lt*delta*gt*]]></dc:creator><pubDate>Thu, 10 Jul 2008 18:33:11 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Thu, 10 Jul 2008 18:54:09 GMT]]></title><description><![CDATA[<p>Für Dialoge ist immer die einfachste Lösung, diese in einer Ressource (rc-Datei) festzulegen und über Menüpunkte aufzurufen. Windows verwaltet dann selbst die Fenster.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1545284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1545284</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Thu, 10 Jul 2008 18:54:09 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Fri, 11 Jul 2008 07:59:29 GMT]]></title><description><![CDATA[<p>Sry, habe vergessen zu erwähnen, dass ich den Dialog in einer rc-Datei erstellt habe.</p>
<p>Sollte aber aus dem Codebeispiel hervorgehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Mfg, echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1545494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1545494</guid><dc:creator><![CDATA[echo*lt*delta*gt*]]></dc:creator><pubDate>Fri, 11 Jul 2008 07:59:29 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sat, 12 Jul 2008 13:46:17 GMT]]></title><description><![CDATA[<p>Das ist wirklich wichtig für mich zu wissen, weil alle meine zukünftigen programme darauf aufgebaut sein werden..</p>
<p>Mfg, echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546204</guid><dc:creator><![CDATA[echo*lt*delta*gt*]]></dc:creator><pubDate>Sat, 12 Jul 2008 13:46:17 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sat, 12 Jul 2008 14:10:55 GMT]]></title><description><![CDATA[<p>Bei Dialogen sollte man...</p>
<p>- BOOL CALLBACK DialogProc() verwenden, da man sowiso nur TRUE und FALSE zurückgibt.<br />
- Vorher InitCommonControls(Ex)() aufrufen, siehe msdn.<br />
- eine Klasse verwenden, die den Dialog repräsentiert, dh, die Klasse enthält aufrufprozedur, DlgProc, sowie statische DlgProc die DlgProc in Klasse aufruft, um auf Klassenmember zurückzugreifen. Dadurch behält man den Überblick über das Geschehen^^.<br />
- Siehe dir die FAQs an, wie man den XP-Style per manifest einkompiliert.</p>
<p>-&gt; Dialoge in der MSDN<br />
<a href="http://msdn.microsoft.com/en-us/library/ms632588(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms632588(VS.85).aspx</a></p>
<p>-&gt; Windows Controls in der MSDN<br />
<a href="http://msdn.microsoft.com/en-us/library/bb773173(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb773173(VS.85).aspx</a></p>
<p>-Serious_C</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546213</guid><dc:creator><![CDATA[Serious_C]]></dc:creator><pubDate>Sat, 12 Jul 2008 14:10:55 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sat, 12 Jul 2008 14:39:55 GMT]]></title><description><![CDATA[<p>als alternative zur winapi allgemein sei hier noch wxwidgets und qt genannt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546235</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 12 Jul 2008 14:39:55 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sat, 12 Jul 2008 16:26:44 GMT]]></title><description><![CDATA[<p>Danke, aber ich kann damit nicht recht viel anfangen?</p>
<p>Wo liegt denn der eigentliche Fehler, den man auf dem Bild sehen kann?</p>
<p>Ich habe auch nichts gegen ein konkretes codebeispiel.</p>
<p>MfG,<br />
echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546292</guid><dc:creator><![CDATA[echo*lt*delta*gt*]]></dc:creator><pubDate>Sat, 12 Jul 2008 16:26:44 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sat, 12 Jul 2008 17:28:38 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/15713">@Fencer</a>: Fuck wxWidgets... We are WinAPI!!!<br />
Warum nicht direkt WinAPI? es ist doch nicht schwer...??!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546317</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546317</guid><dc:creator><![CDATA[Serious_C]]></dc:creator><pubDate>Sat, 12 Jul 2008 17:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sun, 13 Jul 2008 17:42:27 GMT]]></title><description><![CDATA[<p>Kann mir hier niemand helfen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Das ist echt wichtig..</p>
<p>Wie macht ihr das eigentlich, also bevorzugt ihr eher Dialog-Anwendungen, wie sie viele kleine Anwendungen verwenden, oder benutzt ihr die 'normalen' Fenster?</p>
<p>MfG, echo&lt;delta&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1546732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546732</guid><dc:creator><![CDATA[echo*lt*delta*gt*]]></dc:creator><pubDate>Sun, 13 Jul 2008 17:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to Einfache Dialog-Anwendung on Sun, 13 Jul 2008 18:27:39 GMT]]></title><description><![CDATA[<p>echo&lt;delta&gt; schrieb:</p>
<blockquote>
<p>Wo liegt denn der eigentliche Fehler, den man auf dem Bild sehen kann?</p>
</blockquote>
<p>Du musst dem Tab-Control noch Tabs hinzufügen <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="😉"
    /> Im Editor wird das Tab-Control mit Tabs angezeigt, damit man was sieht. Im Programm musst du sie dann aber selber hinzufügen.</p>
<p>edit: Also einfach bei WM_INITDIALOG:</p>
<pre><code class="language-cpp">TCITEM item = { TCIF_TEXT, 0, 0, &quot;Hallo&quot; };
TabCtrl_InsertItem( GetDlgItem(hwnd,TAB_CTRL_ID), 0, &amp;item );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1546755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1546755</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 13 Jul 2008 18:27:39 GMT</pubDate></item></channel></rss>