This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpeedIE.cpp
79 lines (68 loc) · 1.85 KB
/
SpeedIE.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SpeedIE.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "SpeedIE.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SpeedIE dialog
SpeedIE::SpeedIE(CWnd* pParent /*=NULL*/)
: CDialog(SpeedIE::IDD, pParent)
{
//{{AFX_DATA_INIT(SpeedIE)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void SpeedIE::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SpeedIE)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SpeedIE, CDialog)
//{{AFX_MSG_MAP(SpeedIE)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SpeedIE message handlers
void SpeedIE::OnOK()
{
HKEY hkey;
DWORD dwDisposition;
DWORD val;
int reponse;
static const TCHAR szRegValue[] = TEXT("Limit");
reponse=this->IsDlgButtonChecked(IDC_SpeedPIE);
RegCreateKeyExW(HKEY_LOCAL_MACHINE ,TEXT("SYSTEM\\GDI\\GLYPHCACHE"), \
0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, &dwDisposition);
if(reponse==BST_CHECKED){
val=64000;
}else{
val=32768;
}
RegSetValueExW(hkey,szRegValue, NULL, REG_DWORD,(PBYTE)&val,sizeof(val));
RegCloseKey(hkey);
CDialog::OnOK();
}
BOOL SpeedIE::OnInitDialog()
{
HKEY hkey;
DWORD val;
DWORD dwType;
DWORD dwLength;
CDialog::OnInitDialog();
RegOpenKeyEx(HKEY_LOCAL_MACHINE ,TEXT("SYSTEM\\GDI\\GLYPHCACHE"),0,
KEY_ALL_ACCESS,&hkey);
RegQueryValueEx(hkey, TEXT("Limit"), NULL, &dwType,(LPBYTE)&val, &dwLength);
RegCloseKey(hkey);
if(val==64000)
this->CheckDlgButton(IDC_SpeedPIE,true);
else
this->CheckDlgButton(IDC_SpeedPIE,false);
return TRUE;
}