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


C++ CPaintManagerUI::GetPaintWindow方法代码示例

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


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

示例1: VwGetPosHight

//   int  VwGetPosHight(VApiHandle hWnd)
SQInteger VwGetPosHight(HSQUIRRELVM v)
{
    SQInteger      nargs         = sq_gettop(v);
    SQInteger      nWnd          = 0;
    WinMgrItem*    pWin          = NULL;
    HWND           hWnd          = NULL;
    SQInteger      nRet          = 0;
    RECT           rc            = {0};

    if (!v || 1 + 1 != nargs) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}

    sq_getinteger(v, 2, &nWnd);

    if (-1 == nWnd) {
        CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
        if (!pMgr) {goto _Exit_;}
        CPaintManagerUI* pPM = pMgr->GetManager();
        if (!pPM) {goto _Exit_;}
        hWnd = pPM->GetPaintWindow();
    } else {
        hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
    }

    ::GetWindowRect(hWnd, &rc);
    nRet = rc.bottom - rc.top;

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

示例2: VwSetWindowPos

// void VwSetWindowPos(HWND hWnd, HWND hWndlnsertAfter,int X, int Y, int cx, int cy, UNIT Flags)
SQInteger VwSetWindowPos(HSQUIRRELVM v)
{
    SQInteger         uIDEvent         = 0;
    SQInteger         nargs            = sq_gettop(v);
    SQInteger         nWnd             = 0;
    SQInteger         nWndlnsertAfter  = NULL;
    HWND              hWnd             = NULL;
    HWND              hWndlnsertAfter  = NULL;
    int               X                = 0;
    int               Y                = 0;
    int               cx               = 0;
    int               cy               = 0;
    UINT              uFlags           = 0;

    if (!v || 7 + 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) && OT_FLOAT  != sq_gettype(v, 4)) {goto _Exit_;}
    if (OT_INTEGER  != sq_gettype(v, 5) && OT_FLOAT  != sq_gettype(v, 5)) {goto _Exit_;}
    if (OT_INTEGER  != sq_gettype(v, 6) && OT_FLOAT  != sq_gettype(v, 6)) {goto _Exit_;}
    if (OT_INTEGER  != sq_gettype(v, 7) && OT_FLOAT  != sq_gettype(v, 7)) {goto _Exit_;}
    if (OT_INTEGER  != sq_gettype(v, 8)) {goto _Exit_;}

    sq_getinteger(v, 2, &nWnd);
    sq_getinteger(v, 3, &nWndlnsertAfter);
    sq_getinteger(v, 4, &X);
    sq_getinteger(v, 5, &Y);
    sq_getinteger(v, 6, &cx);
    sq_getinteger(v, 7, &cy);
    sq_getinteger(v, 8, (SQInteger*)&uFlags);

    if (-1 == nWnd) {
        CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
        if (!pMgr) {goto _Exit_;}
        CPaintManagerUI* pPM = pMgr->GetManager();
        if (!pPM) {goto _Exit_;}
        hWnd = pPM->GetPaintWindow();
    } else {
        hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
    }

    if (HWND_TOP == (HWND)nWndlnsertAfter    ||
        HWND_BOTTOM == (HWND)nWndlnsertAfter ||
        HWND_TOPMOST == (HWND)nWndlnsertAfter ||
        HWND_TOPMOST == (HWND)nWndlnsertAfter) {
        hWndlnsertAfter = (HWND)nWndlnsertAfter;
    } else {
        hWndlnsertAfter = QiHwHandleToWin(nWndlnsertAfter)->pWinObj->GetHWND();
    }

    ::SetWindowPos(hWnd, hWndlnsertAfter, X, Y, cx, cy, uFlags);
	//::MoveWindow( hWnd, X, Y, cx, cy, TRUE);

_Exit_:
    return 0;
}
开发者ID:eriser,项目名称:kdguigl,代码行数:57,代码来源:Scriptapi.cpp

示例3: VwSnapShot

// HANDLE VwSnapShot(VApiHandle hWnd)
SQInteger VwSnapShot(HSQUIRRELVM v)
{
    SQInteger        nargs         = sq_gettop(v);
    SQInteger        nWnd          = 0;
    HWND             hWnd          = NULL;
	CUIImage*        pImg          = NULL;
	CScriptMgr*      pMgr          = NULL;
	CPaintManagerUI* pPM           = NULL;
	BOOL             bIsAlphaWin   = NULL;
	VApiHandle       hRet          = NULL;
	CUIRect          rt;

    if (!v || 1 + 1 != nargs) {goto _Exit_;}
    if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}

    sq_getinteger(v, 2, &nWnd);

    if (-1 == nWnd) {
        pMgr = (CScriptMgr*)sq_getforeignptr(v);
        if (!pMgr) {goto _Exit_;}
        pPM = pMgr->GetManager();
        if (!pPM) {goto _Exit_;}
        hWnd = pPM->GetPaintWindow();
    } else {
        hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
    }

	::GetWindowRect(hWnd, &rt);
	bIsAlphaWin = pPM->IsAlphaWin();
	pImg = new CUIImage();
	pImg->Create(pPM->GetPaintDC(), rt.GetWidth(), rt.GetHeight(), 0, TRUE);
	
	::PrintWindow(hWnd, pImg->GetDC(), 0);
	::SendMessage(hWnd, WM_PRINT, (WPARAM)pImg->GetDC(), PRF_NONCLIENT | PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN);

	hRet = QiHwObjToHandle(pImg);

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

示例4: VwSetLayeredWindowAttributes

//BOOL VwSetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
SQInteger VwSetLayeredWindowAttributes(HSQUIRRELVM v)
{
    SQInteger         uIDEvent         = 0;
    SQInteger         nargs            = sq_gettop(v);
    SQInteger         nWnd             = 0;
    HWND              hWnd             = NULL;
    COLORREF          crKey            = 0;
    int               bAlpha           = 0;
    DWORD             dwFlags          = 0;

    if (!v || 4 + 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_;}

    sq_getinteger(v, 2, &nWnd);
    sq_getinteger(v, 3, (SQInteger*)&crKey);
    sq_getinteger(v, 4, (SQInteger*)&bAlpha);
    sq_getinteger(v, 5, (SQInteger*)&dwFlags);

    if (-1 == nWnd) {
        CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
        if (!pMgr) {goto _Exit_;}
        CPaintManagerUI* pPM = pMgr->GetManager();
        if (!pPM) {goto _Exit_;}
        hWnd = pPM->GetPaintWindow();
    } else {
        hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
    }

    //::SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) ^ WS_EX_LAYERED);
    ::SetLayeredWindowAttributes(hWnd, crKey, (BYTE)bAlpha, dwFlags);
    ::RedrawWindow(hWnd, NULL, NULL,
        RDW_ERASE | RDW_INVALIDATE | 
        RDW_FRAME | RDW_ALLCHILDREN);

_Exit_:
    return 1;
}
开发者ID:eriser,项目名称:kdguigl,代码行数:41,代码来源:Scriptapi.cpp

示例5: VwKillTimer

//   BOOL VwKillTimer(SQInteger uIDEvent)
SQInteger VwKillTimer(HSQUIRRELVM v)
{
    SQUserPointer     uIDEvent   = 0;
    SQInteger         nargs      = sq_gettop(v);

    if (!v || 1 + 1 != nargs) {goto _Exit_;}
    if (OT_USERPOINTER  != sq_gettype(v, 2)) {goto _Exit_;}

    sq_getuserpointer(v, 2, &uIDEvent);

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

    ::KillTimer(pPM->GetPaintWindow(), (UINT_PTR)uIDEvent);
    delete (SetTimerParam*)uIDEvent;

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

示例6: _VwSetTimerInternal

SQInteger _VwSetTimerInternal(HSQUIRRELVM v, TIMERPROC lpTimerFunc)
{
	SQInteger      nargs         = sq_gettop(v);
	SQInteger      Handle        = 0;
	SQInteger      uElapse       = 0;
	LPCTSTR        pstrFunc      = NULL;
	SetTimerParam* pTimerParam   = NULL;
	SQUserPointer      nRet          = NULL;

	if (!v || 3 + 1 != nargs) {goto _Exit_;}
	if (OT_INTEGER  != sq_gettype(v, 2)) {goto _Exit_;}
	if (OT_STRING   != sq_gettype(v, 3)) {goto _Exit_;}
	if (OT_INSTANCE != sq_gettype(v, 4)) {goto _Exit_;}

	sq_getinteger(v, 2, &uElapse);
	sq_getstring(v, 3, &pstrFunc);

	pTimerParam = new SetTimerParam();
	pTimerParam->v = v;
	pTimerParam->sFunc = pstrFunc;
	sq_getstackobj(v, 4, &pTimerParam->Obj);

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

	if (NULL != ::SetTimer(pPM->GetPaintWindow(), (UINT_PTR)pTimerParam, uElapse, lpTimerFunc)) {
		nRet = (SQUserPointer)pTimerParam;
	} else {
		nRet = NULL;
	}

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


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