<?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[Abfrage in einer While]]></title><description><![CDATA[<p>hallo Forum,<br />
ich habe mir da ein programm gebastelt, wo alles mögliche gemixt ist, bin ja halt noch anfänger.</p>
<p>Nun habe ich mir gedacht, wenn eine taste gedrückt ist, soll eine variable hochgezählt werden, habe dazu dann halt eine while schleife gemacht.</p>
<p>Nun aber egal was ich mache, sobald die bedingung erfüllt ist, geht die cpu auf 100%, das liegt warscheinlich daran (wenn ich mich jetzt nicht teusche) das die schleife solange ausgeführt wird bis die bedingung erfüllt ist, und das programm sonst nix anderes macht, da aber außerhalb abgefragt wird ob die taste nun gedrückt ist oder nicht, leuft die schleife ja ewig durch.</p>
<p>nun frage ich mich, wie ich es hin bekomme, das die schleife, also irgent etwas in der schleife abfragt, ob die taste gedrückt ist. Sowas wie ein check, soll halt einfach nur abfragen ob die taste gedrückt ist, habe gehört dazu giebt es einen befehl, aber den kenne ich leider nicht <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>Hier ist der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;dwfds.h&quot;
#include &quot;stdafx.h&quot;

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

   static RECT   rect;
   static bool   ArrowKeys[4];
   static char     cBuffer[100];
   static int      iActLen;

   switch (message)
   {

   case WM_SIZE:
      {
         rect.right  = LOWORD(lParam);
         rect.bottom = HIWORD(lParam);
         return 0;
      }

     case WM_CHAR:
      {
         switch (wParam)
         {

          case '\r':
            iActLen = 0;
            InvalidateRect(hWnd, NULL, TRUE);
            break;

         case '\b':
            if (iActLen &lt;= 0)
               break;

            iActLen--;
            InvalidateRect(hWnd, NULL, TRUE);
            break;

                  case '\t':
         case '\n':
         case  27 :
            break;

 default:
            if (iActLen &lt; sizeof(cBuffer))
            {
               cBuffer[iActLen++] = wParam;
               InvalidateRect(hWnd, NULL, FALSE);
            }
            break;
         }
         return 0;
      }

 case WM_KEYDOWN:
      {

if (wParam == VK_ESCAPE)
         {

             SendMessage(hWnd, WM_CLOSE, 0, 0);
         }

         switch (wParam)
         {
         case VK_LEFT:

           ArrowKeys[0] = true;
            break;

         case VK_UP:
            ArrowKeys[1] = true;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = true;
            break;

         case VK_DOWN:
            ArrowKeys[3] = true;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
      }

      case WM_KEYUP:
      {
         switch (wParam)
         {
         case VK_LEFT:
            ArrowKeys[0] = false;
            break;

         case VK_UP:
            ArrowKeys[1] = false;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = false;
            break;

         case VK_DOWN:
            ArrowKeys[3] = false;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
     }
   }

         int i;
       int b=0;

HANDLE hbitmap = LoadImage(NULL,TEXT(&quot;&quot;),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HDC hdc = GetWindowDC(hWnd);
HDC hdc_ram = CreateCompatibleDC(NULL);

PAINTSTRUCT ps;

 SIZE         size;

       char szKeyStatus[40];
         int  iKeyLength;

switch( message ) 
         { 
           case WM_PAINT:     
             hdc = BeginPaint( hWnd, &amp;ps );

         DrawText(hdc, cBuffer, iActLen, &amp;rect,
                          DT_SINGLELINE | DT_VCENTER);

       for (int i = 0; i &lt; 4; i++)
         {
            iKeyLength = wsprintf(szKeyStatus, &quot;Pfeil-Taste %i: %i&quot;,
                                  i, ArrowKeys[i]);

          GetTextExtentPoint32(hdc, szKeyStatus, iKeyLength, &amp;size);

            TextOut(hdc, rect.right / 2 - size.cx / 2, rect.bottom / 2 -
                    2 * size.cy + i * size.cy, szKeyStatus, iKeyLength);

int a=ArrowKeys[1];

         char  szText [200]; 
 wsprintf (szText,&quot;Hallo, dies ist der Text. %i&quot;,a);
 TextOut(hdc, 50, 50, szText, lstrlen (szText)); 

 while(ArrowKeys[1]==1)
 {
 }

      }

 hbitmap = LoadImage (NULL,TEXT(&quot;C:\\bild2.bmp&quot;),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
  hdc_ram = CreateCompatibleDC(NULL);
  SelectObject (hdc_ram, hbitmap);
  BitBlt       (hdc,50,50,100,100,hdc_ram,0,0,SRCCOPY);
  DeleteDC     (hdc_ram);
  DeleteObject (hbitmap);

             EndPaint( hWnd, &amp;ps );

           return 0;

           case WM_DESTROY:     
             PostQuitMessage(0);     
           return 0;               

           return 0; 
         }
         return DefWindowProc (hWnd, message, wParam, lParam);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
   MSG          msg;
   HWND         hWnd;
   WNDCLASS     wc;

   char szAppName[] = &quot;Tastaturabfragen&quot;;

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

   RegisterClass(&amp;wc);

  hWnd = CreateWindow(szAppName,
            TEXT(&quot;FullscreenWindow&quot;),
            WS_POPUP,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            NULL,
            NULL,
            hInstance,
            NULL);

    // window darstellen und maximieren
    ShowWindow(hWnd, SW_MAXIMIZE);

   while (GetMessage(&amp;msg, NULL, 0, 0))
   {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
   }
   return msg.wParam;
}
</code></pre>
<p>habe lieber mal den ganzen code geschickt um sicher zu gehen <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>Und hier ist der bereich wo doe schleife ist:</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; 4; i++)
         {
            iKeyLength = wsprintf(szKeyStatus, &quot;Pfeil-Taste %i: %i&quot;,
                                  i, ArrowKeys[i]);

          GetTextExtentPoint32(hdc, szKeyStatus, iKeyLength, &amp;size);

            TextOut(hdc, rect.right / 2 - size.cx / 2, rect.bottom / 2 -
                    2 * size.cy + i * size.cy, szKeyStatus, iKeyLength);

int a=ArrowKeys[1];

         char  szText [200]; 
 wsprintf (szText,&quot;Hallo, dies ist der Text. %i&quot;,a);
 TextOut(hdc, 50, 50, szText, lstrlen (szText)); 

 while(ArrowKeys[1]==1)
 {
 }

      }
</code></pre>
<p>in dieser leeren while schleife soll etwas ausgeführt werden, also eine variable soll hochgezählt werden, solange beispielsweise die taste arrowkeys[1] gedrückt ist, also der wert dueser variable 1 ist.</p>
<p>meine frage ist halt wie lautet der befehl um abzufragen ob die taste gedrückt ist, bzw wie kann man in einer schleife nochmal alle variablen durchgehen lassen?</p>
<p>Falls ihr mir heflen könnt, könntet ihr mir auch denn befehl, bzw funktion genau erklären ???</p>
<p>Danke schöööön!</p>
<p>MfG<br />
Showball!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188207/abfrage-in-einer-while</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 16:34:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188207.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Jul 2007 10:36:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Abfrage in einer While on Sun, 29 Jul 2007 10:36:50 GMT]]></title><description><![CDATA[<p>hallo Forum,<br />
ich habe mir da ein programm gebastelt, wo alles mögliche gemixt ist, bin ja halt noch anfänger.</p>
<p>Nun habe ich mir gedacht, wenn eine taste gedrückt ist, soll eine variable hochgezählt werden, habe dazu dann halt eine while schleife gemacht.</p>
<p>Nun aber egal was ich mache, sobald die bedingung erfüllt ist, geht die cpu auf 100%, das liegt warscheinlich daran (wenn ich mich jetzt nicht teusche) das die schleife solange ausgeführt wird bis die bedingung erfüllt ist, und das programm sonst nix anderes macht, da aber außerhalb abgefragt wird ob die taste nun gedrückt ist oder nicht, leuft die schleife ja ewig durch.</p>
<p>nun frage ich mich, wie ich es hin bekomme, das die schleife, also irgent etwas in der schleife abfragt, ob die taste gedrückt ist. Sowas wie ein check, soll halt einfach nur abfragen ob die taste gedrückt ist, habe gehört dazu giebt es einen befehl, aber den kenne ich leider nicht <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>Hier ist der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;dwfds.h&quot;
#include &quot;stdafx.h&quot;

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

   static RECT   rect;
   static bool   ArrowKeys[4];
   static char     cBuffer[100];
   static int      iActLen;

   switch (message)
   {

   case WM_SIZE:
      {
         rect.right  = LOWORD(lParam);
         rect.bottom = HIWORD(lParam);
         return 0;
      }

     case WM_CHAR:
      {
         switch (wParam)
         {

          case '\r':
            iActLen = 0;
            InvalidateRect(hWnd, NULL, TRUE);
            break;

         case '\b':
            if (iActLen &lt;= 0)
               break;

            iActLen--;
            InvalidateRect(hWnd, NULL, TRUE);
            break;

                  case '\t':
         case '\n':
         case  27 :
            break;

 default:
            if (iActLen &lt; sizeof(cBuffer))
            {
               cBuffer[iActLen++] = wParam;
               InvalidateRect(hWnd, NULL, FALSE);
            }
            break;
         }
         return 0;
      }

 case WM_KEYDOWN:
      {

if (wParam == VK_ESCAPE)
         {

             SendMessage(hWnd, WM_CLOSE, 0, 0);
         }

         switch (wParam)
         {
         case VK_LEFT:

           ArrowKeys[0] = true;
            break;

         case VK_UP:
            ArrowKeys[1] = true;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = true;
            break;

         case VK_DOWN:
            ArrowKeys[3] = true;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
      }

      case WM_KEYUP:
      {
         switch (wParam)
         {
         case VK_LEFT:
            ArrowKeys[0] = false;
            break;

         case VK_UP:
            ArrowKeys[1] = false;
            break;

         case VK_RIGHT:
            ArrowKeys[2] = false;
            break;

         case VK_DOWN:
            ArrowKeys[3] = false;
            break;

         default:
            return 0;
         }
         InvalidateRect(hWnd, NULL, FALSE);
         return 0;
     }
   }

         int i;
       int b=0;

HANDLE hbitmap = LoadImage(NULL,TEXT(&quot;&quot;),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HDC hdc = GetWindowDC(hWnd);
HDC hdc_ram = CreateCompatibleDC(NULL);

PAINTSTRUCT ps;

 SIZE         size;

       char szKeyStatus[40];
         int  iKeyLength;

switch( message ) 
         { 
           case WM_PAINT:     
             hdc = BeginPaint( hWnd, &amp;ps );

         DrawText(hdc, cBuffer, iActLen, &amp;rect,
                          DT_SINGLELINE | DT_VCENTER);

       for (int i = 0; i &lt; 4; i++)
         {
            iKeyLength = wsprintf(szKeyStatus, &quot;Pfeil-Taste %i: %i&quot;,
                                  i, ArrowKeys[i]);

          GetTextExtentPoint32(hdc, szKeyStatus, iKeyLength, &amp;size);

            TextOut(hdc, rect.right / 2 - size.cx / 2, rect.bottom / 2 -
                    2 * size.cy + i * size.cy, szKeyStatus, iKeyLength);

int a=ArrowKeys[1];

         char  szText [200]; 
 wsprintf (szText,&quot;Hallo, dies ist der Text. %i&quot;,a);
 TextOut(hdc, 50, 50, szText, lstrlen (szText)); 

 while(ArrowKeys[1]==1)
 {
 }

      }

 hbitmap = LoadImage (NULL,TEXT(&quot;C:\\bild2.bmp&quot;),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
  hdc_ram = CreateCompatibleDC(NULL);
  SelectObject (hdc_ram, hbitmap);
  BitBlt       (hdc,50,50,100,100,hdc_ram,0,0,SRCCOPY);
  DeleteDC     (hdc_ram);
  DeleteObject (hbitmap);

             EndPaint( hWnd, &amp;ps );

           return 0;

           case WM_DESTROY:     
             PostQuitMessage(0);     
           return 0;               

           return 0; 
         }
         return DefWindowProc (hWnd, message, wParam, lParam);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
   MSG          msg;
   HWND         hWnd;
   WNDCLASS     wc;

   char szAppName[] = &quot;Tastaturabfragen&quot;;

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

   RegisterClass(&amp;wc);

  hWnd = CreateWindow(szAppName,
            TEXT(&quot;FullscreenWindow&quot;),
            WS_POPUP,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            NULL,
            NULL,
            hInstance,
            NULL);

    // window darstellen und maximieren
    ShowWindow(hWnd, SW_MAXIMIZE);

   while (GetMessage(&amp;msg, NULL, 0, 0))
   {
      TranslateMessage(&amp;msg);
      DispatchMessage(&amp;msg);
   }
   return msg.wParam;
}
</code></pre>
<p>habe lieber mal den ganzen code geschickt um sicher zu gehen <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>Und hier ist der bereich wo doe schleife ist:</p>
<pre><code class="language-cpp">for (int i = 0; i &lt; 4; i++)
         {
            iKeyLength = wsprintf(szKeyStatus, &quot;Pfeil-Taste %i: %i&quot;,
                                  i, ArrowKeys[i]);

          GetTextExtentPoint32(hdc, szKeyStatus, iKeyLength, &amp;size);

            TextOut(hdc, rect.right / 2 - size.cx / 2, rect.bottom / 2 -
                    2 * size.cy + i * size.cy, szKeyStatus, iKeyLength);

int a=ArrowKeys[1];

         char  szText [200]; 
 wsprintf (szText,&quot;Hallo, dies ist der Text. %i&quot;,a);
 TextOut(hdc, 50, 50, szText, lstrlen (szText)); 

 while(ArrowKeys[1]==1)
 {
 }

      }
</code></pre>
<p>in dieser leeren while schleife soll etwas ausgeführt werden, also eine variable soll hochgezählt werden, solange beispielsweise die taste arrowkeys[1] gedrückt ist, also der wert dueser variable 1 ist.</p>
<p>meine frage ist halt wie lautet der befehl um abzufragen ob die taste gedrückt ist, bzw wie kann man in einer schleife nochmal alle variablen durchgehen lassen?</p>
<p>Falls ihr mir heflen könnt, könntet ihr mir auch denn befehl, bzw funktion genau erklären ???</p>
<p>Danke schöööön!</p>
<p>MfG<br />
Showball!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334246</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 29 Jul 2007 10:36:50 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Sun, 29 Jul 2007 11:28:30 GMT]]></title><description><![CDATA[<p>Du kannst die Funktion <a href="http://msdn2.microsoft.com/en-us/library/ms646293.aspx" rel="nofollow">GetAsyncKeyState</a> bzw. <a href="http://msdn2.microsoft.com/en-us/library/ms646299.aspx" rel="nofollow">GetKeyboardState</a> verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334271</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 29 Jul 2007 11:28:30 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Sun, 29 Jul 2007 14:08:21 GMT]]></title><description><![CDATA[<p>wenn ich das nun in die schleife einfüge sagt der mir das GetKeyboardState neudefiniert wird, wenn ichs dann kompiliere, bekomme cih es auch irgentwie ihin ohne das die fehler medung kommt?</p>
<p>MfG Showball!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334363</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 29 Jul 2007 14:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Sun, 29 Jul 2007 16:48:04 GMT]]></title><description><![CDATA[<p>Hast Du etwa die Deklaration eingefügt ?!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334441</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 29 Jul 2007 16:48:04 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Sun, 29 Jul 2007 17:28:34 GMT]]></title><description><![CDATA[<p>wie mache ich die denn? wie kann man denn eine funktion dekladieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334469</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Sun, 29 Jul 2007 17:28:34 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Mon, 30 Jul 2007 07:24:00 GMT]]></title><description><![CDATA[<p>wieso nimmst du nicht einfach GetAsyncKeyState?<br />
dass müsste doch gehen.</p>
<pre><code class="language-cpp">while (GetAsyncKeyState(VK_UP))
{
    // Mach was...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1334750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334750</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Mon, 30 Jul 2007 07:24:00 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Mon, 30 Jul 2007 10:17:36 GMT]]></title><description><![CDATA[<p>oh habe das in der schleife, net in der bedingung gemacht^^</p>
<p>aber wie mace ich da jetzt eine bedingung in die schleife, muss ich jetzt unbedingt eine if davor setzen?</p>
<p>Und was ich nicht verstehe, wie kann ich das dann machen das nur diese taste gedrückt ist, weil das ist ja in variablen abgespeichert und das überprüft ja nur ob tasten gedrückt sind, aber wie amche ich jetzt die bedingung, also der überprüft ja ob die obige taste gedrückt ist, und wenn ich eine bedingung mache muss die so ausehen:</p>
<p>VK_UP = True</p>
<p>oder vertuhe ich mih jetzt, und wie bekomme ich das danna cu wieder in eine variable?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334834</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Mon, 30 Jul 2007 10:17:36 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Mon, 30 Jul 2007 10:59:55 GMT]]></title><description><![CDATA[<p>Eine gängige Lösung ist auch, sich ein globales Feld für die Tasten anzulegen:</p>
<pre><code class="language-cpp">bool keys[256];
</code></pre>
<p>Jetzt kannst du in der WindowProcedure dieses Feld füllen:</p>
<pre><code class="language-cpp">...
case WM_KEYDOWN:
{
  keys[LOBYTE(wParam)] = true;
}
case WM_KEYUP:
{
  keys[LOBYTE(wParam)] = false;
}
...
</code></pre>
<p>und den Tastenstatus in deiner Hauptschleife abfragen:</p>
<pre><code class="language-cpp">while(!keys[VK_ESCAPE])
{
  if(PeekMessage(&amp;msg, hwnd, 0,0, PM_REMOVE)
  {
    TranslateMessage(&amp;msg);
    DispatchMessage(&amp;msg);
  }

  if(keys[VK_LEFT])
  { ... }

  if(keys[VK_RIGHT])
  { ... }
}
</code></pre>
<p>(Ich hab das jetzt nicht ausprobiert, das Prinzip sollte aber stimmen)</p>
<p>Grüße,</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1334860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1334860</guid><dc:creator><![CDATA[JimmydaMage]]></dc:creator><pubDate>Mon, 30 Jul 2007 10:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Mon, 30 Jul 2007 21:32:56 GMT]]></title><description><![CDATA[<p>will ja das das wann in der while schleife ist eine variabkle hochgezählt wird, und das sind die pixlangaben im bild, aber wenn nun das bild außerhalb ist also nicht in der shcleife, ändert der das danna uch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1335291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1335291</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Mon, 30 Jul 2007 21:32:56 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Tue, 31 Jul 2007 16:46:06 GMT]]></title><description><![CDATA[<p>wenn ich das nun mache kommt folgender fehler:</p>
<blockquote>
<p>c:\dokumente und einstellungen\dustin.trance\eigene dateien\visual studio 2005\projects\dwfds\dwfds\dwfds.cpp(51) : warning C4244: '=': Konvertierung von 'WPARAM' in 'char', möglicher Datenverlust<br />
c:\dokumente und einstellungen\dustin.trance\eigene dateien\visual studio 2005\projects\dwfds\dwfds\dwfds.cpp(169) : error C2065: 'keys': nichtdeklarierter Bezeichner<br />
c:\dokumente und einstellungen\dustin.trance\eigene dateien\visual studio 2005\projects\dwfds\dwfds\dwfds.cpp(169) : fatal error C1903: Weiterverarbeitung nach vorherigem Fehler nicht möglich; Kompilierung wird abgebrochen.</p>
</blockquote>
<p>Ich muss wohl key definieren, aber was soll ich definieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1335986</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1335986</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Tue, 31 Jul 2007 16:46:06 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Tue, 31 Jul 2007 21:28:18 GMT]]></title><description><![CDATA[<p>Hat JimmydaMage doch schon geposted?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336159</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 31 Jul 2007 21:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to Abfrage in einer While on Wed, 01 Aug 2007 02:00:22 GMT]]></title><description><![CDATA[<p>oh hab das ganz übersehen sry!</p>
<p>Hmm wie bekomme ich das nunn hin, das die schleife nur alle 0.10 sekunden ausgeführt wird?</p>
<p>geht das mit dem gaz normalem sleep?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336220</guid><dc:creator><![CDATA[Showball]]></dc:creator><pubDate>Wed, 01 Aug 2007 02:00:22 GMT</pubDate></item></channel></rss>