<?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[Maus einlesen - Win32 Anwendung]]></title><description><![CDATA[<p>Hallo, ich programmiere schon länger in C++. Ich weiß auch wie ich einzelne Tasten mit WM_Keydown einlesen kann. Jetzt interessiere ich mich dafür, wie ich die Mausposition und das Klicken der linken/ rechten Maustaste einlesen kann. Wäre echt nett wenn mir, da einer ein Beispiel geben könnte.</p>
<p>Mfg Peta</p>
<p>Mein Quellcode zum Erstellen eines Fensters:</p>
<pre><code>#include &quot;stdafx.h&quot;

HWND hWnd = 0;

int WINAPI WinMain(HINSTANCE hInstance,     
                   HINSTANCE hPrevInstance, 
                   LPSTR lpCmdLine,         
                   int nCmdShow)            
{   
    hWnd = CreateMainWindow(hInstance);
    if(0 == hWnd)
    {
        MessageBox(0,&quot;Fehler&quot;,&quot;Fehler&quot;,MB_OK);
        return 0;
    }
    MSG msg;
    while(GetMessage(&amp;msg,NULL,0,0))
	{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
    }
	return 0;
}

HWND CreateMainWindow(HINSTANCE hInstance)
{
    WNDCLASSEX wndClass;              
    wndClass.cbSize        = sizeof(WNDCLASSEX);         
    wndClass.style         = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW; 
    wndClass.lpfnWndProc   = WindowFunc;              
    wndClass.cbClsExtra    = 0;                     
    wndClass.cbWndExtra    = 0;                     
    wndClass.hInstance     = hInstance;             
    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); 
    wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW); 
    wndClass.lpszMenuName  = NULL;                        
    wndClass.lpszClassName = &quot;WindowClass&quot;;               
    wndClass.hIcon         = LoadIcon(NULL, IDI_WINLOGO);
    wndClass.hIconSm       = LoadIcon(NULL, IDI_WINLOGO);
    RegisterClassEx(&amp;wndClass);
    return CreateWindowEx(NULL, &quot;WindowClass&quot;, &quot;Ein einfaches Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 400, 300, NULL, NULL, hInstance, NULL);
}
LRESULT CALLBACK WindowFunc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_DESTROY:
                    PostQuitMessage(0);
                    return 0;
                break;

        case WM_PAINT:
                    PAINTSTRUCT ps;
                    HDC hDC;
                    hDC = BeginPaint(hWnd,&amp;ps);    

//Achtung hier beginnt der Bereich zum Zeichnen

//Achtung hier endet der Bereich zum Zeichnen

                    EndPaint(hWnd,&amp;ps);

                    return 0;
                break;
    }

    return (DefWindowProc(hwnd, msg, wParam, lParam));
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/211371/maus-einlesen-win32-anwendung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 15:25:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211371.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Apr 2008 15:06:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Tue, 22 Apr 2008 15:06:16 GMT]]></title><description><![CDATA[<p>Hallo, ich programmiere schon länger in C++. Ich weiß auch wie ich einzelne Tasten mit WM_Keydown einlesen kann. Jetzt interessiere ich mich dafür, wie ich die Mausposition und das Klicken der linken/ rechten Maustaste einlesen kann. Wäre echt nett wenn mir, da einer ein Beispiel geben könnte.</p>
<p>Mfg Peta</p>
<p>Mein Quellcode zum Erstellen eines Fensters:</p>
<pre><code>#include &quot;stdafx.h&quot;

HWND hWnd = 0;

int WINAPI WinMain(HINSTANCE hInstance,     
                   HINSTANCE hPrevInstance, 
                   LPSTR lpCmdLine,         
                   int nCmdShow)            
{   
    hWnd = CreateMainWindow(hInstance);
    if(0 == hWnd)
    {
        MessageBox(0,&quot;Fehler&quot;,&quot;Fehler&quot;,MB_OK);
        return 0;
    }
    MSG msg;
    while(GetMessage(&amp;msg,NULL,0,0))
	{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
    }
	return 0;
}

HWND CreateMainWindow(HINSTANCE hInstance)
{
    WNDCLASSEX wndClass;              
    wndClass.cbSize        = sizeof(WNDCLASSEX);         
    wndClass.style         = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW; 
    wndClass.lpfnWndProc   = WindowFunc;              
    wndClass.cbClsExtra    = 0;                     
    wndClass.cbWndExtra    = 0;                     
    wndClass.hInstance     = hInstance;             
    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); 
    wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW); 
    wndClass.lpszMenuName  = NULL;                        
    wndClass.lpszClassName = &quot;WindowClass&quot;;               
    wndClass.hIcon         = LoadIcon(NULL, IDI_WINLOGO);
    wndClass.hIconSm       = LoadIcon(NULL, IDI_WINLOGO);
    RegisterClassEx(&amp;wndClass);
    return CreateWindowEx(NULL, &quot;WindowClass&quot;, &quot;Ein einfaches Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 400, 300, NULL, NULL, hInstance, NULL);
}
LRESULT CALLBACK WindowFunc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_DESTROY:
                    PostQuitMessage(0);
                    return 0;
                break;

        case WM_PAINT:
                    PAINTSTRUCT ps;
                    HDC hDC;
                    hDC = BeginPaint(hWnd,&amp;ps);    

//Achtung hier beginnt der Bereich zum Zeichnen

//Achtung hier endet der Bereich zum Zeichnen

                    EndPaint(hWnd,&amp;ps);

                    return 0;
                break;
    }

    return (DefWindowProc(hwnd, msg, wParam, lParam));
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1496260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496260</guid><dc:creator><![CDATA[Peta]]></dc:creator><pubDate>Tue, 22 Apr 2008 15:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Tue, 22 Apr 2008 15:47:36 GMT]]></title><description><![CDATA[<p>Dazu gibts zwei Events: WM_SETCURSOR und WM_MOUSEMOVE.</p>
<p>Mittels GetCursorPos() kannst du passend dazu die aktuelle Position des Cursors auf dem Bildschirm feststellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1496284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496284</guid><dc:creator><![CDATA[Bitte ein Bit]]></dc:creator><pubDate>Tue, 22 Apr 2008 15:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Tue, 22 Apr 2008 16:39:48 GMT]]></title><description><![CDATA[<p>Könntest du dazu auch noch ein Beispiel geben? Wäre echt nett.</p>
<p>Mfg Peta</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1496310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496310</guid><dc:creator><![CDATA[Peta]]></dc:creator><pubDate>Tue, 22 Apr 2008 16:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Tue, 22 Apr 2008 20:14:22 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-10455.html" rel="nofollow">evilissimo</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" 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/1496478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496478</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 22 Apr 2008 20:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Tue, 22 Apr 2008 21:42:01 GMT]]></title><description><![CDATA[<p>Hier im WinAPI-Forum SuFu benutzen ... da findest du mehr als du lesen kannst ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1496509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1496509</guid><dc:creator><![CDATA[dust]]></dc:creator><pubDate>Tue, 22 Apr 2008 21:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Wed, 23 Apr 2008 20:39:35 GMT]]></title><description><![CDATA[<p>Ich hab jetzt hier im WinAPI-Forum das SuFu benutzt und frage mich wieso das immernoch nicht geht, bei hilfe bin ich sehr dankbar.</p>
<pre><code>case WM_LBUTTONDOWN:

	xPos = LOWORD(lParam);
	yPos = HIWORD(lParam);
</code></pre>
<p>Die Fehler sind:<br />
1. Nichtaufgeloestes externes Symbol _main<br />
2. 1 unaufgeloeste externe Verweise</p>
<p>Mfg Peta</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497157</guid><dc:creator><![CDATA[Peta]]></dc:creator><pubDate>Wed, 23 Apr 2008 20:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Wed, 23 Apr 2008 21:15:58 GMT]]></title><description><![CDATA[<p>du baust ne konsolenanwendung, bau mal ne subsystem:windoof anwendung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1497169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497169</guid><dc:creator><![CDATA[real_rofler]]></dc:creator><pubDate>Wed, 23 Apr 2008 21:15:58 GMT</pubDate></item><item><title><![CDATA[Reply to Maus einlesen - Win32 Anwendung on Thu, 24 Apr 2008 10:31:43 GMT]]></title><description><![CDATA[<p>Hallo Peta,</p>
<p>ich bin C++Anfänger.<br />
kannst dumir bitte mit der WM_Keydown ein beispiel code zeigen.</p>
<p>ich möchte eventuel ein dll erzeugen und in Excel vba es anwenden.</p>
<p><a href="mailto:nedim.oezbey@aee-inova.de" rel="nofollow">nedim.oezbey@aee-inova.de</a></p>
<p>mfg<br />
Nedim</p>
<p>Peta schrieb:</p>
<blockquote>
<p>Hallo, ich programmiere schon länger in C++. Ich weiß auch wie ich einzelne Tasten mit WM_Keydown einlesen kann. Jetzt interessiere ich mich dafür, wie ich die Mausposition und das Klicken der linken/ rechten Maustaste einlesen kann. Wäre echt nett wenn mir, da einer ein Beispiel geben könnte.</p>
<p>Mfg Peta</p>
<p>Mein Quellcode zum Erstellen eines Fensters:</p>
<pre><code>#include &quot;stdafx.h&quot;

HWND hWnd = 0;

int WINAPI WinMain(HINSTANCE hInstance,     
                   HINSTANCE hPrevInstance, 
                   LPSTR lpCmdLine,         
                   int nCmdShow)            
{   
    hWnd = CreateMainWindow(hInstance);
    if(0 == hWnd)
    {
        MessageBox(0,&quot;Fehler&quot;,&quot;Fehler&quot;,MB_OK);
        return 0;
    }
    MSG msg;
    while(GetMessage(&amp;msg,NULL,0,0))
	{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
    }
	return 0;
}

HWND CreateMainWindow(HINSTANCE hInstance)
{
    WNDCLASSEX wndClass;              
    wndClass.cbSize        = sizeof(WNDCLASSEX);         
    wndClass.style         = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW; 
    wndClass.lpfnWndProc   = WindowFunc;              
    wndClass.cbClsExtra    = 0;                     
    wndClass.cbWndExtra    = 0;                     
    wndClass.hInstance     = hInstance;             
    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); 
    wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW); 
    wndClass.lpszMenuName  = NULL;                        
    wndClass.lpszClassName = &quot;WindowClass&quot;;               
    wndClass.hIcon         = LoadIcon(NULL, IDI_WINLOGO);
    wndClass.hIconSm       = LoadIcon(NULL, IDI_WINLOGO);
    RegisterClassEx(&amp;wndClass);
    return CreateWindowEx(NULL, &quot;WindowClass&quot;, &quot;Ein einfaches Fenster&quot;, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 400, 300, NULL, NULL, hInstance, NULL);
}
LRESULT CALLBACK WindowFunc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_DESTROY:
                    PostQuitMessage(0);
                    return 0;
                break;
    
        case WM_PAINT:
                    PAINTSTRUCT ps;
                    HDC hDC;
                    hDC = BeginPaint(hWnd,&amp;ps);    

//Achtung hier beginnt der Bereich zum Zeichnen

//Achtung hier endet der Bereich zum Zeichnen
                    
                    EndPaint(hWnd,&amp;ps);
                    
                    return 0;
                break;
    }

    return (DefWindowProc(hwnd, msg, wParam, lParam));
}
</code></pre>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1497342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1497342</guid><dc:creator><![CDATA[Nedim_2152]]></dc:creator><pubDate>Thu, 24 Apr 2008 10:31:43 GMT</pubDate></item></channel></rss>