<?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[neues fenster zeichnen]]></title><description><![CDATA[<p>wie kann ich nach einer if oder case abfrage ein neues fenster zeichnen? muss ich dieses in einer funktion erstellen? wie würde dann die funktion aussehen</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147037/neues-fenster-zeichnen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 03:18:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147037.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 May 2006 09:23:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 09:23:00 GMT]]></title><description><![CDATA[<p>wie kann ich nach einer if oder case abfrage ein neues fenster zeichnen? muss ich dieses in einer funktion erstellen? wie würde dann die funktion aussehen</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1056922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1056922</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sat, 13 May 2006 09:23:00 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 12:32:51 GMT]]></title><description><![CDATA[<p>Öhm ehrlich gesagt vermute ich mal das keiner dein Problem versteht.</p>
<p>Was willst du genau?<br />
1. Ein neues Fenster erstellen, dann natürlich auch anzeigen?<br />
2. Ein Fenster neu zeichnen?<br />
3. Du weißt garnicht was du da machst... und wovon du sprichst?</p>
<p>Na <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/1057018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057018</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 13 May 2006 12:32:51 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 13:17:36 GMT]]></title><description><![CDATA[<p>1. Ein neues Fenster erstellen, dann natürlich auch anzeigen? / und das alte ausblenden, aber das kann ich ja mit show window(hwnd,show) machen</p>
<p>nur ich habe noch nicht viel mit der api zu tun gehabt und möchte nun auf eine benutzeraktion (zb menüauswahl) per case menupunkt: ein fenster erstellen</p>
<p>wenn ich ein fenster nur ausblende: wie viele fenster kann ich so offenhalten ohne den pc zu überlasten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057044</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057044</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sat, 13 May 2006 13:17:36 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 15:06:27 GMT]]></title><description><![CDATA[<blockquote>
<p>wie viele fenster kann ich so offenhalten ohne den pc zu überlasten?</p>
</blockquote>
<p>Also ich habs noch net ausprobiert... so ca. 100000 ?! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Ne mal im ernst... kommt immer darauf an was innerhalb des Dialogs gemacht wird... bsw CPU fressende Berechnungnen in mehreren Dialogen nebeneinander... na ich weiß net <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Also einen Window kannst du mit CreateWindow erstellen... wo ist dein Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057106</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 13 May 2006 15:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 17:43:43 GMT]]></title><description><![CDATA[<p>ich weiß nicht wo ichs in die winmain stecken soll</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057193</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sat, 13 May 2006 17:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 19:50:48 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> is doch egal?! am besten an den anfang</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057263</guid><dc:creator><![CDATA[b0m0x]]></dc:creator><pubDate>Sat, 13 May 2006 19:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 21:00:34 GMT]]></title><description><![CDATA[<p>soll ich mit einer ifabfrage reagieren? wenn ja die variable ist in meiner fensterfunktion wie soll ich sie ins winmain schaffen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057299</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sat, 13 May 2006 21:00:34 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 21:39:52 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

long __stdcall WndProc(::HWND__*, unsigned int, unsigned int, long);

int __stdcall WinMain(::HINSTANCE__* hInstance, ::HINSTANCE__* hPrevInstance, 
                   LPSTR szCmdLine, int iCmdShow)
{
   ::HWND__*    hWnd;
   ::MSG        msg;
   ::WNDCLASS   wc;

   wc.style         =  CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc   =  WndProc;
   wc.cbClsExtra    =  0;
   wc.cbWndExtra    =  0;
   wc.hInstance     =  hInstance;
   wc.hCursor       =  ::LoadCursor(NULL, IDC_ARROW);
   wc.hIcon         =  ::LoadIcon(NULL, IDI_APPLICATION);
   wc.hbrBackground =  (HBRUSH)GetStockObject(WHITE_BRUSH);
   wc.lpszClassName =  &quot;Test&quot;;
   wc.lpszMenuName  =  NULL;

   ::RegisterClass(&amp;wc);

   hWnd = ::CreateWindow(&quot;Test&quot;, &quot;Meine 1. Anwendung&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

   ::ShowWindow(hWnd, iCmdShow);
   ::UpdateWindow(hWnd);

   while (::GetMessage(&amp;msg, NULL, 0, 0))
   {
      ::TranslateMessage(&amp;msg);
      ::DispatchMessage(&amp;msg);
   }

   return msg.wParam;
}

long __stdcall WndProc(::HWND__* hWnd, unsinged int message, unsigned int wParam, long lParam)
{
   switch (message)
   {
   case WM_CREATE:
      {
         // ... Hier kannst de dir bsw auch nochmal ein neues Fenster mit CreateWindow erstellen. usw :...
      }
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }

   return (long)DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1057316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057316</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 13 May 2006 21:39:52 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sat, 13 May 2006 22:07:24 GMT]]></title><description><![CDATA[<p>das meine ich: wenn ich das da mache meckert er bei der hInstance rum. wenn ich dann das fenster nochmal neu in einer funktion definiere mit windowsclass und dem rest dann mekert er auch an der stelle rum. das ist ja mein problem. soll ich vielleicht mal einen code posten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057325</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sat, 13 May 2006 22:07:24 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sun, 14 May 2006 08:01:48 GMT]]></title><description><![CDATA[<p>wäre hilfreich -.- und mal die genaue Fehlermeldung...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057393</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 14 May 2006 08:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sun, 14 May 2006 16:12:14 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

long __stdcall WndProc(::HWND__*, unsigned int, unsigned int, long);

char szPrgm[]  = &quot;test2&quot;;

bool MakeWindow(int iWidth, int iHeight)
{
  HINSTANCE hInstance;

  WNDCLASS wndWc;

  wndWc.style = CS_OWNDC;
  wndWc.lpfnWndProc = (WNDPROC) WndProc;
  wndWc.cbClsExtra = 0;
  wndWc.cbWndExtra = 0;
  wndWc.hInstance = GetModuleHandle(NULL);
  wndWc.hIcon = ::LoadCursor(NULL, IDC_ARROW);
  wndWc.hCursor = ::LoadIcon(NULL, IDI_APPLICATION);
  wndWc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
  wndWc.lpszMenuName = NULL;
  wndWc.lpszClassName = szPrgm;

  if (!RegisterClass(&amp;wndWc)) return false;

  int iSw = (WORD)GetSystemMetrics(SM_CXSCREEN);       // width
  int iSh = (WORD)GetSystemMetrics(SM_CYSCREEN);       // height

  RECT rc = { (iSw - iWidth)/2, (iSh - iHeight)/2, iWidth, iHeight };

  hWnd = CreateWindow(szPrgm, TEXT(&quot;Calculator 1.4&quot;),
                      WS_SYSMENU,
                      rc.left,rc.top, iWidth,iHeight,
                      NULL, NULL, GetModuleHandle(NULL), NULL);

  return (hWnd?true:false);
}

int __stdcall WinMain(::HINSTANCE__* hInstance, ::HINSTANCE__* hPrevInstance,
                   LPSTR szCmdLine, int iCmdShow)
{
   ::HWND__*    hWnd;
   ::MSG        msg;
   ::WNDCLASS   wc;

   wc.style         =  CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc   =  WndProc;
   wc.cbClsExtra    =  0;
   wc.cbWndExtra    =  0;
   wc.hInstance     =  hInstance;
   wc.hCursor       =  ::LoadCursor(NULL, IDC_ARROW);
   wc.hIcon         =  ::LoadIcon(NULL, IDI_APPLICATION);
   wc.hbrBackground =  (HBRUSH)GetStockObject(WHITE_BRUSH);
   wc.lpszClassName =  &quot;Test&quot;;
   wc.lpszMenuName  =  NULL;

   ::RegisterClass(&amp;wc);

   hWnd = ::CreateWindow(&quot;Test&quot;, &quot;Meine 1. Anwendung&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

   ::ShowWindow(hWnd, iCmdShow);
   ::UpdateWindow(hWnd);

   while (::GetMessage(&amp;msg, NULL, 0, 0))
   {
      ::TranslateMessage(&amp;msg);
      ::DispatchMessage(&amp;msg);
   }

   return msg.wParam;
}

long __stdcall WndProc(::HWND__* hWnd, unsigned int message, unsigned int wParam, long lParam)
{
   switch (message)
   {
   case WM_CREATE:
      {
      }
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }

   return (long)DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>So jetzt habe ich nur noch hWnd den fehler hWnd undeclared, sonst funktioniert es. ich möchte dann einfach die funktion aufrufen (das geht oder oder)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057640</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sun, 14 May 2006 16:12:14 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sun, 14 May 2006 16:13:37 GMT]]></title><description><![CDATA[<p>*edit: hauptteil hab ich auf ner opensourcepage gefunden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057642</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Sun, 14 May 2006 16:13:37 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Sun, 14 May 2006 17:01:26 GMT]]></title><description><![CDATA[<p>natürlich beschwert er sich da, du hast hWnd ja auch nirgends deklariert in deiner MakeWindow funktion...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057681</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057681</guid><dc:creator><![CDATA[WebNubbi]]></dc:creator><pubDate>Sun, 14 May 2006 17:01:26 GMT</pubDate></item><item><title><![CDATA[Reply to neues fenster zeichnen on Mon, 15 May 2006 12:07:02 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

char szPrgm[]  = &quot;abc&quot;;
static HBRUSH MyBrush;

bool MakeWindowSmall(int iWidth, int iHeight)
{
  HINSTANCE hInstance;
  WNDCLASS wndWc;

  wndWc.style = CS_OWNDC;
  wndWc.lpfnWndProc = (WNDPROC) WndProc;
  wndWc.cbClsExtra = 0;
  wndWc.cbWndExtra = 0;
  wndWc.hInstance = GetModuleHandle(NULL);
  wndWc.hIcon = LoadIcon (GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_ICON));
  wndWc.hCursor = LoadCursor (GetModuleHandle(NULL),MAKEINTRESOURCE(IDC_CURSOR));
  wndWc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
  wndWc.lpszMenuName = szPrgm;
  wndWc.lpszClassName = szPrgm;

  if (!RegisterClass(&amp;wndWc)) return false;

  int iSw = (WORD)GetSystemMetrics(SM_CXSCREEN);       // width
  int iSh = (WORD)GetSystemMetrics(SM_CYSCREEN);       // height

  RECT rc = { (iSw - iWidth)/2, (iSh - iHeight)/2, iWidth, iHeight };

  hWnd = CreateWindow(szPrgm, TEXT(&quot;abc&quot;),
                      WS_SYSMENU,
                      rc.left,rc.top, iWidth,iHeight,
                      NULL, NULL, GetModuleHandle(NULL), NULL);

  ShowWindow(hWnd, SW_SHOW);

  return (hWnd?true:false);
}

bool MakeWindowCompact(int iWidth, int iHeight)
{
  HINSTANCE hInstance;
  ::HWND__*    hWnds;
  WNDCLASS wndWc;

  wndWc.style = CS_OWNDC;
  wndWc.lpfnWndProc = (WNDPROC) WndProc;
  wndWc.cbClsExtra = 0;
  wndWc.cbWndExtra = 0;
  wndWc.hInstance = GetModuleHandle(NULL);
  wndWc.hIcon = ::LoadCursor(NULL, IDC_ARROW);
  wndWc.hCursor = ::LoadIcon(NULL, IDI_APPLICATION);
  wndWc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
  wndWc.lpszMenuName = NULL;
  wndWc.lpszClassName = szPrgm;

  if (!RegisterClass(&amp;wndWc)) return false;

  int iSw = (WORD)GetSystemMetrics(SM_CXSCREEN);       // width
  int iSh = (WORD)GetSystemMetrics(SM_CYSCREEN);       // height

  RECT rc = { (iSw - iWidth)/2, (iSh - iHeight)/2, iWidth, iHeight };

  hWnds = CreateWindow(szPrgm, TEXT(&quot;Calculator 1.4&quot;),
                      WS_SYSMENU,
                      rc.left,rc.top, iWidth,iHeight,
                      NULL, NULL, GetModuleHandle(NULL), NULL);

  ShowWindow(hWnds, SW_SHOW);

  return (hWnds?true:false);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, \
                   LPSTR lpCmdLine, int nCmdShow)
{

  if( !MakeWindowSmall(200,250))
        return -1;

  MSG mMsg;

  while (1)
  {

    if(PeekMessage(&amp;mMsg, 0, 0, 0, PM_REMOVE))
    {

      if(mMsg.message == WM_QUIT)
      {
          break;
      }

      TranslateMessage(&amp;mMsg);
      DispatchMessage(&amp;mMsg);
    }

  }

  DestroyWindow(hWnd);

  return 0;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{

HMENU hMenu;

  switch(uMessage)
  {
   case WM_CREATE:
     return 0;

case WM_COMMAND:

hMenu = GetMenu(hWnd);

switch( LOWORD (wParam))
{

case IDM_WM_small:
{
    MakeWindowSmall(200,250);
    break;
}
case IDM_WM_compact:
{
    MakeWindowCompact(200,450);
    break;
}
case IDM_WM_EXIT:
{
    PostQuitMessage(0);
    return 0;
}
case WM_DESTROY:
{
    DeleteObject(MyBrush);
    PostQuitMessage (0);
    return 0;
}

}

  return DefWindowProc(hWnd,uMessage,wParam,lParam);
}

LRESULT CALLBACK WndProc(HWND hWnds, UINT uMessage, WPARAM wParam, LPARAM lParam)
{

HMENU hMenu;

  switch(uMessage)
  {
   case WM_CREATE:
     return 0;

case WM_COMMAND:

hMenu = GetMenu(hWnds);

switch( LOWORD (wParam))
{

case IDM_WM_small:
{
    MakeWindowSmall(200,250);
    break;
}
case IDM_WM_compact:
{
    MakeWindowCompact(200,450);
    break;
}
case IDM_WM_EXIT:
{
    PostQuitMessage(0);
    return 0;
}
case WM_DESTROY:
{
    DeleteObject(MyBrush);
    PostQuitMessage (0);
    return 0;
}

}

  return DefWindowProc(hWnds,uMessage,wParam,lParam);
}
</code></pre>
<p>nun sollte er ja beim menüauswählen ein neues fenster öffnen, das macht er aber nicht</p>
<p>*kann sein das ich was kleines vergessen habe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> aber meine version läuft</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058065</guid><dc:creator><![CDATA[backstreez]]></dc:creator><pubDate>Mon, 15 May 2006 12:07:02 GMT</pubDate></item></channel></rss>