Sorry, forgot I posted...
Yeah, just send it when the user's about to close, something of this sort:
Code:
//yada yada yada, window procedure
case WM_CLOSE :
if(SendDlgItemMessage(winh, EDIT_ID, WM_GETMODIFY, 0, 0))
{
if(MessageBox(winh, "This document has not been saved, are you sure you want to close?", "Alert",
MB_ICONEXCLAMATION | MB_YESNO) == IDYES) DestroyWindow(winh);
}
else DestroyWindow(winh);
break;
//whatever else...
And whenver you do save it you could send the edit a WM_SETMODIFY message to set the modification status to 0.