I have an homework organizing application in which you can save you assignments to a file. I want to be able to, when the users exits, and if the document is modified, prompt to save changes or not. How would I go about calling a function to do this on a person choosing to close (I would know how if they chose 'Exit' from the menu, but I would like to know how to if they choose to click the "X" to close) Also I would like to know the most efficient way of doing this. I was thinking about containing a hash of the information in the file and when exit is chosen compare the hash of the new data to the old. What would you suggest, and how, if hashing is the best idea, would I go about that? Would reading the information into a stream and then hashing the stream be the best, or creating a temporary file and hashing it be the best way. Thank you for your time and GOD Bless.
Matthew Middleton