Win32 - Memwatch - some code cleanup

This commit is contained in:
adelikat 2009-02-25 00:35:34 +00:00
parent ff32c900bc
commit 1974deb21d
1 changed files with 19 additions and 23 deletions

View File

@ -654,30 +654,26 @@ void CloseMemoryWatch()
//New File //New File
void ClearAllText() void ClearAllText()
{ {
//Ask to save changes first, if necessary
if (fileChanged==true) //If contents have changed if (fileChanged==true) //If contents have changed
{ {
if(MessageBox(hwndMemWatch, "Save Changes?", "Save", MB_YESNO)==IDYES) if(MessageBox(hwndMemWatch, "Save Changes?", "Save", MB_YESNO)==IDYES)
{ SaveMemWatch();
SaveMemWatch(); }
//Clear all strings
} for(int i=0;i<MWNUM;i++)
} {
addresses[i][0] = 0;
int i; labels[i][0] = 0;
for(i=0;i<MWNUM;i++) SetDlgItemText(hwndMemWatch,MW_ADDR(i),(LPTSTR) addresses[i]);
{ SetDlgItemText(hwndMemWatch,MW_NAME(i),(LPTSTR) labels[i]);
addresses[i][0] = 0; }
labels[i][0] = 0; //Now clear last file used variable (memwLastFilename)
SetDlgItemText(hwndMemWatch,MW_ADDR(i),(LPTSTR) addresses[i]); for (int i=0;i<2048;i++)
SetDlgItemText(hwndMemWatch,MW_NAME(i),(LPTSTR) labels[i]); memwLastFilename[i] = NULL;
}
//Now clear last file used variable (memwLastFilename) //A new file, so file has not changed
for (int i=0;i<2048;i++) fileChanged = false;
{
memwLastFilename[i] = NULL;
}
fileChanged = false;
} }
static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)