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

mnapi.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL xxxSetMenu (PWND pwnd, PMENU pMenu, BOOL fRedraw)
BOOL xxxSetSystemMenu (PWND pwnd, PMENU pMenu)
BOOL xxxSetDialogSystemMenu (PWND pwnd)
void xxxEndMenu (PMENUSTATE pMenuState)


Function Documentation

void xxxEndMenu PMENUSTATE  pMenuState  ) 
 

Definition at line 124 of file mnapi.c.

References BOOL, FALSE, tagPOPUPMENU::fDestroyed, tagPOPUPMENU::fInCancel, tagMENUSTATE::fInEndMenu, tagMENUSTATE::fInsideMenuLoop, tagPOPUPMENU::fIsTrackPopup, tagMENUSTATE::fMenuStarted, NULL, tagMENUSTATE::pGlobalPopupMenu, PtiCurrent, tagMENUSTATE::ptiMenuStateOwner, tagPOPUPMENU::spwndNotify, tagPOPUPMENU::spwndPopupMenu, TRUE, xxxDestroyWindow(), xxxMNCloseHierarchy(), xxxMNDismiss(), and xxxMNReleaseCapture().

Referenced by xxxDestroyWindow(), xxxDWP_DoCancelMode(), and xxxEndMenuLoop().

00126 { 00127 BOOL fMenuStateOwner; 00128 PPOPUPMENU ppopup; 00129 PTHREADINFO ptiCurrent; 00130 00131 if ((ppopup = pMenuState->pGlobalPopupMenu) == NULL) { 00132 00133 /* 00134 * We're not really in menu mode. This can happen 00135 * if we are forced out of menu loop too soon; i.e, from 00136 * inside xxxMNGetPopup or xxxTrackPopupMenuEx. 00137 */ 00138 UserAssert(!pMenuState->fInsideMenuLoop && !pMenuState->fMenuStarted); 00139 return; 00140 } 00141 00142 00143 00144 pMenuState->fInsideMenuLoop = FALSE; 00145 pMenuState->fMenuStarted = FALSE; 00146 /* 00147 * Mark the popup as destroyed so people will not use it anymore. 00148 * This means that root popups can be marked as destroyed before 00149 * actually being destroyed (nice and confusing). 00150 */ 00151 ppopup->fDestroyed = TRUE; 00152 00153 /* 00154 * Determine if this is the menu loop owner before calling back. 00155 * Only the owner can destroy the menu windows 00156 */ 00157 ptiCurrent = PtiCurrent(); 00158 fMenuStateOwner = (ptiCurrent == pMenuState->ptiMenuStateOwner); 00159 00160 /* 00161 * Release mouse capture if we got it in xxxStartMenuState 00162 */ 00163 if (ptiCurrent->pq->spwndCapture == pMenuState->pGlobalPopupMenu->spwndNotify) { 00164 xxxMNReleaseCapture(); 00165 } 00166 00167 /* 00168 * Bail if this is not the menu loop owner 00169 */ 00170 if (!fMenuStateOwner) { 00171 RIPMSG1(RIP_WARNING, "xxxEndMenu: Thread %#p doesn't own the menu loop", ptiCurrent); 00172 return; 00173 } 00174 /* 00175 * If the menu loop is running on a thread different than the thread 00176 * that owns spwndNotify, we can have two threads trying to end 00177 * this menu at the same time. 00178 */ 00179 if (pMenuState->fInEndMenu) { 00180 RIPMSG1(RIP_WARNING, "xxxEndMenu: already in EndMenu. pMenuState:%#p", pMenuState); 00181 return; 00182 } 00183 pMenuState->fInEndMenu = TRUE; 00184 00185 if (pMenuState->pGlobalPopupMenu->spwndNotify != NULL) { 00186 if (!pMenuState->pGlobalPopupMenu->fInCancel) { 00187 xxxMNDismiss(pMenuState); 00188 } 00189 } else { 00190 BOOL fTrackedPopup = ppopup->fIsTrackPopup; 00191 00192 /* 00193 * This should do the same stuff as MenuCancelMenus but not send any 00194 * messages... 00195 */ 00196 xxxMNCloseHierarchy(ppopup, pMenuState); 00197 00198 if (fTrackedPopup) { 00199 xxxDestroyWindow(ppopup->spwndPopupMenu); 00200 } 00201 00202 } 00203 00204 }

BOOL xxxSetDialogSystemMenu PWND  pwnd  ) 
 

Definition at line 95 of file mnapi.c.

References BOOL, CheckLock, tagWND::head, ID_DIALOGSYSMENU, LockWndMenu(), NULL, tagWND::spmenuSys, and xxxLoadSysDesktopMenu().

00097 { 00098 PMENU pMenu; 00099 00100 CheckLock(pwnd); 00101 00102 pMenu = pwnd->head.rpdesk->spmenuDialogSys; 00103 if (pMenu == NULL) { 00104 pMenu = xxxLoadSysDesktopMenu (&pwnd->head.rpdesk->spmenuDialogSys, ID_DIALOGSYSMENU); 00105 } 00106 00107 LockWndMenu(pwnd, &pwnd->spmenuSys, pMenu); 00108 00109 return (pMenu != NULL); 00110 }

BOOL xxxSetMenu PWND  pwnd,
PMENU  pMenu,
BOOL  fRedraw
 

Definition at line 27 of file mnapi.c.

References BOOL, CheckLock, FALSE, LockWndMenu(), tagWND::spmenu, TestWF, TestwndChild, TRUE, WFMINIMIZED, and xxxRedrawFrame().

Referenced by NtUserSetMenu().

00031 { 00032 CheckLock(pwnd); 00033 CheckLock(pMenu); 00034 00035 if (!TestwndChild(pwnd)) { 00036 00037 LockWndMenu(pwnd, &pwnd->spmenu, pMenu); 00038 00039 /* 00040 * only redraw the frame if the window is non-minimized -- 00041 * even if it's not visible, we need RedrawFrame to recalc the NC size 00042 * 00043 * Added a check for (redraw) since the MDISetMenu() only needs to 00044 * set the menu and not perform any redraws. 00045 */ 00046 if (!TestWF(pwnd, WFMINIMIZED) && fRedraw) 00047 xxxRedrawFrame(pwnd); 00048 00049 return TRUE; 00050 } 00051 00052 RIPERR0(ERROR_CHILD_WINDOW_MENU, RIP_VERBOSE, ""); 00053 return FALSE; 00054 }

BOOL xxxSetSystemMenu PWND  pwnd,
PMENU  pMenu
 

Definition at line 65 of file mnapi.c.

References _DestroyMenu(), BOOL, CheckLock, FALSE, LockWndMenu(), MNPositionSysMenu(), tagWND::spmenuSys, TestWF, TRUE, and WFSYSMENU.

Referenced by NtUserSetSystemMenu().

00068 { 00069 CheckLock(pwnd); 00070 CheckLock(pMenu); 00071 00072 if (TestWF(pwnd, WFSYSMENU)) { 00073 PMENU pmenuT = pwnd->spmenuSys; 00074 if (LockWndMenu(pwnd, &pwnd->spmenuSys, pMenu)) 00075 _DestroyMenu(pmenuT); 00076 00077 MNPositionSysMenu(pwnd, pMenu); 00078 00079 return TRUE; 00080 } 00081 00082 RIPERR0(ERROR_NO_SYSTEM_MENU, RIP_VERBOSE, ""); 00083 return FALSE; 00084 }


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