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