<?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[wo ist die schleife? gibt es überhaupt eine?]]></title><description><![CDATA[<p>hi</p>
<p>würde gerne wissen wo die schleife bei diesem code ist:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;resource.h&quot;

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst;								// current instance
TCHAR szTitle[MAX_LOADSTRING];								// The title bar text
TCHAR szWindowClass[MAX_LOADSTRING];								// The title bar text

// Foward declarations of functions included in this code module:
ATOM				MyRegisterClass(HINSTANCE hInstance);
BOOL				InitInstance(HINSTANCE, int);
LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK	About(HWND, UINT, WPARAM, LPARAM);

int test=1;
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.
	MSG msg;
	HACCEL hAccelTable;

	// Initialize global strings
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_WINDOW, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Perform application initialization:
	if (!InitInstance (hInstance, nCmdShow)) 
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINDOW);

	// Main message loop:
	while (GetMessage(&amp;msg, NULL, 0, 0)) 
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg)) 
		{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}

	return msg.wParam;
}

//
//  FUNCTION: MyRegisterClass()
//
//  PURPOSE: Registers the window class.
//
//  COMMENTS:
//
//    This function and its usage is only necessary if you want this code
//    to be compatible with Win32 systems prior to the 'RegisterClassEx'
//    function that was added to Windows 95. It is important to call this function
//    so that the application will get 'well formed' small icons associated
//    with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX); 

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, (LPCTSTR)IDI_WINDOW);
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
	wcex.lpszMenuName	= (LPCSTR)IDC_WINDOW;
	wcex.lpszClassName	= szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

	return RegisterClassEx(&amp;wcex);
}

//
//   FUNCTION: InitInstance(HANDLE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

//
//  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;
	TCHAR szHello[MAX_LOADSTRING];

	LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);

	switch (message) 
	{
		case WM_COMMAND:
			wmId    = LOWORD(wParam); 
			wmEvent = HIWORD(wParam); 
			// Parse the menu selections:
			switch (wmId)
			{
				case IDM_\1:
				   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
				   break;
				case IDM_ABOUT2:
				   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX2, hWnd, (DLGPROC)About);
				   break;
				case IDM_EXIT:
				   DestroyWindow(hWnd);
				   break;
				default:
				   return DefWindowProc(hWnd, message, wParam, lParam);
			}
			break;
		case WM_PAINT:
			hdc = BeginPaint(hWnd, &amp;ps);
			// TODO: Add any drawing code here...
			RECT rt;
			GetClientRect(hWnd, &amp;rt);
			if(test==1)
			{
				DrawText(hdc, szHello, strlen(szHello), &amp;rt, DT_CENTER);
			}
			EndPaint(hWnd, &amp;ps);
			break;
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
   }
   return 0;
}

// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		case WM_INITDIALOG:
				return TRUE;

		case WM_COMMAND:
			if (ID_RADIO_OK)
			{
				test=0;//IRGENDWAS MUSS PASSIEREN
			}
			if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 
			{
				EndDialog(hDlg, LOWORD(wParam));
				return TRUE;
			}
			break;
	}
    return FALSE;
}
</code></pre>
<p>sorry wegen der länge aber das ist das kleinste beispiel...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/127976/wo-ist-die-schleife-gibt-es-überhaupt-eine</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 18:10:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127976.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Nov 2005 11:34:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 11:34:24 GMT]]></title><description><![CDATA[<p>hi</p>
<p>würde gerne wissen wo die schleife bei diesem code ist:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;resource.h&quot;

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst;								// current instance
TCHAR szTitle[MAX_LOADSTRING];								// The title bar text
TCHAR szWindowClass[MAX_LOADSTRING];								// The title bar text

// Foward declarations of functions included in this code module:
ATOM				MyRegisterClass(HINSTANCE hInstance);
BOOL				InitInstance(HINSTANCE, int);
LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK	About(HWND, UINT, WPARAM, LPARAM);

int test=1;
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.
	MSG msg;
	HACCEL hAccelTable;

	// Initialize global strings
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_WINDOW, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Perform application initialization:
	if (!InitInstance (hInstance, nCmdShow)) 
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINDOW);

	// Main message loop:
	while (GetMessage(&amp;msg, NULL, 0, 0)) 
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg)) 
		{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}

	return msg.wParam;
}

//
//  FUNCTION: MyRegisterClass()
//
//  PURPOSE: Registers the window class.
//
//  COMMENTS:
//
//    This function and its usage is only necessary if you want this code
//    to be compatible with Win32 systems prior to the 'RegisterClassEx'
//    function that was added to Windows 95. It is important to call this function
//    so that the application will get 'well formed' small icons associated
//    with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX); 

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, (LPCTSTR)IDI_WINDOW);
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
	wcex.lpszMenuName	= (LPCSTR)IDC_WINDOW;
	wcex.lpszClassName	= szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

	return RegisterClassEx(&amp;wcex);
}

//
//   FUNCTION: InitInstance(HANDLE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

//
//  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;
	TCHAR szHello[MAX_LOADSTRING];

	LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);

	switch (message) 
	{
		case WM_COMMAND:
			wmId    = LOWORD(wParam); 
			wmEvent = HIWORD(wParam); 
			// Parse the menu selections:
			switch (wmId)
			{
				case IDM_\1:
				   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
				   break;
				case IDM_ABOUT2:
				   DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX2, hWnd, (DLGPROC)About);
				   break;
				case IDM_EXIT:
				   DestroyWindow(hWnd);
				   break;
				default:
				   return DefWindowProc(hWnd, message, wParam, lParam);
			}
			break;
		case WM_PAINT:
			hdc = BeginPaint(hWnd, &amp;ps);
			// TODO: Add any drawing code here...
			RECT rt;
			GetClientRect(hWnd, &amp;rt);
			if(test==1)
			{
				DrawText(hdc, szHello, strlen(szHello), &amp;rt, DT_CENTER);
			}
			EndPaint(hWnd, &amp;ps);
			break;
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
   }
   return 0;
}

// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		case WM_INITDIALOG:
				return TRUE;

		case WM_COMMAND:
			if (ID_RADIO_OK)
			{
				test=0;//IRGENDWAS MUSS PASSIEREN
			}
			if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 
			{
				EndDialog(hDlg, LOWORD(wParam));
				return TRUE;
			}
			break;
	}
    return FALSE;
}
</code></pre>
<p>sorry wegen der länge aber das ist das kleinste beispiel...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/929572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929572</guid><dc:creator><![CDATA[ohne namen 123]]></dc:creator><pubDate>Tue, 29 Nov 2005 11:34:24 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 11:38:37 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>einmal ist das doch gar kein MFC-Thema. Das gehört in C...</p>
<p>deine Schleife hier ist</p>
<p>while{...}</p>
<p>aber was alles Schleifen sind oder nicht usw. steht in jedem Buch, für Einsteiger in C bzw. C++</p>
<p>Gruß 's Mädle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/929575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929575</guid><dc:creator><![CDATA[&#x27;s Mädle]]></dc:creator><pubDate>Tue, 29 Nov 2005 11:38:37 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 11:55:38 GMT]]></title><description><![CDATA[<p>steht doch da: main message loop</p>
]]></description><link>https://www.c-plusplus.net/forum/post/929580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929580</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Tue, 29 Nov 2005 11:55:38 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 12:00:10 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=9713" rel="nofollow">estartu_de</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/929583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929583</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 29 Nov 2005 12:00:10 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 13:46:19 GMT]]></title><description><![CDATA[<p>hi ok thx hab ich voll übersehen...</p>
<p>aber hier das habe ich hinzugefügt:</p>
<pre><code class="language-cpp">//
//  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	if(test!=100)
	{
		DialogBox(hInst, (LPCTSTR)IDD_WARNING, hWnd, (DLGPROC)About);
		test=100;
		break;
	}
</code></pre>
<p>also an deiser stelle abgeändert und oben noch:</p>
<pre><code class="language-cpp">// window.cpp : Defines the entry point for the application.
//

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

#define MAX_LOADSTRING 100
int test=10;
</code></pre>
<p>aber der gibt einen error aus warum? und wenn ich ohne break; mache gehts aber das muss dahin sonst kommt der alarmdialog 10000 mal...</p>
<p>wo liegt der fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/929718</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929718</guid><dc:creator><![CDATA[ohne namen 123]]></dc:creator><pubDate>Tue, 29 Nov 2005 13:46:19 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 13:49:56 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if(test!=100) 
{ 
  test=100; 
  DialogBox(hInst, (LPCTSTR)IDD_WARNING, hWnd, (DLGPROC)About); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/929722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929722</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 29 Nov 2005 13:49:56 GMT</pubDate></item><item><title><![CDATA[Reply to wo ist die schleife? gibt es überhaupt eine? on Tue, 29 Nov 2005 14:07:24 GMT]]></title><description><![CDATA[<p>ne klappt leider nicht. dann kommt das alert feld auch wieder 1000 mal(bis man mit Strg + Alt + Entf ausschaltet)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/929745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/929745</guid><dc:creator><![CDATA[ohne namen 123]]></dc:creator><pubDate>Tue, 29 Nov 2005 14:07:24 GMT</pubDate></item></channel></rss>