本文整理汇总了C++中TApp::AddWinByWnd方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::AddWinByWnd方法的具体用法?C++ TApp::AddWinByWnd怎么用?C++ TApp::AddWinByWnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApp
的用法示例。
在下文中一共展示了TApp::AddWinByWnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinProc
LRESULT CALLBACK TApp::WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TApp *app = TApp::GetApp();
TWin *win = app->SearchWnd(hWnd);
if (win)
return win->WinProc(uMsg, wParam, lParam);
if ((win = app->preWnd))
{
app->preWnd = NULL;
app->AddWinByWnd(win, hWnd);
return win->WinProc(uMsg, wParam, lParam);
}
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
示例2: WinProc
LRESULT CALLBACK TApp::WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TApp *app = TApp::GetApp();
TWin *win = app->SearchWnd(hWnd);
LRESULT ret = 0;
if (win) {
ret = win->WinProc(uMsg, wParam, lParam);
}
else if ((win = app->preWnd)) {
app->preWnd = NULL;
app->AddWinByWnd(win, hWnd);
ret = win->WinProc(uMsg, wParam, lParam);
}
else {
ret = ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
if (uMsg == WM_DESTROY && app->mainWnd && hWnd == app->mainWnd->hWnd) {
::PostQuitMessage(app->result);
}
return ret;
}