<?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[Windows Func Problem]]></title><description><![CDATA[<p>#include &lt;windows.h&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>HWND CreateWindowEx(<br />
DWORD dwExStyle,<br />
LPCTSTR lpClassName,<br />
LPCTSTR lpWindowName,<br />
DWORD dwStyle,<br />
LPVOID lpParam,<br />
int x,<br />
int y,<br />
int nWidth,<br />
int nHeight,<br />
HWND hWndParent,<br />
HMENU hMenu,<br />
HINSTANCE hInstance<br />
);</p>
<p>LRESULT CALLBACK MessageHandler(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CREATE:<br />
return 0;<br />
break;<br />
case WM_LBUTTONDBLCLK:<br />
return 0;<br />
break;<br />
case WM_CLOSE:<br />
return 0;<br />
break;<br />
}<br />
return (DefWindowProc(hWnd, msg, wParam, lParam));<br />
}</p>
<p>HRESULT CALLBACK WindowFunc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
break;<br />
case WM_LBUTTONDOWN:<br />
PAINTSTRUCT ps;<br />
HDC hDC;</p>
<p>hDC = BeginPaint(hWnd,&amp;ps);</p>
<p>HPEN PenRed = CreatePen(PS_SOLID,3,0xFF004BFF);<br />
HPEN PenGreen = CreatePen(PS_SOLID,2,0x2DFF00FF);<br />
HPEN PenBlue = CreatePen(PS_SOLID,1,0x0000FFFF);</p>
<p>SelectObject(hDC,PenBlue);<br />
Ellipse(hDC,60,5,340,250);<br />
Ellipse(hDC,150,190,250,210);</p>
<p>SelectObject(hDC,PenGreen);<br />
Rectangle(hDC,110,40,160,80);<br />
Rectangle(hDC,240,40,290,80);</p>
<p>SelectObject(hDC,PenRed);<br />
LineTo(hDC,180,150);<br />
LineTo(hDC,220,150);<br />
LineTo(hDC,200,120);</p>
<p>DeleteObject(PenRed);<br />
DeleteObject(PenBlue);<br />
DeleteObject(PenGreen);</p>
<p>EndPaint(hWnd,&amp;ps);<br />
return 0;<br />
break;<br />
}<br />
return (DefWindowProc(hWnd, msg, wparam, lparam));<br />
}</p>
<p>HWND CreateMainWindow(HINSTANCE hInstance)<br />
{<br />
WNDCLASSEX wndClass; // WNDCLASSEX Struktur</p>
<p>// Struktur initialisieren<br />
wndClass.cbSize = sizeof(WNDCLASSEX); // Größe angeben (nie vergessen!)<br />
wndClass.style = CS_DBLCLKS | CS_OWNDC |<br />
CS_HREDRAW | CS_VREDRAW; // Standard Stile<br />
wndClass.lpfnWndProc = MessageHandler; // Die Callback Funktion angeben</p>
<p>wndClass.cbClsExtra = 0; // Zusätzliche Angaben, wird nicht benötigt<br />
wndClass.cbWndExtra = 0; // Zusätzliche Angaben, wird nicht benötigt<br />
wndClass.hInstance = hInstance; // Anwendungsinstanz</p>
<p>wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); // Weisser Pinsel<br />
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Normaler Cursor<br />
wndClass.lpszMenuName = NULL; // Das Fenster hat kein Menü<br />
wndClass.lpszClassName = &quot;WindowClass&quot;; // Der Name der Klasse<br />
wndClass.hIcon = LoadIcon(NULL, IDI_WINLOGO); // Windows Logo<br />
wndClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); // Windows Logo</p>
<p>RegisterClassEx(&amp;wndClass);</p>
<p>return CreateWindowEx(NULL, // Keine erweiterten Stile nutzen<br />
&quot;WindowClass&quot;, // Klassenname<br />
&quot;Hello Windows&quot;, // Fenstertitel<br />
WS_OVERLAPPEDWINDOW | // Fenster<br />
WS_VISIBLE, // Eigenschaften<br />
0, 0, 400, 300, // Anfangsposition und Größe<br />
NULL, // Handle des Elternfensters<br />
NULL, // Handle des Menüs<br />
hInstance, // Anwendungsinstanz<br />
NULL); // wird nicht benötigt<br />
}</p>
<p>typedef struct _WNDCLASSEX<br />
{<br />
UINT cbSize;<br />
UINT style;<br />
WNDPROC lpfnWndProc;<br />
int cbClsExtra;<br />
int cbWndExtra;<br />
HINSTANCE hInstance;<br />
HICON hIcon;<br />
HCURSOR hCursor;<br />
HBRUSH hbrBackround;<br />
LPCTSTR lpszMenuName;<br />
HICON hIconSm;<br />
};</p>
<p>HWND hWnd = 0;</p>
<p>int WINAPI WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
hWnd = CreateMainWindow(hInstance);</p>
<p>/*PAINTSTRUCT ps;<br />
HDC hDC;</p>
<p>hDC = BeginPaint(hWnd,&amp;ps);</p>
<p>for(int i = 0; i &lt; 200;i+=200)<br />
{<br />
SetTextColor(hDC,0xFF2800FF);<br />
TextOut(hDC,i,i,&quot;Hallortttt nana Ja&quot;,18);</p>
<p>}<br />
*/</p>
<p>MessageBox(0,&quot;Erfolgreich erstellt&quot;,&quot;Nachricht&quot;,MB_OK);<br />
if(hWnd == 0)<br />
{<br />
MessageBox(0,&quot;Fenster konnte nicht erzeugt werden&quot;,&quot;Fehler&quot;,MB_OK);<br />
return 0;<br />
}<br />
MSG msg;</p>
<p>// Diese Schleife läuft bis die Nachricht WM_QUIT empfangen wird<br />
while(GetMessage(&amp;msg,NULL,0,0))<br />
{<br />
// Nachricht an die Callbackfunktion senden<br />
TranslateMessage(&amp;msg);<br />
DispatchMessage(&amp;msg);<br />
}<br />
return 0;<br />
}<br />
Das klappt nicht also das was in windowfuunc ist wird nicht angezeigt</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/316816/windows-func-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 14:46:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/316816.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 May 2013 13:12:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Windows Func Problem on Fri, 17 May 2013 13:12:21 GMT]]></title><description><![CDATA[<p>#include &lt;windows.h&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>HWND CreateWindowEx(<br />
DWORD dwExStyle,<br />
LPCTSTR lpClassName,<br />
LPCTSTR lpWindowName,<br />
DWORD dwStyle,<br />
LPVOID lpParam,<br />
int x,<br />
int y,<br />
int nWidth,<br />
int nHeight,<br />
HWND hWndParent,<br />
HMENU hMenu,<br />
HINSTANCE hInstance<br />
);</p>
<p>LRESULT CALLBACK MessageHandler(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CREATE:<br />
return 0;<br />
break;<br />
case WM_LBUTTONDBLCLK:<br />
return 0;<br />
break;<br />
case WM_CLOSE:<br />
return 0;<br />
break;<br />
}<br />
return (DefWindowProc(hWnd, msg, wParam, lParam));<br />
}</p>
<p>HRESULT CALLBACK WindowFunc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
break;<br />
case WM_LBUTTONDOWN:<br />
PAINTSTRUCT ps;<br />
HDC hDC;</p>
<p>hDC = BeginPaint(hWnd,&amp;ps);</p>
<p>HPEN PenRed = CreatePen(PS_SOLID,3,0xFF004BFF);<br />
HPEN PenGreen = CreatePen(PS_SOLID,2,0x2DFF00FF);<br />
HPEN PenBlue = CreatePen(PS_SOLID,1,0x0000FFFF);</p>
<p>SelectObject(hDC,PenBlue);<br />
Ellipse(hDC,60,5,340,250);<br />
Ellipse(hDC,150,190,250,210);</p>
<p>SelectObject(hDC,PenGreen);<br />
Rectangle(hDC,110,40,160,80);<br />
Rectangle(hDC,240,40,290,80);</p>
<p>SelectObject(hDC,PenRed);<br />
LineTo(hDC,180,150);<br />
LineTo(hDC,220,150);<br />
LineTo(hDC,200,120);</p>
<p>DeleteObject(PenRed);<br />
DeleteObject(PenBlue);<br />
DeleteObject(PenGreen);</p>
<p>EndPaint(hWnd,&amp;ps);<br />
return 0;<br />
break;<br />
}<br />
return (DefWindowProc(hWnd, msg, wparam, lparam));<br />
}</p>
<p>HWND CreateMainWindow(HINSTANCE hInstance)<br />
{<br />
WNDCLASSEX wndClass; // WNDCLASSEX Struktur</p>
<p>// Struktur initialisieren<br />
wndClass.cbSize = sizeof(WNDCLASSEX); // Größe angeben (nie vergessen!)<br />
wndClass.style = CS_DBLCLKS | CS_OWNDC |<br />
CS_HREDRAW | CS_VREDRAW; // Standard Stile<br />
wndClass.lpfnWndProc = MessageHandler; // Die Callback Funktion angeben</p>
<p>wndClass.cbClsExtra = 0; // Zusätzliche Angaben, wird nicht benötigt<br />
wndClass.cbWndExtra = 0; // Zusätzliche Angaben, wird nicht benötigt<br />
wndClass.hInstance = hInstance; // Anwendungsinstanz</p>
<p>wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); // Weisser Pinsel<br />
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Normaler Cursor<br />
wndClass.lpszMenuName = NULL; // Das Fenster hat kein Menü<br />
wndClass.lpszClassName = &quot;WindowClass&quot;; // Der Name der Klasse<br />
wndClass.hIcon = LoadIcon(NULL, IDI_WINLOGO); // Windows Logo<br />
wndClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); // Windows Logo</p>
<p>RegisterClassEx(&amp;wndClass);</p>
<p>return CreateWindowEx(NULL, // Keine erweiterten Stile nutzen<br />
&quot;WindowClass&quot;, // Klassenname<br />
&quot;Hello Windows&quot;, // Fenstertitel<br />
WS_OVERLAPPEDWINDOW | // Fenster<br />
WS_VISIBLE, // Eigenschaften<br />
0, 0, 400, 300, // Anfangsposition und Größe<br />
NULL, // Handle des Elternfensters<br />
NULL, // Handle des Menüs<br />
hInstance, // Anwendungsinstanz<br />
NULL); // wird nicht benötigt<br />
}</p>
<p>typedef struct _WNDCLASSEX<br />
{<br />
UINT cbSize;<br />
UINT style;<br />
WNDPROC lpfnWndProc;<br />
int cbClsExtra;<br />
int cbWndExtra;<br />
HINSTANCE hInstance;<br />
HICON hIcon;<br />
HCURSOR hCursor;<br />
HBRUSH hbrBackround;<br />
LPCTSTR lpszMenuName;<br />
HICON hIconSm;<br />
};</p>
<p>HWND hWnd = 0;</p>
<p>int WINAPI WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
hWnd = CreateMainWindow(hInstance);</p>
<p>/*PAINTSTRUCT ps;<br />
HDC hDC;</p>
<p>hDC = BeginPaint(hWnd,&amp;ps);</p>
<p>for(int i = 0; i &lt; 200;i+=200)<br />
{<br />
SetTextColor(hDC,0xFF2800FF);<br />
TextOut(hDC,i,i,&quot;Hallortttt nana Ja&quot;,18);</p>
<p>}<br />
*/</p>
<p>MessageBox(0,&quot;Erfolgreich erstellt&quot;,&quot;Nachricht&quot;,MB_OK);<br />
if(hWnd == 0)<br />
{<br />
MessageBox(0,&quot;Fenster konnte nicht erzeugt werden&quot;,&quot;Fehler&quot;,MB_OK);<br />
return 0;<br />
}<br />
MSG msg;</p>
<p>// Diese Schleife läuft bis die Nachricht WM_QUIT empfangen wird<br />
while(GetMessage(&amp;msg,NULL,0,0))<br />
{<br />
// Nachricht an die Callbackfunktion senden<br />
TranslateMessage(&amp;msg);<br />
DispatchMessage(&amp;msg);<br />
}<br />
return 0;<br />
}<br />
Das klappt nicht also das was in windowfuunc ist wird nicht angezeigt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2324027</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2324027</guid><dc:creator><![CDATA[lcp91]]></dc:creator><pubDate>Fri, 17 May 2013 13:12:21 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Func Problem on Fri, 17 May 2013 13:30:49 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/200753" rel="nofollow">http://www.c-plusplus.net/forum/200753</a><br />
<a href="http://www.c-plusplus.net/forum/39405" rel="nofollow">http://www.c-plusplus.net/forum/39405</a><br />
<a href="http://www.c-plusplus.net/forum/310187" rel="nofollow">http://www.c-plusplus.net/forum/310187</a><br />
<a href="http://www.c-plusplus.net/forum/304133" rel="nofollow">http://www.c-plusplus.net/forum/304133</a><br />
<a href="http://www.tty1.net/smart-questions_de.html" rel="nofollow">http://www.tty1.net/smart-questions_de.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2324035</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2324035</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 17 May 2013 13:30:49 GMT</pubDate></item></channel></rss>