Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

miscutil.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

VOID ZapActiveAndFocus (VOID)
VOID SetDialogPointer (PWND pwnd, LONG_PTR lPtr)
BOOL _SetProgmanWindow (PWND pwnd)
BOOL _SetTaskmanWindow (PWND pwnd)
BOOL xxxSetShellWindow (PWND pwnd, PWND pwndBkGnd)
PSBINFO _InitPwSB (PWND pwnd)


Function Documentation

PSBINFO _InitPwSB PWND  pwnd  ) 
 

Definition at line 183 of file miscutil.c.

References DesktopAlloc(), DTAG_SBINFO, tagWND::head, tagSBINFO::Horz, NULL, tagSBDATA::posMax, tagWND::pSBInfo, SBINFO, and tagSBINFO::Vert.

Referenced by CalcSBStuff(), xxxDefWindowProc(), xxxEnableWndSBArrows(), xxxSetScrollBar(), and xxxShowScrollBar().

00185 { 00186 if (pwnd->pSBInfo) { 00187 00188 /* 00189 * If memory is already allocated, don't bother to do it again. 00190 */ 00191 return pwnd->pSBInfo; 00192 } 00193 00194 pwnd->pSBInfo = (PSBINFO)DesktopAlloc(pwnd->head.rpdesk, 00195 sizeof(SBINFO), 00196 DTAG_SBINFO); 00197 00198 if (pwnd->pSBInfo != NULL) { 00199 00200 /* 00201 * rgw[0] = 0; */ /* LPTR zeros all 6 words 00202 */ 00203 00204 /* 00205 * rgw[1] = 0; 00206 */ 00207 00208 /* 00209 * rgw[3] = 0; 00210 */ 00211 00212 /* 00213 * rgw[4] = 0; 00214 */ 00215 pwnd->pSBInfo->Vert.posMax = 100; 00216 pwnd->pSBInfo->Horz.posMax = 100; 00217 } 00218 00219 return pwnd->pSBInfo; 00220 }

BOOL _SetProgmanWindow PWND  pwnd  ) 
 

Definition at line 48 of file miscutil.c.

References BOOL, FALSE, GETDESKINFO, Lock, NULL, PtiCurrent, tagDESKTOPINFO::spwndProgman, and TRUE.

00048 { 00049 00050 PDESKTOPINFO pdeskinfo = GETDESKINFO(PtiCurrent()); 00051 00052 if (pwnd != NULL) { 00053 // Fail the call if another shell window exists 00054 if (pdeskinfo->spwndProgman != NULL) 00055 return(FALSE); 00056 } 00057 00058 Lock(&pdeskinfo->spwndProgman, pwnd); 00059 00060 return(TRUE); 00061 }

BOOL _SetTaskmanWindow PWND  pwnd  ) 
 

Definition at line 63 of file miscutil.c.

References BOOL, FALSE, GETDESKINFO, Lock, NULL, PtiCurrent, tagDESKTOPINFO::spwndTaskman, and TRUE.

00063 { 00064 00065 PDESKTOPINFO pdeskinfo = GETDESKINFO(PtiCurrent()); 00066 00067 if (pwnd != NULL) { 00068 // Fail the call if another shell window exists 00069 if (pdeskinfo->spwndTaskman != NULL) 00070 return(FALSE); 00071 } 00072 00073 Lock(&pdeskinfo->spwndTaskman, pwnd); 00074 00075 return(TRUE); 00076 }

VOID SetDialogPointer PWND  pwnd,
LONG_PTR  lPtr
 

Definition at line 24 of file miscutil.c.

References tagWND::cbwndExtra, ClrWF, FNID_CLEANEDUP_BIT, FNID_DIALOG, GETPTI, PpiCurrent, SetWF, TestWF, VOID(), WFDIALOGWINDOW, and WFSERVERSIDEPROC.

00024 { 00025 00026 if ((pwnd->cbwndExtra < DLGWINDOWEXTRA) 00027 || TestWF(pwnd, WFSERVERSIDEPROC) 00028 || (PpiCurrent() != GETPTI(pwnd)->ppi)) { 00029 RIPMSG1(RIP_WARNING, "SetDialogPointer: Unexpected pwnd:%#p", pwnd); 00030 return; 00031 } 00032 00033 ((PDIALOG)pwnd)->pdlg = (PDLG)lPtr; 00034 00035 if (lPtr == 0) { 00036 pwnd->fnid |= FNID_CLEANEDUP_BIT; 00037 ClrWF(pwnd, WFDIALOGWINDOW); 00038 } else { 00039 if (pwnd->fnid == 0) { 00040 pwnd->fnid = FNID_DIALOG; 00041 } 00042 SetWF(pwnd, WFDIALOGWINDOW); 00043 } 00044 00045 00046 }

BOOL xxxSetShellWindow PWND  pwnd,
PWND  pwndBkGnd
 

Definition at line 97 of file miscutil.c.

References _RegisterHotKey(), BOOL, FALSE, GETDESKINFO, GETPTI, Lock, NULL, tagDESKTOPINFO::ppiShellProcess, PtiCurrent, PWND_BOTTOM, SetWF, tagDESKTOPINFO::spwndBkGnd, tagWND::spwndOwner, tagDESKTOPINFO::spwndShell, TestWF, TestwndChild, TRUE, WEFTOPMOST, WFBOTTOMMOST, and xxxSetWindowPos().

Referenced by NtUserSetShellWindowEx().

00098 { 00099 PTHREADINFO ptiCurrent = PtiCurrent(); 00100 PDESKTOPINFO pdeskinfo = GETDESKINFO(ptiCurrent); 00101 00102 PPROCESSINFO ppiShellProcess; 00103 00104 UserAssert(pwnd); 00105 00106 /* 00107 * Fail the call if another shell window exists 00108 */ 00109 if (pdeskinfo->spwndShell != NULL) 00110 return(FALSE); 00111 00112 /* 00113 * The shell window must be 00114 * (1) Top-level 00115 * (2) Unowned 00116 * (3) Not topmost 00117 */ 00118 if (TestwndChild(pwnd) || 00119 (pwnd->spwndOwner != NULL) || 00120 TestWF(pwnd, WEFTOPMOST)) { 00121 00122 RIPMSG0(RIP_WARNING, "xxxSetShellWindow: Invalid type of window"); 00123 return(FALSE); 00124 } 00125 00126 /* 00127 * Chicago has a totally different input model which has special code 00128 * that checks for Ctrl-Esc and sends it to the shell. We can get 00129 * the same functionality, without totally re-writing our input model 00130 * by just automatically installing the Ctrl-Esc as a hotkey for the 00131 * shell window. The hotkey delivery code has a special case which 00132 * turns this into a WM_SYSCOMMAND message instead of a WM_HOTKEY 00133 * message. 00134 * 00135 * We don't both checking for failure. Somebody could already have 00136 * a Ctrl-Esc handler installed. 00137 */ 00138 _RegisterHotKey(pwnd,SC_TASKLIST,MOD_CONTROL,VK_ESCAPE); 00139 00140 /* 00141 * This is the shell window wright. 00142 * So get the process id for the shell. 00143 */ 00144 ppiShellProcess = GETPTI(pwnd)->ppi; 00145 00146 /* 00147 * Set the shell process id to the desktop only if it's the first instance 00148 */ 00149 if ((ppiShellProcess != NULL) && (pdeskinfo->ppiShellProcess == NULL)) { 00150 pdeskinfo->ppiShellProcess = ppiShellProcess; 00151 } 00152 00153 Lock(&pdeskinfo->spwndShell, pwnd); 00154 Lock(&pdeskinfo->spwndBkGnd, pwndBkGnd); 00155 00156 /* 00157 * Push window to bottom of stack. 00158 */ 00159 SetWF(pdeskinfo->spwndShell, WFBOTTOMMOST); 00160 xxxSetWindowPos(pdeskinfo->spwndShell, 00161 PWND_BOTTOM, 00162 0, 00163 0, 00164 0, 00165 0, 00166 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); 00167 00168 return(TRUE); 00169 }

VOID ZapActiveAndFocus VOID   ) 
 

Definition at line 16 of file miscutil.c.

References PtiCurrent, tagQ::spwndActive, tagQ::spwndFocus, Unlock, and VOID().

00017 { 00018 PQ pq = PtiCurrent()->pq; 00019 00020 Unlock(&pq->spwndActive); 00021 Unlock(&pq->spwndFocus); 00022 }


Generated on Sat May 15 19:44:43 2004 for test by doxygen 1.3.7