Jump to content

several questioni about child window and some functions

Recommended Posts

I could have the following results by this script, 4 different window inside a MainGUI


$hWnd1 = WinGetHandle("Google - Mozilla Firefox")

WinWait("Windows Live Messenger")
$hWnd2 = WinGetHandle("Windows Live Messenger")

;; WinWait("WinEdt 6.0")
$hWnd3 = 0x00C0668

$hWnd4 = WinGetHandle("[CLASS:SUMATRA_PDF_FRAME]")

$MainGUI = GUICreate("Pdf Test", @DesktopWidth*3/5, @DesktopHeight*9/10, -1, -1, BitOr($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN,$WS_SIZEBOX))
$WinSize = WinGetClientSize($MainGUI)

_WinAPI_SetParent($hWnd1, $MainGUI)
_WinAPI_SetParent($hWnd2, $MainGUI)

_WinAPI_SetParent($hWnd3, $MainGUI)

_WinAPI_SetParent($hWnd4, $MainGUI)

While 1

Posted Image

But I found something bother me:

1) WinGetHandle doesn't 100% give the correct result. For an Latex editor "WinEdt 6", the result is different from AutoIt Window Info.exe.

2) But for this WinEdt 6, WinActive(WinGetHandle("WinEdt 6.0")) works, but not $hwnd = (the handle got from AutoIt Window Info.exe), WinActive($hwnd) doesn't.

3) Furthermore, in the above script, I need to use $hWnd3 = 0x00C0668, which is the one given by AutoIt Window Info.exe. If $hWnd3 = WinGetHandle("WinEdt 6.0"), then this script doesn't work for WinEdt 6.

4) Suppose a window inside the MainGUI is active, then use another scirpt to test if this window is active by WinActive, the result is False, meaning that the widnow is non-active. I think the reason is that the system thinks the active window ins MainGUI, not the child window. In this way, is there a way to detect which child window is active?

5) Furthermore, WinEdt can has only one window a time. But if one WinEdt Window is inside the MainGUI, then I can open another WinEdt window ( outside the MainGUI). So It seems that if a window is in a parent window, then, it is not a window for the system.

6) The ControlClick doesn't work for child window anymore, even use ClassNN (at least, it doesn't work for WinEdt 6.0. ) Is there a way to make ControlClick work in this case?

7) It seems that doing this way, the programs become slower. For example, when I type my .tex file, it's slower than I type in normal usage of WinEdt 6. Anyway to avoid this?

Edited by hodgestructure
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...