当前位置: 首页>>代码示例>>C++>>正文


C++ CWindowWnd类代码示例

本文整理汇总了C++中CWindowWnd的典型用法代码示例。如果您正苦于以下问题:C++ CWindowWnd类的具体用法?C++ CWindowWnd怎么用?C++ CWindowWnd使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CWindowWnd类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _T

LRESULT CALLBACK CWindowWnd::__ControlProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    CWindowWnd* pThis = NULL;
    if( uMsg == WM_NCCREATE ) {
        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam);
        pThis = static_cast<CWindowWnd*>(lpcs->lpCreateParams);
        ::SetProp(hWnd, _T("WndX"), (HANDLE) pThis);
        pThis->m_hWnd = hWnd;
    } 
    else {
        pThis = reinterpret_cast<CWindowWnd*>(::GetProp(hWnd, _T("WndX")));
        if( uMsg == WM_NCDESTROY && pThis != NULL ) {
            LRESULT lRes = ::CallWindowProc(pThis->m_OldWndProc, hWnd, uMsg, wParam, lParam);
            if( pThis->m_bSubclassed ) pThis->Unsubclass();
            ::SetProp(hWnd, _T("WndX"), NULL);
            pThis->m_hWnd = NULL;
            pThis->OnFinalMessage(hWnd);
            return lRes;
        }
    }
    if( pThis != NULL ) {
        return pThis->HandleMessage(uMsg, wParam, lParam);
    } 
    else {
        return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
    }
}
开发者ID:radtek,项目名称:andy-im,代码行数:27,代码来源:UIBase.cpp

示例2: __WndProc

LRESULT CALLBACK CWindowWnd::__WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    CWindowWnd* pThis = NULL;
    if( uMsg == WM_NCCREATE ) 
	{
        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam);
        pThis = static_cast<CWindowWnd*>(lpcs->lpCreateParams);
        pThis->m_hWnd = hWnd;
        ::SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LPARAM>(pThis));
    } 
    else 
	{
        pThis = reinterpret_cast<CWindowWnd*>(::GetWindowLongPtr(hWnd, GWLP_USERDATA));
        if( uMsg == WM_NCDESTROY && pThis != NULL ) 
		{
            LRESULT lRes = ::CallWindowProc(pThis->m_OldWndProc, hWnd, uMsg, wParam, lParam);
            ::SetWindowLongPtr(pThis->m_hWnd, GWLP_USERDATA, 0L);
            if( pThis->m_bSubclassed ) 
				pThis->Unsubclass();
            pThis->m_hWnd = NULL;
            pThis->OnFinalMessage(hWnd);	//OnFinalMessage做最后处理
            return lRes;
        }
    }
    if( pThis != NULL ) 
	{
        return pThis->HandleMessage(uMsg, wParam, lParam);
    } 
    else 
	{
        return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
    }
}
开发者ID:Fireye,项目名称:Duilib_Ext,代码行数:33,代码来源:UIBase.cpp

示例3: IMPL_LUA_FUNC

	IMPL_LUA_FUNC(LuaCWindowWnd, CreateDuiWindow)
	{
		try
		{
			CWindowWnd* self;
			self = static_cast<CWindowWnd*>(LuaStatic::CheckUserData(l, 1));
			HWND hwndParent = NULL;
			if (lua_isuserdata(l, 2))
				hwndParent = static_cast<HWND>(LuaStatic::CheckUserData(l, 2));
			CDuiString pstrText;
			lua_op_t<CDuiString>::lua_to_value(l, 3, pstrText);
			DWORD dwStyle = 0;
			if(lua_isnumber(l,4))
				dwStyle = (DWORD)lua_tonumber(l,4);
			DWORD dwStyleEx = 0;
			if(lua_isnumber(l,5))
				dwStyleEx = (DWORD)lua_tonumber(l,5);
			HWND hWnd = self->CreateDuiWindow(hwndParent, pstrText, dwStyle, dwStyleEx);
			LuaStatic::AddObject2Lua(l, hWnd, "HWND");
			return 1;
		}
		catch(...)
		{
			DuiException(_T("LuaCWindowWnd::CreateDuiWindow"));
			return 0;
		}
	}
开发者ID:yuechuanbingzhi163,项目名称:myduilib,代码行数:27,代码来源:LuaCWindowWnd.cpp

示例4: OnPrepare

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();
		}
	}
}
开发者ID:pyq881120,项目名称:urltraveler,代码行数:56,代码来源:LoginPreWnd.cpp

示例5: WinMain

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
{
	CWindowWnd* pFrame = new MyWindowWnd(hInstance);
	if (pFrame == NULL) return 0;
	pFrame->Create(NULL, _T("ListDemo"), UI_WNDSTYLE_FRAME, WS_EX_STATICEDGE | WS_EX_APPWINDOW, 0, 0, 600, 320);
	pFrame->CenterWindow();
	pFrame->ShowModal();

	return 0;
}
开发者ID:jupiterben,项目名称:fdui,代码行数:10,代码来源:main.cpp

示例6: VwCreateWin

// HANDLE VwCreateWin(
// VApiHandle hWndParent, int X, int Y, int nWidth, int nHeight, 
// WCHAR* wszRegName, WCHAR* wszNewName, BOOL bIsAlpha)
SQInteger VwCreateWin(HSQUIRRELVM v)
{
    SQInteger        nargs           = sq_gettop(v);
    SQInteger        nWndParent      = 0;
    HWND             hWndParent      = NULL;
    CUIImage*        pImg            = NULL;
    CScriptMgr*      pMgr            = NULL;
    CPaintManagerUI* pPM             = NULL;
    int              X               = 0;
    int              Y               = 0;
    int              nWidth          = 0;
    int              nHeight         = 0;
    const SQChar*    pwszRegName     = NULL;
    const SQChar*    pwszNewName     = NULL;
    WCHAR            wszNewName[60]  = {0};
    SQBool           bIsAlphaWin     = NULL;
    WinMgrItem*      pWinMgrIt       = NULL;
    HWND             hWnd            = NULL;
    CWindowWnd*      pWinObj         = NULL;
    SQInteger        nRet            = 0;
    CMarkupNode*     pRootXm         = NULL;

    if (!v || 8 + 1 != nargs) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 4)) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 5)) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 6)) {goto _Exit_;}
    if (OT_STRING != sq_gettype(v, 7)) {goto _Exit_;}
    if (OT_STRING != sq_gettype(v, 8)) {goto _Exit_;}
    if (OT_BOOL != sq_gettype(v, 9)) {goto _Exit_;}

    sq_getinteger(v, 2, &nWndParent);
    sq_getinteger(v, 3, &X);
    sq_getinteger(v, 4, &Y);
    sq_getinteger(v, 5, &nWidth);
    sq_getinteger(v, 6, &nHeight);
    sq_getstring(v, 7, &pwszRegName);
    //sq_getinteger(v, 8, &wszNewName);
    sq_getbool(v, 9, &bIsAlphaWin);

    swprintf_s(wszNewName, 60, L"%x", ::GetTickCount());

    if (nWndParent) {
        hWndParent = QiHwHandleToWin(nWndParent)->pWinObj->GetHWND();
    }

    pMgr = (CScriptMgr*)sq_getforeignptr(v);
    if (!pMgr) {goto _Exit_;}
    pPM = pMgr->GetManager();
    if (!pPM || !pPM->GetWinMgr()) {goto _Exit_;}

    pWinMgrIt = pPM->GetWinMgr()->FindWinByName(pwszRegName);
    if (!pWinMgrIt) {goto _Exit_;}

    // 新建立个模板,因为需要可重复用以前的名字
    pRootXm = new CMarkupNode(*pWinMgrIt->pWinXML);
    pWinObj = new CWindowTemplate(pWinMgrIt->pWinObj);
    pWinObj->GetPM()->SetWinMgr(pPM->GetWinMgr());
    pWinObj->SetDefaultResource(pRootXm);

    pWinMgrIt = pPM->GetWinMgr()->AddOneWin(pWinObj, 
        wszNewName, pRootXm, X, Y, nWidth, 
        nHeight, pWinMgrIt->dwStyle, pWinMgrIt->dwExStyle, &pWinMgrIt->ExInfo);

    if (!bIsAlphaWin) {
        hWnd = pWinObj->Create(hWndParent, pwszNewName,
            pWinMgrIt->dwStyle, pWinMgrIt->dwExStyle,
            X, Y, nWidth, nHeight, 0);
    } else {
        hWnd = pWinObj->CreateAlphaWin(hWndParent, pwszNewName,
            pWinMgrIt->dwStyle | WS_EX_LAYERED, pWinMgrIt->dwExStyle,
            X, Y, nWidth, nHeight);
    }

    if (!hWnd) {goto _Exit_;}

    nRet = QiHwObjToHandle(pWinMgrIt);

_Exit_:
    sq_pushinteger(v, nRet);
    return 1;
}
开发者ID:eriser,项目名称:kdguigl,代码行数:86,代码来源:Scriptapi.cpp

示例7: framebuffer_size_callback

static void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
	CWindowWnd* pWnd = (CWindowWnd*)glfwGetWindowUserPointer(window);
	pWnd->HandleMessage(UI_WM_SIZE, width, height);
	glViewport(0, 0, width, height);
}
开发者ID:plutochn,项目名称:lduilib,代码行数:6,代码来源:UIBase.cpp

示例8: window_refresh_callback

static void window_refresh_callback(GLFWwindow* window)
{
	CWindowWnd* pWnd = (CWindowWnd*)glfwGetWindowUserPointer(window);
	pWnd->HandleMessage(UI_WM_PAINT, 0, 0);
}
开发者ID:plutochn,项目名称:lduilib,代码行数:5,代码来源:UIBase.cpp


注:本文中的CWindowWnd类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。