<?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[Festplattentraffic bei Windows-Anwendungen?]]></title><description><![CDATA[<p>Da ich mir keinen teuren Microsoft-Compiler mit VisualStudio o.ä. leisten kann/will, versuche ich mich grade darin, auch so Fenster verwenden zu &quot;dürfen&quot;. Allerdings fängt aus unerfindlichen Gründen meine Festplatte immer an zu &quot;rattern&quot;, wenn ich ein solches Programm starte. Es klingt nach heftig schnellen Zugriffen... Dabei greife ich gar nicht auf die Festplatte zu.</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK myWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
    switch(uMsg) {
        case WM_CLOSE:
            ExitProcess(0);
            break;
        default:
            return CallWindowProc(DefWindowProc, hwnd, uMsg, wParam, lParam);
    }
}

void loop() {
    MSG msg;
    for(;;)
        while(PeekMessage(&amp;msg, NULL, 0, 0, PM_NOREMOVE) &gt; 0)
            if(GetMessage(&amp;msg, NULL, 0, 0) &gt; 0) {
                TranslateMessage(&amp;msg);
                DispatchMessage(&amp;msg);
            }
}

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
    WNDCLASS wndclass;
    wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wndclass.lpfnWndProc = myWindowProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = GetModuleHandle(NULL);
    wndclass.hIcon = NULL;
    wndclass.hCursor = NULL;
    wndclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = &quot;Sample window class&quot;;
    RegisterClass(&amp;wndclass);
    HWND window = CreateWindow(&quot;Sample window class&quot;, &quot;Sample window&quot;, WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
            WS_MINIMIZEBOX, (GetSystemMetrics(SM_CXFULLSCREEN) - 800) / 2, (GetSystemMetrics(SM_CYFULLSCREEN) - 600) / 2, 800, 600, GetDesktopWindow(),
            NULL, GetModuleHandle(NULL), NULL);
    ShowWindow(window, SW_SHOW);
    loop();
}
</code></pre>
<p>Mache ich etwas falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/103828/festplattentraffic-bei-windows-anwendungen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 16:57:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/103828.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 13 Mar 2005 16:23:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Festplattentraffic bei Windows-Anwendungen? on Sun, 13 Mar 2005 16:23:15 GMT]]></title><description><![CDATA[<p>Da ich mir keinen teuren Microsoft-Compiler mit VisualStudio o.ä. leisten kann/will, versuche ich mich grade darin, auch so Fenster verwenden zu &quot;dürfen&quot;. Allerdings fängt aus unerfindlichen Gründen meine Festplatte immer an zu &quot;rattern&quot;, wenn ich ein solches Programm starte. Es klingt nach heftig schnellen Zugriffen... Dabei greife ich gar nicht auf die Festplatte zu.</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

LRESULT CALLBACK myWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
    switch(uMsg) {
        case WM_CLOSE:
            ExitProcess(0);
            break;
        default:
            return CallWindowProc(DefWindowProc, hwnd, uMsg, wParam, lParam);
    }
}

void loop() {
    MSG msg;
    for(;;)
        while(PeekMessage(&amp;msg, NULL, 0, 0, PM_NOREMOVE) &gt; 0)
            if(GetMessage(&amp;msg, NULL, 0, 0) &gt; 0) {
                TranslateMessage(&amp;msg);
                DispatchMessage(&amp;msg);
            }
}

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
    WNDCLASS wndclass;
    wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wndclass.lpfnWndProc = myWindowProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = GetModuleHandle(NULL);
    wndclass.hIcon = NULL;
    wndclass.hCursor = NULL;
    wndclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = &quot;Sample window class&quot;;
    RegisterClass(&amp;wndclass);
    HWND window = CreateWindow(&quot;Sample window class&quot;, &quot;Sample window&quot;, WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
            WS_MINIMIZEBOX, (GetSystemMetrics(SM_CXFULLSCREEN) - 800) / 2, (GetSystemMetrics(SM_CYFULLSCREEN) - 600) / 2, 800, 600, GetDesktopWindow(),
            NULL, GetModuleHandle(NULL), NULL);
    ShowWindow(window, SW_SHOW);
    loop();
}
</code></pre>
<p>Mache ich etwas falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/743767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/743767</guid><dc:creator><![CDATA[UncleSniper]]></dc:creator><pubDate>Sun, 13 Mar 2005 16:23:15 GMT</pubDate></item><item><title><![CDATA[Reply to Festplattentraffic bei Windows-Anwendungen? on Sun, 13 Mar 2005 18:15:21 GMT]]></title><description><![CDATA[<p>Nimm dir am besten das als Beispiel:</p>
<p><a href="http://www.winapi.net/index.php?inhalt=tipp1" rel="nofollow">http://www.winapi.net/index.php?inhalt=tipp1</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/743856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/743856</guid><dc:creator><![CDATA[Grober]]></dc:creator><pubDate>Sun, 13 Mar 2005 18:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to Festplattentraffic bei Windows-Anwendungen? on Sun, 13 Mar 2005 23:29:38 GMT]]></title><description><![CDATA[<p>Danke, hat geholfen! Das ist lustig, wenn ich in loop() den Part</p>
<pre><code class="language-cpp">for(;;) 
    while(PeekMessage(&amp;msg, NULL, 0, 0, PM_NOREMOVE) &gt; 0) 
        if(GetMessage(&amp;msg, NULL, 0, 0) &gt; 0) {
</code></pre>
<p>durch</p>
<pre><code class="language-cpp">while(GetMessage(&amp;msg, NULL, 0, 0)) {
</code></pre>
<p>ersetze, kratzt er nicht mehr so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/744067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744067</guid><dc:creator><![CDATA[UncleSniper]]></dc:creator><pubDate>Sun, 13 Mar 2005 23:29:38 GMT</pubDate></item><item><title><![CDATA[Reply to Festplattentraffic bei Windows-Anwendungen? on Sun, 13 Mar 2005 23:38:21 GMT]]></title><description><![CDATA[<p>Bei mir hat sich nur der CPU Lüfter schneller gedreht, weil dein gepostetes Programm 100% CPU Auslastung erzeugt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/744068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744068</guid><dc:creator><![CDATA[Grober]]></dc:creator><pubDate>Sun, 13 Mar 2005 23:38:21 GMT</pubDate></item><item><title><![CDATA[Reply to Festplattentraffic bei Windows-Anwendungen? on Mon, 14 Mar 2005 00:26:31 GMT]]></title><description><![CDATA[<p>UncleSniper schrieb:</p>
<blockquote>
<p>Danke, hat geholfen! Das ist lustig, wenn ich in loop() den Part</p>
<pre><code class="language-cpp">for(;;) 
    while(PeekMessage(&amp;msg, NULL, 0, 0, PM_NOREMOVE) &gt; 0) 
        if(GetMessage(&amp;msg, NULL, 0, 0) &gt; 0) {
</code></pre>
<p>durch</p>
<pre><code class="language-cpp">while(GetMessage(&amp;msg, NULL, 0, 0)) {
</code></pre>
<p>ersetze, kratzt er nicht mehr so.</p>
</blockquote>
<p>Was sollte der Blödsinn egentlich mit for(;;)? <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/744074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744074</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Mon, 14 Mar 2005 00:26:31 GMT</pubDate></item></channel></rss>