DennisFV Posted October 16, 2009 Posted October 16, 2009 Hi All, I've been using AutoIT the past few weeks to automate some web based stuff for work and its worked great. Now I'm trying to automate some stuff for a program called FirstClass if anyone is familiar with it. We use it as a content management system for websites. I've been able to automate a few things so far but it all requires me to send key strokes and mouse movements which means I can't really use my computer while it's running. I just read up on ControlSend and similar functions and I can get those to send keystrokes to the first class client in the background which is good. The issue is that a lot of the stuff I want to automate in FirstClass opens new windows (Permissions dialog box, properties dialog, etc.) Is there a way I can have these windows open in the background so they don't interrupt what I am currently working on? I love that I can automate IE and Excel stuff to run in the background and am trying to do the same here. Thanks Dennis
rliiack Posted October 16, 2009 Posted October 16, 2009 Maybe this? _WinAPI_ShowWindow(_WinAPI_FindWindow($sClassName, $sWindowName), @SW_HIDE) My Projects:Smart Icons
DennisFV Posted October 16, 2009 Author Posted October 16, 2009 (edited) Maybe this?_WinAPI_ShowWindow(_WinAPI_FindWindow($sClassName, $sWindowName), @SW_HIDE)I'll look into this. I haven't really looked at the WinAPI at all. I know there's a WinSetState that you can use to hide, maximize and other stuff to windows but I think that (and what you are suggesting since it seems similar) requires the window to already be open. Once the window is open and becomes active it doesn't need to stay open for very long (probably not more than 10 seconds or so) the issue is that by becoming the active window it would interrupt whatever I was doing. So if it opened while I was in the middle of typing I could end up typing over data in the window that opens. Ideally there would be a way to set new windows to open without becoming active. I might have to spend some time looking at the WinAPI.Edit: In a related note (and I may find something in the WinAPI) is there a way to wait for a window to fully load sort of like the IELoadWait() function?I have a window that I open currently and I have to add a sleep delay in because if I send the keystrokes immediately the window isn't fully loaded and it ends up messing everything up. The sleeps also might need to change depending on computer speed.Just found WinWait might have to try that. Edited October 16, 2009 by DennisFV
rliiack Posted October 16, 2009 Posted October 16, 2009 (edited) WinWaitActive or WinWait should be good. Edited October 16, 2009 by rliiack My Projects:Smart Icons
picea892 Posted October 16, 2009 Posted October 16, 2009 I have a solution 1) run the program hidden. 2) switch the parent to the desktop window so when you shownoactivate it is behind all other windows. 3) shownoactivate 4) switch the parent back to the original parent. #Include <WinAPI.au3> Run ("notepad.exe", "", @SW_HIDE) $handle=WinGetHandle("Untitled - Notepad") $origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $handle, "hwnd", WinGetHandle("Program Manager")) _WinAPI_ShowWindow($handle, @SW_SHOWNOACTIVATE) $origParent2 = DllCall("user32.dll", "int", "SetParent", "hwnd", $handle, "hwnd", $origParent[0])
DennisFV Posted October 16, 2009 Author Posted October 16, 2009 I have a solutionThis worked on my small scale test. Thanks
Yashied Posted October 16, 2009 Posted October 16, 2009 #Include <WinAPI.au3> #Include <Constants.au3> $hForm = GUICreate('MyGUI', 800, 600) _WinAPI_SetWindowPos($hForm, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_SHOWWINDOW)) Do Until GUIGetMsg() = -3 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
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