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

usercli.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001 // Increment this if a change has global effects 00002 00003 /****************************** Module Header ******************************\ 00004 * Module Name: usercli.h 00005 * 00006 * Copyright (c) 1985 - 1999, Microsoft Corporation 00007 * 00008 * Typedefs, defines, and prototypes that are used exclusively by the User 00009 * client-side DLL. 00010 * 00011 * History: 00012 * 04-27-91 DarrinM Created from PROTO.H, MACRO.H and STRTABLE.H 00013 \***************************************************************************/ 00014 00015 #ifndef _USERCLI_ 00016 #define _USERCLI_ 00017 00018 #define OEMRESOURCE 1 00019 00020 #pragma warning(4:4821) // Disable all ptr64->ptr32 truncation warnings for now 00021 #include <windows.h> 00022 #include <winnls32.h> 00023 00024 #include <w32gdip.h> 00025 #include <w32err.h> 00026 #include <ddeml.h> 00027 #include "ddemlp.h" 00028 #include "winuserp.h" 00029 #include "w32wow64.h" 00030 #include "winuserk.h" 00031 #include <winnlsp.h> 00032 #include <dde.h> 00033 #include <ddetrack.h> 00034 #include "kbd.h" 00035 #include <wowuserp.h> 00036 #include "immstruc.h" 00037 #include "immuser.h" 00038 #include <winbasep.h> 00039 00040 #include "user.h" 00041 00042 #include "callproc.h" 00043 00044 /* 00045 * This prototype is needed in client\globals.h which is included unintentionally 00046 * from usersrv.h 00047 */ 00048 typedef LRESULT (APIENTRY *CFNSCSENDMESSAGE)(HWND, UINT, WPARAM, LPARAM, 00049 ULONG_PTR, DWORD, BOOL); 00050 00051 /***************************************************************************\ 00052 * Typedefs and Macros 00053 * 00054 * Here are defined all types and macros that are shared across the User's 00055 * client-side code modules. Types and macros that are unique to a single 00056 * module should be defined at the head of that module, not in this file. 00057 * 00058 \***************************************************************************/ 00059 00060 #ifdef USE_MIRRORING 00061 #define MIRRORED_HDC(hdc) (GetLayout(hdc) & LAYOUT_RTL) 00062 #endif 00063 00064 #if DBG 00065 00066 __inline void DebugUserGlobalUnlock(HANDLE h) 00067 { 00068 UserAssert( 00069 "GlobalUnlock on bad handle" && 00070 !(GlobalFlags(h) == GMEM_INVALID_HANDLE)); 00071 00072 GlobalUnlock((HANDLE) h); 00073 } 00074 00075 /* 00076 * Bug 262144 - joejo 00077 * 00078 * Changed function to accept a pointer to the handle so we 00079 * can trash the handle and return it as trashed. 00080 * 00081 * Added a local handle variable to accept the return from GlobalFree 00082 * so we can return it as expected. 00083 * 00084 * Trash incoming handle freed so we can track any invalid access on 00085 * it after it's been free'd. 00086 */ 00087 __inline HANDLE DebugUserGlobalFree(HANDLE* ph) 00088 { 00089 HANDLE th; 00090 00091 UserAssert( 00092 "GlobalFree on bad handle" && 00093 !(GlobalFlags(*ph) == GMEM_INVALID_HANDLE)); 00094 00095 th = GlobalFree(*ph); 00096 #if defined(_WIN64) 00097 *ph = (HANDLE)(PVOID)0xBAADF00DBAADF00D; 00098 #else 00099 *ph = (HANDLE)(PVOID)0xBAADF00D; 00100 #endif 00101 return th; 00102 } 00103 00104 __inline HANDLE DebugUserGlobalAlloc(UINT uFlags, SIZE_T dwBytes) 00105 { 00106 HANDLE h = GlobalAlloc(uFlags, dwBytes); 00107 /* 00108 * Assert that FreeDDElParam and _ClientFreeDDEHandle assumption is correct. 00109 */ 00110 if (h != NULL) { 00111 UserAssert(h > (HANDLE)0xFFFF); 00112 } 00113 00114 return h; 00115 } 00116 00117 #define USERGLOBALUNLOCK(h) DebugUserGlobalUnlock((HANDLE)(h)) 00118 #define UserGlobalFree(h) DebugUserGlobalFree((HANDLE*)(&h)) 00119 #define UserGlobalAlloc(flags, size) DebugUserGlobalAlloc(flags, size) 00120 00121 #else 00122 00123 #define USERGLOBALUNLOCK(h) GlobalUnlock((HANDLE)(h)) 00124 #define UserGlobalFree(h) GlobalFree((HANDLE)(h)) 00125 #define UserGlobalAlloc(flags, size) GlobalAlloc(flags, size) 00126 #endif 00127 00128 #define USERGLOBALLOCK(h, p) p = GlobalLock((HANDLE)(h)) 00129 #define UserGlobalReAlloc(pmem, cnt, flags) GlobalReAlloc(pmem,cnt,flags) 00130 #define UserGlobalSize(pmem) GlobalSize(pmem) 00131 #define WOWGLOBALFREE(pmem) GlobalFree(pmem) 00132 00133 #define RESERVED_MSG_BITS (0xFFFE0000) 00134 00135 00136 00137 /* 00138 * A macro for testing bits in the message bit-arrays. Messages in the 00139 * the bit arrays must be processed 00140 */ 00141 #define FDEFWINDOWMSG(msg, procname) \ 00142 ((msg <= (gSharedInfo.procname.maxMsgs)) && \ 00143 ((gSharedInfo.procname.abMsgs)[msg / 8] & (1 << (msg & 7)))) 00144 #define FWINDOWMSG(msg, fnid) \ 00145 ((msg <= (gSharedInfo.awmControl[fnid - FNID_START].maxMsgs)) && \ 00146 ((gSharedInfo.awmControl[fnid - FNID_START].abMsgs)[msg / 8] & (1 << (msg & 7)))) 00147 00148 #define CsSendMessage(hwnd, msg, wParam, lParam, xParam, pfn, bAnsi) \ 00149 (((msg) >= WM_USER) ? \ 00150 NtUserMessageCall(hwnd, msg, wParam, lParam, xParam, pfn, bAnsi) : \ 00151 gapfnScSendMessage[MessageTable[msg].iFunction](hwnd, msg, wParam, lParam, xParam, pfn, bAnsi)) 00152 00153 #define GetWindowProcess(hwnd) NtUserQueryWindow(hwnd, WindowProcess) 00154 #define GETPROCESSID() (NtCurrentTeb()->ClientId.UniqueProcess) 00155 #define GETTHREADID() (NtCurrentTeb()->ClientId.UniqueThread) 00156 00157 /* 00158 * Macro to mask off uniqueness bits for WOW handles 00159 */ 00160 #define SAMEWOWHANDLE(h1, h2) ((BOOL)!(((ULONG_PTR)(h1) ^ (ULONG_PTR)(h2)) & 0xffff)) 00161 #define DIFFWOWHANDLE(h1, h2) (!SAMEWOWHANDLE(h1, h2)) 00162 00163 /* 00164 * This macro can check to see if a function pointer is a server side 00165 * procedure. 00166 */ 00167 // #define ISSERVERSIDEPROC(p) (((DWORD)p) >= FNID_START && ((DWORD)p) <= FNID_END) 00168 00169 /* 00170 * For callbacks to the client - for msg and hook thunks, callback addresses 00171 * are passed as addresses, not function indexes as they are from client to 00172 * server. 00173 */ 00174 typedef int (WINAPI *GENERICPROC)(); 00175 00176 #define CALLPROC(p) ((GENERICPROC)p) 00177 00178 /* Bug 234292 - joejo 00179 * Since the called window/dialog proc may have a different calling 00180 * convention, we must wrap the call and, check esp and replace with 00181 * a good esp when the call returns. This is what UserCallWinProc* does. 00182 */ 00183 #define CALLPROC_WOWCHECKPWW_DLG(pfn, hwnd, msg, wParam, lParam, pww) \ 00184 (IsWOWProc(pfn) ? (*pfnWowDlgProcEx)(hwnd, msg, wParam, lParam, PtrToUlong(pfn), pww) : \ 00185 UserCallWinProc((WNDPROC)pfn, hwnd, msg, wParam, lParam)) 00186 00187 #define CALLPROC_WOWCHECKPWW(pfn, hwnd, msg, wParam, lParam, pww) \ 00188 (IsWOWProc(pfn) ? (*pfnWowWndProcEx)(hwnd, msg, wParam, lParam, PtrToUlong(pfn), pww) : \ 00189 UserCallWinProc((WNDPROC)pfn, hwnd, msg, wParam, lParam)) 00190 00191 #define CALLPROC_WOWCHECK(pfn, hwnd, msg, wParam, lParam) \ 00192 CALLPROC_WOWCHECKPWW(pfn, hwnd, msg, wParam, lParam, NULL) 00193 00194 #define RevalidateHwnd(hwnd) ((PWND)HMValidateHandleNoSecure(hwnd, TYPE_WINDOW)) 00195 00196 #define VALIDATEHMENU(hmenu) ((PMENU)HMValidateHandle(hmenu, TYPE_MENU)) 00197 #define VALIDATEHMONITOR(hmonitor) ((PMONITOR)HMValidateSharedHandle(hmonitor, TYPE_MONITOR)) 00198 00199 00200 /* 00201 * REBASE macros take kernel desktop addresses and convert them into 00202 * user addresses. 00203 * 00204 * REBASEALWAYS converts a kernel address contained in an object 00205 * REBASEPWND casts REBASEALWAYS to a PWND 00206 * REBASE only converts if the address is in kernel space. Also works for NULL 00207 * REBASEPTR converts a random kernel address 00208 */ 00209 00210 #define REBASEALWAYS(p, elem) ((PVOID)((KERNEL_ULONG_PTR)(p) + ((KERNEL_ULONG_PTR)(p)->elem - (KERNEL_ULONG_PTR)(p)->head.pSelf))) 00211 #define REBASEPTR(obj, p) ((PVOID)((KERNEL_ULONG_PTR)(p) - ((KERNEL_ULONG_PTR)(obj)->head.pSelf - (KERNEL_ULONG_PTR)(obj)))) 00212 00213 #define REBASE(p, elem) ((KERNEL_ULONG_PTR)((p)->elem) <= (KERNEL_ULONG_PTR)gHighestUserAddress ? \ 00214 ((PVOID)(p)->elem) : REBASEALWAYS(p, elem)) 00215 #define REBASEPWND(p, elem) ((PWND)REBASE(p, elem)) 00216 00217 #ifndef USEREXTS 00218 00219 PTHREADINFO PtiCurrent(VOID); 00220 00221 /* 00222 * Window Proc Window Validation macro. This macro assumes 00223 * that pwnd and hwnd are existing variables pointing to the window. 00224 * Checking the BUTTON is for Mavis Beacon. 00225 */ 00226 00227 #define VALIDATECLASSANDSIZE(pwnd, inFNID) \ 00228 switch ((pwnd)->fnid) { \ 00229 case inFNID: \ 00230 break; \ 00231 \ 00232 case 0: \ 00233 if ((pwnd->cbwndExtra + sizeof(WND)) < (DWORD)(CBFNID(inFNID))) { \ 00234 RIPMSG3(RIP_ERROR, \ 00235 "(%#p %lX) needs at least (%ld) window words for this proc", \ 00236 pwnd, pwnd->cbwndExtra, \ 00237 (DWORD)(CBFNID(inFNID)) - sizeof(WND)); \ 00238 return 0; \ 00239 } \ 00240 \ 00241 if (inFNID == FNID_BUTTON && *((PULONG_PTR)(pwnd + 1))) { \ 00242 \ 00243 RIPMSG3(RIP_WARNING, "Window (%#p) fnid = %lX overrides " \ 00244 "the extra pointer with %#p\n", \ 00245 pwnd, inFNID, *((PULONG_PTR)(pwnd + 1))); \ 00246 \ 00247 NtUserSetWindowLongPtr(hwnd, 0, 0, FALSE); \ 00248 } \ 00249 \ 00250 NtUserSetWindowFNID(hwnd, inFNID); \ 00251 break; \ 00252 \ 00253 case (inFNID | FNID_CLEANEDUP_BIT): \ 00254 case (inFNID | FNID_DELETED_BIT): \ 00255 case (inFNID | FNID_STATUS_BITS): \ 00256 return 0; \ 00257 \ 00258 default: \ 00259 RIPMSG3(RIP_WARNING, \ 00260 "Window (%#p) not of correct class; fnid = %lX not %lX", \ 00261 (pwnd), (DWORD)((pwnd)->fnid), (DWORD)(inFNID)); \ 00262 return 0; \ 00263 } 00264 00265 /* 00266 * This macro initializes the lookaside entry for a control. It assumes 00267 * that pwnd and hwnd are existing variables pointing to the control's 00268 * windows and that fInit exists as a BOOL initialization flag. 00269 */ 00270 #define INITCONTROLLOOKASIDE(plaType, type, pwnditem, count) \ 00271 if (!*((PULONG_PTR)(pwnd + 1))) { \ 00272 P ## type pType; \ 00273 if (fInit) { \ 00274 if (!NT_SUCCESS(InitLookaside(plaType, sizeof(type), count))) { \ 00275 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); \ 00276 NtUserDestroyWindow(hwnd); \ 00277 return FALSE; \ 00278 } \ 00279 fInit = FALSE; \ 00280 } \ 00281 if ((pType = (P ## type)AllocLookasideEntry(plaType))) { \ 00282 NtUserSetWindowLongPtr(hwnd, 0, (LONG_PTR)pType, FALSE); \ 00283 Lock(&(pType->pwnditem), pwnd); \ 00284 } else { \ 00285 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); \ 00286 NtUserDestroyWindow(hwnd); \ 00287 return FALSE; \ 00288 } \ 00289 } 00290 00291 #endif 00292 00293 #define ISREMOTESESSION() (NtCurrentPeb()->SessionId != 0) 00294 00295 00296 /* 00297 * Bitmap related macroes. 00298 */ 00299 #define SetBestStretchMode(hdc, planes, bpp) \ 00300 SetStretchBltMode(hdc, (((planes) * (bpp)) == 1 ? BLACKONWHITE : COLORONCOLOR)) 00301 00302 #define BitmapSize(cx, cy, planes, bits) \ 00303 (BitmapWidth(cx, bits) * (cy) * (planes)) 00304 00305 #define BitmapWidth(cx, bpp) (((((cx)*(bpp)) + 31) & ~31) >> 3) 00306 00307 #define RGBX(rgb) RGB(GetBValue(rgb), GetGValue(rgb), GetRValue(rgb)) 00308 00309 /* 00310 * Typedefs used for capturing string arguments to be passed 00311 * to the kernel. 00312 */ 00313 typedef struct _IN_STRING { 00314 UNICODE_STRING strCapture; 00315 PUNICODE_STRING pstr; 00316 BOOL fAllocated; 00317 } IN_STRING, *PIN_STRING; 00318 00319 typedef struct _LARGE_IN_STRING { 00320 LARGE_UNICODE_STRING strCapture; 00321 PLARGE_UNICODE_STRING pstr; 00322 BOOL fAllocated; 00323 } LARGE_IN_STRING, *PLARGE_IN_STRING; 00324 00325 00326 /* 00327 * Lookaside definitions 00328 */ 00329 typedef struct _LOOKASIDE { 00330 PVOID LookasideBase; 00331 PVOID LookasideBounds; 00332 ZONE_HEADER LookasideZone; 00333 DWORD EntrySize; 00334 #if DBG 00335 ULONG AllocHiWater; 00336 ULONG AllocCalls; 00337 ULONG AllocSlowCalls; 00338 ULONG DelCalls; 00339 ULONG DelSlowCalls; 00340 #endif // DBG 00341 } LOOKASIDE, *PLOOKASIDE; 00342 00343 NTSTATUS InitLookaside(PLOOKASIDE pla, DWORD cbEntry, DWORD cEntries); 00344 PVOID AllocLookasideEntry(PLOOKASIDE pla); 00345 void FreeLookasideEntry(PLOOKASIDE pla, PVOID pEntry); 00346 00347 /***************************************************************************\ 00348 * 00349 * Thread and structure locking routines - we'll just define these to do 00350 * nothing for now until we figure out what needs to be done 00351 * 00352 \***************************************************************************/ 00353 00354 #undef ThreadLock 00355 #undef ThreadLockAlways 00356 #undef ThreadLockWithPti 00357 #undef ThreadLockAlwaysWithPti 00358 #undef ThreadUnlock 00359 #undef Lock 00360 #undef Unlock 00361 #define CheckLock(pobj) 00362 #define ThreadLock(pobj, ptl) DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl) 00363 #define ThreadLockAlways(pobj, ptl) DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl) 00364 #define ThreadLockWithPti(pti, pobj, ptl) DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl) 00365 #define ThreadLockAlwaysWithPti(pti, pobj, ptl) DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl) 00366 #define ThreadUnlock(ptl) (ptl) 00367 #define Lock(ppobj, pobj) (*ppobj = pobj) 00368 #define Unlock(ppobj) (*ppobj = NULL) 00369 00370 #if !defined(_USERRTL_) && !defined(USEREXTS) 00371 typedef struct _TL { 00372 int iBogus; 00373 } TL; 00374 #endif 00375 00376 /***************************************************************************\ 00377 * 00378 * Button Controls 00379 * 00380 \***************************************************************************/ 00381 00382 /* 00383 * Note: The button data structures are now found in user.h because the 00384 * kernel needs to handle a special case of SetWindowWord on index 00385 * 0L to change the state of the button. 00386 */ 00387 00388 #define BUTTONSTATE(pbutn) (pbutn->buttonState) 00389 00390 #define BST_CHECKMASK 0x0003 00391 #define BST_INCLICK 0x0010 00392 #define BST_CAPTURED 0x0020 00393 #define BST_MOUSE 0x0040 00394 #define BST_DONTCLICK 0x0080 00395 #define BST_INBMCLICK 0x0100 00396 00397 #define PBF_PUSHABLE 0x0001 00398 #define PBF_DEFAULT 0x0002 00399 00400 /* 00401 * BNDrawText codes 00402 */ 00403 #define DBT_TEXT 0x0001 00404 #define DBT_FOCUS 0x0002 00405 00406 00407 /***************************************************************************\ 00408 * 00409 * ComboBox 00410 * 00411 \***************************************************************************/ 00412 00413 /* 00414 * ID numbers (hMenu) for the child controls in the combo box 00415 */ 00416 #define CBLISTBOXID 1000 00417 #define CBEDITID 1001 00418 #define CBBUTTONID 1002 00419 00420 /* 00421 * For CBOX.c. BoxType field, we define the following combo box styles. These 00422 * numbers are the same as the CBS_ style codes as defined in windows.h. 00423 */ 00424 #define SDROPPABLE CBS_DROPDOWN 00425 #define SEDITABLE CBS_SIMPLE 00426 00427 00428 #define SSIMPLE SEDITABLE 00429 #define SDROPDOWNLIST SDROPPABLE 00430 #define SDROPDOWN (SDROPPABLE | SEDITABLE) 00431 00432 00433 /* 00434 * CBOX.OwnerDraw & LBIV.OwnerDraw types 00435 */ 00436 #define OWNERDRAWFIXED 1 00437 #define OWNERDRAWVAR 2 00438 00439 #define UPPERCASE 1 00440 #define LOWERCASE 2 00441 00442 #define CaretCreate(plb) ((plb)->fCaret = TRUE) 00443 00444 /* 00445 * Special styles for static controls, edit controls & listboxes so that we 00446 * can do combo box specific stuff in their wnd procs. 00447 */ 00448 #define LBS_COMBOBOX 0x8000L 00449 00450 /* 00451 * combo.h - Include file for combo boxes. 00452 */ 00453 00454 /* 00455 * This macro is used to isolate the combo box style bits. Ie if it the combo 00456 * box is simple, atomic, dropdown, or a dropdown listbox. 00457 */ 00458 #define COMBOBOXSTYLE(style) ((LOBYTE(style)) & 3) 00459 00460 #define IsComboVisible(pcbox) (!pcbox->fNoRedraw && IsVisible(pcbox->spwnd)) 00461 00462 /* 00463 * Note that I depend on the fact that these CBN_ defines are the same as 00464 * their listbox counterparts. These defines are found in windows.h. 00465 * #define CBN_ERRSPACE (-1) 00466 * #define CBN_SELCHANGE 1 00467 * #define CBN_DBLCLK 2 00468 */ 00469 00470 00471 /***************************************************************************\ 00472 * 00473 * Edit Control Types/Macros 00474 * 00475 \***************************************************************************/ 00476 00477 /* Window extra bytes - we need at least this much space for compatibility */ 00478 #define CBEDITEXTRA 6 00479 00480 /* 00481 * NOTE: Text handle is sized as multiple of this constant 00482 * (should be power of 2). 00483 */ 00484 #define CCHALLOCEXTRA 0x20 00485 00486 /* Maximum width in pixels for a line/rectangle */ 00487 00488 #define MAXPIXELWIDTH 30000 00489 00490 #define MAXCLIPENDPOS 32764 00491 00492 /* Limit multiline edit controls to at most 1024 characters on a single line. 00493 * We will force a wrap if the user exceeds this limit. 00494 */ 00495 00496 #define MAXLINELENGTH 1024 00497 00498 /* 00499 * Allow an initial maximum of 30000 characters in all edit controls since 00500 * some apps will run into unsigned problems otherwise. If apps know about 00501 * the 64K limit, they can set the limit themselves. 00502 */ 00503 #define MAXTEXT 30000 00504 00505 /* 00506 * Key modifiers which have been pressed. Code in KeyDownHandler and 00507 * CharHandler depend on these exact values. 00508 */ 00509 #define NONEDOWN 0 /* Neither shift nor control down */ 00510 #define CTRLDOWN 1 /* Control key only down */ 00511 #define SHFTDOWN 2 /* Shift key only down */ 00512 #define SHCTDOWN 3 /* Shift and control keys down = CTRLDOWN + SHFTDOWN */ 00513 #define NOMODIFY 4 /* Neither shift nor control down */ 00514 00515 00516 #define CALLWORDBREAKPROC(proc, pText, iStart, cch, iAction) \ 00517 (IsWOWProc(proc) ? \ 00518 (* pfnWowEditNextWord)(pText, iStart, cch, iAction, PtrToUlong(proc)) : \ 00519 (* proc)(pText, iStart, cch, iAction)) 00520 00521 /* 00522 * Types of undo supported in this ped 00523 */ 00524 #define UNDO_NONE 0 /* We can't undo the last operation. */ 00525 #define UNDO_INSERT 1 /* We can undo the user's insertion of characters */ 00526 #define UNDO_DELETE 2 /* We can undo the user's deletion of characters */ 00527 00528 typedef struct tagUNDO { 00529 UINT undoType; /* Current type of undo we support */ 00530 PBYTE hDeletedText; /* Pointer to text which has been deleted (for 00531 undo) -- note, the memory is allocated as fixed 00532 */ 00533 ICH ichDeleted; /* Starting index from which text was deleted */ 00534 ICH cchDeleted; /* Count of deleted characters in buffer */ 00535 ICH ichInsStart; /* Starting index from which text was 00536 inserted */ 00537 ICH ichInsEnd; /* Ending index of inserted text */ 00538 } UNDO, *PUNDO; 00539 00540 #define Pundo(ped) ((PUNDO)&(ped)->undoType) 00541 00542 /* 00543 * Length of the buffer for ASCII character width caching: for characters 00544 * 0x00 to 0xff (field charWidthBuffer in PED structure below). 00545 * As the upper half of the cache was not used by almost anyone and fixing 00546 * it's usage required a lot of conversion, we decided to get rid of it 00547 * MCostea #174031 00548 */ 00549 #define CHAR_WIDTH_BUFFER_LENGTH 128 00550 00551 typedef struct tagED { 00552 HANDLE hText; /* Block of text we are editing */ 00553 ICH cchAlloc; /* Number of chars we have allocated for hText 00554 */ 00555 ICH cchTextMax; /* Max number bytes allowed in edit control 00556 */ 00557 ICH cch; /* Current number of bytes of actual text 00558 */ 00559 ICH cLines; /* Number of lines of text */ 00560 00561 ICH ichMinSel; /* Selection extent. MinSel is first selected 00562 char */ 00563 ICH ichMaxSel; /* MaxSel is first unselected character */ 00564 ICH ichCaret; /* Caret location. Caret is on left side of 00565 char */ 00566 ICH iCaretLine; /* The line the caret is on. So that if word 00567 * wrapping, we can tell if the caret is at end 00568 * of a line of at beginning of next line... 00569 */ 00570 ICH ichScreenStart; /* Index of left most character displayed on 00571 * screen for sl ec and index of top most line 00572 * for multiline edit controls 00573 */ 00574 ICH ichLinesOnScreen; /* Number of lines we can display on screen */ 00575 UINT xOffset; /* x (horizontal) scroll position in pixels 00576 * (for multiline text horizontal scroll bar) 00577 */ 00578 UINT charPasswordChar; /* If non null, display this character instead 00579 * of the real text. So that we can implement 00580 * hidden text fields. 00581 */ 00582 int cPasswordCharWidth;/* Width of password char */ 00583 00584 HWND hwnd; /* Window for this edit control */ 00585 PWND pwnd; /* Pointer to window */ 00586 RECT rcFmt; /* Client rectangle */ 00587 HWND hwndParent; /* Parent of this edit control window */ 00588 00589 /* These vars allow us to automatically scroll 00590 * when the user holds the mouse at the bottom 00591 * of the multiline edit control window. 00592 */ 00593 POINT ptPrevMouse; /* Previous point for the mouse for system 00594 * timer. 00595 */ 00596 UINT prevKeys; /* Previous key state for the mouse */ 00597 00598 00599 UINT fSingle : 1; /* Single line edit control? (or multiline) */ 00600 UINT fNoRedraw : 1; /* Redraw in response to a change? */ 00601 UINT fMouseDown : 1; /* Is mouse button down? when moving mouse */ 00602 UINT fFocus : 1; /* Does ec have the focus ? */ 00603 UINT fDirty : 1; /* Modify flag for the edit control */ 00604 UINT fDisabled : 1; /* Window disabled? */ 00605 UINT fNonPropFont : 1; /* Fixed width font? */ 00606 UINT fNonPropDBCS : 1; /* Non-Propotional DBCS font */ 00607 UINT fBorder : 1; /* Draw a border? */ 00608 UINT fAutoVScroll : 1; /* Automatically scroll vertically */ 00609 UINT fAutoHScroll : 1; /* Automatically scroll horizontally */ 00610 UINT fNoHideSel : 1; /* Hide sel when we lose focus? */ 00611 UINT fDBCS : 1; /* Are we using DBCS font set for editing? */ 00612 UINT fFmtLines : 1; /* For multiline only. Do we insert CR CR LF at 00613 * word wrap breaks? 00614 */ 00615 UINT fWrap : 1; /* Do int wrapping? */ 00616 UINT fCalcLines : 1; /* Recalc ped->chLines array? (recalc line 00617 * breaks?) 00618 */ 00619 UINT fEatNextChar : 1; /* Hack for ALT-NUMPAD stuff with combo boxes. 00620 * If numlock is up, we want to eat the next 00621 * character generated by the keyboard driver 00622 * if user enter num pad ascii value... 00623 */ 00624 UINT fStripCRCRLF : 1; /* CRCRLFs have been added to text. Strip them 00625 * before doing any internal edit control 00626 * stuff 00627 */ 00628 UINT fInDialogBox : 1; /* True if the ml edit control is in a dialog 00629 * box and we have to specially treat TABS and 00630 * ENTER 00631 */ 00632 UINT fReadOnly : 1; /* Is this a read only edit control? Only 00633 * allow scrolling, selecting and copying. 00634 */ 00635 UINT fCaretHidden : 1; /* This indicates whether the caret is 00636 * currently hidden because the width or height 00637 * of the edit control is too small to show it. 00638 */ 00639 UINT fTrueType : 1; /* Is the current font TrueType? */ 00640 UINT fAnsi : 1; /* is the edit control Ansi or unicode */ 00641 UINT fWin31Compat : 1; /* TRUE if created by Windows 3.1 app */ 00642 UINT f40Compat : 1; /* TRUE if created by Windows 4.0 app */ 00643 UINT fFlatBorder : 1; /* Do we have to draw this baby ourself? */ 00644 UINT fSawRButtonDown : 1; 00645 UINT fInitialized : 1; /* If any more bits are needed, then */ 00646 UINT fSwapRoOnUp : 1; /* Swap reading order on next keyup */ 00647 UINT fAllowRTL : 1; /* Allow RTL processing */ 00648 UINT fDisplayCtrl : 1; /* Display unicode control characters */ 00649 UINT fRtoLReading : 1; /* Right to left reading order */ 00650 00651 BOOL fInsertCompChr :1; /* means WM_IME_COMPOSITION:CS_INSERTCHAR will come */ 00652 BOOL fReplaceCompChr :1; /* means need to replace current composition str. */ 00653 BOOL fNoMoveCaret :1; /* means stick to current caret pos. */ 00654 BOOL fResultProcess :1; /* means now processing result. */ 00655 BOOL fKorea :1; /* for Korea */ 00656 BOOL fInReconversion :1; /* In reconversion mode */ 00657 BOOL fLShift :1; /* L-Shift pressed with Ctrl */ 00658 00659 WORD wImeStatus; /* current IME status */ 00660 00661 WORD cbChar; /* count of bytes in the char size (1 or 2 if unicode) */ 00662 LPICH chLines; /* index of the start of each line */ 00663 00664 UINT format; /* Left, center, or right justify multiline 00665 * text. 00666 */ 00667 EDITWORDBREAKPROCA lpfnNextWord; /* use CALLWORDBREAKPROC macro to call */ 00668 00669 /* Next word function */ 00670 int maxPixelWidth; /* WASICH Width (in pixels) of longest line */ 00671 00672 UNDO; /* Undo buffer */ 00673 00674 HANDLE hFont; /* Handle to the font for this edit control. 00675 Null if system font. 00676 */ 00677 int aveCharWidth; /* Ave width of a character in the hFont */ 00678 int lineHeight; /* Height of a line in the hFont */ 00679 int charOverhang; /* Overhang associated with the hFont */ 00680 int cxSysCharWidth; /* System font ave width */ 00681 int cySysCharHeight; /* System font height */ 00682 HWND listboxHwnd; /* ListBox hwnd. Non null if we are a combo 00683 box */ 00684 LPINT pTabStops; /* Points to an array of tab stops; First 00685 * element contains the number of elements in 00686 * the array 00687 */ 00688 LPINT charWidthBuffer; 00689 BYTE charSet; /* Character set for currently selected font 00690 * needed for all versions 00691 */ 00692 UINT wMaxNegA; /* The biggest negative A width, */ 00693 UINT wMaxNegAcharPos; /* and how many characters it can span accross */ 00694 UINT wMaxNegC; /* The biggest negative C width, */ 00695 UINT wMaxNegCcharPos; /* and how many characters it can span accross */ 00696 UINT wLeftMargin; /* Left margin width in pixels. */ 00697 UINT wRightMargin; /* Right margin width in pixels. */ 00698 00699 ICH ichStartMinSel; 00700 ICH ichStartMaxSel; 00701 00702 PLPKEDITCALLOUT pLpkEditCallout; 00703 HBITMAP hCaretBitmap; /* Current caret bitmap handle */ 00704 INT iCaretOffset; /* Offset in pixels (for LPK use) */ 00705 00706 HANDLE hInstance; /* for WOW */ 00707 UCHAR seed; /* used to encode and decode password text */ 00708 BOOLEAN fEncoded; /* is the text currently encoded */ 00709 int iLockLevel; /* number of times the text has been locked */ 00710 00711 BYTE DBCSVector[8]; /* DBCS vector table */ 00712 HIMC hImcPrev; /* place to save hImc if we disable IME */ 00713 POINT ptScreenBounding; /* top left corner of edit window in screen */ 00714 } ED, *PED, **PPED; 00715 00716 typedef struct tagEDITWND { 00717 WND wnd; 00718 PED ped; 00719 } EDITWND, *PEDITWND; 00720 00721 #ifdef FAREAST_CHARSET_BITS 00722 #error FAREAST_CHARSET_BITS should not be defined 00723 #endif 00724 #define FAREAST_CHARSET_BITS (FS_JISJAPAN | FS_CHINESESIMP | FS_WANSUNG | FS_CHINESETRAD) 00725 00726 00727 // Language pack specific context menu IDs 00728 00729 #define ID_CNTX_RTL 0x00008000L 00730 #define ID_CNTX_DISPLAYCTRL 0x00008001L 00731 #define ID_CNTX_INSERTCTRL 0x00008013L 00732 #define ID_CNTX_ZWJ 0x00008002L 00733 #define ID_CNTX_ZWNJ 0x00008003L 00734 #define ID_CNTX_LRM 0x00008004L 00735 #define ID_CNTX_RLM 0x00008005L 00736 #define ID_CNTX_LRE 0x00008006L 00737 #define ID_CNTX_RLE 0x00008007L 00738 #define ID_CNTX_LRO 0x00008008L 00739 #define ID_CNTX_RLO 0x00008009L 00740 #define ID_CNTX_PDF 0x0000800AL 00741 #define ID_CNTX_NADS 0x0000800BL 00742 #define ID_CNTX_NODS 0x0000800CL 00743 #define ID_CNTX_ASS 0x0000800DL 00744 #define ID_CNTX_ISS 0x0000800EL 00745 #define ID_CNTX_AAFS 0x0000800FL 00746 #define ID_CNTX_IAFS 0x00008010L 00747 #define ID_CNTX_RS 0x00008011L 00748 #define ID_CNTX_US 0x00008012L 00749 00750 /* 00751 * The following structure is used to store a selection block; In Multiline 00752 * edit controls, "StPos" and "EndPos" fields contain the Starting and Ending 00753 * lines of the block. In Single line edit controls, "StPos" and "EndPos" 00754 * contain the Starting and Ending character positions of the block; 00755 */ 00756 typedef struct tagBLOCK { 00757 ICH StPos; 00758 ICH EndPos; 00759 } BLOCK, *LPBLOCK; 00760 00761 /* The following structure is used to store complete information about a 00762 * a strip of text. 00763 */ 00764 typedef struct { 00765 LPSTR lpString; 00766 ICH ichString; 00767 ICH nCount; 00768 int XStartPos; 00769 } STRIPINFO; 00770 typedef STRIPINFO FAR *LPSTRIPINFO; 00771 00772 00773 /***************************************************************************\ 00774 * 00775 * ListBox 00776 * 00777 \***************************************************************************/ 00778 00779 #define IsLBoxVisible(plb) (plb->fRedraw && IsVisible(plb->spwnd)) 00780 00781 /* 00782 * Number of list box items we allocated whenever we grow the list box 00783 * structures. 00784 */ 00785 #define CITEMSALLOC 32 00786 00787 /* Return Values */ 00788 #define EQ 0 00789 #define PREFIX 1 00790 #define LT 2 00791 #define GT 3 00792 00793 #define SINGLESEL 0 00794 #define MULTIPLESEL 1 00795 #define EXTENDEDSEL 2 00796 00797 #define LBI_ADD 0x0004 00798 00799 /* 00800 * The various bits of wFileDetails field are used as mentioned below: 00801 * 0x0001 Should the file name be in upper case. 00802 * 0x0002 Should the file size be shown. 00803 * 0x0004 Date stamp of the file to be shown ? 00804 * 0x0008 Time stamp of the file to be shown ? 00805 * 0x0010 The dos attributes of the file ? 00806 * 0x0020 In DlgDirSelectEx(), along with file name 00807 * all other details also will be returned 00808 * 00809 */ 00810 00811 #define LBUP_RELEASECAPTURE 0x0001 00812 #define LBUP_RESETSELECTION 0x0002 00813 #define LBUP_NOTIFY 0x0004 00814 #define LBUP_SUCCESS 0x0008 00815 #define LBUP_SELCHANGE 0x0010 00816 00817 /* 00818 * rgpch is set up as follows: First there are cMac 2 byte pointers to the 00819 * start of the strings in hStrings or if ownerdraw, it is 4 bytes of data 00820 * supplied by the app and hStrings is not used. Then if multiselection 00821 * listboxes, there are cMac 1 byte selection state bytes (one for each item 00822 * in the list box). If variable height owner draw, there will be cMac 1 byte 00823 * height bytes (once again, one for each item in the list box.). 00824 * 00825 * CHANGES DONE BY SANKAR: 00826 * The selection byte in rgpch is divided into two nibbles. The lower 00827 * nibble is the selection state (1 => Selected; 0 => de-selected) 00828 * and higher nibble is the display state(1 => Hilited and 0 => de-hilited). 00829 * You must be wondering why on earth we should store this selection state and 00830 * the display state seperately.Well! The reason is as follows: 00831 * While Ctrl+Dragging or Shift+Ctrl+Dragging, the user can adjust the 00832 * selection before the mouse button is up. If the user enlarges a range and 00833 * and before the button is up if he shrinks the range, then the old selection 00834 * state has to be preserved for the individual items that do not fall in the 00835 * range finally. 00836 * Please note that the display state and the selection state for an item 00837 * will be the same except when the user is dragging his mouse. When the mouse 00838 * is dragged, only the display state is updated so that the range is hilited 00839 * or de-hilited) but the selection state is preserved. Only when the button 00840 * goes up, for all the individual items in the range, the selection state is 00841 * made the same as the display state. 00842 */ 00843 00844 typedef struct tagLBItem { 00845 LONG offsz; 00846 ULONG_PTR itemData; 00847 } LBItem, *lpLBItem; 00848 00849 typedef struct tagLBODItem { 00850 ULONG_PTR itemData; 00851 } LBODItem, *lpLBODItem; 00852 00853 void LBEvent(PLBIV, UINT, int); 00854 00855 /***************************************************************************\ 00856 * 00857 * Static Controls 00858 * 00859 \***************************************************************************/ 00860 00861 typedef struct tagSTAT { 00862 PWND spwnd; 00863 union { 00864 HANDLE hFont; 00865 BOOL fDeleteIt; 00866 }; 00867 HANDLE hImage; 00868 UINT cicur; 00869 UINT iicur; 00870 UINT fPaintKbdCuesOnly : 1; 00871 } STAT, *PSTAT; 00872 00873 typedef struct tagSTATWND { 00874 WND wnd; 00875 PSTAT pstat; 00876 } STATWND, *PSTATWND; 00877 00878 00879 typedef struct tagCURSORRESOURCE { 00880 WORD xHotspot; 00881 WORD yHotspot; 00882 BITMAPINFOHEADER bih; 00883 } CURSORRESOURCE, *PCURSORRESOURCE; 00884 00885 00886 #define NextWordBoundary(p) ((PBYTE)(p) + ((ULONG_PTR)(p) & 1)) 00887 #define NextDWordBoundary(p) ((PBYTE)(p) + ((ULONG_PTR)(-(LONG_PTR)(p)) & 3)) 00888 00889 // DDEML stub prototypes 00890 00891 DWORD Event(PEVENT_PACKET pep); 00892 PVOID CsValidateInstance(HANDLE hInst); 00893 00894 /***************************************************************************\ 00895 * WOW Prototypes, Typedefs and Defines 00896 * 00897 * WOW registers resource callback functions so it can load 16 bit resources 00898 * transparently for Win32. At resource load time, these WOW functions are 00899 * called. 00900 * 00901 \***************************************************************************/ 00902 00903 BOOL APIENTRY _FreeResource(HANDLE hResData, HINSTANCE hModule); 00904 LPSTR APIENTRY _LockResource(HANDLE hResData, HINSTANCE hModule); 00905 BOOL APIENTRY _UnlockResource(HANDLE hResData, HINSTANCE hModule); 00906 00907 #define FINDRESOURCEA(hModule,lpName,lpType) ((*(pfnFindResourceExA))(hModule, lpType, lpName, 0)) 00908 #define FINDRESOURCEW(hModule,lpName,lpType) ((*(pfnFindResourceExW))(hModule, lpType, lpName, 0)) 00909 #define FINDRESOURCEEXA(hModule,lpName,lpType,wLang) ((*(pfnFindResourceExA))(hModule, lpType, lpName, wLang)) 00910 #define FINDRESOURCEEXW(hModule,lpName,lpType,wLang) ((*(pfnFindResourceExW))(hModule, lpType, lpName, wLang)) 00911 #define LOADRESOURCE(hModule,hResInfo) ((*(pfnLoadResource))(hModule, hResInfo)) 00912 #define LOCKRESOURCE(hResData, hModule) ((*(pfnLockResource))(hResData, hModule)) 00913 #define UNLOCKRESOURCE(hResData, hModule) ((*(pfnUnlockResource))(hResData, hModule)) 00914 #define FREERESOURCE(hResData, hModule) ((*(pfnFreeResource))(hResData, hModule)) 00915 #define SIZEOFRESOURCE(hModule,hResInfo) ((*(pfnSizeofResource))(hModule, hResInfo)) 00916 #define GETEXPWINVER(hModule) ((*(pfnGetExpWinVer))((hModule)?(hModule):GetModuleHandle(NULL))) 00917 00918 /* 00919 * Pointers to unaligned-bits. These are necessary for handling 00920 * bitmap-info's loaded from file. 00921 */ 00922 typedef BITMAPINFO UNALIGNED *UPBITMAPINFO; 00923 typedef BITMAPINFOHEADER UNALIGNED *UPBITMAPINFOHEADER; 00924 typedef BITMAPCOREHEADER UNALIGNED *UPBITMAPCOREHEADER; 00925 00926 #define CCHFILEMAX MAX_PATH 00927 00928 HANDLE LocalReallocSafe(HANDLE hMem, DWORD dwBytes, DWORD dwFlags, PPED pped); 00929 00930 HLOCAL WINAPI DispatchLocalAlloc( 00931 UINT uFlags, 00932 UINT uBytes, 00933 HANDLE hInstance); 00934 00935 HLOCAL WINAPI DispatchLocalReAlloc( 00936 HLOCAL hMem, 00937 UINT uBytes, 00938 UINT uFlags, 00939 HANDLE hInstance, 00940 PVOID* ppv); 00941 00942 LPVOID WINAPI DispatchLocalLock( 00943 HLOCAL hMem, 00944 HANDLE hInstance); 00945 00946 BOOL WINAPI DispatchLocalUnlock( 00947 HLOCAL hMem, 00948 HANDLE hInstance); 00949 00950 UINT WINAPI DispatchLocalSize( 00951 HLOCAL hMem, 00952 HANDLE hInstance); 00953 00954 HLOCAL WINAPI DispatchLocalFree( 00955 HLOCAL hMem, 00956 HANDLE hInstance); 00957 00958 #define UserLocalAlloc(uFlag,uBytes) HeapAlloc(pUserHeap, uFlag, (uBytes)) 00959 #define UserLocalReAlloc(p, uBytes, uFlags) HeapReAlloc(pUserHeap, uFlags, (LPSTR)(p), (uBytes)) 00960 #define UserLocalFree(p) HeapFree(pUserHeap, 0, (LPSTR)(p)) 00961 #define UserLocalSize(p) HeapSize(pUserHeap, 0, (LPSTR)(p)) 00962 #define UserLocalLock(p) (LPSTR)(p) 00963 #define UserLocalUnlock(p) 00964 #define UserLocalFlags(p) 0 00965 #define UserLocalHandle(p) (HLOCAL)(p) 00966 00967 LONG TabTextOut(HDC hdc, int x, int y, LPCWSTR lpstring, int nCount, 00968 int nTabPositions, CONST INT *lpTabPositions, int iTabOrigin, 00969 BOOL fDrawTheText, int iCharset); 00970 LONG UserLpkTabbedTextOut(HDC hdc, int x, int y, LPCWSTR lpstring, 00971 int nCount, int nTabPositions, CONST INT *lpTabPositions, 00972 int iTabOrigin, BOOL fDrawTheText, int cxCharWidth, 00973 int cyCharHeight, int iCharset); 00974 void UserLpkPSMTextOut(HDC hdc, int xLeft, int yTop, 00975 LPWSTR lpsz, int cch, DWORD dwFlags); 00976 void PSMTextOut(HDC hdc, int xLeft, int yTop, LPWSTR lpsz, int cch, DWORD dwFlags); 00977 void ECUpdateFormat(PED ped, DWORD dwStyle, DWORD dwExStyle); 00978 00979 #ifndef _USERK_ 00980 int LoadStringOrError(HANDLE, UINT, LPTSTR, int, WORD); 00981 int RtlGetIdFromDirectory(PBYTE, BOOL, int, int, DWORD, PDWORD); 00982 BOOL RtlCaptureAnsiString(PIN_STRING, LPCSTR, BOOL); 00983 BOOL RtlCaptureLargeAnsiString(PLARGE_IN_STRING, LPCSTR, BOOL); 00984 #endif // !_USERK_ 00985 00986 PWND FASTCALL ValidateHwnd(HWND hwnd); 00987 PWND FASTCALL ValidateHwndNoRip(HWND hwnd); 00988 00989 PSTR ECLock(PED ped); 00990 void ECUnlock(PED ped); 00991 BOOL ECNcCreate(PED, PWND, LPCREATESTRUCT); 00992 void ECInvalidateClient(PED ped, BOOL fErase); 00993 BOOL ECCreate(PED ped, LONG windowStyle); 00994 void ECWord(PED, ICH, BOOL, ICH*, ICH*); 00995 ICH ECFindTab(LPSTR, ICH); 00996 void ECNcDestroyHandler(PWND, PED); 00997 BOOL ECSetText(PED, LPSTR); 00998 void ECSetPasswordChar(PED, UINT); 00999 ICH ECCchInWidth(PED, HDC, LPSTR, ICH, int, BOOL); 01000 void ECEmptyUndo(PUNDO); 01001 void ECSaveUndo(PUNDO pundoFrom, PUNDO pundoTo, BOOL fClear); 01002 BOOL ECInsertText(PED, LPSTR, ICH*); 01003 ICH ECDeleteText(PED); 01004 void ECResetTextInfo(PED ped); 01005 void ECNotifyParent(PED, int); 01006 void ECSetEditClip(PED, HDC, BOOL); 01007 HDC ECGetEditDC(PED, BOOL); 01008 void ECReleaseEditDC(PED, HDC, BOOL); 01009 ICH ECGetText(PED, ICH, LPSTR, BOOL); 01010 void ECSetFont(PED, HFONT, BOOL); 01011 void ECSetMargin(PED, UINT, long, BOOL); 01012 ICH ECCopy(PED); 01013 BOOL ECCalcChangeSelection(PED, ICH, ICH, LPBLOCK, LPBLOCK); 01014 void ECFindXORblks(LPBLOCK, LPBLOCK, LPBLOCK, LPBLOCK); 01015 BOOL ECIsCharNumeric(PED ped, DWORD keyPress); 01016 01017 /* 01018 * Combine two DBCS WM_CHAR messages to 01019 * a single WORD value. 01020 */ 01021 WORD DbcsCombine(HWND, WORD); 01022 #define CrackCombinedDbcsLB(c) ((BYTE)(c)) 01023 #define CrackCombinedDbcsTB(c) ((c) >> 8) 01024 01025 ICH ECAdjustIch(PED, LPSTR, ICH); 01026 ICH ECAdjustIchNext(PED, LPSTR, ICH); 01027 int ECGetDBCSVector(PED, HDC, BYTE); 01028 BOOL ECIsDBCSLeadByte(PED, BYTE); 01029 LPSTR ECAnsiNext(PED, LPSTR); 01030 LPSTR ECAnsiPrev(PED, LPSTR, LPSTR); 01031 ICH ECPrevIch(PED, LPSTR, ICH); 01032 ICH ECNextIch(PED, LPSTR, ICH); 01033 01034 void ECEnableDisableIME( PED ped ); 01035 void ECImmSetCompositionFont( PED ped ); 01036 void ECImmSetCompositionWindow( PED ped, LONG, LONG ); 01037 void ECSetCaretHandler(PED ped); 01038 void ECInitInsert(PED ped, HKL hkl); 01039 LRESULT ECImeComposition(PED ped, WPARAM wParam, LPARAM lParam); 01040 LRESULT EcImeRequestHandler(PED, WPARAM, LPARAM); // NT 5.0 01041 BOOL HanjaKeyHandler(PED ped); // Korean Support 01042 01043 void ECInOutReconversionMode(PED ped, BOOL fIn); 01044 01045 01046 // ECTabTheTextOut draw codes 01047 #define ECT_CALC 0 01048 #define ECT_NORMAL 1 01049 #define ECT_SELECTED 2 01050 01051 #define ECGetCaretWidth() (gpsi->uCaretWidth) 01052 01053 UINT ECTabTheTextOut(HDC, int, int, int, int, 01054 LPSTR, int, ICH, PED, int, BOOL, LPSTRIPINFO); 01055 HBRUSH ECGetControlBrush(PED, HDC, LONG); 01056 HBRUSH ECGetBrush(PED ped, HDC hdc); 01057 int ECGetModKeys(int); 01058 void ECSize( PED, LPRECT, BOOL); 01059 01060 ICH MLInsertText(PED, LPSTR, ICH, BOOL); 01061 ICH MLDeleteText(PED); 01062 BOOL MLEnsureCaretVisible(PED); 01063 void MLDrawText(PED, HDC, ICH, ICH, BOOL); 01064 void MLDrawLine(PED, HDC, int, ICH, int, BOOL); 01065 void MLPaintABlock(PED, HDC, int, int); 01066 int GetBlkEndLine(int, int, BOOL FAR *, int, int); 01067 void MLBuildchLines(PED, ICH, int, BOOL, PLONG, PLONG); 01068 void MLShiftchLines(PED, ICH, int); 01069 BOOL MLInsertchLine(PED, ICH, ICH, BOOL); 01070 void MLSetCaretPosition(PED,HDC); 01071 void MLIchToXYPos(PED, HDC, ICH, BOOL, LPPOINT); 01072 int MLIchToLine(PED, ICH); 01073 void MLRepaintChangedSelection(PED, HDC, ICH, ICH); 01074 void MLMouseMotion(PED, UINT, UINT, LPPOINT); 01075 ICH MLLine(PED, ICH); 01076 void MLStripCrCrLf(PED); 01077 int MLCalcXOffset(PED, HDC, int); 01078 BOOL MLUndo(PED); 01079 LRESULT MLEditWndProc(HWND, PED, UINT, WPARAM, LPARAM); 01080 void MLChar(PED, DWORD, int); 01081 void MLKeyDown(PED, UINT, int); 01082 ICH MLPasteText(PED); 01083 void MLSetSelection(PED, BOOL, ICH, ICH); 01084 LONG MLCreate(PED, LPCREATESTRUCT); 01085 BOOL MLInsertCrCrLf(PED); 01086 void MLSetHandle(PED, HANDLE); 01087 LONG MLGetLine(PED, ICH, ICH, LPSTR); 01088 ICH MLLineIndex(PED, ICH); 01089 void MLSize(PED, BOOL); 01090 void MLChangeSelection(PED, HDC, ICH, ICH); 01091 void MLSetRectHandler(PED, LPRECT); 01092 BOOL MLExpandTabs(PED); 01093 BOOL MLSetTabStops(PED, int, LPINT); 01094 LONG MLScroll(PED, BOOL, int, int, BOOL); 01095 int MLThumbPosFromPed(PED, BOOL); 01096 void MLUpdateiCaretLine(PED ped); 01097 ICH MLLineLength(PED, ICH); 01098 void MLReplaceSel(PED, LPSTR); 01099 01100 void SLReplaceSel(PED, LPSTR); 01101 BOOL SLUndo(PED); 01102 void SLSetCaretPosition(PED, HDC); 01103 int SLIchToLeftXPos(PED, HDC, ICH); 01104 void SLChangeSelection(PED, HDC, ICH, ICH); 01105 void SLDrawText(PED, HDC, ICH); 01106 void SLDrawLine(PED, HDC, int, int, ICH, int, BOOL); 01107 int SLGetBlkEnd(PED, ICH, ICH, BOOL FAR *); 01108 BOOL SLScrollText(PED, HDC); 01109 void SLSetSelection(PED,ICH, ICH); 01110 ICH SLInsertText(PED, LPSTR, ICH); 01111 ICH SLPasteText(PED); 01112 void SLChar(PED, DWORD); 01113 void SLKeyDown(PED, DWORD, int); 01114 ICH SLMouseToIch(PED, HDC, LPPOINT); 01115 void SLMouseMotion(PED, UINT, UINT, LPPOINT); 01116 LONG SLCreate(PED, LPCREATESTRUCT); 01117 void SLPaint(PED, HDC); 01118 void SLSetFocus(PED); 01119 void SLKillFocus(PED, HWND); 01120 LRESULT SLEditWndProc(HWND, PED, UINT, WPARAM, LPARAM); 01121 LRESULT EditWndProc(PWND, UINT, WPARAM, LPARAM); 01122 01123 #define GETAPPVER() GetClientInfo()->dwExpWinVer 01124 #define THREAD_HKL() (GetClientInfo()->hKL) 01125 01126 01127 UINT HelpMenu(HWND hwnd, PPOINT ppt); 01128 01129 #define ISDELIMETERA(ch) ((ch == ' ') || (ch == '\t')) 01130 #define ISDELIMETERW(ch) ((ch == L' ') || (ch == L'\t')) 01131 01132 #define AWCOMPARECHAR(ped,pbyte,awchar) (ped->fAnsi ? (*(PUCHAR)(pbyte) == (UCHAR)(awchar)) : (*(LPWSTR)(pbyte) == (WCHAR)(awchar))) 01133 01134 /* Menu that comes up when you press the right mouse button on an edit 01135 * control 01136 */ 01137 #define ID_EC_PROPERTY_MENU 1 01138 01139 #define IDD_MDI_ACTIVATE 9 01140 01141 #ifndef _USERK_ 01142 /* 01143 * String IDs 01144 */ 01145 #define STR_ERROR 0x00000002L 01146 #define STR_MOREWINDOWS 0x0000000DL 01147 #define STR_NOMEMBITMAP 0x0000000EL 01148 01149 /* 01150 * IME specific context menu string 01151 */ 01152 #define STR_IMEOPEN 700 01153 #define STR_IMECLOSE 701 01154 #define STR_SOFTKBDOPEN 702 01155 #define STR_SOFTKBDCLOSE 703 01156 #define STR_RECONVERTSTRING 705 01157 01158 #endif // !_USERK_ 01159 01160 01161 BOOL InitClientDrawing(); 01162 01163 /***************************************************************************\ 01164 * Function Prototypes 01165 * 01166 * NOTE: Only prototypes for GLOBAL (across module) functions should be put 01167 * here. Prototypes for functions that are global to a single module should 01168 * be put at the head of that module. 01169 * 01170 \***************************************************************************/ 01171 01172 int InternalScrollWindowEx(HWND hwnd, int dx, int dy, CONST RECT *prcScroll, 01173 CONST RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, 01174 UINT dwFlags, DWORD dwTime); 01175 01176 BOOL IsMetaFile(HDC hdc); 01177 01178 BOOL DrawDiagonal(HDC hdc, LPRECT lprc, HBRUSH hbrTL, HBRUSH hbrBR, UINT flags); 01179 BOOL FillTriangle(HDC hdc, LPRECT lprc, HBRUSH hbr, UINT flags); 01180 01181 BOOL _ClientFreeLibrary(HANDLE hmod); 01182 DWORD _ClientGetListboxString(PWND pwnd, UINT msg, WPARAM wParam, LPSTR lParam, 01183 ULONG_PTR xParam, PROC xpfn); 01184 LPHLP HFill(LPCSTR lpszHelp, DWORD ulCommand, ULONG_PTR ulData); 01185 BOOL SetVideoTimeout(DWORD dwVideoTimeout); 01186 01187 DWORD _GetWindowLong(PWND pwnd, int index, BOOL bAnsi); 01188 #ifdef _WIN64 01189 ULONG_PTR _GetWindowLongPtr(PWND pwnd, int index, BOOL bAnsi); 01190 #else 01191 #define _GetWindowLongPtr _GetWindowLong 01192 #endif 01193 WORD _GetWindowWord(PWND pwnd, int index); 01194 01195 HWND InternalFindWindowExA(HWND hwndParent, HWND hwndChild, LPCSTR pClassName, 01196 LPCSTR pWindowName, DWORD dwFlag); 01197 HWND InternalFindWindowExW(HWND hwndParent, HWND hwndChild, LPCTSTR pClassName, 01198 LPCTSTR pWindowName, DWORD dwFlag); 01199 01200 01201 /* 01202 * Message thunks. 01203 */ 01204 #define fnCOPYDATA NtUserMessageCall 01205 #define fnDDEINIT NtUserMessageCall 01206 #define fnDWORD NtUserMessageCall 01207 #define fnDWORDOPTINLPMSG NtUserMessageCall 01208 #define fnGETTEXTLENGTHS NtUserMessageCall 01209 #define fnGETDBCSTEXTLENGTHS NtUserMessageCall 01210 #define fnINLPCREATESTRUCT NtUserMessageCall 01211 #define fnINLPCOMPAREITEMSTRUCT NtUserMessageCall 01212 #define fnINLPDELETEITEMSTRUCT NtUserMessageCall 01213 #define fnINLPDRAWITEMSTRUCT NtUserMessageCall 01214 #define fnINLPHELPINFOSTRUCT NtUserMessageCall 01215 #define fnINLPHLPSTRUCT NtUserMessageCall 01216 #define fnINLPWINDOWPOS NtUserMessageCall 01217 #define fnINOUTDRAG NtUserMessageCall 01218 #define fnINOUTLPMEASUREITEMSTRUCT NtUserMessageCall 01219 #define fnINOUTLPPOINT5 NtUserMessageCall 01220 #define fnINOUTLPRECT NtUserMessageCall 01221 #define fnINOUTLPSCROLLINFO NtUserMessageCall 01222 #define fnINOUTLPWINDOWPOS NtUserMessageCall 01223 #define fnINOUTNCCALCSIZE NtUserMessageCall 01224 #define fnINOUTNEXTMENU NtUserMessageCall 01225 #define fnINOUTSTYLECHANGE NtUserMessageCall 01226 #define fnOPTOUTLPDWORDOPTOUTLPDWORD NtUserMessageCall 01227 #define fnOUTLPRECT NtUserMessageCall 01228 #define fnPOPTINLPUINT NtUserMessageCall 01229 #define fnPOUTLPINT NtUserMessageCall 01230 #define fnSENTDDEMSG NtUserMessageCall 01231 #define fnOUTDWORDINDWORD NtUserMessageCall 01232 #define fnINOUTMENUGETOBJECT NtUserMessageCall 01233 #define fnINCBOXSTRING NtUserMessageCall 01234 #define fnINCNTOUTSTRING NtUserMessageCall 01235 #define fnINCNTOUTSTRINGNULL NtUserMessageCall 01236 #define fnINLBOXSTRING NtUserMessageCall 01237 #define fnINLPMDICREATESTRUCT NtUserMessageCall 01238 #define fnINSTRING NtUserMessageCall 01239 #define fnINSTRINGNULL NtUserMessageCall 01240 #define fnINWPARAMCHAR NtUserMessageCall 01241 #define fnOUTCBOXSTRING NtUserMessageCall 01242 #define fnOUTLBOXSTRING NtUserMessageCall 01243 #define fnOUTSTRING NtUserMessageCall 01244 #define fnKERNELONLY NtUserMessageCall 01245 01246 #define MESSAGEPROTO(func) \ 01247 LRESULT CALLBACK fn ## func( \ 01248 HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, \ 01249 ULONG_PTR xParam, DWORD xpfnWndProc, BOOL bAnsi) 01250 01251 MESSAGEPROTO(COPYGLOBALDATA); 01252 MESSAGEPROTO(INDEVICECHANGE); 01253 MESSAGEPROTO(INPAINTCLIPBRD); 01254 MESSAGEPROTO(INSIZECLIPBRD); 01255 MESSAGEPROTO(IMECONTROL); 01256 MESSAGEPROTO(IMEREQUEST); 01257 MESSAGEPROTO(INWPARAMDBCSCHAR); 01258 MESSAGEPROTO(EMGETSEL); 01259 MESSAGEPROTO(EMSETSEL); 01260 MESSAGEPROTO(CBGETEDITSEL); 01261 01262 01263 /* 01264 * clhook.c 01265 */ 01266 #define IsHooked(pci, fsHook) \ 01267 ((fsHook & (pci->fsHooks | pci->pDeskInfo->fsHooks)) != 0) 01268 01269 LRESULT fnHkINLPCWPSTRUCTW(PWND pwnd, UINT message, WPARAM wParam, 01270 LPARAM lParam, ULONG_PTR xParam); 01271 LRESULT fnHkINLPCWPSTRUCTA(PWND pwnd, UINT message, WPARAM wParam, 01272 LPARAM lParam, ULONG_PTR xParam); 01273 LRESULT fnHkINLPCWPRETSTRUCTW(PWND pwnd, UINT message, WPARAM wParam, 01274 LPARAM lParam, ULONG_PTR xParam); 01275 LRESULT fnHkINLPCWPRETSTRUCTA(PWND pwnd, UINT message, WPARAM wParam, 01276 LPARAM lParam, ULONG_PTR xParam); 01277 LRESULT DispatchHookW(int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn); 01278 LRESULT DispatchHookA(int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn); 01279 01280 /* 01281 * client.c 01282 */ 01283 LRESULT APIENTRY ButtonWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01284 LRESULT APIENTRY ButtonWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01285 LRESULT APIENTRY MenuWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01286 LRESULT APIENTRY MenuWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01287 LRESULT APIENTRY DesktopWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01288 LRESULT APIENTRY DesktopWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01289 LRESULT APIENTRY ScrollBarWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01290 LRESULT APIENTRY ScrollBarWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01291 LRESULT APIENTRY ListBoxWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01292 LRESULT APIENTRY ListBoxWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01293 LRESULT APIENTRY StaticWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01294 LRESULT APIENTRY StaticWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01295 LRESULT APIENTRY ComboBoxWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01296 LRESULT APIENTRY ComboBoxWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01297 LRESULT APIENTRY ComboListBoxWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01298 LRESULT APIENTRY ComboListBoxWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01299 LRESULT APIENTRY MDIClientWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01300 LRESULT APIENTRY MDIClientWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01301 INT_PTR APIENTRY MB_DlgProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01302 INT_PTR APIENTRY MB_DlgProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01303 INT_PTR APIENTRY MDIActivateDlgProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01304 INT_PTR APIENTRY MDIActivateDlgProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01305 LRESULT APIENTRY EditWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01306 LRESULT APIENTRY EditWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01307 LRESULT APIENTRY ImeWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01308 LRESULT APIENTRY ImeWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 01309 LRESULT SendMessageWorker(PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL fAnsi); 01310 LRESULT SendMessageTimeoutWorker(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, 01311 UINT fuFlags, UINT uTimeout, PULONG_PTR lpdwResult, BOOL fAnsi); 01312 01313 void ClientEmptyClipboard(void); 01314 VOID GetActiveKeyboardName(LPWSTR lpszName); 01315 HANDLE OpenKeyboardLayoutFile(LPWSTR lpszKLName, PUINT puFlags, PUINT poffTable, PUINT pKbdInputLocale); 01316 VOID LoadPreloadKeyboardLayouts(void); 01317 void SetWindowState(PWND pwnd, UINT flags); 01318 void ClearWindowState(PWND pwnd, UINT flags); 01319 01320 HKL LoadKeyboardLayoutWorker(HKL hkl, LPCWSTR lpszKLName, UINT uFlags, BOOL fFailSafe); 01321 01322 /* 01323 * Worker routines called from both the window procs and 01324 * the callback thunks. 01325 */ 01326 LRESULT DispatchClientMessage(PWND pwnd, UINT message, WPARAM wParam, 01327 LPARAM lParam, ULONG_PTR pfn); 01328 LRESULT DefWindowProcWorker(PWND pwnd, UINT message, WPARAM wParam, 01329 LPARAM lParam, DWORD fAnsi); 01330 LRESULT ButtonWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01331 LPARAM lParam, DWORD fAnsi); 01332 LRESULT ListBoxWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01333 LPARAM lParam, DWORD fAnsi); 01334 LRESULT StaticWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01335 LPARAM lParam, DWORD fAnsi); 01336 LRESULT ComboBoxWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01337 LPARAM lParam, DWORD fAnsi); 01338 LRESULT ComboListBoxWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01339 LPARAM lParam, DWORD fAnsi); 01340 LRESULT MDIClientWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01341 LPARAM lParam, DWORD fAnsi); 01342 LRESULT EditWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01343 LPARAM lParam, DWORD fAnsi); 01344 LRESULT DefDlgProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01345 LPARAM lParam, DWORD fAnsi); 01346 LRESULT ImeWndProcWorker(PWND pwnd, UINT msg, WPARAM wParam, 01347 LPARAM lParam, DWORD fAnsi); 01348 01349 /* 01350 * Server Stubs - ntstubs.c 01351 */ 01352 01353 LONG _SetWindowLong( 01354 HWND hWnd, 01355 int nIndex, 01356 LONG dwNewLong, 01357 BOOL bAnsi); 01358 01359 #ifdef _WIN64 01360 LONG_PTR _SetWindowLongPtr( 01361 HWND hWnd, 01362 int nIndex, 01363 LONG_PTR dwNewLong, 01364 BOOL bAnsi); 01365 #else 01366 #define _SetWindowLongPtr _SetWindowLong 01367 #endif 01368 01369 BOOL _PeekMessage( 01370 LPMSG pmsg, 01371 HWND hwnd, 01372 UINT wMsgFilterMin, 01373 UINT wMsgFilterMax, 01374 UINT wRemoveMsg, 01375 BOOL bAnsi); 01376 01377 BOOL _DefSetText( 01378 HWND hwnd, 01379 LPCWSTR pstr, 01380 BOOL bAnsi); 01381 01382 HCURSOR _GetCursorFrameInfo( 01383 HCURSOR hcur, 01384 LPWSTR id, 01385 int iFrame, 01386 LPDWORD pjifRate, 01387 LPINT pccur); 01388 01389 HWND _CreateWindowEx( 01390 DWORD dwExStyle, 01391 LPCTSTR pClassName, 01392 LPCTSTR pWindowName, 01393 DWORD dwStyle, 01394 int x, 01395 int y, 01396 int nWidth, 01397 int nHeight, 01398 HWND hwndParent, 01399 HMENU hmenu, 01400 HANDLE hModule, 01401 LPVOID pParam, 01402 DWORD dwFlags); 01403 01404 HKL _LoadKeyboardLayoutEx( 01405 HANDLE hFile, 01406 UINT offTable, 01407 HKL hkl, 01408 LPCWSTR pwszKL, 01409 UINT KbdInputLocale, 01410 UINT Flags); 01411 01412 BOOL _SetCursorIconData( 01413 HCURSOR hCursor, 01414 PCURSORDATA pcur); 01415 01416 HCURSOR FindExistingCursorIcon( 01417 LPWSTR pszModName, 01418 LPCWSTR pszResName, 01419 PCURSORFIND pcfSearch); 01420 01421 HANDLE CreateLocalMemHandle( 01422 HANDLE hMem); 01423 01424 HANDLE ConvertMemHandle( 01425 HANDLE hMem, 01426 UINT cbNULL); 01427 01428 HHOOK _SetWindowsHookEx( 01429 HANDLE hmod, 01430 LPTSTR pszLib, 01431 DWORD idThread, 01432 int nFilterType, 01433 PROC pfnFilterProc, 01434 DWORD dwFlags); 01435 01436 #if 0 01437 DWORD WINAPI ImmGetReconvertTotalSize( 01438 DWORD dwSize, 01439 REQ_CALLER eCaller, 01440 BOOL bAnsiTarget); 01441 01442 DWORD WINAPI ImmReconversionWorker( 01443 LPRECONVERTSTRING lpRecTo, 01444 LPRECONVERTSTRING lpRecFrom, 01445 BOOL bToAnsi, 01446 DWORD dwCodePage); 01447 #endif 01448 01449 /* 01450 * classc.c 01451 */ 01452 ULONG_PTR _GetClassData( 01453 PCLS pcls, 01454 PWND pwnd, 01455 int index, 01456 BOOL bAnsi); 01457 01458 DWORD _GetClassLong( 01459 PWND pwnd, 01460 int index, 01461 BOOL bAnsi); 01462 01463 #ifdef _WIN64 01464 ULONG_PTR _GetClassLongPtr( 01465 PWND pwnd, 01466 int index, 01467 BOOL bAnsi); 01468 #else 01469 #define _GetClassLongPtr _GetClassLong 01470 #endif 01471 01472 /* 01473 * mngrayc.c 01474 */ 01475 BOOL BitBltSysBmp( 01476 HDC hdc, 01477 int x, 01478 int y, 01479 UINT i); 01480 01481 01482 /* 01483 * clenum.c 01484 */ 01485 DWORD BuildHwndList( 01486 HDESK hdesk, 01487 HWND hwndNext, 01488 BOOL fEnumChildren, 01489 DWORD idThread, 01490 HWND **phwndFirst); 01491 01492 /* 01493 * cltxt.h 01494 */ 01495 ATOM RegisterClassExWOWA( 01496 PWNDCLASSEXA lpWndClass, 01497 LPDWORD pdwWOWstuff, 01498 WORD fnid); 01499 01500 ATOM RegisterClassExWOWW( 01501 PWNDCLASSEXW lpWndClass, 01502 LPDWORD pdwWOWstuff, 01503 WORD fnid); 01504 01505 void CopyLogFontAtoW( 01506 PLOGFONTW pdest, 01507 PLOGFONTA psrc); 01508 01509 void CopyLogFontWtoA( 01510 PLOGFONTA pdest, 01511 PLOGFONTW psrc); 01512 01513 /* 01514 * dlgmgrc.c 01515 */ 01516 PWND _NextControl( 01517 PWND pwndDlg, 01518 PWND pwnd, 01519 UINT uFlags); 01520 01521 PWND _PrevControl( 01522 PWND pwndDlg, 01523 PWND pwnd, 01524 UINT uFlags); 01525 01526 PWND _GetNextDlgGroupItem( 01527 PWND pwndDlg, 01528 PWND pwnd, 01529 BOOL fPrev); 01530 01531 PWND _GetNextDlgTabItem( 01532 PWND pwndDlg, 01533 PWND pwnd, 01534 BOOL fPrev); 01535 01536 PWND _GetChildControl( 01537 PWND pwndDlg, 01538 PWND pwndLevel); 01539 01540 /* 01541 * winmgrc.c 01542 */ 01543 BOOL FChildVisible( 01544 HWND hwnd); 01545 01546 /* 01547 * draw.c 01548 */ 01549 BOOL PaintRect( 01550 HWND hwndBrush, 01551 HWND hwndPaint, 01552 HDC hdc, 01553 HBRUSH hbr, 01554 LPRECT lprc); 01555 01556 #define NtUserReleaseDC(hwnd,hdc) NtUserCallOneParam((ULONG_PTR)(hdc), SFI__RELEASEDC) 01557 #define NtUserArrangeIconicWindows(hwnd) (UINT)NtUserCallHwndLock((hwnd), SFI_XXXARRANGEICONICWINDOWS) 01558 #define NtUserBeginDeferWindowPos(nNumWindows) (HANDLE)NtUserCallOneParam((nNumWindows),SFI__BEGINDEFERWINDOWPOS) 01559 #define NtUserCreateMenu() (HMENU)NtUserCallNoParam(SFI__CREATEMENU) 01560 #define NtUserDestroyCaret() (BOOL)NtUserCallNoParam(SFI_ZZZDESTROYCARET) 01561 #define NtUserEnableWindow(hwnd, bEnable) (BOOL)NtUserCallHwndParamLock((hwnd), (bEnable),SFI_XXXENABLEWINDOW) 01562 #define NtUserGetMessagePos() (DWORD)NtUserCallNoParam(SFI__GETMESSAGEPOS) 01563 #define NtUserKillSystemTimer(hwnd,nIDEvent) (BOOL)NtUserCallHwndParam((hwnd), (nIDEvent), SFI__KILLSYSTEMTIMER) 01564 #define NtUserMessageBeep(wType) (BOOL)NtUserCallOneParam((wType), SFI_XXXMESSAGEBEEP) 01565 #define NtUserSetWindowContextHelpId(hwnd,id) (BOOL)NtUserCallHwndParam((hwnd), (id), SFI__SETWINDOWCONTEXTHELPID) 01566 #define NtUserGetWindowContextHelpId(hwnd) (BOOL)NtUserCallHwnd((hwnd), SFI__GETWINDOWCONTEXTHELPID) 01567 #define NtUserRedrawFrame(hwnd) NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAME) 01568 #define NtUserRedrawFrameAndHook(hwnd) NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAMEANDHOOK) 01569 #define NtUserRedrawTitle(hwnd, wFlags) NtUserCallHwndParamLock((hwnd), (wFlags), SFI_XXXREDRAWTITLE) 01570 #define NtUserReleaseCapture() (BOOL)NtUserCallNoParam(SFI_XXXRELEASECAPTURE) 01571 #define NtUserSetCaretPos(X,Y) (BOOL)NtUserCallTwoParam((DWORD)(X), (DWORD)(Y), SFI_ZZZSETCARETPOS) 01572 #define NtUserSetCursorPos(X, Y) (BOOL)NtUserCallTwoParam((X), (Y), SFI_ZZZSETCURSORPOS) 01573 #define NtUserSetForegroundWindow(hwnd) (BOOL)NtUserCallHwndLock((hwnd), SFI_XXXSTUBSETFOREGROUNDWINDOW) 01574 #define NtUserSetSysMenu(hwnd) NtUserCallHwndLock((hwnd), SFI_XXXSETSYSMENU) 01575 #define NtUserSetVisible(hwnd,fSet) NtUserCallHwndParam((hwnd), (fSet), SFI_SETVISIBLE) 01576 #define NtUserShowCursor(bShow) (int)NtUserCallOneParam((bShow), SFI_ZZZSHOWCURSOR) 01577 #define NtUserUpdateClientRect(hwnd) NtUserCallHwndLock((hwnd), SFI_XXXUPDATECLIENTRECT) 01578 01579 #define CreateCaret NtUserCreateCaret 01580 #define FillWindow NtUserFillWindow 01581 #define GetControlBrush NtUserGetControlBrush 01582 #define GetControlColor NtUserGetControlColor 01583 #define GetDCEx NtUserGetDCEx 01584 #define GetWindowPlacement NtUserGetWindowPlacement 01585 #define RedrawWindow NtUserRedrawWindow 01586 01587 01588 /* 01589 * dmmnem.c 01590 */ 01591 int FindMnemChar( 01592 LPWSTR lpstr, 01593 WCHAR ch, 01594 BOOL fFirst, 01595 BOOL fPrefix); 01596 01597 /* 01598 * clres.c 01599 */ 01600 BOOL WowGetModuleFileName( 01601 HMODULE hModule, 01602 LPWSTR pwsz, 01603 DWORD cchMax); 01604 01605 HICON WowServerLoadCreateCursorIcon( 01606 HANDLE hmod, 01607 LPTSTR lpModName, 01608 DWORD dwExpWinVer, 01609 LPCTSTR lpName, 01610 DWORD cb, 01611 PVOID pcr, 01612 LPTSTR lpType, 01613 BOOL fClient); 01614 01615 HANDLE InternalCopyImage( 01616 HANDLE hImage, 01617 UINT IMAGE_flag, 01618 int cxNew, 01619 int cyNew, 01620 UINT LR_flags); 01621 01622 HMENU CreateMenuFromResource( 01623 LPBYTE); 01624 01625 /* 01626 * acons.c 01627 */ 01628 #define BFT_ICON 0x4349 // 'IC' 01629 #define BFT_BITMAP 0x4D42 // 'BM' 01630 #define BFT_CURSOR 0x5450 // 'PT' 01631 01632 typedef struct _FILEINFO { 01633 LPBYTE pFileMap; 01634 LPBYTE pFilePtr; 01635 LPBYTE pFileEnd; 01636 LPCWSTR pszName; 01637 } FILEINFO, *PFILEINFO; 01638 01639 HANDLE LoadCursorIconFromFileMap( 01640 IN PFILEINFO pfi, 01641 IN OUT LPWSTR *prt, 01642 IN DWORD cxDesired, 01643 IN DWORD cyDesired, 01644 IN DWORD LR_flags, 01645 OUT LPBOOL pfAni); 01646 01647 DWORD GetIcoCurWidth( 01648 DWORD cxOrg, 01649 BOOL fIcon, 01650 UINT LR_flags, 01651 DWORD cxDesired); 01652 01653 DWORD GetIcoCurHeight( 01654 DWORD cyOrg, 01655 BOOL fIcon, 01656 UINT LR_flags, 01657 DWORD cyDesired); 01658 01659 DWORD GetIcoCurBpp( 01660 UINT LR_flags); 01661 01662 HICON LoadIcoCur( 01663 HINSTANCE hmod, 01664 LPCWSTR lpName, 01665 LPWSTR type, 01666 DWORD cxDesired, 01667 DWORD cyDesired, 01668 UINT LR_flags); 01669 01670 HANDLE ObjectFromDIBResource( 01671 HINSTANCE hmod, 01672 LPCWSTR lpName, 01673 LPWSTR type, 01674 DWORD cxDesired, 01675 DWORD cyDesired, 01676 UINT LR_flags); 01677 01678 HANDLE RtlLoadObjectFromDIBFile( 01679 LPCWSTR lpszName, 01680 LPWSTR type, 01681 DWORD cxDesired, 01682 DWORD cyDesired, 01683 UINT LR_flags); 01684 01685 HCURSOR LoadCursorOrIconFromFile( 01686 LPCWSTR pszFilename, 01687 BOOL fIcon); 01688 01689 HBITMAP ConvertDIBBitmap( 01690 UPBITMAPINFOHEADER lpbih, 01691 DWORD cxDesired, 01692 DWORD cyDesired, 01693 UINT flags, 01694 LPBITMAPINFOHEADER *lplpbih, 01695 LPSTR *lplpBits); 01696 01697 HICON ConvertDIBIcon( 01698 LPBITMAPINFOHEADER lpbih, 01699 HINSTANCE hmod, 01700 LPCWSTR lpName, 01701 BOOL fIcon, 01702 DWORD cxNew, 01703 DWORD cyNew, 01704 UINT LR_flags); 01705 01706 int SmartStretchDIBits( 01707 HDC hdc, 01708 int xD, 01709 int yD, 01710 int dxD, 01711 int dyD, 01712 int xS, 01713 int yS, 01714 int dxS, 01715 int dyS, 01716 LPVOID lpBits, 01717 LPBITMAPINFO lpbi, 01718 UINT wUsage, 01719 DWORD rop); 01720 01721 01722 /* 01723 * OFFSET for different DPI resources. 01724 * This allows us to take a resource number and "map" to an actual resource 01725 * based on what DPI the user selected 01726 */ 01727 01728 #define OFFSET_SCALE_DPI 000 01729 #define OFFSET_96_DPI 100 01730 #define OFFSET_120_DPI 200 01731 #define OFFSET_160_DPI 300 01732 01733 /* 01734 * defines the highest resource number so we can do math on the resource 01735 * number. 01736 */ 01737 01738 #define MAX_RESOURCE_INDEX 32768 01739 01740 01741 /* 01742 * Parameter for xxxAlterHilite() 01743 */ 01744 #define HILITEONLY 0x0001 01745 #define SELONLY 0x0002 01746 #define HILITEANDSEL (HILITEONLY + SELONLY) 01747 01748 #define HILITE 1 01749 01750 // LATER IanJa: these vary by country! For US they are VK_OEM_2 VK_OEM_5. 01751 // Change lboxctl2.c MapVirtualKey to character - and fix the spelling? 01752 #define VERKEY_SLASH 0xBF /* Vertual key for '/' character */ 01753 #define VERKEY_BACKSLASH 0xDC /* Vertual key for '\' character */ 01754 01755 /* 01756 * Procedures for combo boxes. 01757 */ 01758 LONG xxxCBCommandHandler(PCBOX, DWORD, HWND); 01759 LRESULT xxxCBMessageItemHandler(PCBOX, UINT, LPVOID); 01760 int xxxCBDir(PCBOX, UINT, LPWSTR); 01761 VOID xxxCBPaint(PCBOX, HDC); 01762 VOID xxxCBCompleteEditWindow(PCBOX pcbox); 01763 BOOL xxxCBHideListBoxWindow(PCBOX pcbox, BOOL fNotifyParent, BOOL fSelEndOK); 01764 VOID xxxCBShowListBoxWindow(PCBOX pcbox, BOOL fTrack); 01765 void xxxCBPosition(PCBOX pcbox); 01766 01767 /* 01768 * combo.h 01769 */ 01770 01771 /* Initialization code */ 01772 long CBNcCreateHandler(PCBOX, PWND); 01773 LRESULT xxxCBCreateHandler(PCBOX, PWND); 01774 void xxxCBCalcControlRects(PCBOX pcbox, LPRECT lprcList); 01775 01776 /* Destruction code */ 01777 VOID xxxCBNcDestroyHandler(PWND, PCBOX); 01778 01779 /* Generic often used routines */ 01780 VOID xxxCBNotifyParent(PCBOX, SHORT); 01781 VOID xxxCBUpdateListBoxWindow(PCBOX, BOOL); 01782 01783 01784 /* Helpers' */ 01785 VOID xxxCBInternalUpdateEditWindow(PCBOX, HDC); 01786 VOID xxxCBGetFocusHelper(PCBOX); 01787 VOID xxxCBKillFocusHelper(PCBOX); 01788 VOID xxxCBInvertStaticWindow(PCBOX,BOOL,HDC); 01789 VOID xxxCBSetFontHandler(PCBOX, HANDLE, BOOL); 01790 VOID xxxCBSizeHandler(PCBOX); 01791 LONG xxxCBSetEditItemHeight(PCBOX pcbox, int editHeight); 01792 01793 01794 /* 01795 * String 01796 */ 01797 01798 INT xxxFindString(PLBIV, LPWSTR, INT, INT, BOOL); 01799 01800 VOID InitHStrings(PLBIV); 01801 01802 int xxxLBInsertItem(PLBIV, LPWSTR, int, UINT); 01803 01804 /* 01805 * Selection 01806 */ 01807 BOOL ISelFromPt(PLBIV, POINT, LPDWORD); 01808 BOOL IsSelected(PLBIV, INT, UINT); 01809 VOID LBSetCItemFullMax(PLBIV plb); 01810 01811 VOID xxxLBSelRange(PLBIV, INT, INT, BOOL); 01812 01813 INT xxxLBSetCurSel(PLBIV, INT); 01814 01815 INT LBoxGetSelItems(PLBIV, BOOL, INT, LPINT); 01816 01817 LONG xxxLBSetSel(PLBIV, BOOL, INT); 01818 01819 VOID xxxSetISelBase(PLBIV, INT); 01820 01821 VOID SetSelected(PLBIV, INT, BOOL, UINT); 01822 01823 01824 /* 01825 * Caret 01826 */ 01827 void xxxLBSetCaret(PLBIV plb, BOOL fSetCaret); 01828 VOID xxxCaretDestroy(PLBIV); 01829 01830 /* 01831 * LBox 01832 */ 01833 LONG xxxLBCreate(PLBIV, PWND, LPCREATESTRUCT); 01834 VOID xxxDestroyLBox(PLBIV, PWND); 01835 VOID xxxLBoxDeleteItem(PLBIV, INT); 01836 01837 VOID xxxLBoxDoDeleteItems(PLBIV); 01838 VOID xxxLBoxDrawItem(PLBIV, INT, UINT, UINT, LPRECT); 01839 01840 01841 /* 01842 * Scroll 01843 */ 01844 INT LBCalcVarITopScrollAmt(PLBIV, INT, INT); 01845 01846 VOID xxxLBoxCtlHScroll(PLBIV, INT, INT); 01847 01848 VOID xxxLBoxCtlHScrollMultiColumn(PLBIV, INT, INT); 01849 01850 VOID xxxLBoxCtlScroll(PLBIV, INT, INT); 01851 01852 VOID xxxLBShowHideScrollBars(PLBIV); 01853 01854 /* 01855 * LBoxCtl 01856 */ 01857 INT xxxLBoxCtlDelete(PLBIV, INT); 01858 01859 VOID xxxLBoxCtlCharInput(PLBIV, UINT, BOOL); 01860 VOID xxxLBoxCtlKeyInput(PLBIV, UINT, UINT); 01861 VOID xxxLBPaint(PLBIV, HDC, LPRECT); 01862 01863 BOOL xxxLBInvalidateRect(PLBIV plb, LPRECT lprc, BOOL fErase); 01864 /* 01865 * Miscellaneous 01866 */ 01867 VOID xxxAlterHilite(PLBIV, INT, INT, BOOL, INT, BOOL); 01868 01869 INT CItemInWindow(PLBIV, BOOL); 01870 01871 VOID xxxCheckRedraw(PLBIV, BOOL, INT); 01872 01873 LPWSTR GetLpszItem(PLBIV, INT); 01874 01875 VOID xxxInsureVisible(PLBIV, INT, BOOL); 01876 01877 VOID xxxInvertLBItem(PLBIV, INT, BOOL); 01878 01879 VOID xxxLBBlockHilite(PLBIV, INT, BOOL); 01880 01881 int LBGetSetItemHeightHandler(PLBIV plb, UINT message, int item, UINT height); 01882 VOID LBDropObjectHandler(PLBIV, PDROPSTRUCT); 01883 LONG_PTR LBGetItemData(PLBIV, INT); 01884 01885 INT LBGetText(PLBIV, BOOL, BOOL, INT, LPWSTR); 01886 01887 VOID xxxLBSetFont(PLBIV, HANDLE, BOOL); 01888 int LBSetItemData(PLBIV, INT, LONG_PTR); 01889 01890 BOOL LBSetTabStops(PLBIV, INT, LPINT); 01891 01892 VOID xxxLBSize(PLBIV, INT, INT); 01893 INT LastFullVisible(PLBIV); 01894 01895 INT xxxLbDir(PLBIV, UINT, LPWSTR); 01896 01897 INT xxxLbInsertFile(PLBIV, LPWSTR); 01898 01899 VOID xxxNewITop(PLBIV, INT); 01900 VOID xxxNewITopEx(PLBIV, INT, DWORD); 01901 01902 VOID xxxNotifyOwner(PLBIV, INT); 01903 01904 VOID xxxResetWorld(PLBIV, INT, INT, BOOL); 01905 01906 VOID xxxTrackMouse(PLBIV, UINT, POINT); 01907 BOOL xxxDlgDirListHelper(PWND, LPWSTR, LPBYTE, int, int, UINT, BOOL); 01908 BOOL DlgDirSelectHelper(LPWSTR pFileName, int cbFileName, HWND hwndListBox); 01909 BOOL xxxLBResetContent(PLBIV plb); 01910 VOID xxxLBSetRedraw(PLBIV plb, BOOL fRedraw); 01911 int xxxSetLBScrollParms(PLBIV plb, int nCtl); 01912 void xxxLBButtonUp(PLBIV plb, UINT uFlags); 01913 01914 /* 01915 * Variable Height OwnerDraw Support Routines 01916 */ 01917 INT CItemInWindowVarOwnerDraw(PLBIV, BOOL); 01918 01919 INT LBPage(PLBIV, INT, BOOL); 01920 01921 01922 /* 01923 * Multicolumn listbox 01924 */ 01925 VOID LBCalcItemRowsAndColumns(PLBIV); 01926 01927 /* 01928 * Both multicol and var height 01929 */ 01930 BOOL LBGetItemRect(PLBIV, INT, LPRECT); 01931 01932 VOID LBSetVariableHeightItemHeight(PLBIV, INT, INT); 01933 01934 INT LBGetVariableHeightItemHeight(PLBIV, INT); 01935 01936 /* 01937 * No-data (lazy evaluation) listbox 01938 */ 01939 INT xxxLBSetCount(PLBIV, INT); 01940 01941 UINT LBCalcAllocNeeded(PLBIV, INT); 01942 01943 /* 01944 * Storage pre-allocation support for LB_INITSTORAGE 01945 */ 01946 LONG xxxLBInitStorage(PLBIV plb, BOOL fAnsi, INT cItems, INT cb); 01947 01948 /***************************************************************************\ 01949 * 01950 * Dialog Boxes 01951 * 01952 \***************************************************************************/ 01953 01954 HWND InternalCreateDialog(HANDLE hmod, 01955 LPDLGTEMPLATE lpDlgTemplate, DWORD cb, 01956 HWND hwndOwner , DLGPROC pfnWndProc, LPARAM dwInitParam, 01957 UINT fFlags); 01958 01959 INT_PTR InternalDialogBox(HANDLE hmod, 01960 LPDLGTEMPLATE lpDlgTemplate, 01961 HWND hwndOwner , DLGPROC pfnWndProc, LPARAM dwInitParam, 01962 UINT fFlags); 01963 01964 PWND _FindDlgItem(PWND pwndParent, DWORD id); 01965 PWND _GetDlgItem(PWND, int); 01966 long _GetDialogBaseUnits(VOID); 01967 PWND GetParentDialog(PWND pwndDialog); 01968 VOID xxxRemoveDefaultButton(PWND pwndDlg, PWND pwndStart); 01969 VOID xxxCheckDefPushButton(PWND pwndDlg, HWND hwndOldFocus, HWND hwndNewFocus); 01970 PWND xxxGotoNextMnem(PWND pwndDlg, PWND pwndStart, WCHAR ch); 01971 VOID DlgSetFocus(HWND hwnd); 01972 void RepositionRect(PMONITOR pMonitor, LPRECT lprc, DWORD dwStyle, DWORD dwExStyle); 01973 BOOL ValidateDialogPwnd(PWND pwnd); 01974 PMONITOR GetDialogMonitor(HWND hwndOwner, DWORD dwFlags); 01975 01976 HANDLE GetEditDS(VOID); 01977 VOID ReleaseEditDS(HANDLE h); 01978 VOID TellWOWThehDlg(HWND hDlg); 01979 01980 UINT GetACPCharSet(); 01981 01982 /***************************************************************************\ 01983 * 01984 * Menus 01985 * 01986 \***************************************************************************/ 01987 // cltxt.h 01988 BOOL GetMenuItemInfoInternalW(HMENU hMenu, UINT uID, BOOL fByPosition, LPMENUITEMINFOW lpmii); 01989 01990 #define MENUAPI_INSERT 0 01991 #define MENUAPI_GET 1 01992 #define MENUAPI_SET 2 01993 01994 // clmenu.c 01995 BOOL InternalInsertMenuItem (HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii); 01996 BOOL ValidateMENUITEMINFO(LPMENUITEMINFOW lpmiiIn, LPMENUITEMINFOW lpmii, DWORD dwAPICode); 01997 BOOL ValidateMENUINFO(LPCMENUINFO lpmi, DWORD dwAPICode); 01998 01999 02000 // ntstubs.c 02001 BOOL ThunkedMenuItemInfo(HMENU hMenu, UINT nPosition, BOOL fByPosition, 02002 BOOL fInsert, LPMENUITEMINFOW lpmii, BOOL fAnsi); 02003 02004 // menuc.c 02005 void SetMenuItemInfoStruct(HMENU hMenu, UINT wFlags, UINT_PTR wIDNew, LPWSTR pwszNew, 02006 LPMENUITEMINFOW pmii); 02007 02008 /***************************************************************************\ 02009 * 02010 * Message Boxes 02011 * 02012 \***************************************************************************/ 02013 02014 02015 #define WINDOWLIST_PROP_NAME TEXT("SysBW") 02016 #define MSGBOX_CALLBACK TEXT("SysMB") 02017 02018 /* Unicode Right-To-Left mark unicode code point. Look in msgbox.c for more info */ 02019 #define UNICODE_RLM 0x200f 02020 02021 /***************************************************************************\ 02022 * 02023 * MDI Windows 02024 * 02025 \***************************************************************************/ 02026 02027 /* maximum number of MDI children windows listed in "Window" menu */ 02028 #define MAXITEMS 10 02029 02030 /* 02031 * MDI typedefs 02032 */ 02033 typedef struct tagSHORTCREATE { 02034 int cy; 02035 int cx; 02036 int y; 02037 int x; 02038 LONG style; 02039 HMENU hMenu; 02040 } SHORTCREATE, *PSHORTCREATE; 02041 02042 typedef struct tagMDIACTIVATEPOS { 02043 int cx; 02044 int cy; 02045 int cxMin; 02046 int cyMin; 02047 } MDIACTIVATEPOS, *PMDIACTIVATEPOS; 02048 02049 BOOL CreateMDIChild(PSHORTCREATE pcs, LPMDICREATESTRUCT pmcs, DWORD dwExpWinVerAndFlags, HMENU *phSysMenu, PWND pwndParent); 02050 BOOL MDICompleteChildCreation(HWND hwndChild, HMENU hSysMenu, BOOL fVisible, BOOL fDisabled); 02051 02052 /* 02053 * MDI defines 02054 */ 02055 #define WS_MDISTYLE (WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU|WS_CAPTION|WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX) 02056 #define WS_MDICOMMANDS (WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) 02057 #define WS_MDIALLOWED (WS_MINIMIZE | WS_MAXIMIZE | WS_CLIPCHILDREN | WS_DISABLED | WS_HSCROLL | WS_VSCROLL | 0x0000FFFFL) 02058 02059 #define HAS_SBVERT 0x0100 02060 #define HAS_SBHORZ 0x0200 02061 #define OTHERMAXING 0x0400 02062 #define CALCSCROLL 0x0800 02063 02064 #define SCROLLSUPPRESS 0x0003 02065 #define SCROLLCOUNT 0x00FF 02066 02067 #define CKIDS(pmdi) (pmdi->cKids) 02068 #define MAXED(pmdi) (pmdi->hwndMaxedChild) 02069 #define ACTIVE(pmdi) (pmdi->hwndActiveChild) 02070 #define WINDOW(pmdi) (pmdi->hmenuWindow) 02071 #define FIRST(pmdi) (pmdi->idFirstChild) 02072 #define SCROLL(pmdi) (pmdi->wScroll) 02073 #define ITILELEVEL(pmdi) (pmdi->iChildTileLevel) 02074 #define HTITLE(pmdi) (pmdi->pTitle) 02075 02076 #define PROP_MDICLIENT MAKEINTRESOURCE(0x8CAC) 02077 #define MDIACTIVATE_PROP_NAME TEXT("MDIA") 02078 02079 PWND FindPwndChild(PWND pwndMDI, UINT wChildID); 02080 int MakeMenuItem(LPWSTR lpOut, PWND pwnd); 02081 VOID ModifyMenuItem(PWND pwnd); 02082 BOOL MDIAddSysMenu(HMENU hmenuFrame, HWND hwndChild); 02083 BOOL MDIRemoveSysMenu(HMENU hMenuFrame, HWND hwndChild); 02084 VOID ShiftMenuIDs(PWND pwnd, PWND pwndVictim); 02085 HMENU MDISetMenu(PWND,BOOL,HMENU,HMENU); 02086 02087 /* 02088 * Drag and Drop menus. 02089 */ 02090 #define COM_NO_WINDOWS_H 02091 #define RPC_NO_WINDOWS_H 02092 #include <ole2.h> 02093 02094 /* 02095 * Prototypes to cast function pointers 02096 */ 02097 typedef HRESULT (* OLEINITIALIZEPROC)(LPVOID); 02098 typedef HRESULT (* OLEUNINITIALIZEPROC)(VOID); 02099 typedef HRESULT (* REGISTERDDPROC)(HWND, LPDROPTARGET); 02100 typedef HRESULT (* REVOKEDDPROC)(HWND); 02101 typedef HRESULT (* DODDPROC)(LPDATAOBJECT, LPDROPSOURCE, DWORD, LPDWORD); 02102 02103 /* 02104 * Internal IDropTarget interface info 02105 */ 02106 typedef struct tagMNIDROPTARGET 02107 { 02108 IDropTarget idt; /* Interal IDropTarget */ 02109 DWORD dwRefCount; /* Ref count */ 02110 IDataObject * pido; /* IDataObject received at DragEnter */ 02111 IDropTarget * pidt; /* Application IDropTarget, if any */ 02112 } MNIDROPTARGET, * PMNIDROPTARGET; 02113 02114 /* 02115 * OLE procs info (used by LoadOLEOnce GetProcAddress calls) 02116 */ 02117 typedef struct tagGETPROCINFO 02118 { 02119 FARPROC * ppfn; 02120 LPCSTR lpsz; 02121 } GETPROCINFO; 02122 02123 /* 02124 * Special value used by __ClientLoadOLE. 02125 */ 02126 #define OLEWONTLOAD (HINSTANCE)IntToPtr(0xFFFFFFFF) 02127 02128 /* 02129 * Accelerator table resources list. 02130 */ 02131 typedef struct tagACCELCACHE 02132 { 02133 struct tagACCELCACHE *pacNext; 02134 UINT dwLockCount; 02135 HACCEL hAccel; 02136 PVOID pRes; 02137 } ACCELCACHE, *PACCELCACHE; 02138 02139 02140 /* 02141 * x86 callback return function prototype 02142 */ 02143 #if defined(_X86_) && !defined(BUILD_WOW6432) 02144 NTSTATUS 02145 FASTCALL 02146 XyCallbackReturn( 02147 IN PVOID Buffer, 02148 IN ULONG Length, 02149 IN NTSTATUS Status 02150 ); 02151 02152 #define UserCallbackReturn XyCallbackReturn 02153 #else 02154 #define UserCallbackReturn NtCallbackReturn 02155 #endif 02156 02157 /* 02158 * Reader mode support 02159 */ 02160 typedef LONG (CALLBACK* READERMODEPROC)(LPARAM lParam, int nCode, int dx, int dy); 02161 02162 typedef struct tagREADERMODE { // rdrm 02163 UINT cbSize; 02164 DWORD dwFlags; 02165 READERMODEPROC pfnReaderModeProc; 02166 LPARAM lParam; 02167 } READERMODE, *PREADERMODE, *LPREADERMODE; 02168 02169 #define RDRMODE_VERT 0x00000001 02170 #define RDRMODE_HORZ 0x00000002 02171 #define RDRMODE_DIAG 0x00000004 02172 02173 #define RDRCODE_START 1 02174 #define RDRCODE_SCROLL 2 02175 #define RDRCODE_END 3 02176 02177 typedef struct tagREADERINFO { 02178 READERMODE; 02179 int dx; 02180 int dy; 02181 UINT uCursor; 02182 HBITMAP hbm; 02183 UINT dxBmp; 02184 UINT dyBmp; 02185 } READERINFO, *PREADERINFO; 02186 02187 typedef struct tagREADERWND { 02188 WND wnd; 02189 PREADERINFO prdr; 02190 } READERWND, *PREADERWND; 02191 02192 BOOL EnterReaderModeHelper(HWND hwnd); 02193 02194 #include "ddemlcli.h" 02195 #include "globals.h" 02196 #include "cscall.h" 02197 #include "ntuser.h" 02198 02199 /***************************************************************************\ 02200 * 02201 * DBCS MESSAGING 02202 * 02203 \***************************************************************************/ 02204 /* 02205 * Message keeper for ... 02206 * 02207 * Client to Client. 02208 */ 02209 #define GetDispatchDbcsInfo() (&(GetClientInfo()->achDbcsCF[0])) 02210 /* 02211 * Client to Server. 02212 */ 02213 #define GetForwardDbcsInfo() (&(GetClientInfo()->achDbcsCF[1])) 02214 /* 02215 * Server to Client. 02216 */ 02217 #define GetCallBackDbcsInfo() (&(GetClientInfo()->msgDbcsCB)) 02218 02219 #if 0 02220 /* 02221 * GetThreadCodePage() 02222 */ 02223 #define GetThreadCodePage() (GetClientInfo()->CodePage) 02224 #endif 02225 02226 /* 02227 * Macros for DBCS Messaging for Recieve side. 02228 */ 02229 #define GET_DBCS_MESSAGE_IF_EXIST(_apiName,_pmsg,_wMsgFilterMin,_wMsgFilterMax,bRemoveMsg) \ 02230 \ 02231 if (GetCallBackDbcsInfo()->wParam) { \ 02232 /* \ 02233 * Check message filter... only WM_CHAR message will be pushed \ 02234 * into CLIENTINFO. Then if WM_CHAR is filtered out, we should \ 02235 * get message from queue... \ 02236 */ \ 02237 if ((!(_wMsgFilterMin) && !(_wMsgFilterMax)) || \ 02238 ((_wMsgFilterMin) <= WM_CHAR && (_wMsgFilterMax) >= WM_CHAR)) { \ 02239 PKERNEL_MSG pmsgDbcs = GetCallBackDbcsInfo(); \ 02240 /* \ 02241 * Get pushed message. \ 02242 * \ 02243 * Backup current message. this backupped message will be used \ 02244 * when Apps peek (or get) message from thier WndProc. \ 02245 * (see GetMessageA(), PeekMessageA()...) \ 02246 * \ 02247 * pmsg->hwnd = pmsgDbcs->hwnd; \ 02248 * pmsg->message = pmsgDbcs->message; \ 02249 * pmsg->wParam = pmsgDbcs->wParam; \ 02250 * pmsg->lParam = pmsgDbcs->lParam; \ 02251 * pmsg->time = pmsgDbcs->time; \ 02252 * pmsg->pt = pmsgDbcs->pt; \ 02253 */ \ 02254 COPY_KERNELMSG_TO_MSG((_pmsg),pmsgDbcs); \ 02255 /* \ 02256 * if we don't want to clear the cached data, just leave it there. \ 02257 */ \ 02258 if (bRemoveMsg) { \ 02259 /* \ 02260 * Invalidate pushed message in CLIENTINFO. \ 02261 */ \ 02262 pmsgDbcs->wParam = 0; \ 02263 } \ 02264 /* \ 02265 * Set return value to TRUE. \ 02266 */ \ 02267 retval = TRUE; \ 02268 /* \ 02269 * Exit function.. \ 02270 */ \ 02271 goto Exit ## _apiName; \ 02272 } \ 02273 } 02274 02275 /* 02276 * Macros for DBCS Messaging for Send side. 02277 */ 02278 #define BUILD_DBCS_MESSAGE_TO_SERVER_FROM_CLIENTA(_msg,_wParam,_RetVal) \ 02279 \ 02280 if (IS_DBCS_ENABLED() && (((_msg) == WM_CHAR) || ((_msg) == EM_SETPASSWORDCHAR))) { \ 02281 /* \ 02282 * Chech wParam is DBCS character or not. \ 02283 */ \ 02284 if (IS_DBCS_MESSAGE((_wParam))) { \ 02285 if ((_wParam) & WMCR_IR_DBCSCHAR) { \ 02286 /* \ 02287 * This message sent with IR_DBCSCHAR, already aligned for conversion \ 02288 */ \ 02289 } else { \ 02290 /* \ 02291 * Make IR_DBCSCHAR compatible DBCS packed message \ 02292 */ \ 02293 (_wParam) = MAKEWPARAM(MAKE_IR_DBCSCHAR(LOWORD((_wParam))),0); \ 02294 } \ 02295 } else { \ 02296 PBYTE pchDbcsCF = GetForwardDbcsInfo(); \ 02297 /* \ 02298 * If we have cached Dbcs LeadingByte character, build A Dbcs character \ 02299 * with the TrailingByte in wParam... \ 02300 */ \ 02301 if (*pchDbcsCF) { \ 02302 WORD DbcsLeadChar = (WORD)(*pchDbcsCF); \ 02303 /* \ 02304 * HIBYTE(LOWORD(wParam)) = Dbcs LeadingByte. \ 02305 * LOBYTE(LOWORD(wParam)) = Dbcs TrailingByte. \ 02306 */ \ 02307 (_wParam) |= (DbcsLeadChar << 8); \ 02308 /* \ 02309 * Invalidate cached data.. \ 02310 */ \ 02311 *pchDbcsCF = 0; \ 02312 } else if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),LOBYTE(LOWORD(_wParam)))) { \ 02313 /* \ 02314 * if this is Dbcs LeadByte character, we should wait Dbcs TrailingByte \ 02315 * to convert this to Unicode. then we cached it here... \ 02316 */ \ 02317 *pchDbcsCF = LOBYTE(LOWORD((_wParam))); \ 02318 /* \ 02319 * Right now, we have nothing to do for this, just return with TRUE. \ 02320 */ \ 02321 return((_RetVal)); \ 02322 } \ 02323 } \ 02324 } 02325 02326 #define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_CLIENTA(_msg,_wParam,_RetVal) \ 02327 \ 02328 if (IS_DBCS_ENABLED() && (((_msg) == WM_CHAR) || ((_msg) == EM_SETPASSWORDCHAR))) { \ 02329 /* \ 02330 * Check wParam is DBCS character or not. \ 02331 */ \ 02332 if (IS_DBCS_MESSAGE((_wParam))) { \ 02333 if ((_wParam) & WMCR_IR_DBCSCHAR) { \ 02334 /* \ 02335 * This message sent with IR_DBCSCHAR, already aligned for conversion \ 02336 */ \ 02337 } else { \ 02338 /* \ 02339 * Make IR_DBCSCHAR compatible DBCS packed message \ 02340 */ \ 02341 (_wParam) = MAKEWPARAM(MAKE_IR_DBCSCHAR(LOWORD((_wParam))),0); \ 02342 } \ 02343 } else { \ 02344 PBYTE pchDbcsCF = GetDispatchDbcsInfo(); \ 02345 /* \ 02346 * If we have cached Dbcs LeadingByte character, build A Dbcs character \ 02347 * with the TrailingByte in wParam... \ 02348 */ \ 02349 if (*pchDbcsCF) { \ 02350 WORD DbcsLeadChar = (WORD)(*pchDbcsCF); \ 02351 /* \ 02352 * HIBYTE(LOWORD(wParam)) = Dbcs LeadingByte. \ 02353 * LOBYTE(LOWORD(wParam)) = Dbcs TrailingByte. \ 02354 */ \ 02355 (_wParam) |= (DbcsLeadChar << 8); \ 02356 /* \ 02357 * Invalidate cached data.. \ 02358 */ \ 02359 *pchDbcsCF = 0; \ 02360 } else if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),LOBYTE(LOWORD(_wParam)))) { \ 02361 /* \ 02362 * if this is Dbcs LeadByte character, we should wait Dbcs TrailingByte \ 02363 * to convert this to Unicode. then we cached it here... \ 02364 */ \ 02365 *pchDbcsCF = LOBYTE(LOWORD((_wParam))); \ 02366 /* \ 02367 * Right now, we have nothing to do for this, just return with TRUE. \ 02368 */ \ 02369 return((_RetVal)); \ 02370 } \ 02371 } \ 02372 } 02373 02374 #define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER(_pmsg,_dwAnsi,_bIrDbcsFormat,bSaveMsg) \ 02375 /* \ 02376 * _bIrDbcsFormat parameter is only effective WM_CHAR/EM_SETPASSWORDCHAR message \ 02377 * \ 02378 * (_bIrDbcsFormat == FALSE) dwAnsi has .... \ 02379 * \ 02380 * HIBYTE(LOWORD(_dwAnsi)) = DBCS TrailingByte character. \ 02381 * LOBYTE(LOWORD(_dwAnsi)) = DBCS LeadingByte character \ 02382 * or SBCS character. \ 02383 * \ 02384 * (_bIrDbcsFormat == TRUE) dwAnsi has .... \ 02385 * \ 02386 * HIBYTE(LOWORD(_dwAnsi)) = DBCS LeadingByte character. \ 02387 * LOBYTE(LOWORD(_dwAnsi)) = DBCS TrailingByte character \ 02388 * or SBCS character. \ 02389 */ \ 02390 if (IS_DBCS_ENABLED()) \ 02391 switch ((_pmsg)->message) { \ 02392 case WM_CHAR: \ 02393 case EM_SETPASSWORDCHAR: \ 02394 if (IS_DBCS_MESSAGE((_dwAnsi))) { \ 02395 /* \ 02396 * This is DBCS character.. \ 02397 */ \ 02398 if ((_pmsg)->wParam & WMCR_IR_DBCSCHAR) { \ 02399 /* \ 02400 * Build IR_DBCSCHAR format message. \ 02401 */ \ 02402 if ((_bIrDbcsFormat)) { \ 02403 (_pmsg)->wParam = (WPARAM)(LOWORD((_dwAnsi))); \ 02404 } else { \ 02405 (_pmsg)->wParam = MAKE_IR_DBCSCHAR(LOWORD((_dwAnsi))); \ 02406 } \ 02407 } else { \ 02408 PKERNEL_MSG pDbcsMsg = GetCallBackDbcsInfo(); \ 02409 if ((_bIrDbcsFormat)) { \ 02410 /* \ 02411 * if the format is IR_DBCSCHAR format, adjust it to regular \ 02412 * WPARAM format... \ 02413 */ \ 02414 (_dwAnsi) = MAKE_WPARAM_DBCSCHAR((_dwAnsi)); \ 02415 } \ 02416 if ((bSaveMsg)) { \ 02417 /* \ 02418 * Copy this message to CLIENTINFO for next GetMessage \ 02419 * or PeekMesssage() call. \ 02420 */ \ 02421 COPY_MSG_TO_KERNELMSG(pDbcsMsg,(_pmsg)); \ 02422 /* \ 02423 * Only Dbcs Trailingbyte is nessesary for pushed message. we'll \ 02424 * pass this message when GetMessage/PeekMessage is called at next. \ 02425 */ \ 02426 pDbcsMsg->wParam = (WPARAM)(((_dwAnsi) & 0x0000FF00) >> 8); \ 02427 } \ 02428 /* \ 02429 * Return DbcsLeading byte to Apps. \ 02430 */ \ 02431 (_pmsg)->wParam = (WPARAM)((_dwAnsi) & 0x000000FF); \ 02432 } \ 02433 } else { \ 02434 /* \ 02435 * This is single byte character... set it to wParam. \ 02436 */ \ 02437 (_pmsg)->wParam = (WPARAM)((_dwAnsi) & 0x000000FF); \ 02438 } \ 02439 break; \ 02440 case WM_IME_CHAR: \ 02441 case WM_IME_COMPOSITION: \ 02442 /* \ 02443 * if the message is not adjusted to IR_DBCSCHAR format yet, \ 02444 * Build WM_IME_xxx format message. \ 02445 */ \ 02446 if (!(_bIrDbcsFormat)) { \ 02447 (_pmsg)->wParam = MAKE_IR_DBCSCHAR(LOWORD((_dwAnsi))); \ 02448 } \ 02449 break; \ 02450 default: \ 02451 (_pmsg)->wParam = (WPARAM)(_dwAnsi); \ 02452 break; \ 02453 } /* switch */ \ 02454 else \ 02455 02456 #define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_SERVER(_msg,_wParam) \ 02457 \ 02458 if (((_msg) == WM_CHAR) || ((_msg) == EM_SETPASSWORDCHAR)) { \ 02459 /* \ 02460 * Only LOWORD of WPARAM is valid for WM_CHAR.... \ 02461 * (Mask off DBCS messaging information.) \ 02462 */ \ 02463 (_wParam) &= 0x0000FFFF; \ 02464 } 02465 02466 #define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_CLIENTW(_hwnd,_msg,_wParam,_lParam,_time,_pt,_bDbcs) \ 02467 \ 02468 if (IS_DBCS_ENABLED() && (((_msg) == WM_CHAR) || ((_msg) == EM_SETPASSWORDCHAR))) { \ 02469 /* \ 02470 * Check this message is DBCS Message or not.. \ 02471 */ \ 02472 if (IS_DBCS_MESSAGE((_wParam))) { \ 02473 PKERNEL_MSG pmsgDbcsCB = GetCallBackDbcsInfo(); \ 02474 /* \ 02475 * Mark this is DBCS character. \ 02476 */ \ 02477 (_bDbcs) = TRUE; \ 02478 /* \ 02479 * Backup current message. this backupped message will be used \ 02480 * when Apps peek (or get) message from thier WndProc. \ 02481 * (see GetMessageA(), PeekMessageA()...) \ 02482 */ \ 02483 pmsgDbcsCB->hwnd = (_hwnd); \ 02484 pmsgDbcsCB->message = (_msg); \ 02485 pmsgDbcsCB->lParam = (_lParam); \ 02486 pmsgDbcsCB->time = (_time); \ 02487 pmsgDbcsCB->pt = (_pt); \ 02488 /* \ 02489 * DbcsLeadByte will be sent below soon, we just need DbcsTrailByte \ 02490 * for further usage.. \ 02491 */ \ 02492 pmsgDbcsCB->wParam = ((_wParam) & 0x000000FF); \ 02493 /* \ 02494 * Pass the LeadingByte of the DBCS character to an ANSI WndProc. \ 02495 */ \ 02496 (_wParam) = ((_wParam) & 0x0000FF00) >> 8; \ 02497 } else { \ 02498 /* \ 02499 * Validate only BYTE for WM_CHAR. \ 02500 */ \ 02501 (_wParam) &= 0x000000FF; \ 02502 } \ 02503 } 02504 02505 #define DISPATCH_DBCS_MESSAGE_IF_EXIST(_msg,_wParam,_bDbcs,_apiName) \ 02506 /* \ 02507 * Check we need to send trailing byte or not, if the wParam has Dbcs character \ 02508 */ \ 02509 if (IS_DBCS_ENABLED() && (_bDbcs) && (GetCallBackDbcsInfo()->wParam)) { \ 02510 PKERNEL_MSG pmsgDbcsCB = GetCallBackDbcsInfo(); \ 02511 /* \ 02512 * If an app didn't peek (or get) the trailing byte from within \ 02513 * WndProc, and then pass the DBCS TrailingByte to the ANSI WndProc here \ 02514 * pmsgDbcsCB->wParam has DBCS TrailingByte here.. see above.. \ 02515 */ \ 02516 (_wParam) = KERNEL_WPARAM_TO_WPARAM(pmsgDbcsCB->wParam); \ 02517 /* \ 02518 * Invalidate cached message. \ 02519 */ \ 02520 pmsgDbcsCB->wParam = 0; \ 02521 /* \ 02522 * Send it.... \ 02523 */ \ 02524 goto _apiName ## Again; \ 02525 } 02526 02527 #define CalcAnsiStringLengthW(_unicodestring,_unicodeLength,_ansiLength) \ 02528 /* \ 02529 * Get AnsiStringLength from UnicodeString,UnicodeLength \ 02530 */ \ 02531 { \ 02532 RtlUnicodeToMultiByteSize((ULONG *)(_ansiLength), \ 02533 (LPWSTR)(_unicodestring), \ 02534 (ULONG)((_unicodeLength)*sizeof(WCHAR))); \ 02535 } 02536 02537 #define CalcAnsiStringLengthA(_ansistring,_unicodeLength,_ansiLength) \ 02538 /* \ 02539 * Get AnsiStringLength from AnsiString,UnicodeLength \ 02540 */ \ 02541 { \ 02542 LPSTR _string = (_ansistring); \ 02543 LONG _length = (LONG)(_unicodeLength); \ 02544 (*(_ansiLength)) = 0; \ 02545 while(*_string && _length) { \ 02546 if(IsDBCSLeadByte(*_string)) { \ 02547 (*(_ansiLength)) += 2; _string++; \ 02548 } else { \ 02549 (*(_ansiLength))++; \ 02550 } \ 02551 _string++; _length--; \ 02552 } \ 02553 } 02554 02555 #define CalcUnicodeStringLengthA(_ansistring,_ansiLength,_unicodeLength) \ 02556 /* \ 02557 * Get UnicodeLength from AnsiString,AnsiLength \ 02558 */ \ 02559 { \ 02560 RtlMultiByteToUnicodeSize((ULONG *)(_unicodeLength), \ 02561 (LPSTR)(_ansistring), \ 02562 (ULONG)(_ansiLength)); \ 02563 (*(_unicodeLength)) /= sizeof(WCHAR); \ 02564 } 02565 02566 #define CalcUnicodeStringLengthW(_unicodestring,_ansiLength,_unicodeLength) \ 02567 /* \ 02568 * Get UnicodeLength from UnicodeString,AnsiLength \ 02569 */ \ 02570 { \ 02571 LPWSTR _string = (_unicodestring); \ 02572 LONG _length = (LONG)(_ansiLength); \ 02573 LONG _charlength; \ 02574 (*(_unicodeLength)) = 0; \ 02575 while(*_string && (_length > 0)) { \ 02576 CalcAnsiStringLengthW(_string,1,&_charlength); \ 02577 _length -= _charlength; \ 02578 if(_length >= 0) { \ 02579 (*(_unicodeLength))++; \ 02580 } \ 02581 _string++; \ 02582 } \ 02583 } 02584 02585 02586 /* 02587 * DBCS function defined in userrtl.lib (see ..\rtl\userrtl.h) 02588 */ 02589 DWORD UserGetCodePage(HDC hdc); 02590 BOOL UserIsFullWidth(DWORD dwCodePage,WCHAR wChar); 02591 BOOL UserIsFELineBreak(DWORD dwCodePage,WCHAR wChar); 02592 02593 02594 // FE_IME // fareast.c 02595 typedef struct { 02596 BOOL (WINAPI* ImmWINNLSEnableIME)(HWND, BOOL); 02597 BOOL (WINAPI* ImmWINNLSGetEnableStatus)(HWND); 02598 LRESULT (WINAPI* ImmSendIMEMessageExW)(HWND, LPARAM); 02599 LRESULT (WINAPI* ImmSendIMEMessageExA)(HWND, LPARAM); 02600 BOOL (WINAPI* ImmIMPGetIMEW)(HWND, LPIMEPROW); 02601 BOOL (WINAPI* ImmIMPGetIMEA)(HWND, LPIMEPROA); 02602 BOOL (WINAPI* ImmIMPQueryIMEW)(LPIMEPROW); 02603 BOOL (WINAPI* ImmIMPQueryIMEA)(LPIMEPROA); 02604 BOOL (WINAPI* ImmIMPSetIMEW)(HWND, LPIMEPROW); 02605 BOOL (WINAPI* ImmIMPSetIMEA)(HWND, LPIMEPROA); 02606 02607 HIMC (WINAPI* ImmAssociateContext)(HWND, HIMC); 02608 LRESULT (WINAPI* ImmEscapeA)(HKL, HIMC, UINT, LPVOID); 02609 LRESULT (WINAPI* ImmEscapeW)(HKL, HIMC, UINT, LPVOID); 02610 LONG (WINAPI* ImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD); 02611 LONG (WINAPI* ImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD); 02612 BOOL (WINAPI* ImmGetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); 02613 HIMC (WINAPI* ImmGetContext)(HWND); 02614 HWND (WINAPI* ImmGetDefaultIMEWnd)(HWND); 02615 BOOL (WINAPI* ImmIsIME)(HKL); 02616 BOOL (WINAPI* ImmReleaseContext)(HWND, HIMC); 02617 BOOL (*ImmRegisterClient)(PSHAREDINFO, HINSTANCE); 02618 02619 BOOL (WINAPI* ImmGetCompositionFontW)(HIMC, LPLOGFONTW); 02620 BOOL (WINAPI* ImmGetCompositionFontA)(HIMC, LPLOGFONTA); 02621 BOOL (WINAPI* ImmSetCompositionFontW)(HIMC, LPLOGFONTW); 02622 BOOL (WINAPI* ImmSetCompositionFontA)(HIMC, LPLOGFONTA); 02623 02624 BOOL (WINAPI* ImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM); 02625 BOOL (WINAPI* ImmNotifyIME)(HIMC, DWORD, DWORD, DWORD); 02626 PINPUTCONTEXT (WINAPI* ImmLockIMC)(HIMC); 02627 BOOL (WINAPI* ImmUnlockIMC)(HIMC); 02628 BOOL (WINAPI* ImmLoadIME)(HKL); 02629 BOOL (WINAPI* ImmSetOpenStatus)(HIMC, BOOL); 02630 BOOL (WINAPI* ImmFreeLayout)(DWORD); 02631 BOOL (WINAPI* ImmActivateLayout)(HKL); 02632 BOOL (WINAPI* ImmSetCandidateWindow)(HIMC, LPCANDIDATEFORM); 02633 BOOL (WINAPI* ImmConfigureIMEW)(HKL, HWND, DWORD, LPVOID); 02634 BOOL (WINAPI* ImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD); 02635 BOOL (WINAPI* ImmSetConversionStatus)(HIMC, DWORD, DWORD); 02636 BOOL (WINAPI* ImmSetStatusWindowPos)(HIMC, LPPOINT); 02637 BOOL (WINAPI* ImmGetImeInfoEx)(PIMEINFOEX, IMEINFOEXCLASS, PVOID); 02638 PIMEDPI (WINAPI* ImmLockImeDpi)(HKL); 02639 VOID (WINAPI* ImmUnlockImeDpi)(PIMEDPI); 02640 BOOL (WINAPI* ImmGetOpenStatus)(HIMC); 02641 BOOL (*ImmSetActiveContext)(HWND, HIMC, BOOL); 02642 BOOL (*ImmTranslateMessage)(HWND, UINT, WPARAM, LPARAM); 02643 BOOL (*ImmLoadLayout)(HKL, PIMEINFOEX); 02644 DWORD (WINAPI* ImmProcessKey)(HWND, HKL, UINT, LPARAM, DWORD); 02645 LRESULT (*ImmPutImeMenuItemsIntoMappedFile)(HIMC); 02646 DWORD (WINAPI* ImmGetProperty)(HKL hKL, DWORD dwIndex); 02647 BOOL (WINAPI* ImmSetCompositionStringA)( 02648 HIMC hImc, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen); 02649 BOOL (WINAPI* ImmSetCompositionStringW)( 02650 HIMC hImc, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen); 02651 BOOL (WINAPI* ImmEnumInputContext)( 02652 DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam); 02653 LRESULT (WINAPI* ImmSystemHandler)(HIMC, WPARAM, LPARAM); 02654 } ImmApiEntries; 02655 02656 extern ImmApiEntries gImmApiEntries; 02657 extern HMODULE ghImm32; 02658 VOID InitializeImmEntryTable(VOID); 02659 VOID GetImmFileName(PWSTR); 02660 VOID CliImmInitializeHotKeys(DWORD dwAction, HKL hkl); 02661 02662 #define fpImmAssociateContext gImmApiEntries.ImmAssociateContext 02663 #define fpImmEscapeA gImmApiEntries.ImmEscapeA 02664 #define fpImmEscapeW gImmApiEntries.ImmEscapeW 02665 #define fpImmGetContext gImmApiEntries.ImmGetContext 02666 #define fpImmGetCompositionStringA gImmApiEntries.ImmGetCompositionStringA 02667 #define fpImmGetCompositionStringW gImmApiEntries.ImmGetCompositionStringW 02668 #define fpImmGetCompositionWindow gImmApiEntries.ImmGetCompositionWindow 02669 #define fpImmGetDefaultIMEWnd gImmApiEntries.ImmGetDefaultIMEWnd 02670 #define fpImmIsIME gImmApiEntries.ImmIsIME 02671 #define fpImmLockIMC gImmApiEntries.ImmLockIMC 02672 #define fpImmReleaseContext gImmApiEntries.ImmReleaseContext 02673 #define fpImmRegisterClient gImmApiEntries.ImmRegisterClient 02674 #define fpImmGetCompositionFontW gImmApiEntries.ImmGetCompositionFontW 02675 #define fpImmGetCompositionFontA gImmApiEntries.ImmGetCompositionFontA 02676 #define fpImmSetCompositionFontW gImmApiEntries.ImmSetCompositionFontW 02677 #define fpImmSetCompositionFontA gImmApiEntries.ImmSetCompositionFontA 02678 #define fpImmSetCompositionFont gImmApiEntries.ImmSetCompositionFont 02679 #define fpImmSetCompositionWindow gImmApiEntries.ImmSetCompositionWindow 02680 #define fpImmNotifyIME gImmApiEntries.ImmNotifyIME 02681 #define fpImmUnlockIMC gImmApiEntries.ImmUnlockIMC 02682 #define fpImmLoadIME gImmApiEntries.ImmLoadIME 02683 #define fpImmSetOpenStatus gImmApiEntries.ImmSetOpenStatus 02684 #define fpImmFreeLayout gImmApiEntries.ImmFreeLayout 02685 #define fpImmActivateLayout gImmApiEntries.ImmActivateLayout 02686 #define fpImmSetCandidateWindow gImmApiEntries.ImmSetCandidateWindow 02687 #define fpImmConfigureIMEW gImmApiEntries.ImmConfigureIMEW 02688 #define fpImmGetConversionStatus gImmApiEntries.ImmGetConversionStatus 02689 #define fpImmSetConversionStatus gImmApiEntries.ImmSetConversionStatus 02690 #define fpImmSetStatusWindowPos gImmApiEntries.ImmSetStatusWindowPos 02691 #define fpImmGetImeInfoEx gImmApiEntries.ImmGetImeInfoEx 02692 #define fpImmLockImeDpi gImmApiEntries.ImmLockImeDpi 02693 #define fpImmUnlockImeDpi gImmApiEntries.ImmUnlockImeDpi 02694 #define fpImmGetOpenStatus gImmApiEntries.ImmGetOpenStatus 02695 #define fpImmSetActiveContext gImmApiEntries.ImmSetActiveContext 02696 #define fpImmTranslateMessage gImmApiEntries.ImmTranslateMessage 02697 #define fpImmLoadLayout gImmApiEntries.ImmLoadLayout 02698 #define fpImmProcessKey gImmApiEntries.ImmProcessKey 02699 #define fpImmPutImeMenuItemsIntoMappedFile gImmApiEntries.ImmPutImeMenuItemsIntoMappedFile 02700 #define fpImmGetProperty gImmApiEntries.ImmGetProperty 02701 #define fpImmSetCompositionStringA gImmApiEntries.ImmSetCompositionStringA 02702 #define fpImmSetCompositionStringW gImmApiEntries.ImmSetCompositionStringW 02703 #define fpImmEnumInputContext gImmApiEntries.ImmEnumInputContext 02704 #define fpImmSystemHandler gImmApiEntries.ImmSystemHandler 02705 02706 BOOL SyncSoftKbdState(HIMC hImc, LPARAM lParam); // imectl.c 02707 02708 // end FE_IME 02709 02710 /* 02711 * Rebasing functions for shared memory. Need to located after 02712 * inclusion of globals.h. 02713 */ 02714 __inline PVOID 02715 REBASESHAREDPTRALWAYS(KERNEL_PVOID p) 02716 { 02717 return (PVOID)(((KERNEL_UINT_PTR)p) - gSharedInfo.ulSharedDelta); 02718 } 02719 02720 __inline PVOID 02721 REBASESHAREDPTR(KERNEL_PVOID p) 02722 { 02723 return (p) ? REBASESHAREDPTRALWAYS(p) : NULL; 02724 } 02725 02726 /* 02727 * Multimonitor macros used in RTL. There are similar definitions 02728 * in kernel\userk.h 02729 */ 02730 __inline PDISPLAYINFO 02731 GetDispInfo(void) 02732 { 02733 return gSharedInfo.pDispInfo; 02734 } 02735 02736 __inline PMONITOR 02737 GetPrimaryMonitor(void) 02738 { 02739 return REBASESHAREDPTR(GetDispInfo()->pMonitorPrimary); 02740 } 02741 02742 02743 #endif // !_USERCLI_

Generated on Sat May 15 19:42:13 2004 for test by doxygen 1.3.7