本文整理汇总了C++中OnCreate函数的典型用法代码示例。如果您正苦于以下问题:C++ OnCreate函数的具体用法?C++ OnCreate怎么用?C++ OnCreate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnCreate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
int CMainFrame::MsgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
OnCommand(wParam, lParam);
break;
case WM_CREATE:
OnCreate(wParam, lParam);
break;
case WM_DESTROY:
OnDestroy(wParam, lParam);
break;
case WM_SIZE:
OnSize(wParam, lParam);
return 1;
case WM_TIMER:
OnTimer(wParam, lParam);
return 1;
case WM_ERASEBKGND:
return 0;
}
return DefFrameProc(m_hWnd, m_hClient, uMsg, wParam, lParam);
}
示例2: while
////////////////////////////////////////////////////////////
/// Initialize internal window
////////////////////////////////////////////////////////////
void Window::Initialize(priv::WindowImpl* Window)
{
// Assign and initialize the new window
myWindow = Window;
myWindow->Initialize();
// Clear the event queue
while (!myEvents.empty())
myEvents.pop();
// Listen to events from the new window
myWindow->AddListener(this);
myWindow->AddListener(&myInput);
// Setup default behaviours (to get a consistent behaviour across different implementations)
Show(true);
UseVerticalSync(false);
ShowMouseCursor(true);
EnableKeyRepeat(true);
// Reset frame time
myClock.Reset();
myLastFrameTime = 0.f;
// Activate the window
SetActive(true);
// Notify the derived class
OnCreate();
}
示例3: WndProc
LRESULT CALLBACK CCustomWindow::WndProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
CCustomWindow *pThis;
if (uMsg==WM_NCCREATE) {
pThis=static_cast<CCustomWindow*>(OnCreate(hwnd,lParam));
if (!pThis->OnMessage(hwnd,uMsg,wParam,lParam)) {
pThis->m_hwnd=NULL;
return FALSE;
}
return TRUE;
} else {
pThis=static_cast<CCustomWindow*>(GetBasicWindow(hwnd));
if (pThis==NULL)
return ::DefWindowProc(hwnd,uMsg,wParam,lParam);
if (uMsg==WM_CREATE) {
if (pThis->OnMessage(hwnd,uMsg,wParam,lParam)<0) {
pThis->m_hwnd=NULL;
return -1;
}
return 0;
}
if (uMsg==WM_DESTROY) {
pThis->OnMessage(hwnd,uMsg,wParam,lParam);
pThis->OnDestroy();
return 0;
}
}
return pThis->OnMessage(hwnd,uMsg,wParam,lParam);
}
示例4: TaskWndProc
static LRESULT CALLBACK TaskWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch (msg) {
case WM_CREATE:
OnCreate(hWnd);
return 0;
case WM_ERASEBKGND:
return 0;
case WM_PAINT:
OnPaint(hWnd);
return 0;
case WM_TIMER:
OnTimer(wParam);
return 0;
case WM_HOTKEY:
return OnHotKey(HTaskWnd, wParam, lParam);
case WM_DESTROY:
OnDestroy();
return 0;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
}
示例5: switch
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CApplication::HandlerMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
case WM_NCCREATE:
if( !OnCreate() )
return DefWindowProc( hWnd, message, wParam, lParam );
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
if( !OnCommand( wmId, wmEvent, lParam ) )
return DefWindowProc( hWnd, message, wParam, lParam );
break;
case WM_PAINT:
hdc = BeginPaint(m_hWnd, &ps);
// TODO: Add any drawing code here...
EndPaint(m_hWnd, &ps);
break;
case WM_DESTROY:
m_bContinue = FALSE;
OnDestroy();
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
示例6: switch
LRESULT CWindow2::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT result;
switch (message)
{
case WM_CREATE:
if (!OnCreate((CREATESTRUCT *)lParam))
return -1;
break;
case WM_COMMAND:
if (OnCommand(wParam, lParam, result))
return result;
break;
case WM_NOTIFY:
if (OnNotify((UINT)wParam, (LPNMHDR) lParam, result))
return result;
break;
case WM_DESTROY:
OnDestroy();
break;
case WM_CLOSE:
OnClose();
return 0;
case WM_SIZE:
if (OnSize(wParam, LOWORD(lParam), HIWORD(lParam)))
return 0;
}
return DefProc(message, wParam, lParam);
}
示例7: switch
LRESULT DesktopUI::HandleMessage(UINT uMsg,WPARAM wParam,LPARAM lParam)
{
LRESULT lRes=0;
BOOL bHandled=TRUE;
switch(uMsg)
{
case WM_CREATE: lRes=OnCreate(uMsg,wParam,lParam,bHandled);break;
//能去除边框
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);break;
//去除显示的标题栏
case WM_SIZE: lRes=OnSize(uMsg,wParam,lParam,bHandled);break;
//解决按住左键或右键时会出现边框的问题
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
//实现按住窗口(除按钮外)拖动窗口
case WM_NCHITTEST: lRes=OnNcHitTest(uMsg,wParam,lParam,bHandled);break;
//获取边框最大最小值
case WM_GETMINMAXINFO: lRes=OnGetMinMaxInfo(uMsg,wParam,lParam,bHandled);break;
case WM_DESTROY: ::PostQuitMessage(0);break;
case WM_HIVE_CELL: lRes = loop(uMsg,wParam,lParam);break;
default: bHandled=FALSE;
}
if(bHandled)
return lRes;
if(m_pm.MessageHandler(uMsg,wParam,lParam,lRes))
return lRes;
return CWindowWnd::HandleMessage(uMsg,wParam,lParam);
}
示例8: switch
LRESULT CMultiMenuUI::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch( uMsg )
{
case WM_CREATE:
lRes = OnCreate(uMsg, wParam, lParam, bHandled);
break;
case WM_KILLFOCUS:
lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
break;
case WM_DESTROY:
lRes = OnDestroy(uMsg, wParam, lParam, bHandled);
default:
bHandled = FALSE;
break;
}
if( bHandled )
return lRes;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) )
return lRes;
//应用层和 DUILIB 都不处理的消息交由系统默认处理
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
示例9: assert
void
Window::Create(ContainerWindow *parent, PixelRect rc,
const WindowStyle window_style)
{
assert(IsScreenInitialized());
assert(rc.left <= rc.right);
assert(rc.right - rc.left < 0x8000);
assert(rc.top <= rc.bottom);
assert(rc.bottom - rc.top < 0x8000);
double_clicks = window_style.double_clicks;
this->parent = parent;
position = rc.GetOrigin();
size = rc.GetSize();
tab_stop = window_style.tab_stop;
control_parent = window_style.control_parent;
visible = window_style.visible;
enabled = window_style.enabled;
has_border = window_style.has_border;
text_style = window_style.text_style;
if (parent != NULL)
parent->AddChild(*this);
OnCreate();
OnResize(size);
}
示例10: switch
LRESULT CEICFrameWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch( uMsg )
{
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
#if defined(UI_BUILD_FOR_WIN32) && !defined(UI_BUILD_FOR_WINCE)
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
#endif
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
default:
bHandled = FALSE;
}
if( bHandled ) return lRes;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
示例11: WndProcTimer
/*-------------------------------------------
window procedure
---------------------------------------------*/
LRESULT CALLBACK WndProcTimer(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_CREATE:
OnCreate(hwnd);
return 0;
case WM_DESTROY:
OnDestroy(hwnd);
return 0;
case WM_TIMER:
switch(wParam)
{
case IDTIMER_TIMER:
OnTimerTimer(hwnd);
break;
}
return 0;
// show dialog box
case TIMERM_SHOWDLG:
OnShowDialog(hwnd);
return 0;
// add item to tcmenu*.txt
case TIMERM_REQUESTMENU:
OnRequestMenu(hwnd, FALSE);
return 0;
// stop running timer
case TIMERM_STOP:
OnStopTimer(hwnd, (int)lParam);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
示例12: WndProc
//窗口处理函数
LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam )
{
switch( uMsg )
{
case WM_LBUTTONDOWN:
InvalidateRect( hWnd, NULL, TRUE );
break;
case WM_PAINT:
OnPaint( hWnd );
break;
case WM_MYMESSAGE:
MessageBox( NULL, "WM_MYMESSAGE", "Infor", MB_OK );
break;
case WM_CREATE:
OnCreate( hWnd );
break;
case WM_SIZE:
OnSize( hWnd, lParam );
break;
case WM_DESTROY:
// PostQuitMessage( 0 );
PostMessage( hWnd, WM_QUIT, 0, 0 );
break;
}
return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
示例13: OnCreate
void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
CPDF_Array* pIdArray,
const uint8_t* user_pass,
FX_DWORD user_size,
FX_DWORD type) {
OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
}
示例14: OnCreate
LRESULT COptionView::Reaction(UINT message, WPARAM wParam, LPARAM lParam){
if (message == WM_CREATE)
{
return OnCreate(wParam,lParam);
}
else return CWSFrameView::Reaction(message,wParam,lParam);
}
示例15: OnCreate
void CPWL_Wnd::Create(const PWL_CREATEPARAM& cp) {
if (!IsValid()) {
m_sPrivateParam = cp;
OnCreate(m_sPrivateParam);
m_sPrivateParam.rcRectWnd.Normalize();
m_rcWindow = m_sPrivateParam.rcRectWnd;
m_rcClip = CPWL_Utils::InflateRect(m_rcWindow, 1.0f);
CreateMsgControl();
if (m_sPrivateParam.pParentWnd)
m_sPrivateParam.pParentWnd->OnNotify(this, PNM_ADDCHILD);
PWL_CREATEPARAM ccp = m_sPrivateParam;
ccp.dwFlags &= 0xFFFF0000L; // remove sub styles
ccp.mtChild = CFX_Matrix(1, 0, 0, 1, 0, 0);
CreateScrollBar(ccp);
CreateChildWnd(ccp);
m_bVisible = HasFlag(PWS_VISIBLE);
OnCreated();
RePosChildWnd();
m_bCreated = TRUE;
}
}