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


C++ CWindowWnd::Create方法代码示例

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


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

示例1: IMPL_LUA_FUNC

	IMPL_LUA_FUNC(LuaCWindowWnd, Create)
	{
		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 = (DWORD)lua_tonumber(l,4);
			DWORD dwStyleEx = (DWORD)lua_tonumber(l,5);
			RECT rc = LuaStatic::ReadRectFromLua(l,6);
			HMENU hMenu = NULL;
			if(lua_isuserdata(l,7))
				hMenu = static_cast<HMENU>(LuaStatic::CheckUserData(l, 7));
			HWND hWnd = self->Create(hwndParent, pstrText, dwStyle, dwStyleEx, rc, hMenu);
			LuaStatic::AddObject2Lua(l, hWnd, "HWND");
			return 1;
		}
		catch(...)
		{
			DuiException(_T("LuaCWindowWnd::Create"));
			return 0;
		}
	}
开发者ID:yuechuanbingzhi163,项目名称:myduilib,代码行数:27,代码来源:LuaCWindowWnd.cpp

示例2: 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

示例3: 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


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