Bluesmaster Posted March 2, 2014 Posted March 2, 2014 it is possible to start a process hidden on another desktop. But is it possible to bring it back to the input-desktop using its PID? Example: ( start Notepad ) #include <WinAPISys.au3> #Include <WinAPI.au3> $hNewDesktop = _WinAPI_CreateDesktop( "ShellExecuteHidden_Desktop" , $GENERIC_ALL ) ; 2 - Start Process $tProcess = DllStructCreate( $tagPROCESS_INFORMATION ) $tStartup = DllStructCreate( $tagSTARTUPINFO ) DllStructSetData( $tStartup , 'Size', DllStructGetSize( $tStartup) ) DllStructSetData( $tStartup , 'Desktop', _WinAPI_CreateString( "ShellExecuteHidden_Desktop" ) ) Local $pid _WinAPI_CreateProcess( @SystemDir & "\notepad.exe" , "" , 0, 0, 0, 0x00000200 , 0, 0, DllStructGetPtr($tStartup), DllStructGetPtr($tProcess) ) $pid = DllStructGetData( $tProcess , 'ProcessID' ) so I got the PID ... and now? SetThreadDesktop: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686250(v=vs.85).aspx does not accept a PID. And there is another problem: "The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop (unless the hDesktop parameter is a handle to the current desktop)." What do they mean with "current desktop" ? The current inputDesktop or the desktop the proccess is currently running on? any experts of the windows desktop system here? best regards Blues My UDF: [topic='156155']_shellExecuteHidden[/topic]
JohnOne Posted March 2, 2014 Posted March 2, 2014 (edited) $hProcess = DllStructGetData( $tProcess , 1 );Process handle Edited March 2, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
KaFu Posted March 2, 2014 Posted March 2, 2014 http://msdn.microsoft.com/en-us/library/windows/desktop/ms686250%28v=vs.85%29.aspx Comment #1: "The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop" > This is understated. SetThreadDesktop will fail if the calling thread has ever had a window or hook on its current desktop. http://stackoverflow.com/questions/16010659/how-to-switch-a-process-between-default-desktop-and-winlogon-desktop OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Bluesmaster Posted March 3, 2014 Author Posted March 3, 2014 @JohnOne How is this related to the question? @KaFu I know the sites you linked but: 1. I want to change the desktop of another thread/ process while SetThreadDesktop only is dedicated to the calling thread > so SetThreadDesktop cannot be the right function? 2. MSDN explicit excludes the "current desktop." and this is what I intend to do...get it on the currend desktop .. but this is just theory any practical experiences? Blues My UDF: [topic='156155']_shellExecuteHidden[/topic]
Bluesmaster Posted March 3, 2014 Author Posted March 3, 2014 and by the way: any windows application has got a window ( except for console windows ). The function would be totaly useless if it can only send console applications from one desktop to another as they do not have visible information to show ... or what is my missunderstanding here? Blues My UDF: [topic='156155']_shellExecuteHidden[/topic]
JohnOne Posted March 8, 2014 Posted March 8, 2014 @JohnOne How is this related to the question?SetThreadDesktop takes a handle, not a pid. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Bluesmaster Posted March 8, 2014 Author Posted March 8, 2014 (edited) yes but a handle of a desktop not a handle of a process. This was part of my question @Thread #5 I appologize: as I learned it is possible to create a system:windows-app without any window. So it seems an app with window on another desktop may be jailed there forever. Edited March 8, 2014 by Bluesmaster My UDF: [topic='156155']_shellExecuteHidden[/topic]
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