📄 wisbarsetup.cpp
字号:
// wisBarSetup.cpp : 傾僾儕働乕僔儑儞梡僋儔僗偺掕媊傪峴偄傑偡丅
//
#include "stdafx.h"
#include "wisBarSetup.h"
#include "SetupDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWisBarSetupApp
BEGIN_MESSAGE_MAP(CWisBarSetupApp, CWinApp)
//{{AFX_MSG_MAP(CWisBarSetupApp)
// 儊儌 - ClassWizard 偼偙偺埵抲偵儅僢僺儞僌梡偺儅僋儘傪捛壛傑偨偼嶍彍偟傑偡丅
// 偙偺埵抲偵惗惉偝傟傞僐乕僪傪曇廤偟側偄偱偔偩偝偄丅
//}}AFX_MSG
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWisBarSetupApp 僋儔僗偺峔抸
CWisBarSetupApp::CWisBarSetupApp()
: CWinApp()
{
// TODO: 偙偺埵抲偵峔抸梡偺僐乕僪傪捛壛偟偰偔偩偝偄丅
// 偙偙偵 InitInstance 拞偺廳梫側弶婜壔張棟傪偡傋偰婰弎偟偰偔偩偝偄丅
}
/////////////////////////////////////////////////////////////////////////////
// 桞堦偺 CWisBarSetupApp 僆僽僕僃僋僩
CWisBarSetupApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CWisBarSetupApp 僋儔僗偺弶婜壔
BOOL CWisBarSetupApp::InitInstance()
{
// 僐儌儞僐儞僩儘乕儖偺弶婜壔
INITCOMMONCONTROLSEX iccex ;
ZeroMemory( &iccex,sizeof(iccex) );
iccex.dwICC = ICC_WIN95_CLASSES ;
iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCommonControlsEx( &iccex );
AfxEnableControlContainer();
// 擇廳婲摦杊巭
HWND hWnd = FindWindow( NULL,STR_TITLE );
if ( hWnd ) {
::SetForegroundWindow( hWnd );
return( FALSE );
}
CSetupDlg dlg( STR_TITLE );
// 愝掕抣傪撉傒崬傓
if ( !dlg.LoadSettings() ) {
::MessageBox( NULL,STR_CANNOTLOAD,STR_ERR_TITLE,MB_OK|MB_ICONHAND );
return( FALSE );
}
int iRet = dlg.DoModal();
if ( iRet == IDOK ) {
if ( !dlg.SaveSettings() ) {
::MessageBox( NULL,STR_CANNOTSAVE,STR_ERR_TITLE,MB_OK|MB_ICONHAND );
return( FALSE );
}
// 揔梡
HWND hWndWis = ::FindWindow( NAV_BAR_CLASS,NULL );
TCHAR szClass[32];
UINT nCmd = GW_CHILD|GW_HWNDFIRST ;
while ( hWndWis = ::GetWindow(hWndWis,nCmd) ) {
::GetClassName( hWndWis,szClass,sizeof(szClass)/sizeof(TCHAR) );
if ( lstrcmp(WIS_BAR_CLASS,szClass) == 0 ) {
break ;
}
nCmd = GW_HWNDNEXT ;
}
if ( !hWndWis ) {
return( FALSE );
}
UINT nMsg = RegisterWindowMessage( MSG_UPDATE_NOTIFY );
::SendMessage( hWndWis,nMsg,0,0 );
}
return( FALSE );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -