mIRC Homepage
Posted By: Surinder Lost settings when closing down Windows - 31/07/05 01:21 PM
Mirc loses changes to settings. To duplicate:

1) Make changes to Mirc's settings, even simple changes like adding a name to the Notify list or adding an address to the auto-ops.

2) Close down the computer (Turn off via the start button).

3) Restart the computer and start Mirc. The changes have disappeared.

It looks like the "forced close" of Mirc during shutdown doesn't carry out the cleaning up operations of the normal program close.

Mirc 6.16, Windows XP SP2
Posted By: Armada Re: Lost settings when closing down Windows - 31/07/05 02:17 PM
Learn to shutdown properly and then expect normal operations smile
Posted By: Surinder Re: Lost settings when closing down Windows - 31/07/05 02:57 PM
Quote:
Learn to shutdown properly and then expect normal operations smile


I think you're missing the point, Armada. There's an easy workaround to this bug. Every time I add a name to the notify list I can close Mirc, then restart it. Is that what you suggest? Or I have to remember that when I want to close down Windows I have to close Mirc first before clicking the Start button. Both of those methods would solve the problem. But these tricks aren't necessary with other Windows programs, so why should Mirc be different?
You could try a /saveini instead of restarting mIRC.
Although I agree that the ini file should be updated as soon
as you click the OK button, actually I didn't realize it wasn't,
I think it's silly that you seem to refuse to close running
programs before shutting down Windows. mIRC isn't the
only program to behave this way, even Windows itself
saves most settings only on a proper shutdown. What's
the big deal? Get a clue and close your programs before
shutting down Windows.
Since any Windows application (with a message loop and window) is warned when Windows is shutting down there is no reason at all why mIRC can't save it's settings automatically.

Quote:
even Windows itself saves most settings only on a proper shutdown

Since mIRC doesn't save it's settings on a proper shutdown (the entire point of this post) I really don't see your point.
Posted By: Surinder Re: Lost settings when closing down Windows - 31/07/05 04:36 PM
Quote:
Although I agree that the ini file should be updated as soon
as you click the OK button, actually I didn't realize it wasn't,
I think it's silly that you seem to refuse to close running
programs before shutting down Windows. mIRC isn't the
only program to behave this way, even Windows itself
saves most settings only on a proper shutdown. What's
the big deal? Get a clue and close your programs before
shutting down Windows.


What is your definition of a "proper shutdown"? I define it as clicking on the Start button, then clicking on "Turn off computer". Windows makes no recommendation to close running programs manually before doing this. If I'm running (for instance) MS Word and have an open document I'm asked if I want to save it, I answer Yes or No, then Word closes and the shutdown goes ahead. Word doesn't just say, "Oh ho, shutdown, I'll throw the document away". I personally know of no other programs that lose their settings when Windows is closed down. Only Mirc. Are you denying this is a bug? Try changing a security setting in Internet Explorer and then closing down Windows. When you reboot the setting will still be there.

I agree that it would be silly to refuse to close running programs before shutting down Windows. Usually it's not necessary, but in Mirc's case I have to do it as a workaround until the bug is fixed. I didn't know the /saveini command suggested in another post. I'll try that later today, when I can afford to reboot. If the saveini also saves the notify list etc it would be the most comfortable workaround available.
He's not properly shutting down mIRC before properly shutting
down windows. Maybe mIRC should save the settings but it
doesn't and really my point was that it's not a bug. A feature
suggestion sure, but not a bug. The parking brake on a car
doesn't engage itself when you park. While the car may be
lacking this feature, it's not a bug.
Quote:
Are you denying this is a bug?


Yes, I am.
Shutting down Windows is a perfectly correct way of closing mIRC, which is exactly why Windows provides the WM_QUERYENDSESSION and WM_ENDSESSION messages in the first place.

It is certainly not expected behaviour that mIRC would forget it's settings when closed in a perfectly normal manner. This is no more of a feature suggestion than it would be if mIRC was forgetting settings on a File -> Exit.
Posted By: argv0 Re: Lost settings when closing down Windows - 31/07/05 06:31 PM
Quote:
He's not properly shutting down mIRC before properly shutting down windows.


Woah let's back this train up a second here. Are you telling this user that there is a "correct" way to shut down his programs? If so, please support your comments by showing microsoft documentation telling their clients to shut down programs manually before clicking the shut down button

As far as I know, there is no such documentation. Shutting down windows tells all programs to exit _normally_ before attempting to shut down. In fact, from what I know, windows will attempt to exit all programs _for you_. Therefore, there should be no reason for mIRC to be shut down before anything else is.

In addition, because this is defined as a _normal_ exit by MSDN standards (read the docs on the message sent by windows, mentioned in the last post: WM_QUERYENDSESSION) mIRC should in fact treat it as such and:

a) Trigger the ON EXIT event (which it might not do, haven't tested)
b) Save all the settings
c) Exit normally!

As per MSDN documentation:

Quote:

If an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE.


Because you see no trouble from the OS when it closes mIRC on a shutdown, this means that mIRC did in fact return TRUE to that message. This also means mIRC acknowledges that it will exit and _should _take the necessary steps to treat this as any other "convenient" (normal) exit:

Quote:

When an application returns TRUE for this message, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message.


According to that, mIRC is reacting incorrectly to a window message sent by the operating system. This means that: it is in fact a bug.

The simple fix:

- Add WM_QUERYENDSESSION as a case in mIRC's WindowProc next to WM_QUIT and the like and return TRUE after performing all the steps for a normal exit
Ok I concede, it's a bug. blush Thanks for the education. grin
Post deleted by tidy_trax
Posted By: Hrung Re: Lost settings when closing down Windows - 31/07/05 08:47 PM
Frankly, it doesn't matter if it's a bug or not. You can split hairs as much as you want, but when it comes down to it, it's behavior that the original poster wants changed. The argument over whether it is a bug or lack of feature is pointless. Before you hit that Continue button, take a good hard look at your post and ask "does this contribute anything to mIRC's development or the quality of the forums, or am I just increasing my post count?" The post-mongering is getting ridiculous, folks.
Posted By: Stealth Re: Lost settings when closing down Windows - 31/07/05 09:17 PM
I think mIRC should properly save its settings when Windows is shut down. My computer is running 24/7 and has a high uptime. When it is shut down, it isn't always my choice. When it shuts down, it is usually automated by either something in Windows wanting a reboot, or by the UPS telling it there has been a power failure. I can't always be restarting mIRC to update the INI, and I never had any good luck with /saveini (forgotten settings seem to happen with it also).

Also, half the time my computer shuts down, I am not even around when it does, so I cant be here to shut down mIRC before Windows.
Posted By: RusselB Re: Lost settings when closing down Windows - 31/07/05 09:41 PM
I guess I've been lucky, in that I've never lost my settings, even the most recent changes, when mIRC has closed down, irrelevant as to why it closed down.
Posted By: Om3n Re: Lost settings when closing down Windows - 12/08/05 06:08 AM
After reading the entire thread, all that really matters is that the original poster is correct. mIRC should correctly call any procedures as if it was closed via File > Exit.

There are many cases in which windows will properly shutdown with little or no time to close running applications. Such cases include a detected overheat, encountering a fetal error or even being shutdown by another program (ups software shutting down the system to avoid a crash during power outage, once battery becomes low, is a good example)
Posted By: stefys99 Re: Lost settings when closing down Windows - 13/08/05 01:04 AM
Quote:
Mirc loses changes to settings. To duplicate:

1) Make changes to Mirc's settings, even simple changes like adding a name to the Notify list or adding an address to the auto-ops.

2) Close down the computer (Turn off via the start button).

3) Restart the computer and start Mirc. The changes have disappeared.

It looks like the "forced close" of Mirc during shutdown doesn't carry out the cleaning up operations of the normal program close.

Mirc 6.16, Windows XP SP2

The mirc's settings are stored in mirc.ini
There is a program named "Deep Freeze" or something like that that is changing files after you restart computer to the old files, before changing them. This deep freeze file is not letting you change contents of the file. If you have it, uninstall it smile
© mIRC Discussion Forums