Jump to content

a problem about A3Library


gzken
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

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
 Share

  • Recently Browsing   0 members

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