- Get rid of an unneeded variable in GetSystemInformation

- Minor changes to the GetProcNameString function
- Fix unselecting the license text. EM_SETSEL only works after the edit control has been drawn, so we cannot send this message in the WM_INITDIALOG message handler.
  Instead we use PostMessage now. See KB96674 for more details.
- Downloaded the latest GPL 2.0 text from the GNU website and use that as the "gpl.txt" now.
  Now we don't have these annoying "box" characters in the license dialog box anymore.

svn path=/trunk/; revision=27786
This commit is contained in:
Colin Finck 2007-07-23 11:48:55 +00:00
parent e2cb9802d4
commit 5252fd9823
3 changed files with 22 additions and 30 deletions

View file

@ -193,11 +193,9 @@ SetProcNameString(HWND hwnd,
HeapFree(GetProcessHeap(),
0,
lpBuf);
return Ret;
}
return 0;
return Ret;
}
static VOID
@ -251,7 +249,6 @@ GetSystemInformation(HWND hwnd)
TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
MEMORYSTATUSEX MemStat;
TCHAR Buf[32];
INT Ret = 0;
INT CurMachineLine = IDC_MACHINELINE1;
@ -272,12 +269,11 @@ GetSystemInformation(HWND hwnd)
CurMachineLine);
CurMachineLine++;
Ret = SetProcNameString(hwnd,
hKey,
_T("ProcessorNameString"),
CurMachineLine,
CurMachineLine+1);
CurMachineLine += Ret;
CurMachineLine += SetProcNameString(hwnd,
hKey,
_T("ProcessorNameString"),
CurMachineLine,
CurMachineLine + 1);
SetProcSpeed(hwnd,
hKey,
@ -316,7 +312,6 @@ GetSystemInformation(HWND hwnd)
if (MemStat.ullTotalPhys > 1024 * 1024)
{
/* We're dealing with PBs or more */
MemStat.ullTotalPhys /= 1024;
i++;
@ -336,16 +331,14 @@ GetSystemInformation(HWND hwnd)
if (LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(szStr[0])))
{
Ret = _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr);
if( _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr) )
{
SetDlgItemText(hwnd,
CurMachineLine,
Buf);
}
}
}
if (Ret)
{
SetDlgItemText(hwnd,
CurMachineLine,
Buf);
}
}

View file

@ -55,11 +55,10 @@ LicenceDlgProc(HWND hDlg,
IDC_LICENCEEDIT,
LicenseText);
SendDlgItemMessage(hDlg,
IDC_LICENCEEDIT,
EM_SETSEL,
-1,
0);
PostMessage(GetDlgItem(hDlg, IDC_LICENCEEDIT),
EM_SETSEL,
-1,
0);
return TRUE;
}