<?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[Position von Child-Window...]]></title><description><![CDATA[<p>Ich versuche eine einfachere Funktion zu schreiben, um Position von Child-Window zu ermitteln... denn scheinbar gibt es nix einfacheres in WinAPI...</p>
<p>Ich meine wenn ich button in window bei koord 10,10 erstelle, und dann mit GetWindowRect auslese, dann habe ich leider immer die Screen-Pos.</p>
<p>Code aus der Funktion (X-Pos):</p>
<pre><code class="language-cpp">HWND  parent;
    POINT point;
    RECT  rect;

    parent = GetParent(handle);
    if (parent==0) parent = GetDesktopWindow();
    if (parent==0) return 0;

    if (GetWindowRect(handle, &amp;rect)==0) return 0;

    point.x=rect.left;
    if (ScreenToClient(parent, &amp;point)==0) return 0;

    return point.x;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/187073/position-von-child-window</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 01:01:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187073.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Jul 2007 14:08:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Position von Child-Window... on Sun, 15 Jul 2007 14:08:59 GMT]]></title><description><![CDATA[<p>Ich versuche eine einfachere Funktion zu schreiben, um Position von Child-Window zu ermitteln... denn scheinbar gibt es nix einfacheres in WinAPI...</p>
<p>Ich meine wenn ich button in window bei koord 10,10 erstelle, und dann mit GetWindowRect auslese, dann habe ich leider immer die Screen-Pos.</p>
<p>Code aus der Funktion (X-Pos):</p>
<pre><code class="language-cpp">HWND  parent;
    POINT point;
    RECT  rect;

    parent = GetParent(handle);
    if (parent==0) parent = GetDesktopWindow();
    if (parent==0) return 0;

    if (GetWindowRect(handle, &amp;rect)==0) return 0;

    point.x=rect.left;
    if (ScreenToClient(parent, &amp;point)==0) return 0;

    return point.x;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1325883</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325883</guid><dc:creator><![CDATA[TheShadow2000]]></dc:creator><pubDate>Sun, 15 Jul 2007 14:08:59 GMT</pubDate></item><item><title><![CDATA[Reply to Position von Child-Window... on Sun, 15 Jul 2007 16:45:27 GMT]]></title><description><![CDATA[<p>hi,<br />
Wenn du die <strong>ScreenPos</strong> hast ist doch alles gut, einfach mit ScreenToClient(POINT pt) umrechnen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1325992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1325992</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Sun, 15 Jul 2007 16:45:27 GMT</pubDate></item></channel></rss>