News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Saving on exit

Started by petezl, January 27, 2005, 03:30:13 AM

Previous topic - Next topic

petezl

Is there a simple solution to the problem of a "Your text has been altered, do you wish to save yes/no" dialog on exit?
I was thinking along the lines of trapping the WM_CHAR message and setting a flag but you could alter the text in the window by using the mouse and >edit>cut. alone, for instance.
I would have thought that there was an api for this but can't find one...
Any thoughts?
Peter.
Cats and women do as they please
Dogs and men should realise it.

tenkey

Went to MSDN and What!? The built-in Windows controls are under the topic of Windows Shell.

If this is an EDIT control, there is a EM_GETMODIFY message you can send to get this information.

invoke SendMessage, hEditControl, EM_GETMODIFY, 0, 0
invoke SendDlgItemMessage, hWindow, idEditControl, EM_GETMODIFY, 0, 0

EAX = 0, if no changes detected.

Haven't tested it for cut-and-paste.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

petezl

Thanks Tenkey,  I felt sure that there was going to be an easy solution to this. Just for the life of me couldn't find it.
Peter.
Cats and women do as they please
Dogs and men should realise it.

pbrennick

petezl,
You need to start searching the API.  This is beginning to be a mantra...

searching the API
searching the API
searching the API
searching the API
searching the API
Paul

petezl

Thanks Tenkey, Worked a treat.

Paul, Searching is fine when you have in mind a keyword to search for!
Peter.
Cats and women do as they please
Dogs and men should realise it.

pbrennick

petezl,
That is very true, I am glad the solution was so close to hand.  Good luck with your project.
Paul