Jump to content

Recommended Posts

Posted

Hi all, I use some functions such as _Menu_ClickItem(), _Menu_ClickPopup() and _Lib_PopupGetHwnd() contained in A3Library to program a script, and the script will run in background.

The program run normally in Win2K foreground, background and WinXP foreground, but when it was running in WinXP background, it seemed that the functions not working, _Lib_PopupGetHwnd() could not get the pop menu's handle.

Any advice?

Posted

Show the source.

Okai, Here is the source, writeLog() is the function I haved defined, I can get the main windows' handle and the pop menu's handle, everything is ok when running in Win2K and WinXP's foreground. However, when I launched the program in WinXP's background, I could just get the main window's handle, but the pop menu's handle is 0x0000000

;define variables and login...

$H_mainWin = WinGetHandle("Application System");

$H_mainMenu=_Menu_GetMenu($H_mainWin);
writeLog("Main Win Handle: "&$H_mainMenu);
_Menu_ClickItem($H_mainWin,$H_mainMenu,_Menu_FindItem($H_mainMenu,"Reports"),True);
$H_subMenu=_Menu_GetItemSubMenu($H_mainMenu,_Menu_FindItem($H_mainMenu,"Reports"));
_Menu_ClickItem($H_mainWin,$H_subMenu,_Menu_FindItem($H_subMenu,"Daily"),True);
$H_pop=_Lib_PopupGetHwnd();
;MsgBox(4096,"pop",$H_pop);
writeLog("Pop Handle: "&$H_pop);

;other operations
Posted

You know, Valik warned about asking for source.

This is not example forum, this is General Help and Support, unless the thread opener can provide more information about his problem, a set of code or a reproducer is much appreciated.
Posted

I forgot one thing, the script is used to run a external program and get controls' handle to operate, the controls are not generated by AutoIt script.

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
×
×
  • Create New...