AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RunChild ?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  

What do you think?
No
50%
 50%  [ 1 ]
Yes
50%
 50%  [ 1 ]
Total Votes : 2

Author Message
heresy



Joined: 11 Mar 2008
Posts: 132

PostPosted: Mon May 12, 2008 1:40 am    Post subject: RunChild ? Reply with quote


(note that PSPad launched ahk script as a child process)

i just thought it would be good if we have additional RunChild command that can launch any programs as a child process
since we often use command line utilities it'll be useful such as not leaving process alone that launched with Hide option when script exits
_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 753
Location: London, UK

PostPosted: Mon May 12, 2008 1:48 am    Post subject: Reply with quote

Not a bug??????

Secondly am I missing something :S


_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
heresy



Joined: 11 Mar 2008
Posts: 132

PostPosted: Mon May 12, 2008 2:13 am    Post subject: Reply with quote

Superfraggle wrote:
Not a bug??????


sorry wrong posting.
i was trying to post at Wishlist Sad

to moderator : please move it to Wishlist, i can't delete it cause someone replied it

[ Moderator!: Moved. ]
_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2364
Location: Australia, Qld

PostPosted: Mon May 12, 2008 9:09 am    Post subject: Reply with quote

I was under the impression that the default Windows behaviour is to make each new process a child of the process that created it...
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 132

PostPosted: Wed May 14, 2008 6:04 am    Post subject: Reply with quote

Lexikos wrote:
make each new process a child of the process that created it...

currently the process launched by Run command doesn't dependent on script right?
what i meant was make RunChild command to do the job.

Code:
Run, Notepad.exe
Exitapp ;launched notepad remains
;--------------------------------------
RunChild, Notepad.exe
Exitapp ;launched notepad will be closed automatically cause it has dependency on script

_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2364
Location: Australia, Qld

PostPosted: Wed May 14, 2008 9:45 am    Post subject: Reply with quote

That doesn't seem like a Windows feature. Why don't you just use WinClose/Process,Close?
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 132

PostPosted: Wed May 14, 2008 11:28 am    Post subject: Reply with quote

oh i thought it was an windows feature cause PSPad does it
by the way i found little trick

Code:
DetectHiddenWindows, On
Gui, +LastFound
Gui, Show, Center w640 h480
uid1 := WinExist()
Run, Notepad.exe,,Hide
WinWait, ahk_class Notepad
uid2 := WinExist()
DllCall("SetParent", "uint", uid2, "uint", uid1)
Return

GuiClose:
ExitApp

run it and look for these processes on task manager or process explorer
then close it. notepad will be closed together
this is what i was talking about
since people using command line utilites with Hide option
i just thought like it would be good if it can be done via single command RunChild
for saving lines and script safeness?
_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2364
Location: Australia, Qld

PostPosted: Wed May 14, 2008 9:59 pm    Post subject: Reply with quote

If a window is closed, it also closes its child windows/controls. When the Notepad window is closed, notepad.exe exits. It won't necessarily happen with all programs.
Quote:
oh i thought it was an windows feature cause PSPad does it
Perhaps PSPad simply terminates the process - i.e. the way Process,Close would...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group