Jump to content
Sign in to follow this  
gzken

a problem about A3Library

Recommended Posts

gzken

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?

Share this post


Link to post
Share on other sites
gzken

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

Share this post


Link to post
Share on other sites
Generator

Can you please define your "foreground" and "background"?

Share this post


Link to post
Share on other sites
Richard Robertson

You know, Valik warned about asking for source.

Share this post


Link to post
Share on other sites
Generator

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.

Share this post


Link to post
Share on other sites
gzken

Can you please define your "foreground" and "background"?

Foreground means that the most usually mode of running a GUI program, open a window and interact with controls.

Background means that launch the GUI program by windows scheduler or using a tool call 'psexec.exe', it won't show a GUI on the desktop.

here is the psexec's link:http://www.microsoft.com/technet/sysintern...es/PsTools.mspx

Thanks.

Share this post


Link to post
Share on other sites
gzken

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.