00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
00046
00047
00048 typedef LRESULT (APIENTRY *CFNSCSENDMESSAGE)(HWND,
UINT, WPARAM, LPARAM,
00049 ULONG_PTR,
DWORD,
BOOL);
00050
00051
00052
00053
00054
00055
00056
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
00077
00078
00079
00080
00081
00082
00083
00084
00085
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
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
00139
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
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
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 typedef int (WINAPI *
GENERICPROC)();
00175
00176 #define CALLPROC(p) ((GENERICPROC)p)
00177
00178
00179
00180
00181
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
00202
00203
00204
00205
00206
00207
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
00223
00224
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
00267
00268
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
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
00311
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
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
00350
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
00379
00380
00381
00382
00383
00384
00385
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
00402
00403 #define DBT_TEXT 0x0001
00404 #define DBT_FOCUS 0x0002
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416 #define CBLISTBOXID 1000
00417 #define CBEDITID 1001
00418 #define CBBUTTONID 1002
00419
00420
00421
00422
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
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
00446
00447
00448 #define LBS_COMBOBOX 0x8000L
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 #define COMBOBOXSTYLE(style) ((LOBYTE(style)) & 3)
00459
00460 #define IsComboVisible(pcbox) (!pcbox->fNoRedraw && IsVisible(pcbox->spwnd))
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478 #define CBEDITEXTRA 6
00479
00480
00481
00482
00483
00484 #define CCHALLOCEXTRA 0x20
00485
00486
00487
00488 #define MAXPIXELWIDTH 30000
00489
00490 #define MAXCLIPENDPOS 32764
00491
00492
00493
00494
00495
00496 #define MAXLINELENGTH 1024
00497
00498
00499
00500
00501
00502
00503 #define MAXTEXT 30000
00504
00505
00506
00507
00508
00509 #define NONEDOWN 0
00510 #define CTRLDOWN 1
00511 #define SHFTDOWN 2
00512 #define SHCTDOWN 3
00513 #define NOMODIFY 4
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
00523
00524 #define UNDO_NONE 0
00525 #define UNDO_INSERT 1
00526 #define UNDO_DELETE 2
00527
00528 typedef struct tagUNDO {
00529 UINT undoType;
00530 PBYTE hDeletedText;
00531
00532
00533 ICH ichDeleted;
00534 ICH cchDeleted;
00535 ICH ichInsStart;
00536
00537 ICH ichInsEnd;
00538 }
UNDO, *
PUNDO;
00539
00540 #define Pundo(ped) ((PUNDO)&(ped)->undoType)
00541
00542
00543
00544
00545
00546
00547
00548
00549 #define CHAR_WIDTH_BUFFER_LENGTH 128
00550
00551 typedef struct tagED {
00552 HANDLE
hText;
00553 ICH cchAlloc;
00554
00555 ICH cchTextMax;
00556
00557 ICH cch;
00558
00559 ICH cLines;
00560
00561 ICH ichMinSel;
00562
00563 ICH ichMaxSel;
00564 ICH ichCaret;
00565
00566 ICH iCaretLine;
00567
00568
00569
00570 ICH ichScreenStart;
00571
00572
00573
00574 ICH ichLinesOnScreen;
00575 UINT xOffset;
00576
00577
00578 UINT charPasswordChar;
00579
00580
00581
00582 int cPasswordCharWidth;
00583
00584 HWND
hwnd;
00585 PWND pwnd;
00586 RECT
rcFmt;
00587 HWND
hwndParent;
00588
00589
00590
00591
00592
00593 POINT
ptPrevMouse;
00594
00595
00596 UINT prevKeys;
00597
00598
00599 UINT fSingle : 1;
00600 UINT fNoRedraw : 1;
00601 UINT fMouseDown : 1;
00602 UINT fFocus : 1;
00603 UINT fDirty : 1;
00604 UINT fDisabled : 1;
00605 UINT fNonPropFont : 1;
00606 UINT fNonPropDBCS : 1;
00607 UINT fBorder : 1;
00608 UINT fAutoVScroll : 1;
00609 UINT fAutoHScroll : 1;
00610 UINT fNoHideSel : 1;
00611 UINT fDBCS : 1;
00612 UINT fFmtLines : 1;
00613
00614
00615 UINT fWrap : 1;
00616 UINT fCalcLines : 1;
00617
00618
00619 UINT fEatNextChar : 1;
00620
00621
00622
00623
00624 UINT fStripCRCRLF : 1;
00625
00626
00627
00628 UINT fInDialogBox : 1;
00629
00630
00631
00632 UINT fReadOnly : 1;
00633
00634
00635 UINT fCaretHidden : 1;
00636
00637
00638
00639 UINT fTrueType : 1;
00640 UINT fAnsi : 1;
00641 UINT fWin31Compat : 1;
00642 UINT f40Compat : 1;
00643 UINT fFlatBorder : 1;
00644 UINT fSawRButtonDown : 1;
00645 UINT fInitialized : 1;
00646 UINT fSwapRoOnUp : 1;
00647 UINT fAllowRTL : 1;
00648 UINT fDisplayCtrl : 1;
00649 UINT fRtoLReading : 1;
00650
00651 BOOL fInsertCompChr :1;
00652 BOOL fReplaceCompChr :1;
00653 BOOL fNoMoveCaret :1;
00654 BOOL fResultProcess :1;
00655 BOOL fKorea :1;
00656 BOOL fInReconversion :1;
00657 BOOL fLShift :1;
00658
00659 WORD
wImeStatus;
00660
00661 WORD
cbChar;
00662 LPICH chLines;
00663
00664 UINT format;
00665
00666
00667 EDITWORDBREAKPROCA
lpfnNextWord;
00668
00669
00670 int maxPixelWidth;
00671
00672 UNDO;
00673
00674 HANDLE
hFont;
00675
00676
00677 int aveCharWidth;
00678 int lineHeight;
00679 int charOverhang;
00680 int cxSysCharWidth;
00681 int cySysCharHeight;
00682 HWND
listboxHwnd;
00683
00684 LPINT
pTabStops;
00685
00686
00687
00688 LPINT
charWidthBuffer;
00689 BYTE charSet;
00690
00691
00692 UINT wMaxNegA;
00693 UINT wMaxNegAcharPos;
00694 UINT wMaxNegC;
00695 UINT wMaxNegCcharPos;
00696 UINT wLeftMargin;
00697 UINT wRightMargin;
00698
00699 ICH ichStartMinSel;
00700 ICH ichStartMaxSel;
00701
00702 PLPKEDITCALLOUT pLpkEditCallout;
00703 HBITMAP
hCaretBitmap;
00704 INT iCaretOffset;
00705
00706 HANDLE
hInstance;
00707 UCHAR
seed;
00708 BOOLEAN
fEncoded;
00709 int iLockLevel;
00710
00711 BYTE DBCSVector[8];
00712 HIMC
hImcPrev;
00713 POINT
ptScreenBounding;
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
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
00752
00753
00754
00755
00756 typedef struct tagBLOCK {
00757 ICH StPos;
00758 ICH EndPos;
00759 }
BLOCK, *
LPBLOCK;
00760
00761
00762
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
00776
00777
00778
00779 #define IsLBoxVisible(plb) (plb->fRedraw && IsVisible(plb->spwnd))
00780
00781
00782
00783
00784
00785 #define CITEMSALLOC 32
00786
00787
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
00801
00802
00803
00804
00805
00806
00807
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
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
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
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
00890
00891
DWORD Event(
PEVENT_PACKET pep);
00892 PVOID
CsValidateInstance(HANDLE hInst);
00893
00894
00895
00896
00897
00898
00899
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
00920
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
01019
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);
01041
BOOL HanjaKeyHandler(PED ped);
01042
01043
void ECInOutReconversionMode(PED ped, BOOL fIn);
01044
01045
01046
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
01135
01136
01137 #define ID_EC_PROPERTY_MENU 1
01138
01139 #define IDD_MDI_ACTIVATE 9
01140
01141
#ifndef _USERK_
01142
01143
01144
01145 #define STR_ERROR 0x00000002L
01146 #define STR_MOREWINDOWS 0x0000000DL
01147 #define STR_NOMEMBITMAP 0x0000000EL
01148
01149
01150
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
01165
01166
01167
01168
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
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
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
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
01324
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
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
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
01474
01475
BOOL BitBltSysBmp(
01476 HDC hdc,
01477
int x,
01478
int y,
01479 UINT i);
01480
01481
01482
01483
01484
01485
DWORD BuildHwndList(
01486 HDESK hdesk,
01487 HWND hwndNext,
01488 BOOL fEnumChildren,
01489 DWORD idThread,
01490 HWND **phwndFirst);
01491
01492
01493
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
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
01542
01543
BOOL FChildVisible(
01544 HWND hwnd);
01545
01546
01547
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
01590
01591
int FindMnemChar(
01592 LPWSTR lpstr,
01593 WCHAR ch,
01594 BOOL fFirst,
01595 BOOL fPrefix);
01596
01597
01598
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
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
01724
01725
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
01735
01736
01737
01738 #define MAX_RESOURCE_INDEX 32768
01739
01740
01741
01742
01743
01744 #define HILITEONLY 0x0001
01745 #define SELONLY 0x0002
01746 #define HILITEANDSEL (HILITEONLY + SELONLY)
01747
01748 #define HILITE 1
01749
01750
01751
01752 #define VERKEY_SLASH 0xBF
01753 #define VERKEY_BACKSLASH 0xDC
01754
01755
01756
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
01769
01770
01771
01772
long CBNcCreateHandler(
PCBOX,
PWND);
01773 LRESULT
xxxCBCreateHandler(
PCBOX,
PWND);
01774
void xxxCBCalcControlRects(
PCBOX pcbox, LPRECT lprcList);
01775
01776
01777
VOID xxxCBNcDestroyHandler(
PWND,
PCBOX);
01778
01779
01780
VOID xxxCBNotifyParent(
PCBOX, SHORT);
01781
VOID xxxCBUpdateListBoxWindow(
PCBOX, BOOL);
01782
01783
01784
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
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
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
01826
01827
void xxxLBSetCaret(
PLBIV plb, BOOL fSetCaret);
01828
VOID xxxCaretDestroy(
PLBIV);
01829
01830
01831
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
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
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
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
01916
01917
INT CItemInWindowVarOwnerDraw(
PLBIV, BOOL);
01918
01919
INT LBPage(
PLBIV, INT, BOOL);
01920
01921
01922
01923
01924
01925
VOID LBCalcItemRowsAndColumns(
PLBIV);
01926
01927
01928
01929
01930
BOOL LBGetItemRect(
PLBIV, INT, LPRECT);
01931
01932
VOID LBSetVariableHeightItemHeight(
PLBIV, INT, INT);
01933
01934
INT LBGetVariableHeightItemHeight(
PLBIV, INT);
01935
01936
01937
01938
01939
INT xxxLBSetCount(
PLBIV, INT);
01940
01941
UINT LBCalcAllocNeeded(
PLBIV, INT);
01942
01943
01944
01945
01946 LONG
xxxLBInitStorage(
PLBIV plb, BOOL fAnsi, INT cItems, INT cb);
01947
01948
01949
01950
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
01985
01986
01987
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
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
02001
BOOL ThunkedMenuItemInfo(HMENU hMenu, UINT nPosition, BOOL fByPosition,
02002 BOOL fInsert, LPMENUITEMINFOW lpmii, BOOL fAnsi);
02003
02004
02005
void SetMenuItemInfoStruct(HMENU hMenu, UINT wFlags, UINT_PTR wIDNew, LPWSTR pwszNew,
02006 LPMENUITEMINFOW pmii);
02007
02008
02009
02010
02011
02012
02013
02014
02015 #define WINDOWLIST_PROP_NAME TEXT("SysBW")
02016 #define MSGBOX_CALLBACK TEXT("SysMB")
02017
02018
02019 #define UNICODE_RLM 0x200f
02020
02021
02022
02023
02024
02025
02026
02027
02028 #define MAXITEMS 10
02029
02030
02031
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
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
02089
02090 #define COM_NO_WINDOWS_H
02091 #define RPC_NO_WINDOWS_H
02092
#include <ole2.h>
02093
02094
02095
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
02105
02106 typedef struct tagMNIDROPTARGET
02107 {
02108 IDropTarget
idt;
02109 DWORD dwRefCount;
02110 IDataObject *
pido;
02111 IDropTarget *
pidt;
02112 }
MNIDROPTARGET, *
PMNIDROPTARGET;
02113
02114
02115
02116
02117 typedef struct tagGETPROCINFO
02118 {
02119 FARPROC *
ppfn;
02120 LPCSTR
lpsz;
02121 }
GETPROCINFO;
02122
02123
02124
02125
02126 #define OLEWONTLOAD (HINSTANCE)IntToPtr(0xFFFFFFFF)
02127
02128
02129
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
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
02159
02160 typedef LONG (CALLBACK* READERMODEPROC)(LPARAM lParam,
int nCode,
int dx,
int dy);
02161
02162 typedef struct tagREADERMODE {
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
02202
02203
02204
02205
02206
02207
02208
02209 #define GetDispatchDbcsInfo() (&(GetClientInfo()->achDbcsCF[0]))
02210
02211
02212
02213 #define GetForwardDbcsInfo() (&(GetClientInfo()->achDbcsCF[1]))
02214
02215
02216
02217 #define GetCallBackDbcsInfo() (&(GetClientInfo()->msgDbcsCB))
02218
02219
#if 0
02220
02221
02222
02223
#define GetThreadCodePage() (GetClientInfo()->CodePage)
02224
#endif
02225
02226
02227
02228
02229 #define GET_DBCS_MESSAGE_IF_EXIST(_apiName,_pmsg,_wMsgFilterMin,_wMsgFilterMax,bRemoveMsg) \
02230
\
02231
if (GetCallBackDbcsInfo()->wParam) { \
02232
02233
02234
02235
02236 \
02237 if ((!(_wMsgFilterMin) && !(_wMsgFilterMax)) || \
02238 ((_wMsgFilterMin) <= WM_CHAR && (_wMsgFilterMax) >= WM_CHAR)) { \
02239 PKERNEL_MSG pmsgDbcs = GetCallBackDbcsInfo(); \
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253 \
02254 COPY_KERNELMSG_TO_MSG((_pmsg),pmsgDbcs); \
02255
02256
02257 \
02258 if (bRemoveMsg) { \
02259
02260
02261 \
02262 pmsgDbcs->wParam = 0; \
02263 } \
02264
02265
02266 \
02267 retval = TRUE; \
02268
02269
02270 \
02271 goto Exit ## _apiName; \
02272 } \
02273 }
02274
02275
02276
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
02283 \
02284 if (IS_DBCS_MESSAGE((_wParam))) { \
02285 if ((_wParam) & WMCR_IR_DBCSCHAR) { \
02286
02287
02288 \
02289 } else { \
02290
02291
02292 \
02293 (_wParam) = MAKEWPARAM(MAKE_IR_DBCSCHAR(LOWORD((_wParam))),0); \
02294 } \
02295 } else { \
02296 PBYTE pchDbcsCF = GetForwardDbcsInfo(); \
02297
02298
02299
02300 \
02301 if (*pchDbcsCF) { \
02302 WORD DbcsLeadChar = (WORD)(*pchDbcsCF); \
02303
02304
02305
02306 \
02307 (_wParam) |= (DbcsLeadChar << 8); \
02308
02309
02310 \
02311 *pchDbcsCF = 0; \
02312 } else if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),LOBYTE(LOWORD(_wParam)))) { \
02313
02314
02315
02316 \
02317 *pchDbcsCF = LOBYTE(LOWORD((_wParam))); \
02318
02319
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
02331 \
02332 if (IS_DBCS_MESSAGE((_wParam))) { \
02333 if ((_wParam) & WMCR_IR_DBCSCHAR) { \
02334
02335
02336 \
02337 } else { \
02338
02339
02340 \
02341 (_wParam) = MAKEWPARAM(MAKE_IR_DBCSCHAR(LOWORD((_wParam))),0); \
02342 } \
02343 } else { \
02344 PBYTE pchDbcsCF = GetDispatchDbcsInfo(); \
02345
02346
02347
02348 \
02349 if (*pchDbcsCF) { \
02350 WORD DbcsLeadChar = (WORD)(*pchDbcsCF); \
02351
02352
02353
02354 \
02355 (_wParam) |= (DbcsLeadChar << 8); \
02356
02357
02358 \
02359 *pchDbcsCF = 0; \
02360 } else if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),LOBYTE(LOWORD(_wParam)))) { \
02361
02362
02363
02364 \
02365 *pchDbcsCF = LOBYTE(LOWORD((_wParam))); \
02366
02367
02368 \
02369 return((_RetVal)); \
02370 } \
02371 } \
02372 }
02373
02374
#define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER(_pmsg,_dwAnsi,_bIrDbcsFormat,bSaveMsg) \
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
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
02397 \
02398 if ((_pmsg)->wParam & WMCR_IR_DBCSCHAR) { \
02399
02400
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
02412
02413 \
02414 (_dwAnsi) = MAKE_WPARAM_DBCSCHAR((_dwAnsi)); \
02415 } \
02416 if ((bSaveMsg)) { \
02417
02418
02419
02420 \
02421 COPY_MSG_TO_KERNELMSG(pDbcsMsg,(_pmsg)); \
02422
02423
02424
02425 \
02426 pDbcsMsg->wParam = (WPARAM)(((_dwAnsi) & 0x0000FF00) >> 8); \
02427 } \
02428
02429
02430 \
02431 (_pmsg)->wParam = (WPARAM)((_dwAnsi) & 0x000000FF); \
02432 } \
02433 } else { \
02434
02435
02436 \
02437 (_pmsg)->wParam = (WPARAM)((_dwAnsi) & 0x000000FF); \
02438 } \
02439 break; \
02440 case WM_IME_CHAR: \
02441 case WM_IME_COMPOSITION: \
02442
02443
02444
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 } \
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
02461
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
02471 \
02472 if (IS_DBCS_MESSAGE((_wParam))) { \
02473 PKERNEL_MSG pmsgDbcsCB = GetCallBackDbcsInfo(); \
02474
02475
02476 \
02477 (_bDbcs) = TRUE; \
02478
02479
02480
02481
02482 \
02483 pmsgDbcsCB->hwnd = (_hwnd); \
02484 pmsgDbcsCB->message = (_msg); \
02485 pmsgDbcsCB->lParam = (_lParam); \
02486 pmsgDbcsCB->time = (_time); \
02487 pmsgDbcsCB->pt = (_pt); \
02488
02489
02490
02491 \
02492 pmsgDbcsCB->wParam = ((_wParam) & 0x000000FF); \
02493
02494
02495 \
02496 (_wParam) = ((_wParam) & 0x0000FF00) >> 8; \
02497 } else { \
02498
02499
02500 \
02501 (_wParam) &= 0x000000FF; \
02502 } \
02503 }
02504
02505
#define DISPATCH_DBCS_MESSAGE_IF_EXIST(_msg,_wParam,_bDbcs,_apiName) \
02506
02507
02508 \
02509 if (IS_DBCS_ENABLED() && (_bDbcs) && (GetCallBackDbcsInfo()->wParam)) { \
02510 PKERNEL_MSG pmsgDbcsCB = GetCallBackDbcsInfo(); \
02511
02512
02513
02514
02515 \
02516 (_wParam) = KERNEL_WPARAM_TO_WPARAM(pmsgDbcsCB->wParam); \
02517
02518
02519 \
02520 pmsgDbcsCB->wParam = 0; \
02521
02522
02523 \
02524 goto _apiName ## Again; \
02525 }
02526
02527
#define CalcAnsiStringLengthW(_unicodestring,_unicodeLength,_ansiLength) \
02528
02529
02530 \
02531 { \
02532 RtlUnicodeToMultiByteSize((ULONG *)(_ansiLength), \
02533 (LPWSTR)(_unicodestring), \
02534 (ULONG)((_unicodeLength)*sizeof(WCHAR))); \
02535 }
02536
02537 #define CalcAnsiStringLengthA(_ansistring,_unicodeLength,_ansiLength) \
02538
02539
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
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
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
02588
02589
DWORD UserGetCodePage(HDC hdc);
02590
BOOL UserIsFullWidth(DWORD dwCodePage,WCHAR wChar);
02591
BOOL UserIsFELineBreak(DWORD dwCodePage,WCHAR wChar);
02592
02593
02594
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);
02707
02708
02709
02710
02711
02712
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
02728
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_