ReactOS  0.4.15-dev-341-g17c5fb8
focus.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HWND FASTCALL IntGetCaptureWindow (VOID)
 
HWND FASTCALL co_UserSetCapture (HWND hWnd)
 
BOOL FASTCALL IntReleaseCapture (VOID)
 
HWND FASTCALL IntGetThreadFocusWindow (VOID)
 
HWND APIENTRY IntGetCapture (VOID)
 
HWND FASTCALL UserGetActiveWindow (VOID)
 
BOOL FASTCALL co_IntMouseActivateWindow (PWND Window)
 
BOOL FASTCALL co_IntSetForegroundWindow (PWND Window)
 
BOOL FASTCALL co_IntSetForegroundWindowMouse (PWND Window)
 
BOOL FASTCALL co_IntSetActiveWindow (PWND, BOOL, BOOL, BOOL)
 
BOOL FASTCALL IntUserSetActiveWindow (PWND, BOOL, BOOL, BOOL)
 
BOOL FASTCALL UserSetActiveWindow (PWND Wnd)
 
BOOL FASTCALL IntLockSetForegroundWindow (UINT uLockCode)
 
BOOL FASTCALL IntAllowSetForegroundWindow (DWORD dwProcessId)
 
VOID FASTCALL IntActivateWindow (PWND, PTHREADINFO, HANDLE, DWORD)
 
BOOL FASTCALL IntDeactivateWindow (PTHREADINFO, HANDLE)
 
BOOL FASTCALL co_IntSetForegroundMessageQueue (PWND, PTHREADINFO, BOOL, DWORD)
 
VOID FASTCALL UpdateShellHook (PWND)
 

Variables

PUSER_MESSAGE_QUEUE gpqForeground
 
PUSER_MESSAGE_QUEUE gpqForegroundPrev
 
PTHREADINFO ptiLastInput
 

Function Documentation

◆ co_IntMouseActivateWindow()

BOOL FASTCALL co_IntMouseActivateWindow ( PWND  Window)

Definition at line 1136 of file focus.c.

1137 {
1138  TRACE("Mouse Active\n");
1140 }
#define TRUE
Definition: types.h:120
static BOOL FASTCALL co_IntSetForegroundAndFocusWindow(_In_opt_ PWND Wnd, _In_ BOOL MouseActivate, _In_ BOOL bFlash)
Definition: focus.c:812
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by co_IntProcessMouseMessage().

◆ co_IntSetActiveWindow()

BOOL FASTCALL co_IntSetActiveWindow ( PWND  ,
BOOL  ,
BOOL  ,
BOOL   
)

◆ co_IntSetForegroundMessageQueue()

BOOL FASTCALL co_IntSetForegroundMessageQueue ( PWND  ,
PTHREADINFO  ,
BOOL  ,
DWORD   
)

◆ co_IntSetForegroundWindow()

BOOL FASTCALL co_IntSetForegroundWindow ( PWND  Window)

Definition at line 1432 of file focus.c.

1433 {
1435 
1437 }
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:13
Definition: window.c:28
static BOOL FASTCALL co_IntSetForegroundAndFocusWindow(_In_opt_ PWND Wnd, _In_ BOOL MouseActivate, _In_ BOOL bFlash)
Definition: focus.c:812

Referenced by ActivateOtherWindowMin(), co_WinPosActivateOtherWindow(), co_WinPosSetWindowPos(), co_WinPosShowWindow(), DefWndHandleSetCursor(), DefWndHandleSysCommand(), and NtUserCallHwndLock().

◆ co_IntSetForegroundWindowMouse()

BOOL FASTCALL co_IntSetForegroundWindowMouse ( PWND  Window)

Definition at line 1443 of file focus.c.

1444 {
1446 
1448 }
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:13
Definition: window.c:28
static BOOL FASTCALL co_IntSetForegroundAndFocusWindow(_In_opt_ PWND Wnd, _In_ BOOL MouseActivate, _In_ BOOL bFlash)
Definition: focus.c:812

Referenced by NC_HandleNCLButtonDown(), and NtUserCallHwndLock().

◆ co_UserSetCapture()

HWND FASTCALL co_UserSetCapture ( HWND  hWnd)

These are HACKS!

Definition at line 1340 of file focus.c.

1341 {
1342  PTHREADINFO pti;
1343  PUSER_MESSAGE_QUEUE ThreadQueue;
1344  PWND pWnd, Window = NULL;
1345  HWND hWndPrev;
1346 
1348  ThreadQueue = pti->MessageQueue;
1349 
1350  if (ThreadQueue->QF_flags & QF_CAPTURELOCKED)
1351  return NULL;
1352 
1353  if (hWnd && (Window = UserGetWindowObject(hWnd)))
1354  {
1355  if (Window->head.pti->MessageQueue != ThreadQueue)
1356  {
1357  ERR("Window Thread does not match Current!\n");
1358  return NULL;
1359  }
1360  }
1361 
1362  hWndPrev = MsqSetStateWindow(pti, MSQ_STATE_CAPTURE, hWnd);
1363 
1364  if (hWndPrev)
1365  {
1366  pWnd = UserGetWindowObject(hWndPrev);
1367  if (pWnd)
1368  IntNotifyWinEvent(EVENT_SYSTEM_CAPTUREEND, pWnd, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI);
1369  }
1370 
1371  if (Window)
1372  IntNotifyWinEvent(EVENT_SYSTEM_CAPTURESTART, Window, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI);
1373 
1374  //
1375  // Only send the message if we have a previous Window!
1376  // Fix msg_menu tracking popup menu and win test_capture_4!!!!
1377  //
1378  if (hWndPrev)
1379  {
1380  if (ThreadQueue->MenuOwner && Window) ThreadQueue->QF_flags |= QF_CAPTURELOCKED;
1381 
1383 
1384  ThreadQueue->QF_flags &= ~QF_CAPTURELOCKED;
1385  }
1386 
1387  if (hWnd == NULL) // Release mode.
1388  {
1389  MOUSEINPUT mi;
1391  /* Also remove other windows if not capturing anymore */
1395  /* Somebody may have missed some mouse movements */
1396  mi.dx = 0;
1397  mi.dy = 0;
1398  mi.mouseData = 0;
1400  mi.time = 0;
1401  mi.dwExtraInfo = 0;
1403  }
1404  return hWndPrev;
1405 }
#define MSQ_STATE_MOVESIZE
Definition: ntuser.h:3548
BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected)
Definition: mouse.c:168
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define WM_CAPTURECHANGED
Definition: winuser.h:1790
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
static MONITORINFO mi
Definition: win.c:7339
Definition: window.c:28
#define QF_CAPTURELOCKED
Definition: msgqueue.h:111
#define CHILDID_SELF
Definition: winable.h:14
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define WEF_SETBYWNDPTI
Definition: ntuser.h:213
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd)
Definition: msgqueue.c:2552
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:657
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88
#define MSQ_STATE_CAPTURE
Definition: ntuser.h:3544
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1169
DWORD dwFlags
Definition: winuser.h:3762
#define MSQ_STATE_MENUOWNER
Definition: ntuser.h:3547

Referenced by DefWndDoSizeMove(), IntReleaseCapture(), IntTrackPopupMenuEx(), MENU_DoNextMenu(), MENU_InitTracking(), MENU_TrackMenu(), NC_DoButton(), NC_HandleNCRButtonDown(), NtUserDragDetect(), and NtUserSetCapture().

◆ IntActivateWindow()

VOID FASTCALL IntActivateWindow ( PWND  ,
PTHREADINFO  ,
HANDLE  ,
DWORD   
)

Definition at line 267 of file focus.c.

268 {
270  PUSER_MESSAGE_QUEUE pmq = pti->MessageQueue;
271 
272  if (Wnd)
273  {
274  Wnd = VerifyWnd(Wnd);
275 
276  if (!Wnd) return;
277 
278  UserRefObjectCo(Wnd, &Ref);
279 
280  if (!gpqForeground)
281  {
282  // No foreground queue set.
283  co_IntSetForegroundMessageQueue( Wnd, pti, (BOOL)Type, 0);
284  }
285  else
286  {
287  // Same Active and Wnd.
288  if ( pmq->spwndActive == Wnd )
289  {
290  WPARAM wParam = (Wnd->head.pti->MessageQueue == gpqForeground);
291 
293 
294  if (wParam)
295  {
296  UpdateShellHook(Wnd);
297 
299  }
300  }
301  else // Not the same, set the active Wnd.
302  {
304  }
305  }
306  UserDerefObjectCo(Wnd);
307  }
308  else // Handle no Wnd!
309  {
310  if ( tid && // TID,
311  pmq->spwndActive && // Active WND not zero,
312  gpqForeground == pmq ) // Same message queues.
313  {
314  Wnd = pmq->spwndActive; // Use active window from current queue.
315 
316  UserRefObjectCo(Wnd, &Ref);
317 
319 
320  UpdateShellHook(Wnd);
321 
323 
324  UserDerefObjectCo(Wnd);
325  }
326  else if (gpqForeground != pmq)
327  {
328  // Not the same message queue so clear flags for foreground switching.
329  pti->TIF_flags &= ~TIF_ALLOWFOREGROUNDACTIVATE;
330  pti->ppi->W32PF_flags &= ~W32PF_ALLOWFOREGROUNDACTIVATE;
331  }
332  }
333 }
PUSER_MESSAGE_QUEUE gpqForeground
Definition: focus.c:12
#define TRUE
Definition: types.h:120
BOOL FASTCALL co_IntSetActiveWindow(_In_ PWND Wnd, _In_ BOOL bMouse, _In_ BOOL bFocus, _In_ BOOL Async)
Definition: focus.c:912
Type
Definition: Type.h:6
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1720
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
#define HWND_TOP
Definition: winuser.h:1193
UINT_PTR WPARAM
Definition: windef.h:207
WPARAM wParam
Definition: combotst.c:138
#define W32PF_ALLOWFOREGROUNDACTIVATE
Definition: win32.h:12
#define WM_NCACTIVATE
Definition: winuser.h:1670
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
Definition: object.h:3
#define TIF_ALLOWFOREGROUNDACTIVATE
Definition: ntuser.h:245
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
BOOL FASTCALL co_IntSetForegroundMessageQueue(_In_opt_ PWND Wnd, _In_ PTHREADINFO pti, _In_ BOOL MouseActivate, _In_ DWORD Type)
Definition: focus.c:655
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define SWP_NOSIZE
Definition: winuser.h:1230
#define SWP_NOMOVE
Definition: winuser.h:1229
PWND FASTCALL VerifyWnd(PWND pWnd)
Definition: window.c:64
static TfClientId tid
VOID FASTCALL UpdateShellHook(PWND Window)
Definition: focus.c:52

Referenced by handle_internal_events().

◆ IntAllowSetForegroundWindow()

BOOL FASTCALL IntAllowSetForegroundWindow ( DWORD  dwProcessId)

Definition at line 1485 of file focus.c.

1486 {
1487  PPROCESSINFO ppi, ppiCur;
1489 
1490  ppi = NULL;
1491  if (dwProcessId != ASFW_ANY)
1492  {
1494  {
1496  return FALSE;
1497  }
1499  if (!ppi)
1500  {
1502  return FALSE;
1503  }
1504  }
1506  if (!CanForceFG(ppiCur))
1507  {
1510  return FALSE;
1511  }
1512  if (dwProcessId == ASFW_ANY)
1513  { // All processes will be enabled to set the foreground window.
1514  //ERR("ptiLastInput is CLEARED!!\n");
1515  ptiLastInput = NULL;
1516  }
1517  else
1518  { // Rule #3, last input event in force.
1519  ERR("ptiLastInput is SET!!\n");
1520  //ptiLastInput = ppi->ptiList; // See CORE-6384 & CORE-7030.
1522  }
1523  return TRUE;
1524 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
Definition: process.c:1193
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
smooth NULL
Definition: ftsmooth.c:416
PTHREADINFO ptiLastInput
Definition: focus.c:17
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define UlongToHandle(ul)
Definition: basetsd.h:97
NTSTATUS NTAPI PsLookupProcessByProcessId(IN HANDLE ProcessId, OUT PEPROCESS *Process)
Definition: process.c:919
#define ERR(fmt,...)
Definition: debug.h:110
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
BOOL FASTCALL CanForceFG(PPROCESSINFO ppi)
Definition: focus.c:637
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by NtUserCallOneParam().

◆ IntDeactivateWindow()

BOOL FASTCALL IntDeactivateWindow ( PTHREADINFO  ,
HANDLE   
)

Definition at line 105 of file focus.c.

106 {
108  PTHREADINFO ptiPrev;
109  PWND pwndPrev;
110  BOOL InAAPM = FALSE;
112 
113  if ( !pti->MessageQueue->spwndActive )
114  {
115  TRACE("IDAW E : Nothing to do, Active is NULL! pti 0x%p tid 0x%p\n",pti,tid);
116  return TRUE;
117  }
118 
119  TRACE("IDAW : pti 0x%p tid 0x%p\n",pti,tid);
120 
121  if (ptiCurrent != pti)
122  {
124  IntReferenceThreadInfo(ptiCurrent);
125  }
126 
127  if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) )
128  {
129  pti->TIF_flags |= TIF_INACTIVATEAPPMSG;
130  InAAPM = TRUE;
131  }
132 
133  //
134  // Check for Capture and release it.
135  //
136  if ( pti->MessageQueue->spwndCapture )
137  {
138  MSG msg;
139  PWND pwndCapture = pti->MessageQueue->spwndCapture;
140 
141  UserRefObjectCo(pwndCapture, &Ref);
142  co_IntSendMessage(UserHMGetHandle(pwndCapture), WM_CANCELMODE, 0, 0);
143  UserDerefObjectCo(pwndCapture);
144 
145  /* Generate mouse move message */
146  msg.message = WM_MOUSEMOVE;
147  msg.wParam = UserGetMouseButtonsState();
148  msg.lParam = MAKELPARAM(gpsi->ptCursor.x, gpsi->ptCursor.y);
149  msg.pt = gpsi->ptCursor;
151  }
152 
153  //
154  // Check for Active and release it.
155  //
156  if ( pti->MessageQueue->spwndActive )
157  {
158  pwndPrev = pti->MessageQueue->spwndActive;
159  ptiPrev = pwndPrev->head.pti;
160 
162  {
163  if (InAAPM) pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG;
164  if (ptiCurrent != pti)
165  {
167  IntDereferenceThreadInfo(ptiCurrent);
168  }
169  return FALSE;
170  }
171 
172  if ( pti->MessageQueue->spwndActive == pwndPrev )
173  {
174  pti->MessageQueue->spwndActivePrev = pwndPrev;
175  pti->MessageQueue->spwndActive = NULL;
176  }
177 
178  if (ptiPrev->TIF_flags & TIF_INCLEANUP) ptiPrev = NULL;
179  }
180  else
181  {
182  ptiPrev = pti;
183  pwndPrev = (PWND)-1; // Avoid zero Active window.
184  }
185 
186  if ( ptiPrev )
187  {
188  HANDLE OldTID = PsGetThreadId(ptiPrev->pEThread);
189  PWND cWindow;
190  HWND *List, *phWnd;
191 
193  if ( List )
194  {
195  if ( OldTID )
196  {
197  for (phWnd = List; *phWnd; ++phWnd)
198  {
199  cWindow = ValidateHwndNoErr(*phWnd);
200  if ( cWindow && cWindow->head.pti == ptiPrev )
201  { // FALSE if the window is being deactivated,
202  // ThreadId that owns the window being activated.
203  //ERR("IDW : WM_ACTIVATEAPP(0) hwnd %p tid Old %p New %p\n",UserHMGetHandle(cWindow),OldTID,tid);
204  UserRefObjectCo(cWindow, &Ref);
206  UserDerefObjectCo(cWindow);
207  }
208  }
209  }
211  }
212  }
213 
214  //
215  // Now check for a change (Bounce), if Active same as previous window, release it too.
216  //
217  if ( pti->MessageQueue->spwndActive == pwndPrev )
218  {
220  {
221  if (InAAPM) pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG;
222  if (ptiCurrent != pti)
223  {
225  IntDereferenceThreadInfo(ptiCurrent);
226  }
227  return FALSE;
228  }
229 
230  if ( pti->MessageQueue->spwndActive == pwndPrev )
231  {
232  pti->MessageQueue->spwndActivePrev = pwndPrev;
233  pti->MessageQueue->spwndActive = NULL;
234  }
235  }
236 
237  //
238  // Check for Focus and release it.
239  //
240  if ( pti->MessageQueue->spwndFocus )
241  {
242  PWND pwndFocus = pti->MessageQueue->spwndFocus;
243 
244  //
245  // Fix win.c:test_SetForegroundWindow:SetActiveWindow(0)!
246  //
247  pti->MessageQueue->spwndFocus = NULL; // Null out Focus.
248 
249  UserRefObjectCo(pwndFocus, &Ref);
251  UserDerefObjectCo(pwndFocus);
252  }
253 
254  if (InAAPM) pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG;
255  if (ptiCurrent != pti)
256  {
258  IntDereferenceThreadInfo(ptiCurrent);
259  }
260  return TRUE;
261 }
#define TRUE
Definition: types.h:120
VOID FASTCALL co_MsqInsertMouseMessage(MSG *Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
Definition: msgqueue.c:580
PWND FASTCALL ValidateHwndNoErr(HWND hWnd)
Definition: window.c:96
FLONG TIF_flags
Definition: win32.h:94
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
PSERVERINFO gpsi
Definition: main.c:27
WORD FASTCALL UserGetMouseButtonsState(VOID)
Definition: mouse.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
THRDESKHEAD head
Definition: ntuser.h:659
Definition: object.h:3
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define IntReferenceThreadInfo(pti)
Definition: win32.h:163
BOOL FASTCALL co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd, BOOL Clear)
Definition: focus.c:68
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_KILLFOCUS
Definition: winuser.h:1596
LIST_ENTRY List
Definition: psmgr.c:57
#define TIF_INACTIVATEAPPMSG
Definition: ntuser.h:249
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1349
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1446
#define WM_CANCELMODE
Definition: winuser.h:1617
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:255
HANDLE NTAPI PsGetThreadId(IN PETHREAD Thread)
Definition: thread.c:705
Definition: ntuser.h:657
struct _WND * PWND
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define msg(x)
Definition: auth_time.c:54
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define USERTAG_WINDOWLIST
Definition: tags.h:297
#define IntDereferenceThreadInfo(pti)
Definition: win32.h:168
static TfClientId tid
#define TIF_INCLEANUP
Definition: ntuser.h:240

Referenced by co_IntSetForegroundMessageQueue(), and handle_internal_events().

◆ IntGetCapture()

HWND APIENTRY IntGetCapture ( VOID  )

Definition at line 1322 of file focus.c.

1323 {
1324  PTHREADINFO pti;
1325  PUSER_MESSAGE_QUEUE ThreadQueue;
1327 
1328  TRACE("Enter IntGetCapture\n");
1329 
1331  ThreadQueue = pti->MessageQueue;
1332  RETURN( ThreadQueue ? (ThreadQueue->spwndCapture ? UserHMGetHandle(ThreadQueue->spwndCapture) : 0) : 0);
1333 
1334 CLEANUP:
1335  TRACE("Leave IntGetCapture, ret=%p\n", _ret_);
1336  END_CLEANUP;
1337 }
#define CLEANUP
Definition: ntuser.h:5
#define RETURN(value)
Definition: ntuser.h:4
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define DECLARE_RETURN(type)
Definition: ntuser.h:3
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88
#define END_CLEANUP
Definition: ntuser.h:6

Referenced by DefWndDoSizeMove(), MENU_TrackMenu(), NC_HandleNCRButtonDown(), and NtUserGetThreadState().

◆ IntGetCaptureWindow()

HWND FASTCALL IntGetCaptureWindow ( VOID  )

Definition at line 32 of file focus.c.

33 {
34  PUSER_MESSAGE_QUEUE ForegroundQueue = IntGetFocusMessageQueue();
35  return ( ForegroundQueue ? (ForegroundQueue->spwndCapture ? UserHMGetHandle(ForegroundQueue->spwndCapture) : 0) : 0);
36 }
PUSER_MESSAGE_QUEUE FASTCALL IntGetFocusMessageQueue(VOID)
Definition: desktop.c:1271
#define UserHMGetHandle(obj)
Definition: ntuser.h:208

Referenced by co_IntTranslateAccelerator(), co_MsqInsertMouseMessage(), and IntDefWindowProc().

◆ IntGetThreadFocusWindow()

HWND FASTCALL IntGetThreadFocusWindow ( VOID  )

Definition at line 39 of file focus.c.

40 {
41  PTHREADINFO pti;
42  PUSER_MESSAGE_QUEUE ThreadQueue;
43 
45  ThreadQueue = pti->MessageQueue;
46  if (!ThreadQueue)
47  return NULL;
48  return ThreadQueue->spwndFocus ? UserHMGetHandle(ThreadQueue->spwndFocus) : 0;
49 }
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
smooth NULL
Definition: ftsmooth.c:416
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88

Referenced by IntEnableWindow(), and NtUserGetThreadState().

◆ IntLockSetForegroundWindow()

BOOL FASTCALL IntLockSetForegroundWindow ( UINT  uLockCode)

Definition at line 1454 of file focus.c.

1455 {
1456  ULONG Err = ERROR_ACCESS_DENIED;
1458  switch (uLockCode)
1459  {
1460  case LSFW_LOCK:
1461  if ( CanForceFG(ppi) && !gppiLockSFW )
1462  {
1463  gppiLockSFW = ppi;
1464  return TRUE;
1465  }
1466  break;
1467  case LSFW_UNLOCK:
1468  if ( gppiLockSFW == ppi)
1469  {
1470  gppiLockSFW = NULL;
1471  return TRUE;
1472  }
1473  break;
1474  default:
1476  }
1477  EngSetLastError(Err);
1478  return FALSE;
1479 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
PPROCESSINFO gppiLockSFW
Definition: focus.c:15
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
BOOL FASTCALL CanForceFG(PPROCESSINFO ppi)
Definition: focus.c:637
unsigned int ULONG
Definition: retypes.h:1
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by NtUserCallOneParam().

◆ IntReleaseCapture()

BOOL FASTCALL IntReleaseCapture ( VOID  )

Definition at line 1412 of file focus.c.

1413 {
1414  PTHREADINFO pti;
1415  PUSER_MESSAGE_QUEUE ThreadQueue;
1416 
1418  ThreadQueue = pti->MessageQueue;
1419 
1420  // Can not release inside WM_CAPTURECHANGED!!
1421  if (ThreadQueue->QF_flags & QF_CAPTURELOCKED) return FALSE;
1422 
1424 
1425  return TRUE;
1426 }
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define QF_CAPTURELOCKED
Definition: msgqueue.h:111
smooth NULL
Definition: ftsmooth.c:416
HWND FASTCALL co_UserSetCapture(HWND hWnd)
Definition: focus.c:1340
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88

Referenced by co_UserFreeWindow(), DefWndDoSizeMove(), IntDefWindowProc(), NC_DoButton(), NC_HandleNCRButtonDown(), and NtUserCallNoParam().

◆ IntUserSetActiveWindow()

BOOL FASTCALL IntUserSetActiveWindow ( PWND  ,
BOOL  ,
BOOL  ,
BOOL   
)

◆ UpdateShellHook()

VOID FASTCALL UpdateShellHook ( PWND  )

Definition at line 52 of file focus.c.

53 {
54  if ( Window->spwndParent == UserGetDesktopWindow() &&
55  (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
56  (Window->ExStyle & WS_EX_APPWINDOW)))
57  {
58  // FIXME lParam; The value is TRUE if the window is in full-screen mode, or FALSE otherwise.
59  co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (WPARAM) UserHMGetHandle(Window), FALSE);
60  }
61  else
62  {
63  co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, 0, FALSE);
64  }
65 }
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
Definition: window.c:28
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1349
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:1656
#define WS_EX_APPWINDOW
Definition: winuser.h:383

Referenced by co_IntSendActivateMessages(), co_IntSetForegroundMessageQueue(), co_WinPosSetWindowPos(), and IntActivateWindow().

◆ UserGetActiveWindow()

HWND FASTCALL UserGetActiveWindow ( VOID  )

Definition at line 1311 of file focus.c.

1312 {
1313  PTHREADINFO pti;
1314  PUSER_MESSAGE_QUEUE ThreadQueue;
1315 
1317  ThreadQueue = pti->MessageQueue;
1318  return( ThreadQueue ? (ThreadQueue->spwndActive ? UserHMGetHandle(ThreadQueue->spwndActive) : 0) : 0);
1319 }
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:88

◆ UserSetActiveWindow()

BOOL FASTCALL UserSetActiveWindow ( PWND  Wnd)

Variable Documentation

◆ gpqForeground

◆ gpqForegroundPrev

◆ ptiLastInput