Jump to content
Sign in to follow this  
Humper

Close a process.

Recommended Posts

Humper

Hello I wonder how I close a process, and not kill it.

ProcessClose, this is the command for killing a process.

I mean like when you press alt+f4/press the X.

Regards Humper


[center][/center]

Share this post


Link to post
Share on other sites
martin

Hello I wonder how I close a process, and not kill it.

ProcessClose, this is the command for killing a process.

I mean like when you press alt+f4/press the X.

Regards Humper

Maybe

#include <sendmessage.au3>

$hW = WingetHandle("Tiltle of window to close")
_SEndMessage($hW,$WM_CLOSE)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Humper

Maybe

#include <sendmessage.au3>

$hW = WingetHandle("Tiltle of window to close")
_SEndMessage($hW,$WM_CLOSE)
Thanks but theres 2 of them and their both at tray.

[center][/center]

Share this post


Link to post
Share on other sites
FreeFry

Hello I wonder how I close a process, and not kill it.

ProcessClose, this is the command for killing a process.

I mean like when you press alt+f4/press the X.

Regards Humper

Closing a process(ProcessClose), is the same as 'killing' it. What you're talking about is closing a window, not its parent process.

As martin suggested, you just send a WM_CLOSE message to the window you want to close(though, I'd rather use WinClose because it does the same thing. but with native functions).

If you have several windows matching your title, you can go through them by listing all windows, with WinList.

Edited by FreeFry

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.