Note that there are some explanatory texts on larger screens.

plurals
  1. PONot able to get the coordinates of a particular window (I've tried the examples...still ) in V C++
    text
    copied!<p>I have been trying various code snippets here and there, but still not successful.I am simply trying to find one of the open windows (it is the Browser window) using <code>FindWindow(NULL,WINDOWTITLE)</code>, with a specific Title string. Once I get the handle of the window, I need the coordinates using <code>GetWindowRect</code>.</p> <p>This code gets me the coordinates, but seems like it's in an infinite loop, there are about a 100 lines of output with the coordindates, should be just 1. I don't see any while construct (originally a Java programmer)... wonder why it's repeating...</p> <pre><code>struct WindowInfo { HWND m_hWnd; string m_title; WindowInfo(HWND hwnd, string title) : m_hWnd(hwnd), m_title(title) {} }; BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam) { vector&lt;WindowInfo*&gt; &amp; windows = *(vector&lt;WindowInfo*&gt;*)lParam; char title[256]; HANDLE wndHandle; LPCWSTR WINDOWTITLE = L"eBargain 2 Share - Windpos Internet Explorer"; RECT rRect; LPRECT lpRect; RECT rc; hwnd = FindWindow(NULL,WINDOWTITLE); GetWindowRect(hwnd,&amp;rc); printf("Position: %d x %d\tSize: %d x %d\n",rc.left,rc.top,rc.right- rc.left,rc.bottom-rc.top); /* Enumerating through all the windows tells me that I am on the right track... (Should I just try to find the TITLE STRING by comparing every title from the following enumeration ? */ GetWindowTextA(hwnd, title, 256); windows.push_back(new WindowInfo(hwnd,title)); // printf("%s\n", title); return TRUE; } int main() { vector&lt;WindowInfo*&gt; windows; BOOL ret = EnumWindows(EnumWindowsProc, (LPARAM) &amp;windows); if ( ret ) { //windows have windowinfo of all enumerated windows } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload