本文整理汇总了C++中UserGetWindowObject函数的典型用法代码示例。如果您正苦于以下问题:C++ UserGetWindowObject函数的具体用法?C++ UserGetWindowObject怎么用?C++ UserGetWindowObject使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserGetWindowObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NtUserChangeClipboardChain
BOOL APIENTRY
NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
{
BOOL bRet = FALSE;
PWND pWindowRemove;
PWINSTATION_OBJECT pWinStaObj;
TRACE("NtUserChangeClipboardChain(%p, %p)\n", hWndRemove, hWndNewNext);
UserEnterExclusive();
pWinStaObj = IntGetWinStaForCbAccess();
if (!pWinStaObj)
goto cleanup;
pWindowRemove = UserGetWindowObject(hWndRemove);
if (pWindowRemove && pWinStaObj->spwndClipViewer)
{
if(pWindowRemove == pWinStaObj->spwndClipViewer)
pWinStaObj->spwndClipViewer = UserGetWindowObject(hWndNewNext);
if(pWinStaObj->spwndClipViewer)
bRet = (BOOL)co_IntSendMessage(pWinStaObj->spwndClipViewer->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext);
}
ObDereferenceObject(pWinStaObj);
cleanup:
UserLeave();
return bRet;
}
示例2: co_IntSetCaretPos
BOOL FASTCALL
co_IntSetCaretPos(int X, int Y)
{
PTHREADINFO pti;
PWND pWnd;
PUSER_MESSAGE_QUEUE ThreadQueue;
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
if(ThreadQueue->CaretInfo->hWnd)
{
pWnd = UserGetWindowObject(ThreadQueue->CaretInfo->hWnd);
if(ThreadQueue->CaretInfo->Pos.x != X || ThreadQueue->CaretInfo->Pos.y != Y)
{
co_IntHideCaret(ThreadQueue->CaretInfo);
ThreadQueue->CaretInfo->Showing = 0;
ThreadQueue->CaretInfo->Pos.x = X;
ThreadQueue->CaretInfo->Pos.y = Y;
co_IntSendMessage(ThreadQueue->CaretInfo->hWnd, WM_SYSTIMER, IDCARETTIMER, 0);
IntSetTimer(UserGetWindowObject(ThreadQueue->CaretInfo->hWnd), IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TMRF_SYSTEM);
IntNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, pWnd, OBJID_CARET, CHILDID_SELF, 0);
}
return TRUE;
}
return FALSE;
}
示例3: NtUserCallHwnd
DWORD
APIENTRY
NtUserCallHwnd(
HWND hWnd,
DWORD Routine)
{
switch (Routine)
{
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
{
PWND Window;
PPROPERTY HelpId;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
}
UserRefObjectCo(Window, &Ref);
HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
UserDerefObjectCo(Window);
UserLeave();
return (DWORD)HelpId->Data;
}
case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntRegisterShellHookWindow(hWnd);
return FALSE;
break;
case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntDeRegisterShellHookWindow(hWnd);
return FALSE;
case HWND_ROUTINE_SETMSGBOX:
{
PWND Window;
UserEnterExclusive();
if ((Window = UserGetWindowObject(hWnd)))
{
Window->state |= WNDS_MSGBOX;
}
UserLeave();
return FALSE;
}
}
STUB;
return 0;
}
示例4: NtUserCallHwnd
DWORD
APIENTRY
NtUserCallHwnd(
HWND hWnd,
DWORD Routine)
{
switch (Routine)
{
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
{
PWND Window;
DWORD HelpId;
UserEnterShared();
if (!(Window = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
}
HelpId = (DWORD)(DWORD_PTR)UserGetProp(Window, gpsi->atomContextHelpIdProp, TRUE);
UserLeave();
return HelpId;
}
case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntRegisterShellHookWindow(hWnd);
return FALSE;
break;
case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntDeRegisterShellHookWindow(hWnd);
return FALSE;
case HWND_ROUTINE_SETMSGBOX:
{
PWND Window;
UserEnterExclusive();
if ((Window = UserGetWindowObject(hWnd)))
{
Window->state |= WNDS_MSGBOX;
}
UserLeave();
return FALSE;
}
}
STUB;
return 0;
}
示例5: NtUserNotifyWinEvent
VOID
APIENTRY
NtUserNotifyWinEvent(
DWORD Event,
HWND hWnd,
LONG idObject,
LONG idChild)
{
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
/* Validate input */
if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
{
Window = UserGetWindowObject(hWnd);
if (!Window)
{
UserLeave();
return;
}
}
if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
{
if (Window) UserRefObjectCo(Window, &Ref);
IntNotifyWinEvent( Event, Window, idObject, idChild, WEF_SETBYWNDPTI);
if (Window) UserDerefObjectCo(Window);
}
UserLeave();
}
示例6: co_UserHideCaret
BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
if (Window) ASSERT_REFS_CO(Window);
if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
{
EngSetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
{
EngSetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
if(ThreadQueue->CaretInfo->Visible)
{
PWND pwnd = UserGetWindowObject(ThreadQueue->CaretInfo->hWnd);
IntKillTimer(pwnd, IDCARETTIMER, TRUE);
co_IntHideCaret(ThreadQueue->CaretInfo);
ThreadQueue->CaretInfo->Visible = 0;
ThreadQueue->CaretInfo->Showing = 0;
}
return TRUE;
}
示例7: NtUserHideCaret
BOOL
APIENTRY
NtUserHideCaret(HWND hWnd OPTIONAL)
{
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
TRACE("Enter NtUserHideCaret\n");
UserEnterExclusive();
if(hWnd && !(Window = UserGetWindowObject(hWnd)))
{
RETURN(FALSE);
}
if (Window) UserRefObjectCo(Window, &Ref);
ret = co_UserHideCaret(Window);
if (Window) UserDerefObjectCo(Window);
RETURN(ret);
CLEANUP:
TRACE("Leave NtUserHideCaret, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例8: NtUserShowScrollBar
DWORD APIENTRY
NtUserShowScrollBar(HWND hWnd, int nBar, DWORD bShow)
{
PWND Window;
DECLARE_RETURN(DWORD);
DWORD ret;
USER_REFERENCE_ENTRY Ref;
TRACE("Enter NtUserShowScrollBar\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN(0);
}
UserRefObjectCo(Window, &Ref);
ret = co_UserShowScrollBar(Window, nBar, (nBar == SB_VERT) ? 0 : bShow,
(nBar == SB_HORZ) ? 0 : bShow);
UserDerefObjectCo(Window);
RETURN(ret);
CLEANUP:
TRACE("Leave NtUserShowScrollBar, ret%lu\n", _ret_);
UserLeave();
END_CLEANUP;
}
示例9: NtUserRemoveProp
HANDLE APIENTRY
NtUserRemoveProp(HWND hWnd, ATOM Atom)
{
PWND Window;
PPROPERTY Prop;
HANDLE Data;
DECLARE_RETURN(HANDLE);
TRACE("Enter NtUserRemoveProp\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( NULL);
}
Prop = IntGetProp(Window, Atom);
if (Prop == NULL)
{
RETURN(NULL);
}
Data = Prop->Data;
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
Window->PropListItems--;
RETURN(Data);
CLEANUP:
TRACE("Leave NtUserRemoveProp, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例10: DECLARE_RETURN
UINT_PTR
APIENTRY
NtUserSetTimer
(
HWND hWnd,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc
)
{
PWND Window;
DECLARE_RETURN(UINT_PTR);
TRACE("Enter NtUserSetTimer\n");
UserEnterExclusive();
Window = UserGetWindowObject(hWnd);
UserLeave();
RETURN(IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND));
CLEANUP:
TRACE("Leave NtUserSetTimer, ret=%i\n", _ret_);
END_CLEANUP;
}
示例11: NtUserSBGetParms
BOOL
APIENTRY
NtUserSBGetParms(
HWND hWnd,
int fnBar,
PSBDATA pSBData,
LPSCROLLINFO lpsi)
{
NTSTATUS Status;
PWND Window;
SCROLLINFO psi;
DWORD sz;
BOOL Ret;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
TRACE("Enter NtUserGetScrollInfo\n");
UserEnterExclusive();
Status = MmCopyFromCaller(&psi.cbSize, &(lpsi->cbSize), sizeof(UINT));
if(!NT_SUCCESS(Status) ||
!((psi.cbSize == sizeof(SCROLLINFO)) || (psi.cbSize == sizeof(SCROLLINFO) - sizeof(psi.nTrackPos))))
{
SetLastNtError(Status);
RETURN(FALSE);
}
sz = psi.cbSize;
Status = MmCopyFromCaller(&psi, lpsi, sz);
if (!NT_SUCCESS(Status))
{
SetLastNtError(Status);
RETURN(FALSE);
}
if(!(Window = UserGetWindowObject(hWnd)))
{
RETURN(FALSE);
}
UserRefObjectCo(Window, &Ref);
Ret = co_IntGetScrollInfo(Window, fnBar, &psi);
UserDerefObjectCo(Window);
Status = MmCopyToCaller(lpsi, &psi, sz);
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
RETURN( FALSE);
}
RETURN( Ret);
CLEANUP:
TRACE("Leave NtUserGetScrollInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例12: co_IntSendSetFocusMessages
VOID FASTCALL
co_IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd)
{
if (hWnd)
{
PWND pWnd = UserGetWindowObject(hWnd);
IntNotifyWinEvent(EVENT_OBJECT_FOCUS, pWnd, OBJID_CLIENT, CHILDID_SELF, 0);
co_IntPostOrSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0);
}
}
示例13: co_IntMouseActivateWindow
BOOL FASTCALL
co_IntMouseActivateWindow(PWND Wnd)
{
HWND Top;
PWND TopWindow;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Wnd);
if(Wnd->style & WS_DISABLED)
{
BOOL Ret;
PWND TopWnd;
PWND DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if(DesktopWindow)
{
Top = IntFindChildWindowToOwner(DesktopWindow, Wnd);
if((TopWnd = UserGetWindowObject(Top)))
{
UserRefObjectCo(TopWnd, &Ref);
Ret = co_IntMouseActivateWindow(TopWnd);
UserDerefObjectCo(TopWnd);
return Ret;
}
}
return FALSE;
}
TopWindow = UserGetAncestor(Wnd, GA_ROOT);
if (!TopWindow) return FALSE;
/* TMN: Check return valud from this function? */
UserRefObjectCo(TopWindow, &Ref);
co_IntSetForegroundAndFocusWindow(TopWindow, Wnd, TRUE);
UserDerefObjectCo(TopWindow);
return TRUE;
}
示例14: NtUserGetControlColor
/*
* Called from PaintRect, works almost like wine PaintRect16 but returns hBrush.
*/
HBRUSH
APIENTRY
NtUserGetControlColor(
HWND hwndParent,
HWND hwnd,
HDC hdc,
UINT CtlMsg) // Wine PaintRect: WM_CTLCOLORMSGBOX + hbrush
{
PWND pwnd, pwndParent = NULL;
HBRUSH hBrush = NULL;
UserEnterExclusive();
if ( (pwnd = UserGetWindowObject(hwnd)) &&
((CtlMsg - WM_CTLCOLORMSGBOX) < CTLCOLOR_MAX) &&
hdc )
{
if (hwndParent) pwndParent = UserGetWindowObject(hwndParent);
hBrush = GetControlColor( pwndParent, pwnd, hdc, CtlMsg);
}
UserLeave();
return hBrush;
}
示例15: co_IntSendDeactivateMessages
VOID FASTCALL
co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
{
PWND WndPrev ;
if (hWndPrev && (WndPrev = UserGetWindowObject(hWndPrev)))
{
co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0);
co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE,
MAKEWPARAM(WA_INACTIVE, WndPrev->style & WS_MINIMIZE),
(LPARAM)hWnd);
}
}