本文整理汇总了C++中CAppModule::GetMessageLoop方法的典型用法代码示例。如果您正苦于以下问题:C++ CAppModule::GetMessageLoop方法的具体用法?C++ CAppModule::GetMessageLoop怎么用?C++ CAppModule::GetMessageLoop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAppModule
的用法示例。
在下文中一共展示了CAppModule::GetMessageLoop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCreate
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// Check if Common Controls 6.0 are used. If yes, use 32-bit (alpha) images
// for the toolbar and command bar. If not, use the old, 4-bit images.
UINT uResID = IDR_MAINFRAME_OLD;
DWORD dwMajor = 0;
DWORD dwMinor = 0;
HRESULT hRet = AtlGetCommCtrlVersion(&dwMajor, &dwMinor);
if(SUCCEEDED(hRet) && dwMajor >= 6)
uResID = IDR_MAINFRAME;
// Set values to be displayed in the view window
m_view.m_dwCommCtrlMajor = dwMajor;
m_view.m_dwCommCtrlMinor = dwMinor;
m_view.m_bAlpha = (uResID == IDR_MAINFRAME);
// create command bar window
HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
// attach menu
m_CmdBar.AttachMenu(GetMenu());
// load command bar images
m_CmdBar.LoadImages(uResID);
// remove old menu
SetMenu(NULL);
HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, uResID, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE);
AddSimpleReBarBand(hWndCmdBar);
AddSimpleReBarBand(hWndToolBar, NULL, TRUE);
CreateSimpleStatusBar();
_createVerticalSplitter();
_createCanvas();
_createHoricalSplitter();
_createTreeView();
_createAnimationBox();
UpdateLayout();
UIAddToolBar(hWndToolBar);
UISetCheck(ID_VIEW_TOOLBAR, 1);
UISetCheck(ID_VIEW_RENDER_BAR, 1);
UISetCheck(ID_VIEW_STATUS_BAR, 1);
// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);
UIEnable(ID_EDIT_PASTE, FALSE);
_canvas = NULL;
//
return 0;
}
示例2: OnInitDialog
LRESULT CTipDlg::OnInitDialog(UINT , WPARAM , LPARAM , BOOL &)
{
_Module.GetMessageLoop()->AddMessageFilter(this);
//m_list = GetDlgItem(IDC_LIST);
m_list.SubclassWindow(GetDlgItem(IDC_LIST));
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP|LVS_EX_BORDERSELECT);
m_list.AddColumn(L"", 0);
m_list.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);
m_il.Create(16, 16, ILC_COLOR32 | ILC_MASK, 4, 4);
m_il.SetBkColor(CLR_NONE);
HBITMAP bmp = AtlLoadBitmap(IDB_UD);
m_il.Add(bmp); DeleteObject(bmp);
cfg::config * c = cfg::config::instance();
for (int i = 0; i < c->index_mgr.cs_count(); i++)
{
HICON icon = NULL;
index_info *ii = c->get_index_info(i);
if (!ii->icon.file.empty())
{
std::wstring path = hlp::abs_path(ii->icon.file.c_str());
ExtractIconEx(path.c_str(), ii->icon.index, NULL, &icon, 1);
if (icon == NULL)
{
icon = (HICON)LoadImage(NULL, path.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
}
if (icon == NULL)
{
bmp = AtlLoadBitmap(IDB_QUICK_LAUNCH);
m_il.Add(bmp);
DeleteObject(bmp);
}
else
{
m_il.AddIcon(icon);
DestroyIcon(icon);
}
}
m_list.SetImageList(m_il, LVSIL_SMALL);
return TRUE;
}
示例3: 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(nCmdShow);
CRgPropSheet ps(_T("PSSHETEE"));
//CPropertySheetEx ps(IDS_PROPSHEET_CAPTION);
CPropertyPage<IDD_DIALOG1> page;
CPropertyPage<IDD_MAINDLG> page2;
CPropertyPage<IDD_ABOUTBOX> page3;
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter(&ps);
pLoop->AddIdleHandler(&ps);
page.SetTitle(_T("1234"));
ps.AddPage(page);
ps.AddPage(page2);
ps.AddPage(page);
ps.AddPage(page3);
//ps.Create(this.m_hWnd);
ps.DoModal();
::PostQuitMessage(1);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
return nRet;
}
示例4: OnDestroy
LRESULT CTipDlg::OnDestroy(UINT , WPARAM , LPARAM , BOOL &)
{
_Module.GetMessageLoop()->RemoveMessageFilter(this);
return 0;
}