Windows auto close window

Closing the Window

When the user closes a window, that action triggers a sequence of window messages.

The user can close an application window by clicking the Close button, or by using a keyboard shortcut such as ALT+F4. Any of these actions causes the window to receive a WM_CLOSE message. The WM_CLOSE message gives you an opportunity to prompt the user before closing the window. If you really do want to close the window, call the DestroyWindow function. Otherwise, simply return zero from the WM_CLOSE message, and the operating system will ignore the message and not destroy the window.

Here is an example of how a program might handle WM_CLOSE.

In this example, the MessageBox function shows a modal dialog that contains OK and Cancel buttons. If the user clicks OK, the program calls DestroyWindow. Otherwise, if the user clicks Cancel, the call to DestroyWindow is skipped, and the window remains open. In either case, return zero to indicate that you handled the message.

If you want to close the window without prompting the user, you could simply call DestroyWindow without the call to MessageBox. However, there is a shortcut in this case. Recall that DefWindowProc executes the default action for any window message. In the case of WM_CLOSE, DefWindowProc automatically calls DestroyWindow. That means if you ignore the WM_CLOSE message in your switch statement, the window is destroyed by default.

When a window is about to be destroyed, it receives a WM_DESTROY message. This message is sent after the window is removed from the screen, but before the destruction occurs (in particular, before any child windows are destroyed).

In your main application window, you will typically respond to WM_DESTROY by calling PostQuitMessage.

We saw in the Window Messages section that PostQuitMessage puts a WM_QUIT message on the message queue, causing the message loop to end.

Here is a flow chart showing the typical way to process WM_CLOSE and WM_DESTROY messages:

Auto Window Closer

Close Windows automatically as they open with Window Closer. Use the software to close any popup windows or even to enable or disable buttons on application. The Window Close can be used on Windows Vista, Windows 7, Windows 8, Windows 8.1 or even on Windows 10 and the trial version can be downloaded free now.

Читайте также:  Как установить с ноутбука windows с загрузочного диска

Have a close look at the screenshot of the Window Closer as displayed on the right hand side. The Window Closer lists application windows which are open at the time the screenshot was taken. Window Closer displays non minimised windows and the Display All checkbox can be used to display all the windows open on your computer. Button, Label, Checkbox and other controls are referred to as in the document as Windows.

Download Window Closer now and give it a try. With Window Closer you can view hidden windows , enable the disabled windows such as Buttons, Checkboxes, etc. Know what all windows are running on your Windows computer right now.

How to Automatically Close a Window

The Software can be used to close any Window (e.g. a annoying popup message box) or any other window. In order to automatically close a window, you need to introduce that window to Window Closer Software and ask the software to automatically close it. Given below steps outline how to configure a window to be closed automatically.

  • Display the Popup Window on your computer screen.
  • Launch Window Closer or if the software is already running click on the Refresh button.
  • Now locate the desired popup window in the top list and click on it.
  • Either double click that Window record from the list or click on the Toggle Auto Close For Selected Window Above . This Action will mark that this Window must be closed automatically whenever activated. You can remove the auto closing of the Window by clicking the toggle button again. Note the last column of the Window Records button which will either say Yes for automatically closing or will be blank for not doing anything for that window.
  • Now Minimize the Window Closer or Hide it to System tray using the button provided.
  • Now onwards the Windows(s) marked for Auto Close will be closed automatically whenever they are activated.

windows 10 auto close app when over 60% of ram

My system install 32GB of ram (disable paging file). But when use 60% of ram, free 12GB but windows auto force close chrome.

Stupid windows when calculate ram by percent. Now aday when system have many ram, but windows use % dectect free ram and and close app. Very stupid.

we have many ram, why force us use ssd, hdd for paging file?. Very hate windows and any thing from microsoft.

Читайте также:  Разделение жесткого диска windows 10 без потери данных

Replies (13) 

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

You should turn on a set page file to about 1500MB.

And it is hard to believe you have 16GB of memory being used at any time. I can be encoding a HD video, capturing a HD Video and watching a HD video all at the same time and doing other things on a system with 8GB Ram with 6 — 2.80ghz processors and only be using about 5.5GB ram, 2.5GB page file and 75% processor usage.

What makes you think that chrome closing down is because of RAM, this makes no sense.

Why do you not want to use a page file.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I think you miss understand this problem.

Why system still free over 12GB, but system force close app? not only chrome, it close other app. (16GB use for other app, you don’t care it).

Very stupid when we have 12GB free ram, but still use page file? Do you know page file will make SSD come to an end faster? and speed can not fast like ram.

Why window use % ram free? if system have 128GB. We will waste 60 free ram. Stupid windows. Look linux and mac os can use ram very best.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I think you miss understand this problem.

Why system still free over 12GB, but system force close app? not only chrome, it close other app. (16GB use for other app, you don’t care it).

Very stupid when we have 12GB free ram, but still use page file? Do you know page file will make SSD come to an end faster? and speed can not fast like ram.

Why window use % ram free? if system have 128GB. We will waste 60 free ram. Stupid windows. Look linux and mac os can use ram very best.

Читайте также:  Windows не загружается после акрониса

I completely understood.

There should be no reason with plenty of memory for apps to fail. Page file or no page file. Maybe some apps or system files need to be run on the page file for best results. That is a whole new topic

You have some type of system corruption error or you may have a bad stick of memory that is causing this issue.

Run the memory diagnostics tool, Go here and follow the steps. Do the «Extended Test» and «8 passes».

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I think you miss understand this problem.

Why system still free over 12GB, but system force close app? not only chrome, it close other app. (16GB use for other app, you don’t care it).

Very stupid when we have 12GB free ram, but still use page file? Do you know page file will make SSD come to an end faster? and speed can not fast like ram.

Why window use % ram free? if system have 128GB. We will waste 60 free ram. Stupid windows. Look linux and mac os can use ram very best.

I completely understood.

There should be no reason with plenty of memory for apps to fail. Page file or no page file. Maybe some apps or system files need to be run on the page file for best results. That is a whole new topic

You have some type of system corruption error or you may have a bad stick of memory that is causing this issue.

Run the memory diagnostics tool, Go here and follow the steps. Do the «Extended Test» and «8 passes».

You should also do a check disk and a system files checker as those could resolve your issue. The other day a guy had his icons on taskbar disappearing and reappearing and something else, and disk check fixed it.

Also maybe it is your video card, update drivers or reinstall them.

And how do you know it is because of ram. What is the error code or message

Оцените статью