joseLB Posted January 14, 2014 Share Posted January 14, 2014 Great, very helpfull, BluesMaster! Probably this will work for me... it´s a webcam window that will stay out of screen, and before to use PixelSearch, I will send a wm_paint message to the webcam window. Thanks Jose Link to comment Share on other sites More sharing options...
wolf9228 Posted January 14, 2014 Share Posted January 14, 2014 (edited) Good Work Edited January 14, 2014 by wolf9228 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
garbb Posted March 1, 2014 Share Posted March 1, 2014 Glad that I could help. By the way I found out through some experiments, that the windows on such a hidden desktop will not render their DCs ( device context ) so for automation with image regognition unfortunately you will have to switch to that desktop or get the window to the current desktop which I will describe another time. regards Blues Would it be possible to move the window you originally created/launched on the hidden desktop to the "real" desktop to capture an image of it or do pixelsearch type functions? (and maybe set the window state to hidden so that you would not see it and it would not steal focus) I was looking at SetProcessWindowStation function but I am not sure this is possible? Link to comment Share on other sites More sharing options...
Bluesmaster Posted March 2, 2014 Author Share Posted March 2, 2014 This is a good question. I have planned to implement this later but it turns out to be non-trivial. I thought about the setThreadDesktop - fcn http://msdn.microsoft.com/en-us/library/windows/desktop/ms686250(v=vs.85).aspx but it doesnt accept any PID so a programm could only switch itself. ( with some limitations due to its window-handels... ) However I think this is worth an own thread: '?do=embed' frameborder='0' data-embedContent>> And you could also ask in some more windows-specific forums ( and come back with the answer please ) You could also switch toward the desktop, screenshot, and switch back...but this is a very ugly solution regards Blues My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
garbb Posted March 2, 2014 Share Posted March 2, 2014 You could also switch toward the desktop, screenshot, and switch back...but this is a very ugly solution Do you mean make the hidden desktop the "foreground" or "active" desktop momentarily in order to take the screenshot? (and flash this on the user's screen?) If so, then yeah, I can see how that would look bad and be disruptive to the user. I will try to do some more research on this... Link to comment Share on other sites More sharing options...
Bluesmaster Posted March 3, 2014 Author Share Posted March 3, 2014 http://msdn.microsoft.com/en-us/library/windows/desktop/ms684303(v=vs.85).aspx if you want to that anyway or join the discussion here: ?do=embed' frameborder='0' data-embedContent> best regards Blues My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
clarkster26 Posted March 3, 2014 Share Posted March 3, 2014 We are unable to download the API link on your post. It says you do not have permission although I am logged in. Link to comment Share on other sites More sharing options...
garbb Posted March 3, 2014 Share Posted March 3, 2014 I think there is a working link in the second post. Link to comment Share on other sites More sharing options...
Bluesmaster Posted March 4, 2014 Author Share Posted March 4, 2014 fixed I think it must be runnable without external libs in new autoit version. I will refactor it later. My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
clarkster26 Posted March 6, 2014 Share Posted March 6, 2014 It works great. I ran into one problem that is doing a "runas". Is it possible? What if all my commands were done in a compiled executable and in a different compiled script I call the other doing a "runas", would everything in that second compiled script be running as the user I defined? Link to comment Share on other sites More sharing options...
Bluesmaster Posted March 7, 2014 Author Share Posted March 7, 2014 The basic "technology" is the CreateProcess function of the win api http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx The new process runs in the security context of the calling process best regards Blues My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
sayanvd Posted April 28, 2014 Share Posted April 28, 2014 Help me, please write here the example code using _shellExecuteHidden, so as not to display any window: Run ("ICQSETUP.EXE") WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") ControlClick ("Mirabilis ICQ 1.1132 Corp Beta","",3) WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") Send("{ENTER}") WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") Send("{ENTER}") WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") Send("{ENTER}") If WinActive("Install") Then Send("{ENTER}") WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") Send("{ENTER}") WinWaitActive ("Mirabilis ICQ 1.1132 Corp Beta") ControlClick ("Mirabilis ICQ 1.1132 Corp Beta","",4) WinWaitActive ("Update Complete") Send("{ENTER}") WinWaitActive ("ICQ Intranet Client - Sign In") ControlClick ("ICQ Intranet Client - Sign In","",2) WinWaitClose ("ICQ Intranet Client - Sign In") Send("!{F4}") Thank you!PS: I'm new to AutoIT, just starting to learn. Link to comment Share on other sites More sharing options...
antonioj84 Posted October 25, 2014 Share Posted October 25, 2014 I tried your application I am getting the error below, not sure if it's <WinAPIEx.au3> that is wrong >Running AU3Check (3.3.10.2) from:C:Program Files (x86)AutoIt3 input:C:Usersanton_000Desktopdemo5_shellExecuteHidden.au3 "C:\Program Files (x86)\AutoIt3\Include\WinAPIEx.au3"(969,230) : error: $tagBITMAPINFOHEADER previously declared as a 'Const'. Global Const $tagBITMAPINFOHEADER = 'dword biSize;long biWidth;long biHeight;ushort biPlanes;ushort biBitCount;dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C: Link to comment Share on other sites More sharing options...
antonioj84 Posted October 25, 2014 Share Posted October 25, 2014 see the attached error Link to comment Share on other sites More sharing options...
antonioj84 Posted October 26, 2014 Share Posted October 26, 2014 simply does not work for me , can we have a very simple example _shellExecuteHidden Link to comment Share on other sites More sharing options...
FaridAgl Posted October 27, 2014 Share Posted October 27, 2014 Remove the constant defined in line 969. http://faridaghili.ir Link to comment Share on other sites More sharing options...
antonioj84 Posted November 1, 2014 Share Posted November 1, 2014 Thank you Universalist, the example listed work as a charm, however when I tried to do some serious implementation of the concept to hide windows as claimed with _shellExecuteHidden , it simply do not work Look at my code the regular shellexecute works, however the behaviour of _shellExecuteHidden is rather strange (seem to hung) Dim $run= _shellExecuteHidden(@ComSpec, " /c start inetcpl.cpl","","") ;Dim $run= shellExecute(@ComSpec, " /c start inetcpl.cpl","","",@SW_HIDE) Sleep(100) ControlClick("Internet Properties", "", "[CLASS:Button; TEXT:OK]") ;~ProcessClose($run) Sleep(1000) MsgBox(0,"","iam here") Link to comment Share on other sites More sharing options...
antonioj84 Posted November 1, 2014 Share Posted November 1, 2014 all I really want to do is work on these sysdm.cpl – System Properties inetcpl.cpl – Internet Explorer Properties (general,security,privacy tab) I will call them silently or invisibly and do some work send some, ie controlclick ect... then close Unfortunately the @sw_Hide does not work and however when I read about the _shellExecuteHidden I was very hopeful so far no luck , If I am doing something wrong please point me to the right direction Link to comment Share on other sites More sharing options...
antonioj84 Posted November 1, 2014 Share Posted November 1, 2014 (edited) what I did so far, the script "appear" to be running however the controlsend, controlclick, controlcommand are not working for me $run= _shellExecuteHidden(@ComSpec, " /c start inetcpl.cpl") ; change made Opt("WinDetectHiddenText", 1) Sleep(100) $hWnd = WinGetHandle("Internet Properties") WinActivate($hWnd) Sleep(1000) ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:7]", "UnCheck") MsgBox(0,"","iam here1") ControlClick($hWnd, "", "[CLASS:Button; TEXT:OK]") Sleep(100) MsgBox(0,"","iam here2") one fact that is interesting if I start the inetcpl.cp windows and leave it on my desktop then run the script all the control suddenly work very interesting fact .... food for thought,any input or comment is most appreciated, can someone try that snippet on their pc and let me know their finding !!! comment or suggestion Edited November 1, 2014 by antonioj84 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