<?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[Warum macht mein Programm 100% CPU-Auslastung???]]></title><description><![CDATA[<p>wie schon gefragt:<br />
Warum macht mein Programm immer 97%-100% CPU-Auslastung???<br />
hier ist es:</p>
<pre><code>#define WIN32_LEAN_AND_MEAN //tells the compiler not to include MFC overhead

#include &lt;Windows.h&gt;
#include &lt;Winuser.h&gt;

#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#endif
#ifndef LWA_COLORKEY
#define LWA_COLORKEY 1
#endif
#ifndef LWA_ALPHA
#define LWA_ALPHA 2
#endif
#define COLOR_TRANSPARENT    RGB(128,128,128)

int SetWindowTransparent_l(HWND hwnd, int iAlpha)
{
  typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
  PSLWA            pSetLayeredWindowAttributes;
  HMODULE        hDLL;
  SetWindowLong (hwnd , GWL_EXSTYLE , GetWindowLong (hwnd , GWL_EXSTYLE ) | WS_EX_LAYERED ) ;
  hDLL = LoadLibrary (&quot;user32.dll&quot;);
  if(!hDLL)
    MessageBox(NULL,TEXT(&quot;No Handle&quot;),TEXT(&quot;ERROR&quot;),MB_OK);
  pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,&quot;SetLayeredWindowAttributes&quot;);
  if (pSetLayeredWindowAttributes != NULL)
  {
    pSetLayeredWindowAttributes (hwnd,COLOR_TRANSPARENT, iAlpha, LWA_COLORKEY|LWA_ALPHA);
  }
  return (0);
}

void bmpshow(HWND hwnd,HBITMAP hbitmap,int xp,int yp,int xs,int ys,int xe,int ye){
			HDC hdc = GetDC(hwnd); 
			HDC image_dc = CreateCompatibleDC(hdc);	
			SelectObject(image_dc,hbitmap);
			BitBlt(hdc,xp,yp,xe,ye,image_dc,xs,ys,SRCCOPY); 
			ReleaseDC(hwnd, hdc); 
			DeleteDC(image_dc);
}

HBITMAP Table   = (HBITMAP)LoadImage(GetModuleHandle(NULL),&quot;tbl\\tbl_Window.bmp&quot; ,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP SysBtns = (HBITMAP)LoadImage(GetModuleHandle(NULL),&quot;tbl\\tbl_SysBtns.bmp&quot;,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);

void table(HWND hwnd,int x1,int y1,int x2,int y2){
			x2=x1+x2;
			y2=y1+y2;
			bmpshow(hwnd,Table,x1   ,y1		,   0,   0,24      ,24 );
			bmpshow(hwnd,Table,x1+24,y1		,  24,   0,x2-x1-48,24 );
			bmpshow(hwnd,Table,x2-24,y1		,2072,   0,24      ,24 );

			bmpshow(hwnd,Table,x1   ,y1+24	,   0,  24,2       ,y2-y1-26);
			bmpshow(hwnd,Table,x1+2 ,y1+24	,  24,  24,x2-x1-4 ,y2-y1-26);
			bmpshow(hwnd,Table,x2-2 ,y1+24	,2072,  24,2       ,y2-y1-26);

			bmpshow(hwnd,Table,x1   ,y2-2	,   0,1304,2       ,2  );
			bmpshow(hwnd,Table,x1+2 ,y2-2	,  24,1304,x2-x1-4 ,2  );
			bmpshow(hwnd,Table,x2-2 ,y2-2	,2072,1304,2       ,2  );
}

void ShowSysBtn(HWND hwnd)
{
bmpshow(hwnd,SysBtns,570,2,0, 0,20,20);
bmpshow(hwnd,SysBtns,595,2,0,20,20,20);
}

void CheckSysBtn(HWND hwnd,POINT MousePos,int Item)
{
int x=MousePos.x;
int y=MousePos.y;
	if(x&gt;570 &amp;&amp; x&lt;590 &amp;&amp; y&gt;2 &amp;&amp; y&lt;22){
		bmpshow(hwnd,SysBtns,570,2,Item*20, 0,20,20);
		if(Item==2){ShowWindow(hwnd,SW_MINIMIZE);}
	}
	else
	{
		bmpshow(hwnd,SysBtns,570,2, 0, 0,20,20);
	}
	if(x&gt;595 &amp;&amp; x&lt;615 &amp;&amp; y&gt;2 &amp;&amp; y&lt;22){
		bmpshow(hwnd,SysBtns,595,2,Item*20,20,20,20);
		if(Item==2){SendMessage(hwnd, WM_DESTROY, 0, 0);}
	}
	else
	{
		bmpshow(hwnd,SysBtns,595,2, 0,20,20,20);
	}
}

LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	POINT MousePos;

	if(msg==WM_CREATE)
		{
		SetWindowTransparent_l(hwnd,255);
		table(hwnd,0 ,0  ,640,480);
		ShowSysBtn(hwnd);
		}
	if(msg==WM_LBUTTONUP)
		{
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,0);
		}
	if(msg==WM_MOUSEMOVE)
		{
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,1);
		}
	if(msg==WM_LBUTTONDOWN)
		{    
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,2);
			if(MousePos.x&lt;550 &amp;&amp; MousePos.y&lt;24){
			ReleaseCapture();
			SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);          
			UpdateWindow(hwnd);
			}
		}
	if(msg==WM_PAINT)
		{
		table(hwnd,0 ,0  ,640,480);
		ShowSysBtn(hwnd);
		}

	if(msg==WM_DESTROY)
		{
			PostQuitMessage(0);
			return 0;
		}
	return(DefWindowProc(hwnd, msg, wparam, lparam));
}

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{

	WNDCLASSEX window; //blank window, we're using the extended windows class (WNDCLASSEX)
	HWND hwnd; //window handle
	MSG msg; //message

	window.cbClsExtra = 0; //extra class stuff, set to 0 for now
	window.cbSize = sizeof(WNDCLASSEX); //set to the size of the WINDOWCLASSEX structure
	window.cbWndExtra = 0; //extra class stuff, set to 0 for now
	window.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);//BLACK_BRUSH); //sets the color of the brush to paint in, notice the type cast to HBRUSH, this is because GetStockObject() can be used for more tehn just getting the brushcolor
	window.hCursor = LoadCursor(NULL, IDC_ARROW); //cursor for your app, sets it to the standard arrow
	window.hIcon = LoadIcon(NULL, IDI_APPLICATION); //icon of your program
	window.hIconSm = LoadIcon(NULL, IDI_APPLICATION); //icon that appears on the titlebar and when minimized
	window.hInstance = hinstance; //the application instance
	window.lpfnWndProc = WindowProc; //name of the function that takes care of the messages
	window.lpszClassName = &quot;WINCLASS1&quot;; //name of the class
	window.lpszMenuName = NULL; //menu, dont worry about this now (maybe in a later example, just set it to NULL
	window.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;

	if(!RegisterClassEx(&amp;window))
		return 0;

	if(!(hwnd = CreateWindowEx(
		NULL,//WS_EX_TRANSPARENT, //extended style
		&quot;WINCLASS1&quot;, //name of the class
		&quot;... by K4!53R&quot;, //title of the window
		WS_OVERLAPPED | WS_VISIBLE | WS_POPUP, //common flags, you DO want to see your window, right?
		0, 0, //initial x and y postion
		650, 515, //initial height and width
		NULL, //handle to parent, set to NULL so the desktop is the parent
		NULL, //handle to menu, we didnt use a menu now so dont worry about it
		hinstance, //instance of application
		NULL ))) //extra param
	return 0;

	while(true)
	{
		if(PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
		{
			if(msg.message == WM_QUIT)
				break;
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}
	return(msg.wParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/117086/warum-macht-mein-programm-100-cpu-auslastung</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 10:19:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117086.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Aug 2005 12:49:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 12:49:13 GMT]]></title><description><![CDATA[<p>wie schon gefragt:<br />
Warum macht mein Programm immer 97%-100% CPU-Auslastung???<br />
hier ist es:</p>
<pre><code>#define WIN32_LEAN_AND_MEAN //tells the compiler not to include MFC overhead

#include &lt;Windows.h&gt;
#include &lt;Winuser.h&gt;

#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED 0x00080000
#endif
#ifndef LWA_COLORKEY
#define LWA_COLORKEY 1
#endif
#ifndef LWA_ALPHA
#define LWA_ALPHA 2
#endif
#define COLOR_TRANSPARENT    RGB(128,128,128)

int SetWindowTransparent_l(HWND hwnd, int iAlpha)
{
  typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
  PSLWA            pSetLayeredWindowAttributes;
  HMODULE        hDLL;
  SetWindowLong (hwnd , GWL_EXSTYLE , GetWindowLong (hwnd , GWL_EXSTYLE ) | WS_EX_LAYERED ) ;
  hDLL = LoadLibrary (&quot;user32.dll&quot;);
  if(!hDLL)
    MessageBox(NULL,TEXT(&quot;No Handle&quot;),TEXT(&quot;ERROR&quot;),MB_OK);
  pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,&quot;SetLayeredWindowAttributes&quot;);
  if (pSetLayeredWindowAttributes != NULL)
  {
    pSetLayeredWindowAttributes (hwnd,COLOR_TRANSPARENT, iAlpha, LWA_COLORKEY|LWA_ALPHA);
  }
  return (0);
}

void bmpshow(HWND hwnd,HBITMAP hbitmap,int xp,int yp,int xs,int ys,int xe,int ye){
			HDC hdc = GetDC(hwnd); 
			HDC image_dc = CreateCompatibleDC(hdc);	
			SelectObject(image_dc,hbitmap);
			BitBlt(hdc,xp,yp,xe,ye,image_dc,xs,ys,SRCCOPY); 
			ReleaseDC(hwnd, hdc); 
			DeleteDC(image_dc);
}

HBITMAP Table   = (HBITMAP)LoadImage(GetModuleHandle(NULL),&quot;tbl\\tbl_Window.bmp&quot; ,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP SysBtns = (HBITMAP)LoadImage(GetModuleHandle(NULL),&quot;tbl\\tbl_SysBtns.bmp&quot;,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);

void table(HWND hwnd,int x1,int y1,int x2,int y2){
			x2=x1+x2;
			y2=y1+y2;
			bmpshow(hwnd,Table,x1   ,y1		,   0,   0,24      ,24 );
			bmpshow(hwnd,Table,x1+24,y1		,  24,   0,x2-x1-48,24 );
			bmpshow(hwnd,Table,x2-24,y1		,2072,   0,24      ,24 );

			bmpshow(hwnd,Table,x1   ,y1+24	,   0,  24,2       ,y2-y1-26);
			bmpshow(hwnd,Table,x1+2 ,y1+24	,  24,  24,x2-x1-4 ,y2-y1-26);
			bmpshow(hwnd,Table,x2-2 ,y1+24	,2072,  24,2       ,y2-y1-26);

			bmpshow(hwnd,Table,x1   ,y2-2	,   0,1304,2       ,2  );
			bmpshow(hwnd,Table,x1+2 ,y2-2	,  24,1304,x2-x1-4 ,2  );
			bmpshow(hwnd,Table,x2-2 ,y2-2	,2072,1304,2       ,2  );
}

void ShowSysBtn(HWND hwnd)
{
bmpshow(hwnd,SysBtns,570,2,0, 0,20,20);
bmpshow(hwnd,SysBtns,595,2,0,20,20,20);
}

void CheckSysBtn(HWND hwnd,POINT MousePos,int Item)
{
int x=MousePos.x;
int y=MousePos.y;
	if(x&gt;570 &amp;&amp; x&lt;590 &amp;&amp; y&gt;2 &amp;&amp; y&lt;22){
		bmpshow(hwnd,SysBtns,570,2,Item*20, 0,20,20);
		if(Item==2){ShowWindow(hwnd,SW_MINIMIZE);}
	}
	else
	{
		bmpshow(hwnd,SysBtns,570,2, 0, 0,20,20);
	}
	if(x&gt;595 &amp;&amp; x&lt;615 &amp;&amp; y&gt;2 &amp;&amp; y&lt;22){
		bmpshow(hwnd,SysBtns,595,2,Item*20,20,20,20);
		if(Item==2){SendMessage(hwnd, WM_DESTROY, 0, 0);}
	}
	else
	{
		bmpshow(hwnd,SysBtns,595,2, 0,20,20,20);
	}
}

LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	POINT MousePos;

	if(msg==WM_CREATE)
		{
		SetWindowTransparent_l(hwnd,255);
		table(hwnd,0 ,0  ,640,480);
		ShowSysBtn(hwnd);
		}
	if(msg==WM_LBUTTONUP)
		{
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,0);
		}
	if(msg==WM_MOUSEMOVE)
		{
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,1);
		}
	if(msg==WM_LBUTTONDOWN)
		{    
		MousePos.x = LOWORD(lparam);
        MousePos.y = HIWORD(lparam);
		CheckSysBtn(hwnd,MousePos,2);
			if(MousePos.x&lt;550 &amp;&amp; MousePos.y&lt;24){
			ReleaseCapture();
			SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);          
			UpdateWindow(hwnd);
			}
		}
	if(msg==WM_PAINT)
		{
		table(hwnd,0 ,0  ,640,480);
		ShowSysBtn(hwnd);
		}

	if(msg==WM_DESTROY)
		{
			PostQuitMessage(0);
			return 0;
		}
	return(DefWindowProc(hwnd, msg, wparam, lparam));
}

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{

	WNDCLASSEX window; //blank window, we're using the extended windows class (WNDCLASSEX)
	HWND hwnd; //window handle
	MSG msg; //message

	window.cbClsExtra = 0; //extra class stuff, set to 0 for now
	window.cbSize = sizeof(WNDCLASSEX); //set to the size of the WINDOWCLASSEX structure
	window.cbWndExtra = 0; //extra class stuff, set to 0 for now
	window.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);//BLACK_BRUSH); //sets the color of the brush to paint in, notice the type cast to HBRUSH, this is because GetStockObject() can be used for more tehn just getting the brushcolor
	window.hCursor = LoadCursor(NULL, IDC_ARROW); //cursor for your app, sets it to the standard arrow
	window.hIcon = LoadIcon(NULL, IDI_APPLICATION); //icon of your program
	window.hIconSm = LoadIcon(NULL, IDI_APPLICATION); //icon that appears on the titlebar and when minimized
	window.hInstance = hinstance; //the application instance
	window.lpfnWndProc = WindowProc; //name of the function that takes care of the messages
	window.lpszClassName = &quot;WINCLASS1&quot;; //name of the class
	window.lpszMenuName = NULL; //menu, dont worry about this now (maybe in a later example, just set it to NULL
	window.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;

	if(!RegisterClassEx(&amp;window))
		return 0;

	if(!(hwnd = CreateWindowEx(
		NULL,//WS_EX_TRANSPARENT, //extended style
		&quot;WINCLASS1&quot;, //name of the class
		&quot;... by K4!53R&quot;, //title of the window
		WS_OVERLAPPED | WS_VISIBLE | WS_POPUP, //common flags, you DO want to see your window, right?
		0, 0, //initial x and y postion
		650, 515, //initial height and width
		NULL, //handle to parent, set to NULL so the desktop is the parent
		NULL, //handle to menu, we didnt use a menu now so dont worry about it
		hinstance, //instance of application
		NULL ))) //extra param
	return 0;

	while(true)
	{
		if(PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
		{
			if(msg.message == WM_QUIT)
				break;
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}
	return(msg.wParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/844976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/844976</guid><dc:creator><![CDATA[K4!53R]]></dc:creator><pubDate>Wed, 03 Aug 2005 12:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 13:39:38 GMT]]></title><description><![CDATA[<p>weil es wahrscheinlich dauernd durchrattert ohne pause...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/845005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845005</guid><dc:creator><![CDATA[loki1985]]></dc:creator><pubDate>Wed, 03 Aug 2005 13:39:38 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 13:40:30 GMT]]></title><description><![CDATA[<p>wie meinst du das???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/845006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845006</guid><dc:creator><![CDATA[K4!53R]]></dc:creator><pubDate>Wed, 03 Aug 2005 13:40:30 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 13:53:24 GMT]]></title><description><![CDATA[<p>Selbst das hier macht die gleiche auslastung bei mir:</p>
<pre><code>#define WIN32_LEAN_AND_MEAN

#include &lt;Windows.h&gt;
#include &lt;Winuser.h&gt;

LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	if(msg==WM_DESTROY)
		{
			PostQuitMessage(0);
			return 0;
		}
	return(DefWindowProc(hwnd, msg, wparam, lparam));
}

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{
	WNDCLASSEX window; 
	HWND hwnd; 
	MSG msg;

	window.cbClsExtra = 0; 
	window.cbSize = sizeof(WNDCLASSEX); 
	window.cbWndExtra = 0; 
	window.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
	window.hCursor = LoadCursor(NULL, IDC_ARROW);
	window.hIcon = LoadIcon(NULL, IDI_APPLICATION); 
	window.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
	window.hInstance = hinstance;
	window.lpfnWndProc = WindowProc;
	window.lpszClassName = &quot;WINCLASS1&quot;;
	window.lpszMenuName = NULL; 
	window.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;

	if(!RegisterClassEx(&amp;window))
		return 0;

	if(!(hwnd = CreateWindowEx(
		NULL,//WS_EX_TRANSPARENT, 
		&quot;WINCLASS1&quot;,
		&quot;... by K4!53R&quot;,
		WS_OVERLAPPED | WS_VISIBLE | WS_POPUP, 
		0, 0,
		650, 515, 
		NULL, 
		NULL,
		hinstance, 
		NULL )))
	return 0;

	while(true)
	{
		if(PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
		{
			if(msg.message == WM_QUIT)
				break;
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}
	return(msg.wParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/845014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845014</guid><dc:creator><![CDATA[K4!53R]]></dc:creator><pubDate>Wed, 03 Aug 2005 13:53:24 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 13:57:12 GMT]]></title><description><![CDATA[<p>AAAHHH - schon erledigt!<br />
<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="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/845018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845018</guid><dc:creator><![CDATA[K4!53R]]></dc:creator><pubDate>Wed, 03 Aug 2005 13:57:12 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Wed, 03 Aug 2005 13:57:32 GMT]]></title><description><![CDATA[<p>Deine Nachrichtenschleife ist unvollständig. Das was du machst, wird idR nur bei Spielen verwndet, wo der Game-Loop sozusagen immer läuft.<br />
Ansonsten solltest du statt PeekMessage eher GetMessage verwenden bzw. WaitMessage aufrufen, sofern keine weiteren Nachrichten anstehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/845019</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845019</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Wed, 03 Aug 2005 13:57:32 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Thu, 04 Aug 2005 01:01:34 GMT]]></title><description><![CDATA[<p>Kennst du switch()? <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="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/845197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845197</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Thu, 04 Aug 2005 01:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to Warum macht mein Programm 100% CPU-Auslastung??? on Thu, 04 Aug 2005 12:14:05 GMT]]></title><description><![CDATA[<p>wie gesagt - schon erledigt!<br />
genauso hab ich es dann nämlich auch gelöst...</p>
<p>sicher kenn ich switch, musste ich zwischendurch aber umändern weil ich es etwas anders brauchte, aber trotzdem danke für den tip!<br />
<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/845572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/845572</guid><dc:creator><![CDATA[K4!53R]]></dc:creator><pubDate>Thu, 04 Aug 2005 12:14:05 GMT</pubDate></item></channel></rss>