void CNetDragonDlg::On32800() { // TODO: 在此添加命令处理程序代码 skinppLoadSkin(_T(".\\Skin\\bbq.ssk")); ShowWindow(SW_HIDE); ShowWindow(SW_SHOW); }
BOOL CServerApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. skinppLoadSkin(_T("AquaOS.ssk")); #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CServerDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } skinppExitSkin(); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CDBManageDlg::OnInitDialog() { skinppRemoveSkin(); //移除皮肤 CDialogEx::OnInitDialog(); // TODO: 在此添加额外的初始化 m_CDBManageSheet.AddPage(&m_DBManagePageTrue); m_CDBManageSheet.AddPage(&m_DBManagePageFake); m_CDBManageSheet.Create(this, WS_CHILD|WS_VISIBLE|WS_TABSTOP, 0); m_CDBManageSheet.ModifyStyleEx(0,WS_EX_CONTROLPARENT); CRect rc; GetClientRect(&rc); m_CDBManageSheet.MoveWindow(rc); m_CDBManageSheet.GetTabControl()->MoveWindow(rc); rc.left+=10; //改变rect的大小,防止CPropertyPage盖住CPropertySheet rc.top+=20; rc.bottom-=10; rc.right-=10; m_CDBManageSheet.SetActivePage(SelectPage); m_CDBManageSheet.GetActivePage()->MoveWindow(rc); skinppLoadSkin(skin_path); //加载皮肤 return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
void CNetDragonDlg::OnComput() { // TODO: 在此添加命令处理程序代码 skinppLoadSkin(_T(".\\Skin\\machine.ssk")); ShowWindow(SW_HIDE); ShowWindow(SW_SHOW); }
void CNetDragonDlg::OnWhite() { // TODO: 在此添加命令处理程序代码 skinppLoadSkin(_T(".\\Skin\\AquaOS.ssk")); ShowWindow(SW_HIDE); ShowWindow(SW_SHOW); }
BOOL CTestApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CString sSkin; GetTempPath(100, sSkin.GetBuffer(100)); sSkin.ReleaseBuffer(); CString sSkinPath = sSkin + "\spring.ssk"; CFileFind find; if(!find.FindFile(sSkinPath)) { HRSRC hMySource = FindResource(NULL, MAKEINTRESOURCE(IDR_SSK), "SSK"); if(hMySource) { DWORD dwSourceSize = SizeofResource(NULL, hMySource); HGLOBAL hResData = LoadResource(NULL, hMySource); if(hResData) { HANDLE hFile = CreateFile(sSkinPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if(hFile) { DWORD dwWritten; WriteFile(hFile, (LPVOID)LockResource(hResData), dwSourceSize, &dwWritten, NULL); CloseHandle(hFile); } } } } CTestDlg dlg; m_pMainWnd = &dlg; skinppLoadSkin(sSkinPath.GetBuffer(100)); sSkinPath.ReleaseBuffer(); int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CDllTestApp::InitInstance() { if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } skinppLoadSkin(_T("Spring.ssk")); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CDllTestDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CConnListView)); AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // The one and only window has been initialized, so show and update it. m_pMainWnd->CenterWindow(); m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; }
BOOL CFiveChessApp::InitInstance() { if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. skinppLoadSkin(_T("AquaOS.ssk")); #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // 注册棋盘窗口类 WNDCLASS wc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH ); wc.hCursor = LoadCursor( IDC_ARROW ); wc.hIcon = NULL; wc.hInstance = AfxGetInstanceHandle(); wc.lpfnWndProc = ::DefWindowProc; wc.lpszClassName = _T("ChessBoard"); wc.lpszMenuName = NULL; wc.style = 0; AfxRegisterClass( &wc ); CFiveChessDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } skinppExitSkin(); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BOOL CGraphicApp::InitInstance() { // 如果一个运行在 Windows XP 上的应用程序清单指定要 // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, //则需要 InitCommonControlsEx()。否则,将无法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 将它设置为包括所有要在应用程序中使用的 // 公共控件类。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); //加载套接字库!!! if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } skinppLoadSkin("RedStar.ssk"); AfxEnableControlContainer(); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); CGraphicDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 在此放置处理何时用 // “确定”来关闭对话框的代码 } else if (nResponse == IDCANCEL) { // TODO: 在此放置处理何时用 // “取消”来关闭对话框的代码 } // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, // 而不是启动应用程序的消息泵。 return FALSE; }