?? ghdlg.cpp
字號:
// ghDlg.cpp : implementation file
//
#include "stdafx.h"
#include "gh.h"
#include "ghDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BOOL GetRegInfo(HKEY hkeyRoot, LPCTSTR pszPath, LPCTSTR pszKey, LPTSTR psz, size_t cch, LPCTSTR defVal)
{
HKEY hKey = NULL;
BOOL fSuccess = FALSE;
if (psz && (0 < cch))
{
if (ERROR_SUCCESS == RegOpenKeyEx(hkeyRoot, pszPath, 0, 0, &hKey))
{
LPBYTE p = (LPBYTE)(LPCSTR) psz;
DWORD dw = cch*sizeof(TCHAR);
if (ERROR_SUCCESS == ::RegQueryValueEx(hKey, pszKey, 0, NULL, p, &dw))
{
fSuccess = TRUE;
}
::RegCloseKey(hKey);
}
}
if (!fSuccess)
{
if (psz && (0 < cch))
{
if (defVal)
{
//if (FAILED(StringCchCopy(psz, cch, defVal)))
*psz = TEXT('\0');
}
else
{
*psz = TEXT('\0');
}
}
}
return fSuccess;
}
/////////////////////////////////////////////////////////////////////////////
// CGhDlg dialog
CGhDlg::CGhDlg(CWnd* pParent /*=NULL*/)
: CDialog(CGhDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CGhDlg)
m_str1 = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CGhDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGhDlg)
DDX_Text(pDX, IDC_EDIT1, m_str1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGhDlg, CDialog)
//{{AFX_MSG_MAP(CGhDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGhDlg message handlers
BOOL CGhDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
//mute /enanle tip
TCHAR pszValue[256];
TCHAR pszKey[] = TEXT("ControlPanel\\Volume");
TCHAR pszValueName1[] = TEXT("Screen");
CString strMute;
//初始化
strMute=_T(""); //導航軟件執行路徑
memset(pszValue,0,256);
if ( GetRegInfo(HKEY_CURRENT_USER,pszKey,pszValueName1,pszValue,-1,L"8") )
{
if ( pszValue[0] == 1 )
m_str1=_T("1");
else
m_str1=_T("0");
// strMute.Format(_T("%s"),pszValue);
}
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -