예제 #1
0
void CLoginPreWnd::Notify(TNotifyUI& msg)
{
	if( msg.sType == _T("windowinit") ) 
	{
		OnPrepare(msg);
	}
	else if( msg.sType == _T("click") ) 
	{
		if( msg.pSender->GetName() == L"closebtn" ) 
		{
			Close();
			return; 
		}
		else if( msg.pSender->GetName() == L"EverAccountLoginBtn" ) 
		{ 
			Close();

			// 强制弹出更新窗口进行升级
			mainframe::MainFrame_GetWndService stGetWndService;
			login::g_LoginModule->GetModuleManager()->CallService(mainframe::SERVICE_VALUE_MAINFRAME_GET_MAINWND, 
				(param)&stGetWndService);

			CWindowWnd* pMainFrameWnd = reinterpret_cast<CWindowWnd*>(stGetWndService.pBaseWnd);
			ASSERT(pMainFrameWnd != NULL);

			CLoginFrameWnd* pLoginFrame = new CLoginFrameWnd();
			pLoginFrame->Create(pMainFrameWnd->GetHWND(), _T(""), 
				UI_WNDSTYLE_DIALOG, UI_WNDSTYLE_EX_DIALOG, 0, 0, 0, 0, NULL);
			pLoginFrame->CenterWindow();
/*
			pMainFrameWnd->ShowModal(*pLoginFrame);
*/
			return;
		}
		else if( msg.pSender->GetName() == L"EverAacountRegisterBtn" ) 
		{ 
		}
		else if( msg.pSender->GetName() == L"QQLogin" ) 
		{
			Close();

			// 强制弹出更新窗口进行升级
			mainframe::MainFrame_GetWndService stGetWndService;
			login::g_LoginModule->GetModuleManager()->CallService(mainframe::SERVICE_VALUE_MAINFRAME_GET_MAINWND, 
				(param)&stGetWndService);

			CWindowWnd* pMainFrameWnd = reinterpret_cast<CWindowWnd*>(stGetWndService.pBaseWnd);
			ASSERT(pMainFrameWnd != NULL);

			COAuthLoginWnd* pLoginFrame = new COAuthLoginWnd();
			pLoginFrame->Create(pMainFrameWnd->GetHWND(), _T(""), 
				UI_WNDSTYLE_DIALOG, UI_WNDSTYLE_EX_DIALOG, 0, 0, 0, 0, NULL);
			pLoginFrame->CenterWindow();
		}
	}
}
예제 #2
0
파일: GameDemo.cpp 프로젝트: uvbs/myduilib
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
    CPaintManagerUI::SetInstance(hInstance);
    CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
    CPaintManagerUI::SetResourceZip(_T("GameRes.zip"));

    HRESULT Hr = ::CoInitialize(NULL);
    if( FAILED(Hr) ) return 0;

	CLoginFrameWnd* pFrame = new CLoginFrameWnd();
    if( pFrame == NULL ) return 0;
	HWND s = pFrame->Create(NULL, _T(""), WS_POPUP, WS_EX_LAYERED, 0, 0, 902, 602);
  //  pFrame->CenterWindow();
    pFrame->ShowWindow(SW_SHOW);

    CPaintManagerUI::MessageLoop();

    ::CoUninitialize();
    return 0;
}