gzken Posted November 9, 2007 Share Posted November 9, 2007 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 More sharing options...
JustinReno Posted November 9, 2007 Share Posted November 9, 2007 Show the source. Link to comment Share on other sites More sharing options...
gzken Posted November 9, 2007 Author Share Posted November 9, 2007 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 More sharing options...
Generator Posted November 9, 2007 Share Posted November 9, 2007 Can you please define your "foreground" and "background"? Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 9, 2007 Share Posted November 9, 2007 You know, Valik warned about asking for source. Link to comment Share on other sites More sharing options...
Generator Posted November 9, 2007 Share Posted November 9, 2007 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. Link to comment Share on other sites More sharing options...
gzken Posted November 9, 2007 Author Share Posted November 9, 2007 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.mspxThanks. Link to comment Share on other sites More sharing options...
gzken Posted November 9, 2007 Author Share Posted November 9, 2007 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. Link to comment Share on other sites More sharing options...
gzken Posted November 12, 2007 Author Share Posted November 12, 2007 waiting for help... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now