Jump to content

Close a process.


Humper
 Share

Recommended Posts

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.
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...