- 博客(0)
- 资源 (9)
- 收藏
- 关注
VS2010 C++创建多视区窗口
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/, CCreateContext* pcc)
{
// create splitter window
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE;
// Create left and right pane/views.
//
CSplitterWnd& sw = m_wndSplitter;
if (!sw.CreateView(0,0,RUNTIME_CLASS(CLeftView), CSize(CXLIST,100), pcc) ||
!sw.CreateView(ROWFORMVIEW, COLFORMVIEW,
FormData.GetViewClass(FormData.GetCurrentForm()),
CSize(0,0), // will get fixed in CMainFrame::OnCreate
pcc) ) {
TRACE("***CMainFrame: failed to create splitter views\n");
sw.DestroyWindow();
return FALSE;
}
// Double-check for ON_NOTIFY in message map above
ASSERT(AFX_IDW_PANE_FIRST == sw.IdFromRowCol(0,0));
return TRUE;
}
2018-05-25
C++视区窗口触摸屏消息捕获
.在 Scratchpad.cpp 中,在 CScratchPadApp::InitInstance(): 后添加以下检查代码:
[cpp] view plain copy
1. BYTE digitizerStatus = (BYTE) GetSystemMetrics(SM_DIGITIZER);
2.
3. if ((digitizerStatus & (0x80 + 0x40)) == 0)
4. //堆栈就绪+多触点
5.
6. {
7.
8. AfxMessageBox(L"No touch input is currently available.");
9.
10. return false;
11.
12. }
13.
14.
15.
16. BYTE nInputs = (BYTE) GetSystemMetrics(SM_MAXIMUMTOUCHES);
17.
18.
19.
20. CString str;
21.
22. str.Format(L"Touch input available with %d touch points.", nInputs);
23.
24. AfxMessageBox(str);
25.
26.
27.
28. return true;
2018-05-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人