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


C++ UserGetWindowObject函数代码示例

本文整理汇总了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;
}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:33,代码来源:clipboard.c

示例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;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:28,代码来源:caret.c

示例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;
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:54,代码来源:simplecall.c

示例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;
}
开发者ID:GYGit,项目名称:reactos,代码行数:51,代码来源:simplecall.c

示例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();
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:31,代码来源:event.c

示例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;
}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:34,代码来源:caret.c

示例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;
}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:30,代码来源:caret.c

示例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;

}
开发者ID:GYGit,项目名称:reactos,代码行数:29,代码来源:scrollbar.c

示例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;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:34,代码来源:prop.c

示例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;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,代码来源:timer.c

示例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;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:57,代码来源:scrollbar.c

示例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);
   }
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:10,代码来源:focus.c

示例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;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:42,代码来源:focus.c

示例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;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:25,代码来源:misc.c

示例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);
   }
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:13,代码来源:focus.c


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