i found out the other day that using "ATL:10024320" and "ATL:100240A0" might not work for all computers.
i had my application installed on another computer and it didn't work because "ATL:10024320" was another set of number "ATL:########"Code:hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:10024320", IntPtr.Zero); hwnd = FindWindowEx(hwnd, IntPtr.Zero, "ATL:100240A0", IntPtr.Zero);
the article implemented a FindChildWindow() function to do a partial match on the string "ATL:".
http://www.mp2kmag.com/downloads/mpvbtest1.zip
i was too lazy to implement a string comparison, so i used GetWindow() to just grab the child:
Code:[DllImport("user32.dll")] private static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd); private const uint GW_CHILD = 5; hwnd = GetWindow(hwnd, GW_CHILD); // get the first "ATL:########" hwnd = GetWindow(hwnd, GW_CHILD); // get the second "ATL:########" mapPointHwnd = FindWindowEx(hwnd, IntPtr.Zero, "AfxFrameOrView70", IntPtr.Zero);