本文整理汇总了C++中CMainDlg::ShowWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CMainDlg::ShowWindow方法的具体用法?C++ CMainDlg::ShowWindow怎么用?C++ CMainDlg::ShowWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMainDlg
的用法示例。
在下文中一共展示了CMainDlg::ShowWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tWinMain
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpstrCmdLine*/, int /*nCmdShow*/)
{
HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to
// make the EXE free threaded. This means that calls come in on a random RPC thread.
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
//::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
CMessageLoop theLoop;
CMessageFilter * filter = new CMouseWheelFilter();
theLoop.AddMessageFilter(filter);
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
dlgMain.Create(NULL);
dlgMain.ShowWindow(SW_NORMAL);
int nRet = theLoop.Run();
delete filter;
_Module.RemoveMessageLoop();
//_Module.Term();
::CoUninitialize();
return nRet;
}
示例2: Run
int Run(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
if(dlgMain.openPreview() == NULL)
{
ATLTRACE(_T("Preview Window creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
if(lpstrCmdLine){
char buf[256];
wcstombs(buf, lpstrCmdLine, sizeof buf);
dlgMain.OpenModel(buf);
}
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例3: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
BkString::Load(IDR_STRING_DEF); // ╪стьвж╥Ш╢╝
BkSkin::LoadSkins(IDR_SKIN_DEF); // ╪стьф╓╥Т
BkStyle::LoadStyles(IDR_STYLE_DEF); // ╪сть╥Г╦Я
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL)
{
DWORD dwErr = GetLastError();
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例4: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
// Get command line params
LPCWSTR szCommandLine = GetCommandLineW();
int argc = 0;
LPWSTR* argv = CommandLineToArgvW(szCommandLine, &argc);
CMainDlg dlgMain;
if(argc==2 && wcscmp(argv[1], L"/restart")==0)
dlgMain.m_bRestarted = TRUE;
else
dlgMain.m_bRestarted = FALSE;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例5: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
// For logging; redirects output so that it works with the allocated console
if (::AllocConsole()) {
::freopen("CONOUT$", "w", stdout);
auto h = ::GetStdHandle(STD_OUTPUT_HANDLE);
// For nowide; output is not displayed otherwise
nowide::cout.set_rdbuf(new nowide::details::my_console_output_buffer(h));
}
bool shouldBeVerbose = true;
if (shouldBeVerbose) {
using namespace vanhelsing::engine;
Log::SetLogLevelFilter(LogLevel::Trace);
}
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例6: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(GetCrashInfoThroughPipe(
dlgMain.m_sAppName,
dlgMain.m_sImageName,
dlgMain.m_sEmailSubject,
dlgMain.m_sEmailTo,
dlgMain.m_sUrl,
&dlgMain.m_uPriorities,
dlgMain.m_sZipName,
dlgMain.m_pUDFiles)!=0)
return 1;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例7: WinMain
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
HRESULT hRes = CoInitialize(NULL);
_ASSERTE(SUCCEEDED(hRes));
_Module.Init(0, hInstance, &LIBID_ATLLib);
CMainDlg mainDlg;
g_pMainWin = &mainDlg;
mainDlg.Create(NULL);
mainDlg.ShowWindow(SW_SHOW);
MSG msg;
while (GetMessage(&msg, 0, 0, 0))
{
if (!IsDialogMessage(mainDlg, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
_Module.Term();
CoUninitialize();
return msg.wParam;
}
示例8: OnMain
void CXfilterDlg::OnMain()
{
CMainDlg *dlg = new CMainDlg;
dlg->Create(IDD_MAIN, this);
dlg->ShowWindow(SW_SHOW);
dlg->UpdateWindow();
// dlg.DoModal();
}
示例9: Run
int Run(LPTSTR lpstrCmdLine=NULL, int nCmdShow=SW_SHOWDEFAULT){
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL){
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例10: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
StartServer();
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例11: Run
int CGtserviceModule::Run(int nShowCmd )
{
CMessageLoop theLoop;
AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
m_pdlgMain = &dlgMain;
dlgMain.ShowWindow(nShowCmd);
StartWork();
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例12: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(_Module.m_bByUserClick ? nCmdShow : SW_HIDE);
dlgMain.CenterWindow(_Module.m_hOuterParent);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例13: Run
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CString sRTL = Utility::GetINIString(_T("Settings"), _T("RTLReading"));
if(sRTL.CompareNoCase(_T("1"))==0)
{
SetProcessDefaultLayout(LAYOUT_RTL);
}
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainDlg dlgMain;
if(GetCrashInfoThroughPipe(
dlgMain.m_sAppName,
dlgMain.m_sAppVersion,
dlgMain.m_sImageName,
dlgMain.m_sEmailSubject,
dlgMain.m_sEmailTo,
dlgMain.m_sUrl,
&dlgMain.m_uPriorities,
dlgMain.m_sZipName,
dlgMain.m_sPrivacyPolicyURL,
dlgMain.m_pUDFiles)!=0)
return 1;
if(dlgMain.Create(NULL) == NULL)
{
ATLTRACE(_T("Main dialog creation failed!\n"));
return 0;
}
dlgMain.ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例14: _tWinMain
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
InitCommonControls(ICC_WIN95_CLASSES);
[!if WINX_VIEWTYPE_RICHEDIT]
InitRichEditControl();
[!endif]
[!if WINX_USE_LOOKNFEEL]
WINX_APP_LOOKNFEEL(hInstance, IDR_MAINFRAME);
[!endif]
[!if WINX_VIEWTYPE_GENERIC || WINX_VIEWTYPE_SCROLL]
[!output WINX_VIEW_CLASS]::RegisterClass();
[!endif]
[!if WINX_USE_GDIPLUS]
GdiplusAppInit gdiplus;
[!endif]
CComModuleInit module;
[!if WINX_APPTYPE_DLG]
CMainDlg dlg;
dlg.Create(NULL);
dlg.ShowWindow(SW_SHOW);
return RunMsgLoop();
[!endif]
[!if WINX_APPTYPE_DLG_MODAL]
CMainDlg dlg;
return dlg.DoModal();
[!endif]
}
示例15: _tWinMain
//.........这里部分代码省略.........
theApp->RegisterSkinFactory(TplSkinFactory<SSkinMutiFrameImg>());
theApp->RegisterSkinFactory(TplSkinFactory<SSkinVScrollbar>());
theApp->RegisterSkinFactory(TplSkinFactory<SSkinNewScrollbar>());
theApp->RegisterSkinFactory(TplSkinFactory<SSkinGif>());
theApp->RegisterSkinFactory(TplSkinFactory<SSkinAPNG>());
{
#ifdef _DEBUG
HMODULE hSysRes = LoadLibrary(_T("soui-sys-resourced.dll"));
#else
HMODULE hSysRes = LoadLibrary(_T("soui-sys-resource.dll"));
#endif
CAutoRefPtr<IResProvider> sysResProvider;
CreateResProvider(RES_PE, (IObjRef**)&sysResProvider);
sysResProvider->Init((WPARAM)hSysRes, 0);
theApp->LoadSystemNamedResource(sysResProvider);
FreeLibrary(hSysRes);
}
CAutoRefPtr<IResProvider> pResProvider;
#if (RES_TYPE == 0)
CreateResProvider(RES_FILE, (IObjRef**)&pResProvider);
if (!pResProvider->Init((LPARAM)_T("uires"), 0))
{
SASSERT(0);
return 1;
}
#else
CreateResProvider(RES_PE, (IObjRef**)&pResProvider);
pResProvider->Init((WPARAM)hInstance, 0);
#endif
//如果需要在代码中使用R::id::namedid这种方式来使用控件必须要这一行代码:2016年2月2日,R::id::namedXmlID是由uiresbuilder 增加-h .\res\resource.h idtable 这3个参数后生成的。
//theApp->InitXmlNamedID(namedXmlID,ARRAYSIZE(namedXmlID),TRUE);
//theApp->Init(_T("XML_INIT")); //这一句不在需要了 在AddResProvider时自动执行初始化
theApp->AddResProvider(pResProvider, L"uidef:UIDESIGNER_XML_INIT"); // theApp->AddResProvider(pResProvider, L"uidef:xml_init");
//设置真窗口处理接口
CSouiRealWndHandler * pRealWndHandler = new CSouiRealWndHandler();
theApp->SetRealWndHandler(pRealWndHandler);
pRealWndHandler->Release();
////加载LUA脚本模块。
//CAutoRefPtr<IScriptModule> pScriptLua;
//bLoaded=pComMgr->CreateScrpit_Lua((IObjRef**)&pScriptLua);
//SASSERT_FMT(bLoaded,_T("load interface [%s] failed!"),_T("script_lua"));
////加载多语言翻译模块。
//CAutoRefPtr<ITranslatorMgr> trans;
//bLoaded=pComMgr->CreateTranslator((IObjRef**)&trans);
//SASSERT_FMT(bLoaded,_T("load interface [%s] failed!"),_T("translator"));
//if(trans)
//{//加载语言翻译包
// theApp->SetTranslator(trans);
// pugi::xml_document xmlLang;
// if(theApp->LoadXmlDocment(xmlLang,_T("lang_cn"),_T("translator")))
// {
// CAutoRefPtr<ITranslator> langCN;
// trans->CreateTranslator(&langCN);
// langCN->Load(&xmlLang.child(L"language"),1);//1=LD_XML
// trans->InstallTranslator(langCN);
// }
//}
// BLOCK: Run application
{
CMainDlg dlgMain;
dlgMain.Create(GetActiveWindow());
dlgMain.SendMessage(WM_INITDIALOG);
dlgMain.CenterWindow(dlgMain.m_hWnd);
dlgMain.ShowWindow(SW_SHOWNORMAL);
SStringT uideffile = lpstrCmdLine;
if (!uideffile.IsEmpty())
{
uideffile.Trim(_T('\"'));
uideffile += _T("uires.idx");
#ifdef _DEBUG
SMessageBox(NULL, uideffile, NULL, MB_OK);
#endif
if(FileIsExist(uideffile))
dlgMain.OpenProject(uideffile);
}
nRet = theApp->Run(dlgMain.m_hWnd);
}
delete theApp;
}
FreeLibrary(hSci);
delete pComMgr;
OleUninitialize();
return nRet;
}