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

usercli.h File Reference

#include <windows.h>
#include <winnls32.h>
#include <w32gdip.h>
#include <w32err.h>
#include <ddeml.h>
#include "ddemlp.h"
#include "winuserp.h"
#include "w32wow64.h"
#include "winuserk.h"
#include <winnlsp.h>
#include <dde.h>
#include <ddetrack.h>
#include "kbd.h"
#include <wowuserp.h>
#include "immstruc.h"
#include "immuser.h"
#include <winbasep.h>
#include "user.h"
#include "callproc.h"
#include <ole2.h>
#include "ddemlcli.h"
#include "globals.h"
#include "cscall.h"
#include "ntuser.h"

Go to the source code of this file.

Classes

struct  _IN_STRING
struct  _LARGE_IN_STRING
struct  _LOOKASIDE
struct  _TL
struct  tagUNDO
struct  tagED
struct  tagEDITWND
struct  tagBLOCK
struct  STRIPINFO
struct  tagLBItem
struct  tagLBODItem
struct  tagSTAT
struct  tagSTATWND
struct  tagCURSORRESOURCE
struct  _FILEINFO
struct  tagSHORTCREATE
struct  tagMDIACTIVATEPOS
struct  tagMNIDROPTARGET
struct  tagGETPROCINFO
struct  tagACCELCACHE
struct  tagREADERMODE
struct  tagREADERINFO
struct  tagREADERWND
struct  ImmApiEntries

Defines

#define OEMRESOURCE   1
#define USERGLOBALUNLOCK(h)   GlobalUnlock((HANDLE)(h))
#define UserGlobalFree(h)   GlobalFree((HANDLE)(h))
#define UserGlobalAlloc(flags, size)   GlobalAlloc(flags, size)
#define USERGLOBALLOCK(h, p)   p = GlobalLock((HANDLE)(h))
#define UserGlobalReAlloc(pmem, cnt, flags)   GlobalReAlloc(pmem,cnt,flags)
#define UserGlobalSize(pmem)   GlobalSize(pmem)
#define WOWGLOBALFREE(pmem)   GlobalFree(pmem)
#define RESERVED_MSG_BITS   (0xFFFE0000)
#define FDEFWINDOWMSG(msg, procname)
#define FWINDOWMSG(msg, fnid)
#define CsSendMessage(hwnd, msg, wParam, lParam, xParam, pfn, bAnsi)
#define GetWindowProcess(hwnd)   NtUserQueryWindow(hwnd, WindowProcess)
#define GETPROCESSID()   (NtCurrentTeb()->ClientId.UniqueProcess)
#define GETTHREADID()   (NtCurrentTeb()->ClientId.UniqueThread)
#define SAMEWOWHANDLE(h1, h2)   ((BOOL)!(((ULONG_PTR)(h1) ^ (ULONG_PTR)(h2)) & 0xffff))
#define DIFFWOWHANDLE(h1, h2)   (!SAMEWOWHANDLE(h1, h2))
#define CALLPROC(p)   ((GENERICPROC)p)
#define CALLPROC_WOWCHECKPWW_DLG(pfn, hwnd, msg, wParam, lParam, pww)
#define CALLPROC_WOWCHECKPWW(pfn, hwnd, msg, wParam, lParam, pww)
#define CALLPROC_WOWCHECK(pfn, hwnd, msg, wParam, lParam)   CALLPROC_WOWCHECKPWW(pfn, hwnd, msg, wParam, lParam, NULL)
#define RevalidateHwnd(hwnd)   ((PWND)HMValidateHandleNoSecure(hwnd, TYPE_WINDOW))
#define VALIDATEHMENU(hmenu)   ((PMENU)HMValidateHandle(hmenu, TYPE_MENU))
#define VALIDATEHMONITOR(hmonitor)   ((PMONITOR)HMValidateSharedHandle(hmonitor, TYPE_MONITOR))
#define REBASEALWAYS(p, elem)   ((PVOID)((KERNEL_ULONG_PTR)(p) + ((KERNEL_ULONG_PTR)(p)->elem - (KERNEL_ULONG_PTR)(p)->head.pSelf)))
#define REBASEPTR(obj, p)   ((PVOID)((KERNEL_ULONG_PTR)(p) - ((KERNEL_ULONG_PTR)(obj)->head.pSelf - (KERNEL_ULONG_PTR)(obj))))
#define REBASE(p, elem)
#define REBASEPWND(p, elem)   ((PWND)REBASE(p, elem))
#define VALIDATECLASSANDSIZE(pwnd, inFNID)
#define INITCONTROLLOOKASIDE(plaType, type, pwnditem, count)
#define ISREMOTESESSION()   (NtCurrentPeb()->SessionId != 0)
#define SetBestStretchMode(hdc, planes, bpp)   SetStretchBltMode(hdc, (((planes) * (bpp)) == 1 ? BLACKONWHITE : COLORONCOLOR))
#define BitmapSize(cx, cy, planes, bits)   (BitmapWidth(cx, bits) * (cy) * (planes))
#define BitmapWidth(cx, bpp)   (((((cx)*(bpp)) + 31) & ~31) >> 3)
#define RGBX(rgb)   RGB(GetBValue(rgb), GetGValue(rgb), GetRValue(rgb))
#define CheckLock(pobj)
#define ThreadLock(pobj, ptl)   DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
#define ThreadLockAlways(pobj, ptl)   DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
#define ThreadLockWithPti(pti, pobj, ptl)   DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
#define ThreadLockAlwaysWithPti(pti, pobj, ptl)   DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
#define ThreadUnlock(ptl)   (ptl)
#define Lock(ppobj, pobj)   (*ppobj = pobj)
#define Unlock(ppobj)   (*ppobj = NULL)
#define BUTTONSTATE(pbutn)   (pbutn->buttonState)
#define BST_CHECKMASK   0x0003
#define BST_INCLICK   0x0010
#define BST_CAPTURED   0x0020
#define BST_MOUSE   0x0040
#define BST_DONTCLICK   0x0080
#define BST_INBMCLICK   0x0100
#define PBF_PUSHABLE   0x0001
#define PBF_DEFAULT   0x0002
#define DBT_TEXT   0x0001
#define DBT_FOCUS   0x0002
#define CBLISTBOXID   1000
#define CBEDITID   1001
#define CBBUTTONID   1002
#define SDROPPABLE   CBS_DROPDOWN
#define SEDITABLE   CBS_SIMPLE
#define SSIMPLE   SEDITABLE
#define SDROPDOWNLIST   SDROPPABLE
#define SDROPDOWN   (SDROPPABLE | SEDITABLE)
#define OWNERDRAWFIXED   1
#define OWNERDRAWVAR   2
#define UPPERCASE   1
#define LOWERCASE   2
#define CaretCreate(plb)   ((plb)->fCaret = TRUE)
#define LBS_COMBOBOX   0x8000L
#define COMBOBOXSTYLE(style)   ((LOBYTE(style)) & 3)
#define IsComboVisible(pcbox)   (!pcbox->fNoRedraw && IsVisible(pcbox->spwnd))
#define CBEDITEXTRA   6
#define CCHALLOCEXTRA   0x20
#define MAXPIXELWIDTH   30000
#define MAXCLIPENDPOS   32764
#define MAXLINELENGTH   1024
#define MAXTEXT   30000
#define NONEDOWN   0 /* Neither shift nor control down */
#define CTRLDOWN   1 /* Control key only down */
#define SHFTDOWN   2 /* Shift key only down */
#define SHCTDOWN   3 /* Shift and control keys down = CTRLDOWN + SHFTDOWN */
#define NOMODIFY   4 /* Neither shift nor control down */
#define CALLWORDBREAKPROC(proc, pText, iStart, cch, iAction)
#define UNDO_NONE   0 /* We can't undo the last operation. */
#define UNDO_INSERT   1 /* We can undo the user's insertion of characters */
#define UNDO_DELETE   2 /* We can undo the user's deletion of characters */
#define Pundo(ped)   ((PUNDO)&(ped)->undoType)
#define CHAR_WIDTH_BUFFER_LENGTH   128
#define FAREAST_CHARSET_BITS   (FS_JISJAPAN | FS_CHINESESIMP | FS_WANSUNG | FS_CHINESETRAD)
#define ID_CNTX_RTL   0x00008000L
#define ID_CNTX_DISPLAYCTRL   0x00008001L
#define ID_CNTX_INSERTCTRL   0x00008013L
#define ID_CNTX_ZWJ   0x00008002L
#define ID_CNTX_ZWNJ   0x00008003L
#define ID_CNTX_LRM   0x00008004L
#define ID_CNTX_RLM   0x00008005L
#define ID_CNTX_LRE   0x00008006L
#define ID_CNTX_RLE   0x00008007L
#define ID_CNTX_LRO   0x00008008L
#define ID_CNTX_RLO   0x00008009L
#define ID_CNTX_PDF   0x0000800AL
#define ID_CNTX_NADS   0x0000800BL
#define ID_CNTX_NODS   0x0000800CL
#define ID_CNTX_ASS   0x0000800DL
#define ID_CNTX_ISS   0x0000800EL
#define ID_CNTX_AAFS   0x0000800FL
#define ID_CNTX_IAFS   0x00008010L
#define ID_CNTX_RS   0x00008011L
#define ID_CNTX_US   0x00008012L
#define IsLBoxVisible(plb)   (plb->fRedraw && IsVisible(plb->spwnd))
#define CITEMSALLOC   32
#define EQ   0
#define PREFIX   1
#define LT   2
#define GT   3
#define SINGLESEL   0
#define MULTIPLESEL   1
#define EXTENDEDSEL   2
#define LBI_ADD   0x0004
#define LBUP_RELEASECAPTURE   0x0001
#define LBUP_RESETSELECTION   0x0002
#define LBUP_NOTIFY   0x0004
#define LBUP_SUCCESS   0x0008
#define LBUP_SELCHANGE   0x0010
#define NextWordBoundary(p)   ((PBYTE)(p) + ((ULONG_PTR)(p) & 1))
#define NextDWordBoundary(p)   ((PBYTE)(p) + ((ULONG_PTR)(-(LONG_PTR)(p)) & 3))
#define FINDRESOURCEA(hModule, lpName, lpType)   ((*(pfnFindResourceExA))(hModule, lpType, lpName, 0))
#define FINDRESOURCEW(hModule, lpName, lpType)   ((*(pfnFindResourceExW))(hModule, lpType, lpName, 0))
#define FINDRESOURCEEXA(hModule, lpName, lpType, wLang)   ((*(pfnFindResourceExA))(hModule, lpType, lpName, wLang))
#define FINDRESOURCEEXW(hModule, lpName, lpType, wLang)   ((*(pfnFindResourceExW))(hModule, lpType, lpName, wLang))
#define LOADRESOURCE(hModule, hResInfo)   ((*(pfnLoadResource))(hModule, hResInfo))
#define LOCKRESOURCE(hResData, hModule)   ((*(pfnLockResource))(hResData, hModule))
#define UNLOCKRESOURCE(hResData, hModule)   ((*(pfnUnlockResource))(hResData, hModule))
#define FREERESOURCE(hResData, hModule)   ((*(pfnFreeResource))(hResData, hModule))
#define SIZEOFRESOURCE(hModule, hResInfo)   ((*(pfnSizeofResource))(hModule, hResInfo))
#define GETEXPWINVER(hModule)   ((*(pfnGetExpWinVer))((hModule)?(hModule):GetModuleHandle(NULL)))
#define CCHFILEMAX   MAX_PATH
#define UserLocalAlloc(uFlag, uBytes)   HeapAlloc(pUserHeap, uFlag, (uBytes))
#define UserLocalReAlloc(p, uBytes, uFlags)   HeapReAlloc(pUserHeap, uFlags, (LPSTR)(p), (uBytes))
#define UserLocalFree(p)   HeapFree(pUserHeap, 0, (LPSTR)(p))
#define UserLocalSize(p)   HeapSize(pUserHeap, 0, (LPSTR)(p))
#define UserLocalLock(p)   (LPSTR)(p)
#define UserLocalUnlock(p)
#define UserLocalFlags(p)   0
#define UserLocalHandle(p)   (HLOCAL)(p)
#define CrackCombinedDbcsLB(c)   ((BYTE)(c))
#define CrackCombinedDbcsTB(c)   ((c) >> 8)
#define ECT_CALC   0
#define ECT_NORMAL   1
#define ECT_SELECTED   2
#define ECGetCaretWidth()   (gpsi->uCaretWidth)
#define GETAPPVER()   GetClientInfo()->dwExpWinVer
#define THREAD_HKL()   (GetClientInfo()->hKL)
#define ISDELIMETERA(ch)   ((ch == ' ') || (ch == '\t'))
#define ISDELIMETERW(ch)   ((ch == L' ') || (ch == L'\t'))
#define AWCOMPARECHAR(ped, pbyte, awchar)   (ped->fAnsi ? (*(PUCHAR)(pbyte) == (UCHAR)(awchar)) : (*(LPWSTR)(pbyte) == (WCHAR)(awchar)))
#define ID_EC_PROPERTY_MENU   1
#define IDD_MDI_ACTIVATE   9
#define STR_ERROR   0x00000002L
#define STR_MOREWINDOWS   0x0000000DL
#define STR_NOMEMBITMAP   0x0000000EL
#define STR_IMEOPEN   700
#define STR_IMECLOSE   701
#define STR_SOFTKBDOPEN   702
#define STR_SOFTKBDCLOSE   703
#define STR_RECONVERTSTRING   705
#define _GetWindowLongPtr   _GetWindowLong
#define fnCOPYDATA   NtUserMessageCall
#define fnDDEINIT   NtUserMessageCall
#define fnDWORD   NtUserMessageCall
#define fnDWORDOPTINLPMSG   NtUserMessageCall
#define fnGETTEXTLENGTHS   NtUserMessageCall
#define fnGETDBCSTEXTLENGTHS   NtUserMessageCall
#define fnINLPCREATESTRUCT   NtUserMessageCall
#define fnINLPCOMPAREITEMSTRUCT   NtUserMessageCall
#define fnINLPDELETEITEMSTRUCT   NtUserMessageCall
#define fnINLPDRAWITEMSTRUCT   NtUserMessageCall
#define fnINLPHELPINFOSTRUCT   NtUserMessageCall
#define fnINLPHLPSTRUCT   NtUserMessageCall
#define fnINLPWINDOWPOS   NtUserMessageCall
#define fnINOUTDRAG   NtUserMessageCall
#define fnINOUTLPMEASUREITEMSTRUCT   NtUserMessageCall
#define fnINOUTLPPOINT5   NtUserMessageCall
#define fnINOUTLPRECT   NtUserMessageCall
#define fnINOUTLPSCROLLINFO   NtUserMessageCall
#define fnINOUTLPWINDOWPOS   NtUserMessageCall
#define fnINOUTNCCALCSIZE   NtUserMessageCall
#define fnINOUTNEXTMENU   NtUserMessageCall
#define fnINOUTSTYLECHANGE   NtUserMessageCall
#define fnOPTOUTLPDWORDOPTOUTLPDWORD   NtUserMessageCall
#define fnOUTLPRECT   NtUserMessageCall
#define fnPOPTINLPUINT   NtUserMessageCall
#define fnPOUTLPINT   NtUserMessageCall
#define fnSENTDDEMSG   NtUserMessageCall
#define fnOUTDWORDINDWORD   NtUserMessageCall
#define fnINOUTMENUGETOBJECT   NtUserMessageCall
#define fnINCBOXSTRING   NtUserMessageCall
#define fnINCNTOUTSTRING   NtUserMessageCall
#define fnINCNTOUTSTRINGNULL   NtUserMessageCall
#define fnINLBOXSTRING   NtUserMessageCall
#define fnINLPMDICREATESTRUCT   NtUserMessageCall
#define fnINSTRING   NtUserMessageCall
#define fnINSTRINGNULL   NtUserMessageCall
#define fnINWPARAMCHAR   NtUserMessageCall
#define fnOUTCBOXSTRING   NtUserMessageCall
#define fnOUTLBOXSTRING   NtUserMessageCall
#define fnOUTSTRING   NtUserMessageCall
#define fnKERNELONLY   NtUserMessageCall
#define MESSAGEPROTO(func)
#define IsHooked(pci, fsHook)   ((fsHook & (pci->fsHooks | pci->pDeskInfo->fsHooks)) != 0)
#define _SetWindowLongPtr   _SetWindowLong
#define _GetClassLongPtr   _GetClassLong
#define NtUserReleaseDC(hwnd, hdc)   NtUserCallOneParam((ULONG_PTR)(hdc), SFI__RELEASEDC)
#define NtUserArrangeIconicWindows(hwnd)   (UINT)NtUserCallHwndLock((hwnd), SFI_XXXARRANGEICONICWINDOWS)
#define NtUserBeginDeferWindowPos(nNumWindows)   (HANDLE)NtUserCallOneParam((nNumWindows),SFI__BEGINDEFERWINDOWPOS)
#define NtUserCreateMenu()   (HMENU)NtUserCallNoParam(SFI__CREATEMENU)
#define NtUserDestroyCaret()   (BOOL)NtUserCallNoParam(SFI_ZZZDESTROYCARET)
#define NtUserEnableWindow(hwnd, bEnable)   (BOOL)NtUserCallHwndParamLock((hwnd), (bEnable),SFI_XXXENABLEWINDOW)
#define NtUserGetMessagePos()   (DWORD)NtUserCallNoParam(SFI__GETMESSAGEPOS)
#define NtUserKillSystemTimer(hwnd, nIDEvent)   (BOOL)NtUserCallHwndParam((hwnd), (nIDEvent), SFI__KILLSYSTEMTIMER)
#define NtUserMessageBeep(wType)   (BOOL)NtUserCallOneParam((wType), SFI_XXXMESSAGEBEEP)
#define NtUserSetWindowContextHelpId(hwnd, id)   (BOOL)NtUserCallHwndParam((hwnd), (id), SFI__SETWINDOWCONTEXTHELPID)
#define NtUserGetWindowContextHelpId(hwnd)   (BOOL)NtUserCallHwnd((hwnd), SFI__GETWINDOWCONTEXTHELPID)
#define NtUserRedrawFrame(hwnd)   NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAME)
#define NtUserRedrawFrameAndHook(hwnd)   NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAMEANDHOOK)
#define NtUserRedrawTitle(hwnd, wFlags)   NtUserCallHwndParamLock((hwnd), (wFlags), SFI_XXXREDRAWTITLE)
#define NtUserReleaseCapture()   (BOOL)NtUserCallNoParam(SFI_XXXRELEASECAPTURE)
#define NtUserSetCaretPos(X, Y)   (BOOL)NtUserCallTwoParam((DWORD)(X), (DWORD)(Y), SFI_ZZZSETCARETPOS)
#define NtUserSetCursorPos(X, Y)   (BOOL)NtUserCallTwoParam((X), (Y), SFI_ZZZSETCURSORPOS)
#define NtUserSetForegroundWindow(hwnd)   (BOOL)NtUserCallHwndLock((hwnd), SFI_XXXSTUBSETFOREGROUNDWINDOW)
#define NtUserSetSysMenu(hwnd)   NtUserCallHwndLock((hwnd), SFI_XXXSETSYSMENU)
#define NtUserSetVisible(hwnd, fSet)   NtUserCallHwndParam((hwnd), (fSet), SFI_SETVISIBLE)
#define NtUserShowCursor(bShow)   (int)NtUserCallOneParam((bShow), SFI_ZZZSHOWCURSOR)
#define NtUserUpdateClientRect(hwnd)   NtUserCallHwndLock((hwnd), SFI_XXXUPDATECLIENTRECT)
#define CreateCaret   NtUserCreateCaret
#define FillWindow   NtUserFillWindow
#define GetControlBrush   NtUserGetControlBrush
#define GetControlColor   NtUserGetControlColor
#define GetDCEx   NtUserGetDCEx
#define GetWindowPlacement   NtUserGetWindowPlacement
#define RedrawWindow   NtUserRedrawWindow
#define BFT_ICON   0x4349
#define BFT_BITMAP   0x4D42
#define BFT_CURSOR   0x5450
#define OFFSET_SCALE_DPI   000
#define OFFSET_96_DPI   100
#define OFFSET_120_DPI   200
#define OFFSET_160_DPI   300
#define MAX_RESOURCE_INDEX   32768
#define HILITEONLY   0x0001
#define SELONLY   0x0002
#define HILITEANDSEL   (HILITEONLY + SELONLY)
#define HILITE   1
#define VERKEY_SLASH   0xBF /* Vertual key for '/' character */
#define VERKEY_BACKSLASH   0xDC /* Vertual key for '\' character */
#define MENUAPI_INSERT   0
#define MENUAPI_GET   1
#define MENUAPI_SET   2
#define WINDOWLIST_PROP_NAME   TEXT("SysBW")
#define MSGBOX_CALLBACK   TEXT("SysMB")
#define UNICODE_RLM   0x200f
#define MAXITEMS   10
#define WS_MDISTYLE   (WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU|WS_CAPTION|WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX)
#define WS_MDICOMMANDS   (WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
#define WS_MDIALLOWED   (WS_MINIMIZE | WS_MAXIMIZE | WS_CLIPCHILDREN | WS_DISABLED | WS_HSCROLL | WS_VSCROLL | 0x0000FFFFL)
#define HAS_SBVERT   0x0100
#define HAS_SBHORZ   0x0200
#define OTHERMAXING   0x0400
#define CALCSCROLL   0x0800
#define SCROLLSUPPRESS   0x0003
#define SCROLLCOUNT   0x00FF
#define CKIDS(pmdi)   (pmdi->cKids)
#define MAXED(pmdi)   (pmdi->hwndMaxedChild)
#define ACTIVE(pmdi)   (pmdi->hwndActiveChild)
#define WINDOW(pmdi)   (pmdi->hmenuWindow)
#define FIRST(pmdi)   (pmdi->idFirstChild)
#define SCROLL(pmdi)   (pmdi->wScroll)
#define ITILELEVEL(pmdi)   (pmdi->iChildTileLevel)
#define HTITLE(pmdi)   (pmdi->pTitle)
#define PROP_MDICLIENT   MAKEINTRESOURCE(0x8CAC)
#define MDIACTIVATE_PROP_NAME   TEXT("MDIA")
#define COM_NO_WINDOWS_H
#define RPC_NO_WINDOWS_H
#define OLEWONTLOAD   (HINSTANCE)IntToPtr(0xFFFFFFFF)
#define UserCallbackReturn   NtCallbackReturn
#define RDRMODE_VERT   0x00000001
#define RDRMODE_HORZ   0x00000002
#define RDRMODE_DIAG   0x00000004
#define RDRCODE_START   1
#define RDRCODE_SCROLL   2
#define RDRCODE_END   3
#define GetDispatchDbcsInfo()   (&(GetClientInfo()->achDbcsCF[0]))
#define GetForwardDbcsInfo()   (&(GetClientInfo()->achDbcsCF[1]))
#define GetCallBackDbcsInfo()   (&(GetClientInfo()->msgDbcsCB))
#define GET_DBCS_MESSAGE_IF_EXIST(_apiName, _pmsg, _wMsgFilterMin, _wMsgFilterMax, bRemoveMsg)
#define BUILD_DBCS_MESSAGE_TO_SERVER_FROM_CLIENTA(_msg, _wParam, _RetVal)
#define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_CLIENTA(_msg, _wParam, _RetVal)
#define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER(_pmsg, _dwAnsi, _bIrDbcsFormat, bSaveMsg)
#define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_SERVER(_msg, _wParam)
#define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_CLIENTW(_hwnd, _msg, _wParam, _lParam, _time, _pt, _bDbcs)
#define DISPATCH_DBCS_MESSAGE_IF_EXIST(_msg, _wParam, _bDbcs, _apiName)
#define CalcAnsiStringLengthW(_unicodestring, _unicodeLength, _ansiLength)
#define CalcAnsiStringLengthA(_ansistring, _unicodeLength, _ansiLength)
#define CalcUnicodeStringLengthA(_ansistring, _ansiLength, _unicodeLength)
#define CalcUnicodeStringLengthW(_unicodestring, _ansiLength, _unicodeLength)
#define fpImmAssociateContext   gImmApiEntries.ImmAssociateContext
#define fpImmEscapeA   gImmApiEntries.ImmEscapeA
#define fpImmEscapeW   gImmApiEntries.ImmEscapeW
#define fpImmGetContext   gImmApiEntries.ImmGetContext
#define fpImmGetCompositionStringA   gImmApiEntries.ImmGetCompositionStringA
#define fpImmGetCompositionStringW   gImmApiEntries.ImmGetCompositionStringW
#define fpImmGetCompositionWindow   gImmApiEntries.ImmGetCompositionWindow
#define fpImmGetDefaultIMEWnd   gImmApiEntries.ImmGetDefaultIMEWnd
#define fpImmIsIME   gImmApiEntries.ImmIsIME
#define fpImmLockIMC   gImmApiEntries.ImmLockIMC
#define fpImmReleaseContext   gImmApiEntries.ImmReleaseContext
#define fpImmRegisterClient   gImmApiEntries.ImmRegisterClient
#define fpImmGetCompositionFontW   gImmApiEntries.ImmGetCompositionFontW
#define fpImmGetCompositionFontA   gImmApiEntries.ImmGetCompositionFontA
#define fpImmSetCompositionFontW   gImmApiEntries.ImmSetCompositionFontW
#define fpImmSetCompositionFontA   gImmApiEntries.ImmSetCompositionFontA
#define fpImmSetCompositionFont   gImmApiEntries.ImmSetCompositionFont
#define fpImmSetCompositionWindow   gImmApiEntries.ImmSetCompositionWindow
#define fpImmNotifyIME   gImmApiEntries.ImmNotifyIME
#define fpImmUnlockIMC   gImmApiEntries.ImmUnlockIMC
#define fpImmLoadIME   gImmApiEntries.ImmLoadIME
#define fpImmSetOpenStatus   gImmApiEntries.ImmSetOpenStatus
#define fpImmFreeLayout   gImmApiEntries.ImmFreeLayout
#define fpImmActivateLayout   gImmApiEntries.ImmActivateLayout
#define fpImmSetCandidateWindow   gImmApiEntries.ImmSetCandidateWindow
#define fpImmConfigureIMEW   gImmApiEntries.ImmConfigureIMEW
#define fpImmGetConversionStatus   gImmApiEntries.ImmGetConversionStatus
#define fpImmSetConversionStatus   gImmApiEntries.ImmSetConversionStatus
#define fpImmSetStatusWindowPos   gImmApiEntries.ImmSetStatusWindowPos
#define fpImmGetImeInfoEx   gImmApiEntries.ImmGetImeInfoEx
#define fpImmLockImeDpi   gImmApiEntries.ImmLockImeDpi
#define fpImmUnlockImeDpi   gImmApiEntries.ImmUnlockImeDpi
#define fpImmGetOpenStatus   gImmApiEntries.ImmGetOpenStatus
#define fpImmSetActiveContext   gImmApiEntries.ImmSetActiveContext
#define fpImmTranslateMessage   gImmApiEntries.ImmTranslateMessage
#define fpImmLoadLayout   gImmApiEntries.ImmLoadLayout
#define fpImmProcessKey   gImmApiEntries.ImmProcessKey
#define fpImmPutImeMenuItemsIntoMappedFile   gImmApiEntries.ImmPutImeMenuItemsIntoMappedFile
#define fpImmGetProperty   gImmApiEntries.ImmGetProperty
#define fpImmSetCompositionStringA   gImmApiEntries.ImmSetCompositionStringA
#define fpImmSetCompositionStringW   gImmApiEntries.ImmSetCompositionStringW
#define fpImmEnumInputContext   gImmApiEntries.ImmEnumInputContext
#define fpImmSystemHandler   gImmApiEntries.ImmSystemHandler

Typedefs

typedef LRESULT(APIENTRY * CFNSCSENDMESSAGE )(HWND, UINT, WPARAM, LPARAM, ULONG_PTR, DWORD, BOOL)
typedef int(WINAPI * GENERICPROC )()
typedef _IN_STRING IN_STRING
typedef _IN_STRINGPIN_STRING
typedef _LARGE_IN_STRING LARGE_IN_STRING
typedef _LARGE_IN_STRINGPLARGE_IN_STRING
typedef _LOOKASIDE LOOKASIDE
typedef _LOOKASIDEPLOOKASIDE
typedef _TL TL
typedef tagUNDO UNDO
typedef tagUNDOPUNDO
typedef tagED ED
typedef tagEDPED
typedef tagED ** PPED
typedef tagEDITWND EDITWND
typedef tagEDITWNDPEDITWND
typedef tagBLOCK BLOCK
typedef tagBLOCKLPBLOCK
typedef STRIPINFO FAR * LPSTRIPINFO
typedef tagLBItem LBItem
typedef tagLBItemlpLBItem
typedef tagLBODItem LBODItem
typedef tagLBODItemlpLBODItem
typedef tagSTAT STAT
typedef tagSTATPSTAT
typedef tagSTATWND STATWND
typedef tagSTATWNDPSTATWND
typedef tagCURSORRESOURCE CURSORRESOURCE
typedef tagCURSORRESOURCEPCURSORRESOURCE
typedef BITMAPINFO UNALIGNED * UPBITMAPINFO
typedef BITMAPINFOHEADER UNALIGNED * UPBITMAPINFOHEADER
typedef BITMAPCOREHEADER UNALIGNED * UPBITMAPCOREHEADER
typedef _FILEINFO FILEINFO
typedef _FILEINFOPFILEINFO
typedef tagSHORTCREATE SHORTCREATE
typedef tagSHORTCREATEPSHORTCREATE
typedef tagMDIACTIVATEPOS MDIACTIVATEPOS
typedef tagMDIACTIVATEPOSPMDIACTIVATEPOS
typedef HRESULT(* OLEINITIALIZEPROC )(LPVOID)
typedef HRESULT(* OLEUNINITIALIZEPROC )(VOID)
typedef HRESULT(* REGISTERDDPROC )(HWND, LPDROPTARGET)
typedef HRESULT(* REVOKEDDPROC )(HWND)
typedef HRESULT(* DODDPROC )(LPDATAOBJECT, LPDROPSOURCE, DWORD, LPDWORD)
typedef tagMNIDROPTARGET MNIDROPTARGET
typedef tagMNIDROPTARGETPMNIDROPTARGET
typedef tagGETPROCINFO GETPROCINFO
typedef tagACCELCACHE ACCELCACHE
typedef tagACCELCACHEPACCELCACHE
typedef LONG(CALLBACK * READERMODEPROC )(LPARAM lParam, int nCode, int dx, int dy)
typedef tagREADERMODE READERMODE
typedef tagREADERMODEPREADERMODE
typedef tagREADERMODELPREADERMODE
typedef tagREADERINFO READERINFO
typedef tagREADERINFOPREADERINFO
typedef tagREADERWND READERWND
typedef tagREADERWNDPREADERWND

Functions

NTSTATUS InitLookaside (PLOOKASIDE pla, DWORD cbEntry, DWORD cEntries)
PVOID AllocLookasideEntry (PLOOKASIDE pla)
void FreeLookasideEntry (PLOOKASIDE pla, PVOID pEntry)
void LBEvent (PLBIV, UINT, int)
DWORD Event (PEVENT_PACKET pep)
PVOID CsValidateInstance (HANDLE hInst)
BOOL APIENTRY _FreeResource (HANDLE hResData, HINSTANCE hModule)
LPSTR APIENTRY _LockResource (HANDLE hResData, HINSTANCE hModule)
BOOL APIENTRY _UnlockResource (HANDLE hResData, HINSTANCE hModule)
HANDLE LocalReallocSafe (HANDLE hMem, DWORD dwBytes, DWORD dwFlags, PPED pped)
HLOCAL WINAPI DispatchLocalAlloc (UINT uFlags, UINT uBytes, HANDLE hInstance)
HLOCAL WINAPI DispatchLocalReAlloc (HLOCAL hMem, UINT uBytes, UINT uFlags, HANDLE hInstance, PVOID *ppv)
LPVOID WINAPI DispatchLocalLock (HLOCAL hMem, HANDLE hInstance)
BOOL WINAPI DispatchLocalUnlock (HLOCAL hMem, HANDLE hInstance)
UINT WINAPI DispatchLocalSize (HLOCAL hMem, HANDLE hInstance)
HLOCAL WINAPI DispatchLocalFree (HLOCAL hMem, HANDLE hInstance)
LONG TabTextOut (HDC hdc, int x, int y, LPCWSTR lpstring, int nCount, int nTabPositions, CONST INT *lpTabPositions, int iTabOrigin, BOOL fDrawTheText, int iCharset)
LONG UserLpkTabbedTextOut (HDC hdc, int x, int y, LPCWSTR lpstring, int nCount, int nTabPositions, CONST INT *lpTabPositions, int iTabOrigin, BOOL fDrawTheText, int cxCharWidth, int cyCharHeight, int iCharset)
void UserLpkPSMTextOut (HDC hdc, int xLeft, int yTop, LPWSTR lpsz, int cch, DWORD dwFlags)
void PSMTextOut (HDC hdc, int xLeft, int yTop, LPWSTR lpsz, int cch, DWORD dwFlags)
void ECUpdateFormat (PED ped, DWORD dwStyle, DWORD dwExStyle)
int LoadStringOrError (HANDLE, UINT, LPTSTR, int, WORD)
int RtlGetIdFromDirectory (PBYTE, BOOL, int, int, DWORD, PDWORD)
BOOL RtlCaptureAnsiString (PIN_STRING, LPCSTR, BOOL)
BOOL RtlCaptureLargeAnsiString (PLARGE_IN_STRING, LPCSTR, BOOL)
PWND FASTCALL ValidateHwnd (HWND hwnd)
PWND FASTCALL ValidateHwndNoRip (HWND hwnd)
PSTR ECLock (PED ped)
void ECUnlock (PED ped)
BOOL ECNcCreate (PED, PWND, LPCREATESTRUCT)
void ECInvalidateClient (PED ped, BOOL fErase)
BOOL ECCreate (PED ped, LONG windowStyle)
void ECWord (PED, ICH, BOOL, ICH *, ICH *)
ICH ECFindTab (LPSTR, ICH)
void ECNcDestroyHandler (PWND, PED)
BOOL ECSetText (PED, LPSTR)
void ECSetPasswordChar (PED, UINT)
ICH ECCchInWidth (PED, HDC, LPSTR, ICH, int, BOOL)
void ECEmptyUndo (PUNDO)
void ECSaveUndo (PUNDO pundoFrom, PUNDO pundoTo, BOOL fClear)
BOOL ECInsertText (PED, LPSTR, ICH *)
ICH ECDeleteText (PED)
void ECResetTextInfo (PED ped)
void ECNotifyParent (PED, int)
void ECSetEditClip (PED, HDC, BOOL)
HDC ECGetEditDC (PED, BOOL)
void ECReleaseEditDC (PED, HDC, BOOL)
ICH ECGetText (PED, ICH, LPSTR, BOOL)
void ECSetFont (PED, HFONT, BOOL)
void ECSetMargin (PED, UINT, long, BOOL)
ICH ECCopy (PED)
BOOL ECCalcChangeSelection (PED, ICH, ICH, LPBLOCK, LPBLOCK)
void ECFindXORblks (LPBLOCK, LPBLOCK, LPBLOCK, LPBLOCK)
BOOL ECIsCharNumeric (PED ped, DWORD keyPress)
WORD DbcsCombine (HWND, WORD)
ICH ECAdjustIch (PED, LPSTR, ICH)
ICH ECAdjustIchNext (PED, LPSTR, ICH)
int ECGetDBCSVector (PED, HDC, BYTE)
BOOL ECIsDBCSLeadByte (PED, BYTE)
LPSTR ECAnsiNext (PED, LPSTR)
LPSTR ECAnsiPrev (PED, LPSTR, LPSTR)
ICH ECPrevIch (PED, LPSTR, ICH)
ICH ECNextIch (PED, LPSTR, ICH)
void ECEnableDisableIME (PED ped)
void ECImmSetCompositionFont (PED ped)
void ECImmSetCompositionWindow (PED ped, LONG, LONG)
void ECSetCaretHandler (PED ped)
void ECInitInsert (PED ped, HKL hkl)
LRESULT ECImeComposition (PED ped, WPARAM wParam, LPARAM lParam)
LRESULT EcImeRequestHandler (PED, WPARAM, LPARAM)
BOOL HanjaKeyHandler (PED ped)
void ECInOutReconversionMode (PED ped, BOOL fIn)
UINT ECTabTheTextOut (HDC, int, int, int, int, LPSTR, int, ICH, PED, int, BOOL, LPSTRIPINFO)
HBRUSH ECGetControlBrush (PED, HDC, LONG)
HBRUSH ECGetBrush (PED ped, HDC hdc)
int ECGetModKeys (int)
void ECSize (PED, LPRECT, BOOL)
ICH MLInsertText (PED, LPSTR, ICH, BOOL)
ICH MLDeleteText (PED)
BOOL MLEnsureCaretVisible (PED)
void MLDrawText (PED, HDC, ICH, ICH, BOOL)
void MLDrawLine (PED, HDC, int, ICH, int, BOOL)
void MLPaintABlock (PED, HDC, int, int)
int GetBlkEndLine (int, int, BOOL FAR *, int, int)
void MLBuildchLines (PED, ICH, int, BOOL, PLONG, PLONG)
void MLShiftchLines (PED, ICH, int)
BOOL MLInsertchLine (PED, ICH, ICH, BOOL)
void MLSetCaretPosition (PED, HDC)
void MLIchToXYPos (PED, HDC, ICH, BOOL, LPPOINT)
int MLIchToLine (PED, ICH)
void MLRepaintChangedSelection (PED, HDC, ICH, ICH)
void MLMouseMotion (PED, UINT, UINT, LPPOINT)
ICH MLLine (PED, ICH)
void MLStripCrCrLf (PED)
int MLCalcXOffset (PED, HDC, int)
BOOL MLUndo (PED)
LRESULT MLEditWndProc (HWND, PED, UINT, WPARAM, LPARAM)
void MLChar (PED, DWORD, int)
void MLKeyDown (PED, UINT, int)
ICH MLPasteText (PED)
void MLSetSelection (PED, BOOL, ICH, ICH)
LONG MLCreate (PED, LPCREATESTRUCT)
BOOL MLInsertCrCrLf (PED)
void MLSetHandle (PED, HANDLE)
LONG MLGetLine (PED, ICH, ICH, LPSTR)
ICH MLLineIndex (PED, ICH)
void MLSize (PED, BOOL)
void MLChangeSelection (PED, HDC, ICH, ICH)
void MLSetRectHandler (PED, LPRECT)
BOOL MLExpandTabs (PED)
BOOL MLSetTabStops (PED, int, LPINT)
LONG MLScroll (PED, BOOL, int, int, BOOL)
int MLThumbPosFromPed (PED, BOOL)
void MLUpdateiCaretLine (PED ped)
ICH MLLineLength (PED, ICH)
void MLReplaceSel (PED, LPSTR)
void SLReplaceSel (PED, LPSTR)
BOOL SLUndo (PED)
void SLSetCaretPosition (PED, HDC)
int SLIchToLeftXPos (PED, HDC, ICH)
void SLChangeSelection (PED, HDC, ICH, ICH)
void SLDrawText (PED, HDC, ICH)
void SLDrawLine (PED, HDC, int, int, ICH, int, BOOL)
int SLGetBlkEnd (PED, ICH, ICH, BOOL FAR *)
BOOL SLScrollText (PED, HDC)
void SLSetSelection (PED, ICH, ICH)
ICH SLInsertText (PED, LPSTR, ICH)
ICH SLPasteText (PED)
void SLChar (PED, DWORD)
void SLKeyDown (PED, DWORD, int)
ICH SLMouseToIch (PED, HDC, LPPOINT)
void SLMouseMotion (PED, UINT, UINT, LPPOINT)
LONG SLCreate (PED, LPCREATESTRUCT)
 !! CREATESTRUCT AorW and in other routines

void SLPaint (PED, HDC)
void SLSetFocus (PED)
void SLKillFocus (PED, HWND)
LRESULT SLEditWndProc (HWND, PED, UINT, WPARAM, LPARAM)
LRESULT EditWndProc (PWND, UINT, WPARAM, LPARAM)
UINT HelpMenu (HWND hwnd, PPOINT ppt)
BOOL InitClientDrawing ()
int InternalScrollWindowEx (HWND hwnd, int dx, int dy, CONST RECT *prcScroll, CONST RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, UINT dwFlags, DWORD dwTime)
BOOL IsMetaFile (HDC hdc)
BOOL DrawDiagonal (HDC hdc, LPRECT lprc, HBRUSH hbrTL, HBRUSH hbrBR, UINT flags)
BOOL FillTriangle (HDC hdc, LPRECT lprc, HBRUSH hbr, UINT flags)
BOOL _ClientFreeLibrary (HANDLE hmod)
DWORD _ClientGetListboxString (PWND pwnd, UINT msg, WPARAM wParam, LPSTR lParam, ULONG_PTR xParam, PROC xpfn)
LPHLP HFill (LPCSTR lpszHelp, DWORD ulCommand, ULONG_PTR ulData)
BOOL SetVideoTimeout (DWORD dwVideoTimeout)
DWORD _GetWindowLong (PWND pwnd, int index, BOOL bAnsi)
WORD _GetWindowWord (PWND pwnd, int index)
HWND InternalFindWindowExA (HWND hwndParent, HWND hwndChild, LPCSTR pClassName, LPCSTR pWindowName, DWORD dwFlag)
HWND InternalFindWindowExW (HWND hwndParent, HWND hwndChild, LPCTSTR pClassName, LPCTSTR pWindowName, DWORD dwFlag)
 MESSAGEPROTO (COPYGLOBALDATA)
 MESSAGEPROTO (INDEVICECHANGE)
 MESSAGEPROTO (INPAINTCLIPBRD)
 MESSAGEPROTO (INSIZECLIPBRD)
 MESSAGEPROTO (IMECONTROL)
 MESSAGEPROTO (IMEREQUEST)
 MESSAGEPROTO (INWPARAMDBCSCHAR)
 MESSAGEPROTO (EMGETSEL)
 MESSAGEPROTO (EMSETSEL)
 MESSAGEPROTO (CBGETEDITSEL)
LRESULT fnHkINLPCWPSTRUCTW (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT fnHkINLPCWPSTRUCTA (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT fnHkINLPCWPRETSTRUCTW (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT fnHkINLPCWPRETSTRUCTA (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT DispatchHookW (int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn)
LRESULT DispatchHookA (int dw, WPARAM wParam, LPARAM lParam, HOOKPROC pfn)
LRESULT APIENTRY ButtonWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ButtonWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY MenuWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY MenuWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY DesktopWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY DesktopWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ScrollBarWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ScrollBarWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ListBoxWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ListBoxWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY StaticWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY StaticWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ComboBoxWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ComboBoxWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ComboListBoxWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ComboListBoxWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY MDIClientWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY MDIClientWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY MB_DlgProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY MB_DlgProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY MDIActivateDlgProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY MDIActivateDlgProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY EditWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY EditWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ImeWndProcA (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY ImeWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT SendMessageWorker (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL fAnsi)
LRESULT SendMessageTimeoutWorker (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PULONG_PTR lpdwResult, BOOL fAnsi)
void ClientEmptyClipboard (void)
VOID GetActiveKeyboardName (LPWSTR lpszName)
HANDLE OpenKeyboardLayoutFile (LPWSTR lpszKLName, PUINT puFlags, PUINT poffTable, PUINT pKbdInputLocale)
VOID LoadPreloadKeyboardLayouts (void)
void SetWindowState (PWND pwnd, UINT flags)
void ClearWindowState (PWND pwnd, UINT flags)
HKL LoadKeyboardLayoutWorker (HKL hkl, LPCWSTR lpszKLName, UINT uFlags, BOOL fFailSafe)
LRESULT DispatchClientMessage (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR pfn)
LRESULT DefWindowProcWorker (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT ButtonWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT ListBoxWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT StaticWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT ComboBoxWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT ComboListBoxWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT MDIClientWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT EditWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT DefDlgProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LRESULT ImeWndProcWorker (PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, DWORD fAnsi)
LONG _SetWindowLong (HWND hWnd, int nIndex, LONG dwNewLong, BOOL bAnsi)
BOOL _PeekMessage (LPMSG pmsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL bAnsi)
BOOL _DefSetText (HWND hwnd, LPCWSTR pstr, BOOL bAnsi)
HCURSOR _GetCursorFrameInfo (HCURSOR hcur, LPWSTR id, int iFrame, LPDWORD pjifRate, LPINT pccur)
HWND _CreateWindowEx (DWORD dwExStyle, LPCTSTR pClassName, LPCTSTR pWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hwndParent, HMENU hmenu, HANDLE hModule, LPVOID pParam, DWORD dwFlags)
HKL _LoadKeyboardLayoutEx (HANDLE hFile, UINT offTable, HKL hkl, LPCWSTR pwszKL, UINT KbdInputLocale, UINT Flags)
BOOL _SetCursorIconData (HCURSOR hCursor, PCURSORDATA pcur)
HCURSOR FindExistingCursorIcon (LPWSTR pszModName, LPCWSTR pszResName, PCURSORFIND pcfSearch)
HANDLE CreateLocalMemHandle (HANDLE hMem)
HANDLE ConvertMemHandle (HANDLE hMem, UINT cbNULL)
HHOOK _SetWindowsHookEx (HANDLE hmod, LPTSTR pszLib, DWORD idThread, int nFilterType, PROC pfnFilterProc, DWORD dwFlags)
ULONG_PTR _GetClassData (PCLS pcls, PWND pwnd, int index, BOOL bAnsi)
DWORD _GetClassLong (PWND pwnd, int index, BOOL bAnsi)
BOOL BitBltSysBmp (HDC hdc, int x, int y, UINT i)
DWORD BuildHwndList (HDESK hdesk, HWND hwndNext, BOOL fEnumChildren, DWORD idThread, HWND **phwndFirst)
ATOM RegisterClassExWOWA (PWNDCLASSEXA lpWndClass, LPDWORD pdwWOWstuff, WORD fnid)
ATOM RegisterClassExWOWW (PWNDCLASSEXW lpWndClass, LPDWORD pdwWOWstuff, WORD fnid)
void CopyLogFontAtoW (PLOGFONTW pdest, PLOGFONTA psrc)
void CopyLogFontWtoA (PLOGFONTA pdest, PLOGFONTW psrc)
PWND _NextControl (PWND pwndDlg, PWND pwnd, UINT uFlags)
PWND _PrevControl (PWND pwndDlg, PWND pwnd, UINT uFlags)
PWND _GetNextDlgGroupItem (PWND pwndDlg, PWND pwnd, BOOL fPrev)
PWND _GetNextDlgTabItem (PWND pwndDlg, PWND pwnd, BOOL fPrev)
PWND _GetChildControl (PWND pwndDlg, PWND pwndLevel)
BOOL FChildVisible (HWND hwnd)
BOOL PaintRect (HWND hwndBrush, HWND hwndPaint, HDC hdc, HBRUSH hbr, LPRECT lprc)
int FindMnemChar (LPWSTR lpstr, WCHAR ch, BOOL fFirst, BOOL fPrefix)
BOOL WowGetModuleFileName (HMODULE hModule, LPWSTR pwsz, DWORD cchMax)
HICON WowServerLoadCreateCursorIcon (HANDLE hmod, LPTSTR lpModName, DWORD dwExpWinVer, LPCTSTR lpName, DWORD cb, PVOID pcr, LPTSTR lpType, BOOL fClient)
HANDLE InternalCopyImage (HANDLE hImage, UINT IMAGE_flag, int cxNew, int cyNew, UINT LR_flags)
HMENU CreateMenuFromResource (LPBYTE)
HANDLE LoadCursorIconFromFileMap (IN PFILEINFO pfi, IN OUT LPWSTR *prt, IN DWORD cxDesired, IN DWORD cyDesired, IN DWORD LR_flags, OUT LPBOOL pfAni)
DWORD GetIcoCurWidth (DWORD cxOrg, BOOL fIcon, UINT LR_flags, DWORD cxDesired)
DWORD GetIcoCurHeight (DWORD cyOrg, BOOL fIcon, UINT LR_flags, DWORD cyDesired)
DWORD GetIcoCurBpp (UINT LR_flags)
HICON LoadIcoCur (HINSTANCE hmod, LPCWSTR lpName, LPWSTR type, DWORD cxDesired, DWORD cyDesired, UINT LR_flags)
HANDLE ObjectFromDIBResource (HINSTANCE hmod, LPCWSTR lpName, LPWSTR type, DWORD cxDesired, DWORD cyDesired, UINT LR_flags)
HANDLE RtlLoadObjectFromDIBFile (LPCWSTR lpszName, LPWSTR type, DWORD cxDesired, DWORD cyDesired, UINT LR_flags)
HCURSOR LoadCursorOrIconFromFile (LPCWSTR pszFilename, BOOL fIcon)
HBITMAP ConvertDIBBitmap (UPBITMAPINFOHEADER lpbih, DWORD cxDesired, DWORD cyDesired, UINT flags, LPBITMAPINFOHEADER *lplpbih, LPSTR *lplpBits)
HICON ConvertDIBIcon (LPBITMAPINFOHEADER lpbih, HINSTANCE hmod, LPCWSTR lpName, BOOL fIcon, DWORD cxNew, DWORD cyNew, UINT LR_flags)
int SmartStretchDIBits (HDC hdc, int xD, int yD, int dxD, int dyD, int xS, int yS, int dxS, int dyS, LPVOID lpBits, LPBITMAPINFO lpbi, UINT wUsage, DWORD rop)
LONG xxxCBCommandHandler (PCBOX, DWORD, HWND)
LRESULT xxxCBMessageItemHandler (PCBOX, UINT, LPVOID)
int xxxCBDir (PCBOX, UINT, LPWSTR)
VOID xxxCBPaint (PCBOX, HDC)
VOID xxxCBCompleteEditWindow (PCBOX pcbox)
BOOL xxxCBHideListBoxWindow (PCBOX pcbox, BOOL fNotifyParent, BOOL fSelEndOK)
VOID xxxCBShowListBoxWindow (PCBOX pcbox, BOOL fTrack)
void xxxCBPosition (PCBOX pcbox)
long CBNcCreateHandler (PCBOX, PWND)
LRESULT xxxCBCreateHandler (PCBOX, PWND)
void xxxCBCalcControlRects (PCBOX pcbox, LPRECT lprcList)
VOID xxxCBNcDestroyHandler (PWND, PCBOX)
VOID xxxCBNotifyParent (PCBOX, SHORT)
VOID xxxCBUpdateListBoxWindow (PCBOX, BOOL)
VOID xxxCBInternalUpdateEditWindow (PCBOX, HDC)
VOID xxxCBGetFocusHelper (PCBOX)
VOID xxxCBKillFocusHelper (PCBOX)
VOID xxxCBInvertStaticWindow (PCBOX, BOOL, HDC)
VOID xxxCBSetFontHandler (PCBOX, HANDLE, BOOL)
VOID xxxCBSizeHandler (PCBOX)
LONG xxxCBSetEditItemHeight (PCBOX pcbox, int editHeight)
INT xxxFindString (PLBIV, LPWSTR, INT, INT, BOOL)
VOID InitHStrings (PLBIV)
int xxxLBInsertItem (PLBIV, LPWSTR, int, UINT)
BOOL ISelFromPt (PLBIV, POINT, LPDWORD)
BOOL IsSelected (PLBIV, INT, UINT)
VOID LBSetCItemFullMax (PLBIV plb)
VOID xxxLBSelRange (PLBIV, INT, INT, BOOL)
INT xxxLBSetCurSel (PLBIV, INT)
INT LBoxGetSelItems (PLBIV, BOOL, INT, LPINT)
LONG xxxLBSetSel (PLBIV, BOOL, INT)
VOID xxxSetISelBase (PLBIV, INT)
VOID SetSelected (PLBIV, INT, BOOL, UINT)
void xxxLBSetCaret (PLBIV plb, BOOL fSetCaret)
VOID xxxCaretDestroy (PLBIV)
LONG xxxLBCreate (PLBIV, PWND, LPCREATESTRUCT)
VOID xxxDestroyLBox (PLBIV, PWND)
VOID xxxLBoxDeleteItem (PLBIV, INT)
VOID xxxLBoxDoDeleteItems (PLBIV)
VOID xxxLBoxDrawItem (PLBIV, INT, UINT, UINT, LPRECT)
INT LBCalcVarITopScrollAmt (PLBIV, INT, INT)
VOID xxxLBoxCtlHScroll (PLBIV, INT, INT)
VOID xxxLBoxCtlHScrollMultiColumn (PLBIV, INT, INT)
VOID xxxLBoxCtlScroll (PLBIV, INT, INT)
VOID xxxLBShowHideScrollBars (PLBIV)
INT xxxLBoxCtlDelete (PLBIV, INT)
VOID xxxLBoxCtlCharInput (PLBIV, UINT, BOOL)
VOID xxxLBoxCtlKeyInput (PLBIV, UINT, UINT)
VOID xxxLBPaint (PLBIV, HDC, LPRECT)
BOOL xxxLBInvalidateRect (PLBIV plb, LPRECT lprc, BOOL fErase)
VOID xxxAlterHilite (PLBIV, INT, INT, BOOL, INT, BOOL)
INT CItemInWindow (PLBIV, BOOL)
VOID xxxCheckRedraw (PLBIV, BOOL, INT)
LPWSTR GetLpszItem (PLBIV, INT)
VOID xxxInsureVisible (PLBIV, INT, BOOL)
VOID xxxInvertLBItem (PLBIV, INT, BOOL)
VOID xxxLBBlockHilite (PLBIV, INT, BOOL)
int LBGetSetItemHeightHandler (PLBIV plb, UINT message, int item, UINT height)
VOID LBDropObjectHandler (PLBIV, PDROPSTRUCT)
LONG_PTR LBGetItemData (PLBIV, INT)
INT LBGetText (PLBIV, BOOL, BOOL, INT, LPWSTR)
VOID xxxLBSetFont (PLBIV, HANDLE, BOOL)
int LBSetItemData (PLBIV, INT, LONG_PTR)
BOOL LBSetTabStops (PLBIV, INT, LPINT)
VOID xxxLBSize (PLBIV, INT, INT)
INT LastFullVisible (PLBIV)
INT xxxLbDir (PLBIV, UINT, LPWSTR)
INT xxxLbInsertFile (PLBIV, LPWSTR)
VOID xxxNewITop (PLBIV, INT)
VOID xxxNewITopEx (PLBIV, INT, DWORD)
VOID xxxNotifyOwner (PLBIV, INT)
VOID xxxResetWorld (PLBIV, INT, INT, BOOL)
VOID xxxTrackMouse (PLBIV, UINT, POINT)
BOOL xxxDlgDirListHelper (PWND, LPWSTR, LPBYTE, int, int, UINT, BOOL)
BOOL DlgDirSelectHelper (LPWSTR pFileName, int cbFileName, HWND hwndListBox)
BOOL xxxLBResetContent (PLBIV plb)
VOID xxxLBSetRedraw (PLBIV plb, BOOL fRedraw)
int xxxSetLBScrollParms (PLBIV plb, int nCtl)
void xxxLBButtonUp (PLBIV plb, UINT uFlags)
INT CItemInWindowVarOwnerDraw (PLBIV, BOOL)
INT LBPage (PLBIV, INT, BOOL)
VOID LBCalcItemRowsAndColumns (PLBIV)
BOOL LBGetItemRect (PLBIV, INT, LPRECT)
VOID LBSetVariableHeightItemHeight (PLBIV, INT, INT)
INT LBGetVariableHeightItemHeight (PLBIV, INT)
INT xxxLBSetCount (PLBIV, INT)
UINT LBCalcAllocNeeded (PLBIV, INT)
LONG xxxLBInitStorage (PLBIV plb, BOOL fAnsi, INT cItems, INT cb)
HWND InternalCreateDialog (HANDLE hmod, LPDLGTEMPLATE lpDlgTemplate, DWORD cb, HWND hwndOwner, DLGPROC pfnWndProc, LPARAM dwInitParam, UINT fFlags)
INT_PTR InternalDialogBox (HANDLE hmod, LPDLGTEMPLATE lpDlgTemplate, HWND hwndOwner, DLGPROC pfnWndProc, LPARAM dwInitParam, UINT fFlags)
PWND _FindDlgItem (PWND pwndParent, DWORD id)
PWND _GetDlgItem (PWND, int)
long _GetDialogBaseUnits (VOID)
PWND GetParentDialog (PWND pwndDialog)
VOID xxxRemoveDefaultButton (PWND pwndDlg, PWND pwndStart)
VOID xxxCheckDefPushButton (PWND pwndDlg, HWND hwndOldFocus, HWND hwndNewFocus)
PWND xxxGotoNextMnem (PWND pwndDlg, PWND pwndStart, WCHAR ch)
VOID DlgSetFocus (HWND hwnd)
void RepositionRect (PMONITOR pMonitor, LPRECT lprc, DWORD dwStyle, DWORD dwExStyle)
BOOL ValidateDialogPwnd (PWND pwnd)
PMONITOR GetDialogMonitor (HWND hwndOwner, DWORD dwFlags)
HANDLE GetEditDS (VOID)
VOID ReleaseEditDS (HANDLE h)
VOID TellWOWThehDlg (HWND hDlg)
UINT GetACPCharSet ()
BOOL GetMenuItemInfoInternalW (HMENU hMenu, UINT uID, BOOL fByPosition, LPMENUITEMINFOW lpmii)
BOOL InternalInsertMenuItem (HMENU hMenu, UINT uID, BOOL fByPosition, LPCMENUITEMINFO lpmii)
BOOL ValidateMENUITEMINFO (LPMENUITEMINFOW lpmiiIn, LPMENUITEMINFOW lpmii, DWORD dwAPICode)
BOOL ValidateMENUINFO (LPCMENUINFO lpmi, DWORD dwAPICode)
BOOL ThunkedMenuItemInfo (HMENU hMenu, UINT nPosition, BOOL fByPosition, BOOL fInsert, LPMENUITEMINFOW lpmii, BOOL fAnsi)
void SetMenuItemInfoStruct (HMENU hMenu, UINT wFlags, UINT_PTR wIDNew, LPWSTR pwszNew, LPMENUITEMINFOW pmii)
BOOL CreateMDIChild (PSHORTCREATE pcs, LPMDICREATESTRUCT pmcs, DWORD dwExpWinVerAndFlags, HMENU *phSysMenu, PWND pwndParent)
BOOL MDICompleteChildCreation (HWND hwndChild, HMENU hSysMenu, BOOL fVisible, BOOL fDisabled)
PWND FindPwndChild (PWND pwndMDI, UINT wChildID)
int MakeMenuItem (LPWSTR lpOut, PWND pwnd)
VOID ModifyMenuItem (PWND pwnd)
BOOL MDIAddSysMenu (HMENU hmenuFrame, HWND hwndChild)
BOOL MDIRemoveSysMenu (HMENU hMenuFrame, HWND hwndChild)
VOID ShiftMenuIDs (PWND pwnd, PWND pwndVictim)
HMENU MDISetMenu (PWND, BOOL, HMENU, HMENU)
BOOL EnterReaderModeHelper (HWND hwnd)
DWORD UserGetCodePage (HDC hdc)
BOOL UserIsFullWidth (DWORD dwCodePage, WCHAR wChar)
BOOL UserIsFELineBreak (DWORD dwCodePage, WCHAR wChar)
VOID InitializeImmEntryTable (VOID)
VOID GetImmFileName (PWSTR)
VOID CliImmInitializeHotKeys (DWORD dwAction, HKL hkl)
BOOL SyncSoftKbdState (HIMC hImc, LPARAM lParam)
__inline PVOID REBASESHAREDPTRALWAYS (KERNEL_PVOID p)
__inline PVOID REBASESHAREDPTR (KERNEL_PVOID p)
__inline PDISPLAYINFO GetDispInfo (void)
__inline PMONITOR GetPrimaryMonitor (void)

Variables

PTHREADINFO PtiCurrent (VOID)
ImmApiEntries gImmApiEntries
HMODULE ghImm32


Define Documentation

#define _GetClassLongPtr   _GetClassLong
 

Definition at line 1469 of file usercli.h.

Referenced by GetClassLongPtr().

#define _GetWindowLongPtr   _GetWindowLong
 

Definition at line 1191 of file usercli.h.

Referenced by GetWindowLongPtr(), and xxxEventWndProc().

#define _SetWindowLongPtr   _SetWindowLong
 

Definition at line 1366 of file usercli.h.

Referenced by SetWindowLongPtr().

#define ACTIVE pmdi   )     (pmdi->hwndActiveChild)
 

Definition at line 2069 of file usercli.h.

Referenced by DefFrameProcWorker(), DefMDIChildProcWorker(), MDIClientWndProcWorker(), MDICompleteChildCreation(), MDISetMenu(), ModifyMenuItem(), TranslateMDISysAccel(), xxxMDIActivate(), and xxxMDIDestroy().

#define AWCOMPARECHAR ped,
pbyte,
awchar   )     (ped->fAnsi ? (*(PUCHAR)(pbyte) == (UCHAR)(awchar)) : (*(LPWSTR)(pbyte) == (WCHAR)(awchar)))
 

Definition at line 1132 of file usercli.h.

Referenced by MLBuildchLines(), MLIchToXYPos(), MLIchToYPos(), and MLUpdateiCaretLine().

#define BFT_BITMAP   0x4D42
 

Definition at line 1629 of file usercli.h.

Referenced by RtlLoadObjectFromDIBFile().

#define BFT_CURSOR   0x5450
 

Definition at line 1630 of file usercli.h.

#define BFT_ICON   0x4349
 

Definition at line 1628 of file usercli.h.

#define BitmapSize cx,
cy,
planes,
bits   )     (BitmapWidth(cx, bits) * (cy) * (planes))
 

Definition at line 302 of file usercli.h.

Referenced by RtlLoadObjectFromDIBFile().

#define BitmapWidth cx,
bpp   )     (((((cx)*(bpp)) + 31) & ~31) >> 3)
 

Definition at line 305 of file usercli.h.

Referenced by ConvertDIBBitmap(), CopyDibHdr(), and ScaleDIB().

#define BST_CAPTURED   0x0020
 

Definition at line 392 of file usercli.h.

Referenced by ButtonWndProcWorker(), xxxBNReleaseCapture(), and xxxBNSetCapture().

#define BST_CHECKMASK   0x0003
 

Definition at line 390 of file usercli.h.

Referenced by ButtonWndProcWorker(), xxxBNDrawText(), xxxBNReleaseCapture(), xxxButtonDrawCheck(), and xxxDrawButton().

#define BST_DONTCLICK   0x0080
 

Definition at line 394 of file usercli.h.

Referenced by ButtonWndProcWorker(), IsDialogMessageW(), and xxxGotoNextMnem().

#define BST_INBMCLICK   0x0100
 

Definition at line 395 of file usercli.h.

Referenced by ButtonWndProcWorker().

#define BST_INCLICK   0x0010
 

Definition at line 391 of file usercli.h.

Referenced by ButtonWndProcWorker(), and xxxBNSetCapture().

#define BST_MOUSE   0x0040
 

Definition at line 393 of file usercli.h.

Referenced by ButtonWndProcWorker(), and xxxBNReleaseCapture().

#define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_CLIENTW _hwnd,
_msg,
_wParam,
_lParam,
_time,
_pt,
_bDbcs   ) 
 

Definition at line 2366 of file usercli.h.

Referenced by DispatchMessageWorker(), and SendMessageWorker().

#define BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER _pmsg,
_dwAnsi,
_bIrDbcsFormat,
bSaveMsg   ) 
 

Definition at line 2311 of file usercli.h.

Referenced by _PeekMessage(), and GetMessage().

#define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_CLIENTA _msg,
_wParam,
_RetVal   ) 
 

Definition at line 2282 of file usercli.h.

Referenced by DispatchMessageWorker(), IsDialogMessageA(), and SendMessageWorker().

#define BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_SERVER _msg,
_wParam   ) 
 

Value:

\ if (((_msg) == WM_CHAR) || ((_msg) == EM_SETPASSWORDCHAR)) { \ /* \ * Only LOWORD of WPARAM is valid for WM_CHAR.... \ * (Mask off DBCS messaging information.) \ */ \ (_wParam) &= 0x0000FFFF; \ }

Definition at line 2359 of file usercli.h.

Referenced by _PeekMessage(), and GetMessage().

#define BUILD_DBCS_MESSAGE_TO_SERVER_FROM_CLIENTA _msg,
_wParam,
_RetVal   ) 
 

Definition at line 2253 of file usercli.h.

Referenced by CallMsgFilter(), DispatchMessageWorker(), MESSAGECALL(), PostMessage(), PostThreadMessage(), SendMessageCallback(), and SendNotifyMessage().

#define BUTTONSTATE pbutn   )     (pbutn->buttonState)
 

Definition at line 388 of file usercli.h.

Referenced by ButtonWndProcWorker(), IsDialogMessageW(), xxxBNDrawText(), xxxBNOwnerDraw(), xxxBNPaint(), xxxBNReleaseCapture(), xxxBNSetCapture(), xxxButtonDrawCheck(), xxxButtonDrawNewState(), xxxDrawButton(), and xxxGotoNextMnem().

#define CalcAnsiStringLengthA _ansistring,
_unicodeLength,
_ansiLength   ) 
 

Value:

/* \ * Get AnsiStringLength from AnsiString,UnicodeLength \ */ \ { \ LPSTR _string = (_ansistring); \ LONG _length = (LONG)(_unicodeLength); \ (*(_ansiLength)) = 0; \ while(*_string && _length) { \ if(IsDBCSLeadByte(*_string)) { \ (*(_ansiLength)) += 2; _string++; \ } else { \ (*(_ansiLength))++; \ } \ _string++; _length--; \ } \ }

Definition at line 2410 of file usercli.h.

Referenced by MESSAGECALL().

#define CalcAnsiStringLengthW _unicodestring,
_unicodeLength,
_ansiLength   ) 
 

Value:

/* \ * Get AnsiStringLength from UnicodeString,UnicodeLength \ */ \ { \ RtlUnicodeToMultiByteSize((ULONG *)(_ansiLength), \ (LPWSTR)(_unicodestring), \ (ULONG)((_unicodeLength)*sizeof(WCHAR))); \ }

Definition at line 2402 of file usercli.h.

Referenced by MESSAGECALL().

#define CALCSCROLL   0x0800
 

Definition at line 2062 of file usercli.h.

Referenced by MDIClientWndProcWorker(), and RecalculateScrollRanges().

#define CalcUnicodeStringLengthA _ansistring,
_ansiLength,
_unicodeLength   ) 
 

Value:

/* \ * Get UnicodeLength from AnsiString,AnsiLength \ */ \ { \ RtlMultiByteToUnicodeSize((ULONG *)(_unicodeLength), \ (LPSTR)(_ansistring), \ (ULONG)(_ansiLength)); \ (*(_unicodeLength)) /= sizeof(WCHAR); \ }

Definition at line 2426 of file usercli.h.

Referenced by MESSAGECALL().

#define CalcUnicodeStringLengthW _unicodestring,
_ansiLength,
_unicodeLength   ) 
 

Value:

/* \ * Get UnicodeLength from UnicodeString,AnsiLength \ */ \ { \ LPWSTR _string = (_unicodestring); \ LONG _length = (LONG)(_ansiLength); \ LONG _charlength; \ (*(_unicodeLength)) = 0; \ while(*_string && (_length > 0)) { \ CalcAnsiStringLengthW(_string,1,&_charlength); \ _length -= _charlength; \ if(_length >= 0) { \ (*(_unicodeLength))++; \ } \ _string++; \ } \ }

Definition at line 2435 of file usercli.h.

Referenced by MESSAGECALL().

#define CALLPROC  )     ((GENERICPROC)p)
 

Definition at line 176 of file usercli.h.

Referenced by MESSAGECALL(), and NtUserMessageCall().

#define CALLPROC_WOWCHECK pfn,
hwnd,
msg,
wParam,
lParam   )     CALLPROC_WOWCHECKPWW(pfn, hwnd, msg, wParam, lParam, NULL)
 

Definition at line 191 of file usercli.h.

Referenced by CallWindowProcAorW().

#define CALLPROC_WOWCHECKPWW pfn,
hwnd,
msg,
wParam,
lParam,
pww   ) 
 

Value:

(IsWOWProc(pfn) ? (*pfnWowWndProcEx)(hwnd, msg, wParam, lParam, PtrToUlong(pfn), pww) : \ UserCallWinProc((WNDPROC)pfn, hwnd, msg, wParam, lParam))

Definition at line 187 of file usercli.h.

Referenced by DispatchClientMessage(), DispatchMessageWorker(), and SendMessageWorker().

#define CALLPROC_WOWCHECKPWW_DLG pfn,
hwnd,
msg,
wParam,
lParam,
pww   ) 
 

Value:

(IsWOWProc(pfn) ? (*pfnWowDlgProcEx)(hwnd, msg, wParam, lParam, PtrToUlong(pfn), pww) : \ UserCallWinProc((WNDPROC)pfn, hwnd, msg, wParam, lParam))

Definition at line 183 of file usercli.h.

Referenced by DefDlgProcWorker().

#define CALLWORDBREAKPROC proc,
pText,
iStart,
cch,
iAction   ) 
 

Value:

(IsWOWProc(proc) ? \ (* pfnWowEditNextWord)(pText, iStart, cch, iAction, PtrToUlong(proc)) : \ (* proc)(pText, iStart, cch, iAction))

Definition at line 516 of file usercli.h.

Referenced by MLBuildchLines(), and NextWordCallBack().

#define CaretCreate plb   )     ((plb)->fCaret = TRUE)
 

Definition at line 442 of file usercli.h.

Referenced by ListBoxWndProcWorker().

#define CBBUTTONID   1002
 

Definition at line 418 of file usercli.h.

#define CBEDITEXTRA   6
 

Definition at line 478 of file usercli.h.

Referenced by RW_RegisterControls().

#define CBEDITID   1001
 

Definition at line 417 of file usercli.h.

Referenced by xxxCBCreateHandler().

#define CBLISTBOXID   1000
 

Definition at line 416 of file usercli.h.

Referenced by SLCreate(), and xxxCBCreateHandler().

#define CCHALLOCEXTRA   0x20
 

Definition at line 484 of file usercli.h.

Referenced by ECDeleteText(), ECInsertText(), ECNcCreate(), ECSetText(), and MLSetHandle().

#define CCHFILEMAX   MAX_PATH
 

Definition at line 926 of file usercli.h.

Referenced by DlgDirSelectHelper(), xxxDlgDirListHelper(), xxxLbDir(), and xxxLbInsertFile().

#define CHAR_WIDTH_BUFFER_LENGTH   128
 

Definition at line 549 of file usercli.h.

Referenced by ECSetFont(), ECTabTheTextOut(), GetActualNegA(), and GetNegABCwidthInfo().

#define CheckLock pobj   ) 
 

Definition at line 361 of file usercli.h.

Referenced by AdjustPushStateForKL(), ButtonWndProcWorker(), CalcClientScrolling(), ComboBoxWndProcWorker(), DefDlgProcWorker(), DefFrameProcWorker(), DefMDIChildProcWorker(), DialogBox2(), DupConvTerminate(), EndDialog(), ImeWndProcWorker(), InternalDialogBox(), IsDialogMessageW(), ListBoxWndProcWorker(), MDIClientWndProcWorker(), MNRecalcTabStrings(), SetClassCursor(), StaticWndProcWorker(), TranslateMDISysAccel(), xxxActivateApp(), xxxActivateKeyboardLayout(), xxxActivateThisWindow(), xxxActivateWindow(), xxxActiveWindowTracking(), xxxAddFullScreen(), xxxAdjustSize(), xxxAdvise(), xxxAdviseAck(), xxxAdviseData(), xxxAdviseDataAck(), xxxAlterHilite(), xxxAnimateCaption(), xxxArrangeIconicWindows(), xxxBeginPaint(), xxxBNGetDC(), xxxBNInitDC(), xxxBNPaint(), xxxBNReleaseCapture(), xxxBNSetCapture(), xxxBroadcastPaletteChanged(), xxxButtonDrawNewState(), xxxButtonNotifyParent(), xxxCalcCaptionButton(), xxxCalcClientRect(), xxxCallHandleMenuMessages(), xxxCancelMouseMoveTracking(), xxxCapture(), xxxCaretDestroy(), xxxCBCalcControlRects(), xxxCBCommandHandler(), xxxCBCompleteEditWindow(), xxxCBCreateHandler(), xxxCBDir(), xxxCBGetFocusHelper(), xxxCBGetTextHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBInvertStaticWindow(), xxxCBKillFocusHelper(), xxxCBMessageItemHandler(), xxxCBNcDestroyHandler(), xxxCBNotifyParent(), xxxCBPaint(), xxxCBSetEditItemHeight(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxCBSizeHandler(), xxxCBUpdateListBoxWindow(), xxxChangeClipboardChain(), xxxCheckDefPushButton(), xxxCheckFocus(), xxxCheckFullScreen(), xxxCheckRedraw(), xxxChildResize(), xxxCleanupDesktopMenu(), xxxContScroll(), xxxCopyAckIn(), xxxCreateCaret(), xxxCreateTooltip(), xxxCreateWindowEx(), xxxCreateWindowSmIcon(), xxxDDETrackPostHook(), xxxDDETrackWindowDying(), xxxDefWindowProc(), xxxDesktopPaintCallback(), xxxDesktopWndProc(), xxxDestroyLBox(), xxxDestroyWindow(), xxxDlgDirListHelper(), xxxDoSyncPaint(), xxxDragObject(), xxxDrawAnimatedRects(), xxxDrawCaptionBar(), xxxDrawCaptionTemp(), xxxDrawDragRect(), xxxDrawMenuBar(), xxxDrawMenuBarTemp(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItem(), xxxDrawSB2(), xxxDrawScrollBar(), xxxDrawThumb(), xxxDrawWallpaper(), xxxDrawWindowFrame(), xxxDW_DestroyOwnedWindows(), xxxDW_SendDestroyMessages(), xxxDWP_DoNCActivate(), xxxDWP_EraseBkgnd(), xxxDWP_NCMouse(), xxxDWP_Paint(), xxxDWP_SetCursor(), xxxDWP_SetIcon(), xxxDWP_SetRedraw(), xxxDWPPrint(), xxxEnableMenuItem(), xxxEnableSBCtlArrows(), xxxEnableScrollBar(), xxxEnableWindow(), xxxEnableWndSBArrows(), xxxEndDeferWindowPosEx(), xxxEndPaint(), xxxEndScroll(), xxxEventWndProc(), xxxExecute(), xxxExecuteAck(), xxxFillWindow(), xxxFindString(), xxxFlashWindow(), xxxFlushPalette(), xxxFocusSetInputContext(), xxxFreeWindow(), xxxFW_DestroyAllChildren(), xxxGetColorObjects(), xxxGetControlBrush(), xxxGetEventProc(), xxxGetInitMenuParam(), xxxGetMenuBarInfo(), xxxGetMenuItemRect(), xxxGetSysMenu(), xxxGetSysMenuHandle(), xxxGetSystemMenu(), xxxGetTitleBarInfo(), xxxGetUpdateRect(), xxxGetUpdateRgn(), xxxGetWindowSmIcon(), xxxGetWindowText(), xxxGNM_FindNextMnem(), xxxGotoNextMnem(), xxxHandleNCMouseGuys(), xxxHandleOwnerSwitch(), xxxHandleWindowPosChanged(), xxxHelpLoop(), xxxHotTrack(), xxxHotTrackMenu(), xxxHungAppDemon(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateLayout(), xxxImmActivateThreadsLayout(), xxxImmProcessKey(), xxxInitActivateDlg(), xxxInitSendValidateMinMaxInfo(), xxxInsertMenuItem(), xxxInsureVisible(), xxxInternalActivateKeyboardLayout(), xxxInternalDoSyncPaint(), xxxInternalEnumWindow(), xxxInternalInvalidate(), xxxInternalPaintDesktop(), xxxInternalUpdateWindow(), xxxInvalidateDesktopOnPaletteChange(), xxxInvalidateRect(), xxxInvalidateRgn(), xxxInvertLBItem(), xxxLBBinarySearchString(), xxxLBBlockHilite(), xxxLBButtonUp(), xxxLbDir(), xxxLBDrawLBItem(), xxxLBGetBrush(), xxxLbInsertFile(), xxxLBInsertItem(), xxxLBInvalidateRect(), xxxLBoxCtlCharInput(), xxxLBoxCtlDelete(), xxxLBoxCtlHScroll(), xxxLBoxCtlHScrollMultiColumn(), xxxLBoxCtlKeyInput(), xxxLBoxCtlScroll(), xxxLBoxDeleteItem(), xxxLBoxDoDeleteItems(), xxxLBoxDrawItem(), xxxLBPaint(), xxxLBSelRange(), xxxLBSetCount(), xxxLBSetCurSel(), xxxLBSetFont(), xxxLBSetRedraw(), xxxLBSetSel(), xxxLBSize(), xxxMakeWindowForegroundWithState(), xxxMDIActivate(), xxxMDIDestroy(), xxxMDINext(), xxxMenuBarCompute(), xxxMenuBarDraw(), xxxMenuDraw(), xxxMenuItemFromPoint(), xxxMenuWindowProc(), xxxMinimizeHungWindow(), xxxMinMaximize(), xxxMNCanClose(), xxxMNCompute(), xxxMNInvertItem(), xxxMNItemSize(), xxxMNRecomputeBarIfNeeded(), xxxMNStartMenuState(), xxxMouseActivate(), xxxMoveSize(), xxxMoveSwitchWndHilite(), xxxMoveThumb(), xxxMoveWindow(), xxxMS_TrackMove(), xxxNewITopEx(), xxxNotifyIMEStatus(), xxxNotifyOwner(), xxxOpenClipboard(), xxxPaintIconsInSwitchWindow(), xxxPaintRect(), xxxPaintSwitchWindow(), xxxPoke(), xxxPokeAck(), xxxProcessHungThreadEvent(), xxxQueryDropObject(), xxxRealDrawMenuItem(), xxxRealizeDesktop(), xxxRecreateSmallIcons(), xxxRedrawFrame(), xxxRedrawFrameAndHook(), xxxRedrawHungWindow(), xxxRedrawHungWindowFrame(), xxxRedrawTitle(), xxxRedrawWindow(), xxxRemoveDefaultButton(), xxxRemoveDeleteMenuHelper(), xxxRemoveFullScreen(), xxxRequestAck(), xxxResetTooltip(), xxxResetWorld(), xxxRestoreDlgFocus(), xxxSaveDlgFocus(), xxxSBTrackInit(), xxxSBTrackLoop(), xxxSBWndProc(), xxxScrollWindowEx(), xxxSendChildNCPaint(), xxxSendEraseBkgnd(), xxxSendFocusMessages(), xxxSendHelpMessage(), xxxSendMenuDrawItemMessage(), xxxSendMenuSelect(), xxxSendMessageCallback(), xxxSendMessageTimeout(), xxxSendNCPaint(), xxxSetActiveWindow(), xxxSetClassData(), xxxSetClassIcon(), xxxSetClassIconEnum(), xxxSetClassLongPtr(), xxxSetClipboardViewer(), xxxSetDialogSystemMenu(), xxxSetFocus(), xxxSetForegroundWindow(), xxxSetForegroundWindow2(), xxxSetFrameTitle(), xxxSetInternalWindowPos(), xxxSetISelBase(), xxxSetLayeredWindow(), xxxSetLPITEMInfo(), xxxSetMenu(), xxxSetMenuInfo(), xxxSetMenuItemInfo(), xxxSetParent(), xxxSetPKLinThreads(), xxxSetScrollBar(), xxxSetStaticImage(), xxxSetSysMenu(), xxxSetSystemMenu(), xxxSetTrayWindow(), xxxSetWindowData(), xxxSetWindowPlacement(), xxxSetWindowPos(), xxxSetWindowStyle(), xxxShowOwnedPopups(), xxxShowOwnedWindows(), xxxShowScrollBar(), xxxShowSwitchWindow(), xxxShowTooltip(), xxxShowWindow(), xxxSimpleDoSyncPaint(), xxxSnapWindow(), xxxStaticLoadImage(), xxxStaticPaint(), xxxSwitchToThisWindow(), xxxSwitchWndProc(), xxxSwpActivate(), xxxSysCommand(), xxxSystemTimerProc(), xxxTA_AccelerateMenu(), xxxTooltipWndProc(), xxxTrackBox(), xxxTrackCaptionButton(), xxxTrackInitSize(), xxxTrackMouse(), xxxTrackMouseMove(), xxxTrackPopupMenuEx(), xxxTrackThumb(), xxxTranslateAccelerator(), xxxUnadviseAck(), xxxUpdateOtherThreadsWindows(), xxxUpdateThreadsWindows(), xxxUpdateTray(), xxxUpdateWindow(), xxxUpdateWindow2(), xxxUpdateWindows(), xxxValidateRect(), xxxValidateRgn(), xxxWindowHitTest(), and xxxWindowHitTest2().

#define CITEMSALLOC   32
 

Definition at line 785 of file usercli.h.

Referenced by xxxLBInsertItem(), and xxxLBSetCount().

#define CKIDS pmdi   )     (pmdi->cKids)
 

Definition at line 2067 of file usercli.h.

Referenced by CreateMDIChild(), DefFrameProcWorker(), MDIClientWndProcWorker(), MDICompleteChildCreation(), MDISetMenu(), ShiftMenuIDs(), xxxInitActivateDlg(), and xxxMDIDestroy().

#define COM_NO_WINDOWS_H
 

Definition at line 2090 of file usercli.h.

#define COMBOBOXSTYLE style   )     ((LOBYTE(style)) & 3)
 

Definition at line 458 of file usercli.h.

#define CrackCombinedDbcsLB c   )     ((BYTE)(c))
 

Definition at line 1022 of file usercli.h.

#define CrackCombinedDbcsTB c   )     ((c) >> 8)
 

Definition at line 1023 of file usercli.h.

Referenced by ComboBoxDBCharHandler().

#define CreateCaret   NtUserCreateCaret
 

Definition at line 1579 of file usercli.h.

Referenced by ECSetCaretHandler(), and WndProc().

#define CsSendMessage hwnd,
msg,
wParam,
lParam,
xParam,
pfn,
bAnsi   ) 
 

Value:

(((msg) >= WM_USER) ? \ NtUserMessageCall(hwnd, msg, wParam, lParam, xParam, pfn, bAnsi) : \ gapfnScSendMessage[MessageTable[msg].iFunction](hwnd, msg, wParam, lParam, xParam, pfn, bAnsi))

Definition at line 148 of file usercli.h.

Referenced by BroadcastSystemMessageWorker(), CallNextHookEx(), CallWindowProcAorW(), DefWindowProcWorker(), DesktopWndProcWorker(), EditWndProcWorker(), MenuWindowProcA(), MenuWindowProcW(), MenuWndProcWorker(), ScrollBarWndProcWorker(), SendMessage(), SendMessageTimeoutWorker(), and SendMessageWorker().

#define CTRLDOWN   1 /* Control key only down */
 

Definition at line 510 of file usercli.h.

Referenced by ECGetModKeys(), MLChar(), MLKeyDown(), and SLKeyDown().

#define DBT_FOCUS   0x0002
 

Definition at line 404 of file usercli.h.

Referenced by ButtonWndProcWorker(), xxxBNDrawText(), xxxBNPaint(), and xxxDrawButton().

#define DBT_TEXT   0x0001
 

Definition at line 403 of file usercli.h.

Referenced by xxxBNDrawText(), xxxBNPaint(), and xxxDrawButton().

#define DIFFWOWHANDLE h1,
h2   )     (!SAMEWOWHANDLE(h1, h2))
 

Definition at line 161 of file usercli.h.

Referenced by DefMDIChildProcWorker(), and StartTaskModalDialog().

#define DISPATCH_DBCS_MESSAGE_IF_EXIST _msg,
_wParam,
_bDbcs,
_apiName   ) 
 

Value:

/* \ * Check we need to send trailing byte or not, if the wParam has Dbcs character \ */ \ if (IS_DBCS_ENABLED() && (_bDbcs) && (GetCallBackDbcsInfo()->wParam)) { \ PKERNEL_MSG pmsgDbcsCB = GetCallBackDbcsInfo(); \ /* \ * If an app didn't peek (or get) the trailing byte from within \ * WndProc, and then pass the DBCS TrailingByte to the ANSI WndProc here \ * pmsgDbcsCB->wParam has DBCS TrailingByte here.. see above.. \ */ \ (_wParam) = KERNEL_WPARAM_TO_WPARAM(pmsgDbcsCB->wParam); \ /* \ * Invalidate cached message. \ */ \ pmsgDbcsCB->wParam = 0; \ /* \ * Send it.... \ */ \ goto _apiName ## Again; \ }

Definition at line 2390 of file usercli.h.

Referenced by DispatchMessageWorker(), and SendMessageWorker().

 
#define ECGetCaretWidth  )     (gpsi->uCaretWidth)
 

Definition at line 1051 of file usercli.h.

Referenced by ECSetFont(), MLEditWndProc(), MLSetCaretPosition(), MLSetFocus(), SLEditWndProc(), and SLSetFocus().

#define ECT_CALC   0
 

Definition at line 1047 of file usercli.h.

Referenced by ECCchInWidth(), and MLGetLineWidth().

#define ECT_NORMAL   1
 

Definition at line 1048 of file usercli.h.

Referenced by MLDrawText().

#define ECT_SELECTED   2
 

Definition at line 1049 of file usercli.h.

Referenced by ECTabTheTextOut(), and MLDrawText().

#define EQ   0
 

Definition at line 788 of file usercli.h.

Referenced by Compare(), ListBoxWndProcWorker(), and xxxFindString().

#define EXTENDEDSEL   2
 

Definition at line 795 of file usercli.h.

Referenced by xxxLBButtonUp(), xxxLBCreate(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), and xxxTrackMouse().

#define FAREAST_CHARSET_BITS   (FS_JISJAPAN | FS_CHINESESIMP | FS_WANSUNG | FS_CHINESETRAD)
 

Definition at line 724 of file usercli.h.

Referenced by ECGetDBCSVector().

#define FDEFWINDOWMSG msg,
procname   ) 
 

Value:

((msg <= (gSharedInfo.procname.maxMsgs)) && \ ((gSharedInfo.procname.abMsgs)[msg / 8] & (1 << (msg & 7))))

Definition at line 141 of file usercli.h.

Referenced by DefWindowProcWorker().

#define FillWindow   NtUserFillWindow
 

Definition at line 1580 of file usercli.h.

Referenced by DefDlgProcWorker(), ListBoxWndProcWorker(), MLEditWndProc(), and UserRegisterWowHandlers().

#define FINDRESOURCEA hModule,
lpName,
lpType   )     ((*(pfnFindResourceExA))(hModule, lpType, lpName, 0))
 

Definition at line 907 of file usercli.h.

Referenced by CreateDialogParamA(), DialogBoxParamA(), LoadAcceleratorsA(), and LoadMenuA().

#define FINDRESOURCEEXA hModule,
lpName,
lpType,
wLang   )     ((*(pfnFindResourceExA))(hModule, lpType, lpName, wLang))
 

Definition at line 909 of file usercli.h.

Referenced by WOWFindResourceExWCover().

#define FINDRESOURCEEXW hModule,
lpName,
lpType,
wLang   )     ((*(pfnFindResourceExW))(hModule, lpType, lpName, wLang))
 

Definition at line 910 of file usercli.h.

Referenced by LoadStringOrError().

#define FINDRESOURCEW hModule,
lpName,
lpType   )     ((*(pfnFindResourceExW))(hModule, lpType, lpName, 0))
 

Definition at line 908 of file usercli.h.

Referenced by CreateDialogParamW(), DialogBoxParamW(), LoadAcceleratorsW(), LoadBmp(), LoadDIB(), LoadMenuW(), and SplFindResource().

#define FIRST pmdi   )     (pmdi->idFirstChild)
 

Definition at line 2071 of file usercli.h.

Referenced by AppendToWindowsMenu(), CreateMDIChild(), DefFrameProcWorker(), MakeMenuItem(), MDIClientWndProcWorker(), MDISetMenu(), ModifyMenuItem(), ShiftMenuIDs(), xxxInitActivateDlg(), xxxMDIActivate(), and xxxMDIDestroy().

#define fnCOPYDATA   NtUserMessageCall
 

Definition at line 1204 of file usercli.h.

#define fnDDEINIT   NtUserMessageCall
 

Definition at line 1205 of file usercli.h.

#define fnDWORD   NtUserMessageCall
 

Definition at line 1206 of file usercli.h.

#define fnDWORDOPTINLPMSG   NtUserMessageCall
 

Definition at line 1207 of file usercli.h.

#define fnGETDBCSTEXTLENGTHS   NtUserMessageCall
 

Definition at line 1209 of file usercli.h.

#define fnGETTEXTLENGTHS   NtUserMessageCall
 

Definition at line 1208 of file usercli.h.

#define fnINCBOXSTRING   NtUserMessageCall
 

Definition at line 1233 of file usercli.h.

#define fnINCNTOUTSTRING   NtUserMessageCall
 

Definition at line 1234 of file usercli.h.

#define fnINCNTOUTSTRINGNULL   NtUserMessageCall
 

Definition at line 1235 of file usercli.h.

#define fnINLBOXSTRING   NtUserMessageCall
 

Definition at line 1236 of file usercli.h.

#define fnINLPCOMPAREITEMSTRUCT   NtUserMessageCall
 

Definition at line 1211 of file usercli.h.

#define fnINLPCREATESTRUCT   NtUserMessageCall
 

Definition at line 1210 of file usercli.h.

#define fnINLPDELETEITEMSTRUCT   NtUserMessageCall
 

Definition at line 1212 of file usercli.h.

#define fnINLPDRAWITEMSTRUCT   NtUserMessageCall
 

Definition at line 1213 of file usercli.h.

#define fnINLPHELPINFOSTRUCT   NtUserMessageCall
 

Definition at line 1214 of file usercli.h.

#define fnINLPHLPSTRUCT   NtUserMessageCall
 

Definition at line 1215 of file usercli.h.

#define fnINLPMDICREATESTRUCT   NtUserMessageCall
 

Definition at line 1237 of file usercli.h.

#define fnINLPWINDOWPOS   NtUserMessageCall
 

Definition at line 1216 of file usercli.h.

#define fnINOUTDRAG   NtUserMessageCall
 

Definition at line 1217 of file usercli.h.

#define fnINOUTLPMEASUREITEMSTRUCT   NtUserMessageCall
 

Definition at line 1218 of file usercli.h.

#define fnINOUTLPPOINT5   NtUserMessageCall
 

Definition at line 1219 of file usercli.h.

#define fnINOUTLPRECT   NtUserMessageCall
 

Definition at line 1220 of file usercli.h.

#define fnINOUTLPSCROLLINFO   NtUserMessageCall
 

Definition at line 1221 of file usercli.h.

#define fnINOUTLPWINDOWPOS   NtUserMessageCall
 

Definition at line 1222 of file usercli.h.

#define fnINOUTMENUGETOBJECT   NtUserMessageCall
 

Definition at line 1232 of file usercli.h.

#define fnINOUTNCCALCSIZE   NtUserMessageCall
 

Definition at line 1223 of file usercli.h.

#define fnINOUTNEXTMENU   NtUserMessageCall
 

Definition at line 1224 of file usercli.h.

#define fnINOUTSTYLECHANGE   NtUserMessageCall
 

Definition at line 1225 of file usercli.h.

#define fnINSTRING   NtUserMessageCall
 

Definition at line 1238 of file usercli.h.

#define fnINSTRINGNULL   NtUserMessageCall
 

Definition at line 1239 of file usercli.h.

#define fnINWPARAMCHAR   NtUserMessageCall
 

Definition at line 1240 of file usercli.h.

#define fnKERNELONLY   NtUserMessageCall
 

Definition at line 1244 of file usercli.h.

#define fnOPTOUTLPDWORDOPTOUTLPDWORD   NtUserMessageCall
 

Definition at line 1226 of file usercli.h.

#define fnOUTCBOXSTRING   NtUserMessageCall
 

Definition at line 1241 of file usercli.h.

#define fnOUTDWORDINDWORD   NtUserMessageCall
 

Definition at line 1231 of file usercli.h.

#define fnOUTLBOXSTRING   NtUserMessageCall
 

Definition at line 1242 of file usercli.h.

#define fnOUTLPRECT   NtUserMessageCall
 

Definition at line 1227 of file usercli.h.

#define fnOUTSTRING   NtUserMessageCall
 

Definition at line 1243 of file usercli.h.

#define fnPOPTINLPUINT   NtUserMessageCall
 

Definition at line 1228 of file usercli.h.

#define fnPOUTLPINT   NtUserMessageCall
 

Definition at line 1229 of file usercli.h.

#define fnSENTDDEMSG   NtUserMessageCall
 

Definition at line 1230 of file usercli.h.

#define fpImmActivateLayout   gImmApiEntries.ImmActivateLayout
 

Definition at line 2552 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmAssociateContext   gImmApiEntries.ImmAssociateContext
 

Definition at line 2529 of file usercli.h.

Referenced by ECEnableDisableIME().

#define fpImmConfigureIMEW   gImmApiEntries.ImmConfigureIMEW
 

Definition at line 2554 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmEnumInputContext   gImmApiEntries.ImmEnumInputContext
 

Definition at line 2570 of file usercli.h.

Referenced by ECDoIMEMenuCommand(), and ImeSystemHandler().

#define fpImmEscapeA   gImmApiEntries.ImmEscapeA
 

Definition at line 2530 of file usercli.h.

Referenced by HanjaKeyHandler().

#define fpImmEscapeW   gImmApiEntries.ImmEscapeW
 

Definition at line 2531 of file usercli.h.

Referenced by HanjaKeyHandler(), and ImeSystemHandler().

#define fpImmFreeLayout   gImmApiEntries.ImmFreeLayout
 

Definition at line 2551 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmGetCompositionFontA   gImmApiEntries.ImmGetCompositionFontA
 

Definition at line 2542 of file usercli.h.

Referenced by ImeControlHandler().

#define fpImmGetCompositionFontW   gImmApiEntries.ImmGetCompositionFontW
 

Definition at line 2541 of file usercli.h.

Referenced by ImeControlHandler().

#define fpImmGetCompositionStringA   gImmApiEntries.ImmGetCompositionStringA
 

Definition at line 2533 of file usercli.h.

Referenced by DefWindowProcWorker().

#define fpImmGetCompositionStringW   gImmApiEntries.ImmGetCompositionStringW
 

Definition at line 2534 of file usercli.h.

Referenced by DefWindowProcWorker().

#define fpImmGetCompositionWindow   gImmApiEntries.ImmGetCompositionWindow
 

Definition at line 2535 of file usercli.h.

Referenced by ECImmSetCompositionWindow().

#define fpImmGetContext   gImmApiEntries.ImmGetContext
 

Definition at line 2532 of file usercli.h.

Referenced by DefWindowProcWorker(), ECDoIMEMenuCommand(), ECEnableDisableIME(), ECImeComposition(), ECImmSetCompositionFont(), ECImmSetCompositionWindow(), ECResultStrHandler(), ECSetIMEMenu(), EditWndProc(), FocusSetIMCContext(), HanjaKeyHandler(), ImeSetContextHandler(), and ImeSystemHandler().

#define fpImmGetConversionStatus   gImmApiEntries.ImmGetConversionStatus
 

Definition at line 2555 of file usercli.h.

Referenced by ECDoIMEMenuCommand(), ECSetIMEMenu(), ImeControlHandler(), ImeSystemHandler(), and SyncSoftKbdState().

#define fpImmGetDefaultIMEWnd   gImmApiEntries.ImmGetDefaultIMEWnd
 

Definition at line 2536 of file usercli.h.

Referenced by DefWindowProcWorker().

#define fpImmGetImeInfoEx   gImmApiEntries.ImmGetImeInfoEx
 

Definition at line 2558 of file usercli.h.

Referenced by CreateIMEUI().

#define fpImmGetOpenStatus   gImmApiEntries.ImmGetOpenStatus
 

Definition at line 2561 of file usercli.h.

Referenced by ECDoIMEMenuCommand(), ECSetIMEMenu(), and ImeControlHandler().

#define fpImmGetProperty   gImmApiEntries.ImmGetProperty
 

Definition at line 2567 of file usercli.h.

Referenced by ECSetIMEMenu().

#define fpImmIsIME   gImmApiEntries.ImmIsIME
 

Definition at line 2537 of file usercli.h.

Referenced by EcImeRequestHandler(), ECInitInsert(), ECMenu(), ECSetFont(), ECSetIMEMenu(), ECSize(), EditWndProc(), MLSetCaretPosition(), and SLSetCaretPosition().

#define fpImmLoadIME   gImmApiEntries.ImmLoadIME
 

Definition at line 2549 of file usercli.h.

Referenced by ImeWndCreateHandler().

#define fpImmLoadLayout   gImmApiEntries.ImmLoadLayout
 

Definition at line 2564 of file usercli.h.

#define fpImmLockIMC   gImmApiEntries.ImmLockIMC
 

Definition at line 2538 of file usercli.h.

Referenced by EditWndProc(), ImeNotifyHandler(), ImeSetContextHandler(), and ImeSystemHandler().

#define fpImmLockImeDpi   gImmApiEntries.ImmLockImeDpi
 

Definition at line 2559 of file usercli.h.

Referenced by CreateIMEUI().

#define fpImmNotifyIME   gImmApiEntries.ImmNotifyIME
 

Definition at line 2547 of file usercli.h.

Referenced by ECImeComposition(), EditWndProc(), and ImeSystemHandler().

#define fpImmProcessKey   gImmApiEntries.ImmProcessKey
 

Definition at line 2565 of file usercli.h.

#define fpImmPutImeMenuItemsIntoMappedFile   gImmApiEntries.ImmPutImeMenuItemsIntoMappedFile
 

Definition at line 2566 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmRegisterClient   gImmApiEntries.ImmRegisterClient
 

Definition at line 2540 of file usercli.h.

Referenced by User32InitializeImmEntryTable(), and UserClientDllInitialize().

#define fpImmReleaseContext   gImmApiEntries.ImmReleaseContext
 

Definition at line 2539 of file usercli.h.

Referenced by DefWindowProcWorker(), ECDoIMEMenuCommand(), ECEnableDisableIME(), ECImeComposition(), ECImmSetCompositionFont(), ECImmSetCompositionWindow(), ECResultStrHandler(), ECSetIMEMenu(), EditWndProc(), FocusSetIMCContext(), and ImeSystemHandler().

#define fpImmSetActiveContext   gImmApiEntries.ImmSetActiveContext
 

Definition at line 2562 of file usercli.h.

Referenced by FocusSetIMCContext().

#define fpImmSetCandidateWindow   gImmApiEntries.ImmSetCandidateWindow
 

Definition at line 2553 of file usercli.h.

Referenced by ImeControlHandler(), and ImeSystemHandler().

#define fpImmSetCompositionFont   gImmApiEntries.ImmSetCompositionFont
 

Definition at line 2545 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmSetCompositionFontA   gImmApiEntries.ImmSetCompositionFontA
 

Definition at line 2544 of file usercli.h.

Referenced by ImeControlHandler().

#define fpImmSetCompositionFontW   gImmApiEntries.ImmSetCompositionFontW
 

Definition at line 2543 of file usercli.h.

Referenced by ECImmSetCompositionFont(), and ImeControlHandler().

#define fpImmSetCompositionStringA   gImmApiEntries.ImmSetCompositionStringA
 

Definition at line 2568 of file usercli.h.

Referenced by ECDoIMEMenuCommand().

#define fpImmSetCompositionStringW   gImmApiEntries.ImmSetCompositionStringW
 

Definition at line 2569 of file usercli.h.

Referenced by ECDoIMEMenuCommand().

#define fpImmSetCompositionWindow   gImmApiEntries.ImmSetCompositionWindow
 

Definition at line 2546 of file usercli.h.

Referenced by ECImmSetCompositionWindow(), ImeControlHandler(), ImeSetContextHandler(), and ImeSystemHandler().

#define fpImmSetConversionStatus   gImmApiEntries.ImmSetConversionStatus
 

Definition at line 2556 of file usercli.h.

Referenced by ImeControlHandler(), and SyncSoftKbdState().

#define fpImmSetOpenStatus   gImmApiEntries.ImmSetOpenStatus
 

Definition at line 2550 of file usercli.h.

Referenced by ECDoIMEMenuCommand(), ImeControlHandler(), and ImeSystemHandler().

#define fpImmSetStatusWindowPos   gImmApiEntries.ImmSetStatusWindowPos
 

Definition at line 2557 of file usercli.h.

Referenced by ImeControlHandler().

#define fpImmSystemHandler   gImmApiEntries.ImmSystemHandler
 

Definition at line 2571 of file usercli.h.

Referenced by ImeSystemHandler().

#define fpImmTranslateMessage   gImmApiEntries.ImmTranslateMessage
 

Definition at line 2563 of file usercli.h.

Referenced by TranslateMessage().

#define fpImmUnlockIMC   gImmApiEntries.ImmUnlockIMC
 

Definition at line 2548 of file usercli.h.

Referenced by EditWndProc(), ImeNotifyHandler(), ImeSetContextHandler(), and ImeSystemHandler().

#define fpImmUnlockImeDpi   gImmApiEntries.ImmUnlockImeDpi
 

Definition at line 2560 of file usercli.h.

Referenced by CreateIMEUI().

#define FREERESOURCE hResData,
hModule   )     ((*(pfnFreeResource))(hResData, hModule))
 

Definition at line 914 of file usercli.h.

Referenced by CreateDialogParamA(), CreateDialogParamW(), DialogBoxParamA(), LoadAcc(), LoadBmp(), and SplFreeResource().

#define FWINDOWMSG msg,
fnid   ) 
 

Value:

((msg <= (gSharedInfo.awmControl[fnid - FNID_START].maxMsgs)) && \ ((gSharedInfo.awmControl[fnid - FNID_START].abMsgs)[msg / 8] & (1 << (msg & 7))))

Definition at line 144 of file usercli.h.

Referenced by ButtonWndProcA(), ButtonWndProcW(), ComboBoxWndProcA(), ComboBoxWndProcW(), ComboListBoxWndProcA(), ComboListBoxWndProcW(), DesktopWndProcWorker(), EditWndProcA(), EditWndProcW(), ImeWndProcWorker(), ListBoxWndProcA(), ListBoxWndProcW(), MenuWndProcWorker(), ScrollBarWndProcWorker(), and StaticWndProcWorker().

#define GET_DBCS_MESSAGE_IF_EXIST _apiName,
_pmsg,
_wMsgFilterMin,
_wMsgFilterMax,
bRemoveMsg   ) 
 

Definition at line 2229 of file usercli.h.

Referenced by _PeekMessage(), and GetMessage().

 
#define GETAPPVER  )     GetClientInfo()->dwExpWinVer
 

Definition at line 1123 of file usercli.h.

Referenced by _AdjustWindowRectEx(), DefWindowProcWorker(), DrawTextExWorker(), ECGetBrush(), ECInsertText(), ECSetFont(), GetAppCompatFlags2(), InternalCreateDialog(), LoadBmp(), LoadIcoCur(), and MLKeyDown().

 
#define GetCallBackDbcsInfo  )     (&(GetClientInfo()->msgDbcsCB))
 

Definition at line 2217 of file usercli.h.

Referenced by PeekMessage().

#define GetControlBrush   NtUserGetControlBrush
 

Definition at line 1581 of file usercli.h.

Referenced by xxxBNInitDC(), xxxCBInternalUpdateEditWindow(), xxxCBPaint(), xxxLBGetBrush(), and xxxStaticPaint().

#define GetControlColor   NtUserGetControlColor
 

Definition at line 1582 of file usercli.h.

Referenced by PaintRect(), and xxxLBGetBrush().

#define GetDCEx   NtUserGetDCEx
 

Definition at line 1583 of file usercli.h.

Referenced by AnimateWindow(), and SmoothScrollWindowEx().

 
#define GetDispatchDbcsInfo  )     (&(GetClientInfo()->achDbcsCF[0]))
 

Definition at line 2209 of file usercli.h.

#define GETEXPWINVER hModule   )     ((*(pfnGetExpWinVer))((hModule)?(hModule):GetModuleHandle(NULL)))
 

Definition at line 916 of file usercli.h.

Referenced by _CreateWindowEx(), ECNcCreate(), GetSizeDialogTemplate(), InternalCreateDialog(), and LoadImageW().

 
#define GetForwardDbcsInfo  )     (&(GetClientInfo()->achDbcsCF[1]))
 

Definition at line 2213 of file usercli.h.

 
#define GETPROCESSID  )     (NtCurrentTeb()->ClientId.UniqueProcess)
 

Definition at line 154 of file usercli.h.

Referenced by PostMessage(), TestInputContextProcess(), and TestWindowProcess().

 
#define GETTHREADID  )     (NtCurrentTeb()->ClientId.UniqueThread)
 

Definition at line 155 of file usercli.h.

#define GetWindowPlacement   NtUserGetWindowPlacement
 

Definition at line 1584 of file usercli.h.

Referenced by DefFrameProcWorker(), and PropertiesUpdate().

#define GetWindowProcess hwnd   )     NtUserQueryWindow(hwnd, WindowProcess)
 

Definition at line 153 of file usercli.h.

Referenced by PostMessage(), and TestWindowProcess().

#define GT   3
 

Definition at line 791 of file usercli.h.

Referenced by Compare(), and xxxFindString().

#define HAS_SBHORZ   0x0200
 

Definition at line 2060 of file usercli.h.

Referenced by MDIClientWndProcWorker().

#define HAS_SBVERT   0x0100
 

Definition at line 2059 of file usercli.h.

Referenced by MDIClientWndProcWorker().

#define HILITE   1
 

Definition at line 1748 of file usercli.h.

Referenced by xxxTrackMouse().

#define HILITEANDSEL   (HILITEONLY + SELONLY)
 

Definition at line 1746 of file usercli.h.

Referenced by SetSelected(), xxxLBBlockHilite(), xxxLBoxCtlKeyInput(), xxxLBSelRange(), xxxLBSetSel(), xxxResetWorld(), and xxxTrackMouse().

#define HILITEONLY   0x0001
 

Definition at line 1744 of file usercli.h.

Referenced by IsSelected(), SetSelected(), xxxAlterHilite(), xxxLBBlockHilite(), xxxLBoxCtlKeyInput(), xxxLBPaint(), xxxLBSetCaret(), xxxResetWorld(), and xxxTrackMouse().

#define HTITLE pmdi   )     (pmdi->pTitle)
 

Definition at line 2074 of file usercli.h.

Referenced by MDIClientWndProcWorker(), and xxxSetFrameTitle().

#define ID_CNTX_AAFS   0x0000800FL
 

Definition at line 745 of file usercli.h.

#define ID_CNTX_ASS   0x0000800DL
 

Definition at line 743 of file usercli.h.

#define ID_CNTX_DISPLAYCTRL   0x00008001L
 

Definition at line 730 of file usercli.h.

Referenced by ECMenu().

#define ID_CNTX_IAFS   0x00008010L
 

Definition at line 746 of file usercli.h.

#define ID_CNTX_INSERTCTRL   0x00008013L
 

Definition at line 731 of file usercli.h.

Referenced by ECMenu().

#define ID_CNTX_ISS   0x0000800EL
 

Definition at line 744 of file usercli.h.

#define ID_CNTX_LRE   0x00008006L
 

Definition at line 736 of file usercli.h.

#define ID_CNTX_LRM   0x00008004L
 

Definition at line 734 of file usercli.h.

#define ID_CNTX_LRO   0x00008008L
 

Definition at line 738 of file usercli.h.

#define ID_CNTX_NADS   0x0000800BL
 

Definition at line 741 of file usercli.h.

#define ID_CNTX_NODS   0x0000800CL
 

Definition at line 742 of file usercli.h.

#define ID_CNTX_PDF   0x0000800AL
 

Definition at line 740 of file usercli.h.

#define ID_CNTX_RLE   0x00008007L
 

Definition at line 737 of file usercli.h.

#define ID_CNTX_RLM   0x00008005L
 

Definition at line 735 of file usercli.h.

#define ID_CNTX_RLO   0x00008009L
 

Definition at line 739 of file usercli.h.

#define ID_CNTX_RS   0x00008011L
 

Definition at line 747 of file usercli.h.

#define ID_CNTX_RTL   0x00008000L
 

Definition at line 729 of file usercli.h.

Referenced by ECMenu().

#define ID_CNTX_US   0x00008012L
 

Definition at line 748 of file usercli.h.

#define ID_CNTX_ZWJ   0x00008002L
 

Definition at line 732 of file usercli.h.

#define ID_CNTX_ZWNJ   0x00008003L
 

Definition at line 733 of file usercli.h.

#define ID_EC_PROPERTY_MENU   1
 

Definition at line 1137 of file usercli.h.

Referenced by ECMenu().

#define IDD_MDI_ACTIVATE   9
 

Definition at line 1139 of file usercli.h.

Referenced by DefFrameProcWorker().

#define INITCONTROLLOOKASIDE plaType,
type,
pwnditem,
count   ) 
 

Value:

if (!*((PULONG_PTR)(pwnd + 1))) { \ P ## type pType; \ if (fInit) { \ if (!NT_SUCCESS(InitLookaside(plaType, sizeof(type), count))) { \ NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); \ NtUserDestroyWindow(hwnd); \ return FALSE; \ } \ fInit = FALSE; \ } \ if ((pType = (P ## type)AllocLookasideEntry(plaType))) { \ NtUserSetWindowLongPtr(hwnd, 0, (LONG_PTR)pType, FALSE); \ Lock(&(pType->pwnditem), pwnd); \ } else { \ NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); \ NtUserDestroyWindow(hwnd); \ return FALSE; \ } \ }

Definition at line 270 of file usercli.h.

Referenced by ButtonWndProcWorker(), ComboBoxWndProcWorker(), EditWndProcWorker(), ImeWndProcWorker(), ListBoxWndProcWorker(), and StaticWndProcWorker().

#define IsComboVisible pcbox   )     (!pcbox->fNoRedraw && IsVisible(pcbox->spwnd))
 

Definition at line 460 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), and xxxCBInternalUpdateEditWindow().

#define ISDELIMETERA ch   )     ((ch == ' ') || (ch == '\t'))
 

Definition at line 1129 of file usercli.h.

Referenced by ECWord(), and MLBuildchLines().

#define ISDELIMETERW ch   )     ((ch == L' ') || (ch == L'\t'))
 

Definition at line 1130 of file usercli.h.

Referenced by ECWord(), and MLBuildchLines().

#define IsHooked pci,
fsHook   )     ((fsHook & (pci->fsHooks | pci->pDeskInfo->fsHooks)) != 0)
 

Definition at line 1266 of file usercli.h.

Referenced by _CallMsgFilter(), CallMsgFilter(), GetCursorPos(), GetJournallingQueue(), SendMessageWorker(), xxxActivateThisWindow(), xxxCallHook2(), xxxCreateWindowEx(), xxxDefWindowProc(), xxxDestroyWindow(), xxxGetInputEvent(), xxxInternalActivateKeyboardLayout(), xxxInternalGetMessage(), xxxInternalUnloadKeyboardLayout(), xxxLoadKeyboardLayoutEx(), xxxMinMaximize(), xxxMoveEventAbsolute(), xxxMsgWaitForMultipleObjects(), xxxNotifyIMEStatus(), xxxProcessEventMessage(), xxxReceiveMessage(), xxxScanSysQueue(), xxxSendMessageCallback(), xxxSendMessageTimeout(), xxxSendMinRectMessages(), xxxSetFocus(), xxxSleepTask(), xxxSleepThread(), and xxxSysCommand().

#define IsLBoxVisible plb   )     (plb->fRedraw && IsVisible(plb->spwnd))
 

Definition at line 779 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxDlgDirListHelper(), xxxInvertLBItem(), xxxLbDir(), xxxLBInvalidateRect(), xxxLBSetCaret(), xxxLBSize(), and xxxNewITopEx().

 
#define ISREMOTESESSION  )     (NtCurrentPeb()->SessionId != 0)
 

Definition at line 293 of file usercli.h.

Referenced by CommonCreateWindowStation(), CtxInitUser32(), GetClientKeyboardType(), GetKeyboardType(), GetRemoteKeyboardLayout(), GetSystemMetrics(), LoadPreloadKeyboardLayouts(), OpenKeyboardLayoutFile(), and xxxLBoxCaretBlinker().

#define ITILELEVEL pmdi   )     (pmdi->iChildTileLevel)
 

Definition at line 2073 of file usercli.h.

Referenced by MDICheckCascadeRect(), and MDICompleteChildCreation().

#define LBI_ADD   0x0004
 

Definition at line 797 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxLbDir(), xxxLbInsertFile(), and xxxLBInsertItem().

#define LBS_COMBOBOX   0x8000L
 

Definition at line 448 of file usercli.h.

Referenced by xxxCBCreateHandler(), and xxxLBCreate().

#define LBUP_NOTIFY   0x0004
 

Definition at line 813 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxCaretDestroy(), xxxLBButtonUp(), and xxxTrackMouse().

#define LBUP_RELEASECAPTURE   0x0001
 

Definition at line 811 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxCaretDestroy(), xxxLBButtonUp(), and xxxTrackMouse().

#define LBUP_RESETSELECTION   0x0002
 

Definition at line 812 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxLBButtonUp(), and xxxTrackMouse().

#define LBUP_SELCHANGE   0x0010
 

Definition at line 815 of file usercli.h.

Referenced by ListBoxWndProcWorker(), and xxxLBButtonUp().

#define LBUP_SUCCESS   0x0008
 

Definition at line 814 of file usercli.h.

Referenced by xxxCaretDestroy(), xxxLBButtonUp(), and xxxTrackMouse().

#define LOADRESOURCE hModule,
hResInfo   )     ((*(pfnLoadResource))(hModule, hResInfo))
 

Definition at line 911 of file usercli.h.

Referenced by CommonLoadMenu(), CreateDialogParamA(), CreateDialogParamW(), DialogBoxParamA(), LoadAcc(), LoadBmp(), LoadDIB(), and LoadStringOrError().

#define Lock ppobj,
pobj   )     (*ppobj = pobj)
 

Definition at line 367 of file usercli.h.

Referenced by _LoadCursorsAndIcons(), _RegisterHotKey(), _SetCursorIconData(), _SetLogonNotifyWindow(), _SetProgmanWindow(), _SetTaskmanWindow(), AddConvProp(), AnticipatePost(), CreateInputContext(), CreateNotify(), CreateSpb(), DrawCaptionIcon(), DWP_SetHotKey(), ExAllocatePool(), ExAllocatePoolWithTag(), ExFreePool(), ExInterlockedDecrementLong(), ExInterlockedExtendRegion(), ExInterlockedExtendZone(), ExInterlockedIncrementLong(), ExOkayToLockRoutine(), FreeWindowStation(), FsRtlCheckNoExclusiveConflict(), FsRtlFastUnlockSingleExclusive(), FsRtlFastUnlockSingleShared(), FsRtlFindFirstOverlapInNode(), FsRtlFindFirstOverlappingExclusiveNode(), FsRtlFindFirstOverlappingSharedNode(), FsRtlPrivateCheckForSharedLockAccess(), FsRtlPrivateInsertSharedLock(), FsRtlSplitLocks(), GetCPD(), ImeSetFutureOwner(), InternalSetTimer(), IoAcquireRemoveLockEx(), IoInitializeRemoveLockEx(), IoReleaseRemoveLockAndWaitEx(), IoReleaseRemoveLockEx(), KeInsertQueueDpc(), KeRemoveQueueDpc(), KeUpdateRunTime(), LinkWindow(), LockDesktopMenu(), LockMFMWFPWindow(), LockPopupMenu(), LockWindowUpdate2(), LockWndMenu(), main(), MDISetMenu(), MNPositionSysMenu(), NtUserSetImeOwnerWindow(), NtUserSetThreadLayoutHandles(), PopState(), ReferenceClass(), ReorderKeyboardLayouts(), RtlCreateHeap(), RtlDebugCreateHeap(), RtlpDebugPageHeapCreate(), RtlpSerializeHeap(), SetClassCursor(), UnlinkConv(), UnlinkWindow(), ValidateAndLockCursor(), xxxActivateThisWindow(), xxxButtonEvent(), xxxCallHook2(), xxxCancelCoolSwitch(), xxxCapture(), xxxCBCreateHandler(), xxxChangeClipboardChain(), xxxChildResize(), xxxCreateCaret(), xxxCreateClassSmIcon(), xxxCreateDesktop(), xxxCreateThreadInfo(), xxxCreateWindowEx(), xxxCreateWindowStation(), xxxCsDdeInitialize(), xxxDeactivate(), xxxDestroyWindow(), xxxDrawMenuBarTemp(), xxxEmptyClipboard(), xxxFreeWindow(), xxxGetSystemMenu(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateLayout(), xxxImmActivateThreadsLayout(), xxxInternalActivateKeyboardLayout(), xxxInternalUnloadKeyboardLayout(), xxxInterSendMsgEx(), xxxLBCreate(), xxxLoadKeyboardLayoutEx(), xxxMakeWindowForegroundWithState(), xxxMDIActivate(), xxxMenuWindowProc(), xxxMNCloseHierarchy(), xxxMNCompute(), xxxMNKeyDown(), xxxMNOpenHierarchy(), xxxMNSelectItem(), xxxMNStartMenuState(), xxxMNSwitchToAlternateMenu(), xxxMoveSize(), xxxNextWindow(), xxxOldNextWindow(), xxxOpenClipboard(), xxxSBTrackInit(), xxxSendFocusMessages(), xxxSetClassIcon(), xxxSetClipboardViewer(), xxxSetLPITEMInfo(), xxxSetParent(), xxxSetPKLinThreads(), xxxSetShellWindow(), xxxSetTrayWindow(), xxxSetWindowData(), xxxSwitchDesktop(), xxxSystemParametersInfo(), xxxTrackMouseMove(), xxxTrackPopupMenuEx(), zzzAttachToQueue(), and zzzSetFMouseMoved().

#define LOCKRESOURCE hResData,
hModule   )     ((*(pfnLockResource))(hResData, hModule))
 

Definition at line 912 of file usercli.h.

Referenced by CommonLoadMenu(), CreateDialogParamA(), CreateDialogParamW(), DialogBoxParamA(), GetIconIdEx(), LoadAcc(), LoadBmp(), LoadStringOrError(), and ObjectFromDIBResource().

#define LOWERCASE   2
 

Definition at line 440 of file usercli.h.

Referenced by ListBoxWndProcWorker(), xxxCBCreateHandler(), and xxxLBInsertItem().

#define LT   2
 

Definition at line 790 of file usercli.h.

Referenced by Compare(), and xxxFindString().

#define MAX_RESOURCE_INDEX   32768
 

Definition at line 1738 of file usercli.h.

Referenced by LoadBmp().

#define MAXCLIPENDPOS   32764
 

Definition at line 490 of file usercli.h.

Referenced by ECTabTheTextOut(), and MLDrawText().

#define MAXED pmdi   )     (pmdi->hwndMaxedChild)
 

Definition at line 2068 of file usercli.h.

Referenced by CreateMDIChild(), DefFrameProcWorker(), DefMDIChildProcWorker(), MDIClientWndProcWorker(), MDISetMenu(), xxxChildResize(), xxxMDIActivate(), xxxMDIDestroy(), xxxMDINext(), and xxxSetFrameTitle().

#define MAXITEMS   10
 

Definition at line 2028 of file usercli.h.

Referenced by AppendToWindowsMenu(), DefFrameProcWorker(), MDIClientWndProcWorker(), MDICompleteChildCreation(), MDISetMenu(), xxxInitActivateDlg(), and xxxMDIActivate().

#define MAXLINELENGTH   1024
 

Definition at line 496 of file usercli.h.

Referenced by ECCchInWidth(), ECTabTheTextOut(), and MLBuildchLines().

#define MAXPIXELWIDTH   30000
 

Definition at line 488 of file usercli.h.

#define MAXTEXT   30000
 

Definition at line 503 of file usercli.h.

Referenced by ECCreate(), and MLCreate().

#define MDIACTIVATE_PROP_NAME   TEXT("MDIA")
 

Definition at line 2077 of file usercli.h.

Referenced by MDIActivateDlgInit().

#define MENUAPI_GET   1
 

Definition at line 1991 of file usercli.h.

Referenced by GetMenuInfo(), GetMenuItemInfo(), ValidateMENUINFO(), and ValidateMENUITEMINFO().

#define MENUAPI_INSERT   0
 

Definition at line 1990 of file usercli.h.

#define MENUAPI_SET   2
 

Definition at line 1992 of file usercli.h.

Referenced by InsertMenuItem(), SetMenuInfo(), and SetMenuItemInfo().

#define MESSAGEPROTO func   ) 
 

Value:

LRESULT CALLBACK fn ## func( \ HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, \ ULONG_PTR xParam, DWORD xpfnWndProc, BOOL bAnsi)

Definition at line 1246 of file usercli.h.

#define MSGBOX_CALLBACK   TEXT("SysMB")
 

Definition at line 2016 of file usercli.h.

Referenced by MB_DlgProcWorker().

#define MULTIPLESEL   1
 

Definition at line 794 of file usercli.h.

Referenced by LBEvent(), xxxLBCreate(), xxxLBoxCtlCharInput(), xxxLBoxCtlKeyInput(), and xxxTrackMouse().

#define NextDWordBoundary  )     ((PBYTE)(p) + ((ULONG_PTR)(-(LONG_PTR)(p)) & 3))
 

Definition at line 887 of file usercli.h.

Referenced by DWordSkipSz(), InternalCreateDialog(), MB_FindDlgTemplateSize(), MB_UpdateDlgHdr(), and MB_UpdateDlgItem().

#define NextWordBoundary  )     ((PBYTE)(p) + ((ULONG_PTR)(p) & 1))
 

Definition at line 886 of file usercli.h.

Referenced by GetInxStr(), InternalCreateDialog(), MB_FindDlgTemplateSize(), MB_UpdateDlgHdr(), MB_UpdateDlgItem(), MenuLoadWinTemplates(), and WordSkipSz().

#define NOMODIFY   4 /* Neither shift nor control down */
 

Definition at line 513 of file usercli.h.

Referenced by ECGetModKeys().

#define NONEDOWN   0 /* Neither shift nor control down */
 

Definition at line 509 of file usercli.h.

Referenced by MLKeyDown(), and SLKeyDown().

#define NtUserArrangeIconicWindows hwnd   )     (UINT)NtUserCallHwndLock((hwnd), SFI_XXXARRANGEICONICWINDOWS)
 

Definition at line 1557 of file usercli.h.

Referenced by ArrangeWindows(), and MDIClientWndProcWorker().

#define NtUserBeginDeferWindowPos nNumWindows   )     (HANDLE)NtUserCallOneParam((nNumWindows),SFI__BEGINDEFERWINDOWPOS)
 

Definition at line 1558 of file usercli.h.

Referenced by ArrangeWindows(), MDIActivateDlgSize(), and xxxMDINext().

 
#define NtUserCreateMenu  )     (HMENU)NtUserCallNoParam(SFI__CREATEMENU)
 

Definition at line 1559 of file usercli.h.

Referenced by MenuLoadChicagoTemplates(), and MenuLoadWinTemplates().

 
#define NtUserDestroyCaret  )     (BOOL)NtUserCallNoParam(SFI_ZZZDESTROYCARET)
 

Definition at line 1560 of file usercli.h.

Referenced by ECSetFont(), MLEditWndProc(), MLKillFocus(), SLEditWndProc(), and SLKillFocus().

#define NtUserEnableWindow hwnd,
bEnable   )     (BOOL)NtUserCallHwndParamLock((hwnd), (bEnable),SFI_XXXENABLEWINDOW)
 

Definition at line 1561 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), DialogBox2(), EndDialog(), EndTaskModalDialog(), InternalDialogBox(), and StartTaskModalDialog().

 
#define NtUserGetMessagePos  )     (DWORD)NtUserCallNoParam(SFI__GETMESSAGEPOS)
 

Definition at line 1562 of file usercli.h.

Referenced by SendHelpMessage().

#define NtUserGetWindowContextHelpId hwnd   )     (BOOL)NtUserCallHwnd((hwnd), SFI__GETWINDOWCONTEXTHELPID)
 

Definition at line 1566 of file usercli.h.

Referenced by MB_DlgProcWorker().

#define NtUserKillSystemTimer hwnd,
nIDEvent   )     (BOOL)NtUserCallHwndParam((hwnd), (nIDEvent), SFI__KILLSYSTEMTIMER)
 

Definition at line 1563 of file usercli.h.

Referenced by MLEditWndProc(), and MLMouseMotion().

#define NtUserMessageBeep wType   )     (BOOL)NtUserCallOneParam((wType), SFI_XXXMESSAGEBEEP)
 

Definition at line 1564 of file usercli.h.

Referenced by DefDlgProcWorker(), ECCopy(), ECImeComposition(), HanjaKeyHandler(), IsDialogMessageW(), MLChar(), MLInsertText(), SLChar(), and xxxLBoxCtlCharInput().

#define NtUserRedrawFrame hwnd   )     NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAME)
 

Definition at line 1567 of file usercli.h.

Referenced by CalcClientScrolling(), MDIAddSysMenu(), MDICompleteChildCreation(), MDIRemoveSysMenu(), xxxMDIDestroy(), and xxxSetFrameTitle().

#define NtUserRedrawFrameAndHook hwnd   )     NtUserCallHwndLock((hwnd), SFI_XXXREDRAWFRAMEANDHOOK)
 

Definition at line 1568 of file usercli.h.

Referenced by xxxSetFrameTitle().

#define NtUserRedrawTitle hwnd,
wFlags   )     NtUserCallHwndParamLock((hwnd), (wFlags), SFI_XXXREDRAWTITLE)
 

Definition at line 1569 of file usercli.h.

Referenced by xxxSetFrameTitle().

 
#define NtUserReleaseCapture  )     (BOOL)NtUserCallNoParam(SFI_XXXRELEASECAPTURE)
 

Definition at line 1570 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), MLMouseMotion(), SLMouseMotion(), xxxBNReleaseCapture(), xxxLBButtonUp(), and xxxTrackMouse().

#define NtUserReleaseDC hwnd,
hdc   )     NtUserCallOneParam((ULONG_PTR)(hdc), SFI__RELEASEDC)
 

Definition at line 1556 of file usercli.h.

Referenced by CopyBitmap(), LBReleaseDC(), SoftModalMessageBox(), StaticRepaint(), xxxCBCalcControlRects(), xxxCBInternalUpdateEditWindow(), xxxInitActivateDlg(), xxxLBCreate(), and xxxLBSetFont().

#define NtUserSetCaretPos X,
 )     (BOOL)NtUserCallTwoParam((DWORD)(X), (DWORD)(Y), SFI_ZZZSETCARETPOS)
 

Definition at line 1571 of file usercli.h.

Referenced by MLSetCaretPosition(), and SLSetCaretPosition().

#define NtUserSetCursorPos X,
 )     (BOOL)NtUserCallTwoParam((X), (Y), SFI_ZZZSETCURSORPOS)
 

Definition at line 1572 of file usercli.h.

Referenced by DefDlgProcWorker().

#define NtUserSetForegroundWindow hwnd   )     (BOOL)NtUserCallHwndLock((hwnd), SFI_XXXSTUBSETFOREGROUNDWINDOW)
 

Definition at line 1573 of file usercli.h.

Referenced by DialogBox2(), InternalCreateDialog(), and SetForegroundWindow().

#define NtUserSetSysMenu hwnd   )     NtUserCallHwndLock((hwnd), SFI_XXXSETSYSMENU)
 

Definition at line 1574 of file usercli.h.

Referenced by DefFrameProcWorker(), MDIAddSysMenu(), and xxxChildResize().

#define NtUserSetVisible hwnd,
fSet   )     NtUserCallHwndParam((hwnd), (fSet), SFI_SETVISIBLE)
 

Definition at line 1575 of file usercli.h.

Referenced by xxxMDINext().

#define NtUserSetWindowContextHelpId hwnd,
id   )     (BOOL)NtUserCallHwndParam((hwnd), (id), SFI__SETWINDOWCONTEXTHELPID)
 

Definition at line 1565 of file usercli.h.

Referenced by InternalCreateDialog(), and MB_DlgProcWorker().

#define NtUserShowCursor bShow   )     (int)NtUserCallOneParam((bShow), SFI_ZZZSHOWCURSOR)
 

Definition at line 1576 of file usercli.h.

Referenced by DefDlgProcWorker().

#define NtUserUpdateClientRect hwnd   )     NtUserCallHwndLock((hwnd), SFI_XXXUPDATECLIENTRECT)
 

Definition at line 1577 of file usercli.h.

Referenced by MDIClientWndProcWorker().

#define OEMRESOURCE   1
 

Definition at line 18 of file usercli.h.

#define OFFSET_120_DPI   200
 

Definition at line 1730 of file usercli.h.

Referenced by LoadBmp().

#define OFFSET_160_DPI   300
 

Definition at line 1731 of file usercli.h.

#define OFFSET_96_DPI   100
 

Definition at line 1729 of file usercli.h.

Referenced by LoadBmp().

#define OFFSET_SCALE_DPI   000
 

Definition at line 1728 of file usercli.h.

#define OLEWONTLOAD   (HINSTANCE)IntToPtr(0xFFFFFFFF)
 

Definition at line 2126 of file usercli.h.

Referenced by __ClientLoadOLE(), and LoadOLEOnce().

#define OTHERMAXING   0x0400
 

Definition at line 2061 of file usercli.h.

Referenced by xxxChildResize().

#define OWNERDRAWFIXED   1
 

Definition at line 436 of file usercli.h.

Referenced by xxxCBCreateHandler(), and xxxLBCreate().

#define OWNERDRAWVAR   2
 

Definition at line 437 of file usercli.h.

Referenced by CItemInWindow(), GrowMem(), ISelFromPt(), LastFullVisible(), LBCalcAllocNeeded(), LBGetItemRect(), LBGetSetItemHeightHandler(), LBSetCItemFullMax(), xxxCBCreateHandler(), xxxInsureVisible(), xxxLBCreate(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBoxCtlScroll(), xxxLBPaint(), and xxxNewITopEx().

#define PBF_DEFAULT   0x0002
 

Definition at line 398 of file usercli.h.

Referenced by BNCalcRect(), IsPushButton(), and xxxDrawButton().

#define PBF_PUSHABLE   0x0001
 

Definition at line 397 of file usercli.h.

Referenced by ButtonWndProcWorker(), and IsPushButton().

#define PREFIX   1
 

Definition at line 789 of file usercli.h.

Referenced by Compare(), ListBoxWndProcWorker(), xxxFindString(), and xxxLBoxCtlCharInput().

#define PROP_MDICLIENT   MAKEINTRESOURCE(0x8CAC)
 

Definition at line 2076 of file usercli.h.

#define Pundo ped   )     ((PUNDO)&(ped)->undoType)
 

Definition at line 540 of file usercli.h.

Referenced by ECDeleteText(), ECInsertText(), ECResetTextInfo(), EditWndProc(), MLEditWndProc(), MLInsertText(), MLReplaceSel(), SLEditWndProc(), and SLReplaceSel().

#define RDRCODE_END   3
 

Definition at line 2175 of file usercli.h.

Referenced by ReaderWndProc().

#define RDRCODE_SCROLL   2
 

Definition at line 2174 of file usercli.h.

Referenced by ReaderFeedback(), and ReaderProcInternal().

#define RDRCODE_START   1
 

Definition at line 2173 of file usercli.h.

Referenced by ReaderWndProc().

#define RDRMODE_DIAG   0x00000004
 

Definition at line 2171 of file usercli.h.

Referenced by FReaderDiag().

#define RDRMODE_HORZ   0x00000002
 

Definition at line 2170 of file usercli.h.

Referenced by EnterReaderModeHelper(), FReader2Dim(), and FReaderHorz().

#define RDRMODE_VERT   0x00000001
 

Definition at line 2169 of file usercli.h.

Referenced by EnterReaderModeHelper(), FReader2Dim(), and FReaderVert().

#define REBASE p,
elem   ) 
 

Value:

((KERNEL_ULONG_PTR)((p)->elem) <= (KERNEL_ULONG_PTR)gHighestUserAddress ? \ ((PVOID)(p)->elem) : REBASEALWAYS(p, elem))

Definition at line 213 of file usercli.h.

Referenced by _FindProp(), BNCalcRect(), CheckRadioButton(), DefFrameProcWorker(), DefWindowProcWorker(), GetMenu(), GetScrollRange(), MDIClientWndProcWorker(), MDICompleteChildCreation(), ShowWindowNoRepaint(), StaticCallback(), xxxBNDrawText(), xxxChildResize(), xxxMDIDestroy(), xxxSetFrameTitle(), and xxxStaticPaint().

#define REBASEALWAYS p,
elem   )     ((PVOID)((KERNEL_ULONG_PTR)(p) + ((KERNEL_ULONG_PTR)(p)->elem - (KERNEL_ULONG_PTR)(p)->head.pSelf)))
 

Definition at line 210 of file usercli.h.

Referenced by _GetClassLongPtr(), _GetMenuDefaultItem(), _GetSubMenu(), _HasCaptionIcon(), _NextSibblingOrAncestor(), ButtonWndProcWorker(), DDEMLClientWndProc(), FScrollEnabled(), GetClassNameA(), GetClassWord(), GetMenuItemID(), GetScrollInfo(), GetScrollPos(), GetWindowData(), GetWindowInfo(), MakeMenuItem(), MDIAddSysMenu(), MNLookUpItem(), ModifyMenuItem(), PhkNextValid(), ProcessDDEMLInitiate(), SendMessageWorker(), SendRegisterMessageToClass(), SetMenuItemInfoStruct(), SmoothScrollWindowEx(), StaticWndProcWorker(), and xxxMNCanClose().

#define REBASEPTR obj,
 )     ((PVOID)((KERNEL_ULONG_PTR)(p) - ((KERNEL_ULONG_PTR)(obj)->head.pSelf - (KERNEL_ULONG_PTR)(obj))))
 

Definition at line 211 of file usercli.h.

Referenced by _GetMenuDefaultItem(), _GetMenuState(), _GetSubMenu(), _GetWindow(), DefWindowProcWorker(), ECGetControlBrush(), EndDialog(), GetClassNameA(), MLCreate(), MNLookUpItem(), SLCreate(), and xxxMNCanClose().

#define REBASEPWND p,
elem   )     ((PWND)REBASE(p, elem))
 

Definition at line 215 of file usercli.h.

Referenced by _FChildVisible(), _GetChildControl(), _GetDlgItem(), _GetLastActivePopup(), _GetParent(), _GetWindow(), _IsChild(), _IsDescendant(), _IsWindowVisible(), _NextControl(), AnyPopup(), ArrangeWindows(), ButtonWndProcWorker(), CalcClientScrolling(), CascadeWindowsEnum(), ChildMinMaxInfo(), ComboBoxWndProcWorker(), DefDlgProcWorker(), DefMDIChildProcWorker(), DefWindowProcWorker(), ECNcDestroyHandler(), FindPwndChild(), GetContextHelpId(), GetDialogMonitor(), GetParentDialog(), GetPrevPwnd(), GetRect(), GetTopLevelWindow(), GetTopWindow(), GetWindowData(), ImeNotifyHandler(), ImeSetContextHandler(), IsVisible(), MakeMenuItem(), MDIActivateDlgSize(), MDIClientWndProcWorker(), MDICompleteChildCreation(), MDISetMenu(), ModifyMenuItem(), ShiftMenuIDs(), SizeBoxHwnd(), StaticNotifyParent(), ValidatePositionableWindow(), WinHelpA(), xxxBNOwnerDraw(), xxxBNPaint(), xxxBNReleaseCapture(), xxxButtonDrawCheck(), xxxButtonNotifyParent(), xxxCBCreateHandler(), xxxChildResize(), xxxDestroyLBox(), xxxGotoNextMnem(), xxxLBCreate(), xxxLBGetBrush(), xxxMDIActivate(), xxxMDIDestroy(), xxxMDINext(), and xxxStaticPaint().

#define RedrawWindow   NtUserRedrawWindow
 

Definition at line 1585 of file usercli.h.

Referenced by AnimateWindow(), MLEditWndProc(), SmoothScrollWindowEx(), UnmaximizeChildWindows(), and xxxLBSetRedraw().

#define RESERVED_MSG_BITS   (0xFFFE0000)
 

Definition at line 133 of file usercli.h.

Referenced by BroadcastSystemMessageWorker(), CallMsgFilter(), DispatchMessageWorker(), GetMessage(), SendMessage(), SendMessageTimeoutWorker(), and TranslateMessageEx().

#define RevalidateHwnd hwnd   )     ((PWND)HMValidateHandleNoSecure(hwnd, TYPE_WINDOW))
 

Definition at line 194 of file usercli.h.

Referenced by _FindWindowEx(), _GetAltTabInfo(), _RemoveNonTaskWindows(), AssociateInputContextEx(), BltValidInit(), DefDlgProcWorker(), DeleteFadeSprite(), DestroyInputContext(), DialogBox2(), DrawIconCallBack(), DrawSwitchWndHilite(), FindQMsg(), InitSwitchWndInfo(), InternalCreateDialog(), IsStillWindowC(), PWInsertAfter(), SfnINCBOXSTRING(), SfnINLBOXSTRING(), SfnOUTCBOXSTRING(), SfnOUTLBOXSTRING(), SoundSentryTimer(), StartTaskModalDialog(), UpdateFade(), UserRecreateRedirectionBitmap(), UserRemoveRedirectionBitmap(), UserVisrgnFromHwnd(), ValidateSmwp(), ValidateWindowPos(), xxxArrangeIconicWindows(), xxxCalcValidRects(), xxxCallJournalPlaybackHook(), xxxCallJournalRecordHook(), xxxCheckImeShowStatus(), xxxClientShutdown2(), xxxCreateWindowEx(), xxxDefWindowProc(), xxxDesktopRecalc(), xxxDesktopWndProc(), xxxDispatchMessage(), xxxDragObject(), xxxDWP_SetCursor(), xxxDWPPrint(), xxxEndDeferWindowPosEx(), xxxInternalDoSyncPaint(), xxxInternalEnumWindow(), xxxMenuWindowProc(), xxxMessageEvent(), xxxMetricsRecalc(), xxxMinMaximize(), xxxMNFindWindowFromPoint(), xxxMNKeyDown(), xxxNextWindow(), xxxNotifyImeShowStatus(), xxxOldNextWindow(), xxxPaintIconsInSwitchWindow(), xxxProcessEventMessage(), xxxScanSysQueue(), xxxSendBSMtoDesktop(), xxxSendChangedMsgs(), xxxSendMessageToUI(), xxxSetActiveWindow(), xxxSetCapture(), xxxSetClipboardViewer(), xxxSetFocus(), xxxShowOwnedWindows(), xxxSysCommand(), xxxWindowFromPoint(), zzzBltValidBits(), and zzzChangeStates().

#define RGBX rgb   )     RGB(GetBValue(rgb), GetGValue(rgb), GetRValue(rgb))
 

Definition at line 307 of file usercli.h.

Referenced by ChangeDibColors(), and MixRGBI().

#define RPC_NO_WINDOWS_H
 

Definition at line 2091 of file usercli.h.

#define SAMEWOWHANDLE h1,
h2   )     ((BOOL)!(((ULONG_PTR)(h1) ^ (ULONG_PTR)(h2)) & 0xffff))
 

Definition at line 160 of file usercli.h.

Referenced by DefMDIChildProcWorker(), EndDialog(), InternalDialogBox(), MDIClientWndProcWorker(), xxxCBCommandHandler(), xxxCheckDefPushButton(), and xxxMDIDestroy().

#define SCROLL pmdi   )     (pmdi->wScroll)
 

Definition at line 2072 of file usercli.h.

Referenced by MDIClientWndProcWorker(), RecalculateScrollRanges(), and xxxChildResize().

#define SCROLLCOUNT   0x00FF
 

Definition at line 2065 of file usercli.h.

Referenced by MDIClientWndProcWorker(), RecalculateScrollRanges(), and xxxChildResize().

#define SCROLLSUPPRESS   0x0003
 

Definition at line 2064 of file usercli.h.

Referenced by MDIClientWndProcWorker().

#define SDROPDOWN   (SDROPPABLE | SEDITABLE)
 

Definition at line 430 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), xxxCBCreateHandler(), and xxxCBShowListBoxWindow().

#define SDROPDOWNLIST   SDROPPABLE
 

Definition at line 429 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), xxxCBCreateHandler(), xxxCBGetFocusHelper(), and xxxCBKillFocusHelper().

#define SDROPPABLE   CBS_DROPDOWN
 

Definition at line 424 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), xxxCBCalcControlRects(), xxxCBCreateHandler(), xxxCBHideListBoxWindow(), xxxCBSetEditItemHeight(), xxxCBShowListBoxWindow(), and xxxLBoxCtlKeyInput().

#define SEDITABLE   CBS_SIMPLE
 

Definition at line 425 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), and xxxCBHideListBoxWindow().

#define SELONLY   0x0002
 

Definition at line 1745 of file usercli.h.

Referenced by LBoxGetSelItems(), ListBoxWndProcWorker(), SetSelected(), xxxAlterHilite(), xxxLBButtonUp(), xxxLBoxCtlKeyInput(), xxxLBSelRange(), and xxxLBSetSel().

#define SetBestStretchMode hdc,
planes,
bpp   )     SetStretchBltMode(hdc, (((planes) * (bpp)) == 1 ? BLACKONWHITE : COLORONCOLOR))
 

Definition at line 299 of file usercli.h.

Referenced by BitmapFromDIB(), BltIcon(), and ConvertToDDB().

#define SHCTDOWN   3 /* Shift and control keys down = CTRLDOWN + SHFTDOWN */
 

Definition at line 512 of file usercli.h.

#define SHFTDOWN   2 /* Shift key only down */
 

Definition at line 511 of file usercli.h.

Referenced by ECGetModKeys(), MLKeyDown(), and SLKeyDown().

#define SINGLESEL   0
 

Definition at line 793 of file usercli.h.

Referenced by GrowMem(), IsSelected(), LBCalcAllocNeeded(), LBEvent(), LBoxGetSelItems(), ListBoxWndProcWorker(), SetSelected(), xxxLBCreate(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBSetSel(), xxxResetWorld(), and xxxTrackMouse().

#define SIZEOFRESOURCE hModule,
hResInfo   )     ((*(pfnSizeofResource))(hModule, hResInfo))
 

Definition at line 915 of file usercli.h.

#define SSIMPLE   SEDITABLE
 

Definition at line 428 of file usercli.h.

Referenced by xxxCBCreateHandler(), and xxxCBSetEditItemHeight().

#define STR_ERROR   0x00000002L
 

Definition at line 1145 of file usercli.h.

Referenced by MessageBoxWorker().

#define STR_IMECLOSE   701
 

Definition at line 1153 of file usercli.h.

Referenced by ECSetIMEMenu().

#define STR_IMEOPEN   700
 

Definition at line 1152 of file usercli.h.

Referenced by ECSetIMEMenu().

#define STR_MOREWINDOWS   0x0000000DL
 

Definition at line 1146 of file usercli.h.

Referenced by AppendToWindowsMenu().

#define STR_NOMEMBITMAP   0x0000000EL
 

Definition at line 1147 of file usercli.h.

#define STR_RECONVERTSTRING   705
 

Definition at line 1156 of file usercli.h.

Referenced by ECSetIMEMenu().

#define STR_SOFTKBDCLOSE   703
 

Definition at line 1155 of file usercli.h.

Referenced by ECSetIMEMenu().

#define STR_SOFTKBDOPEN   702
 

Definition at line 1154 of file usercli.h.

Referenced by ECSetIMEMenu().

 
#define THREAD_HKL  )     (GetClientInfo()->hKL)
 

Definition at line 1124 of file usercli.h.

Referenced by ECCreate(), ECEnableDisableIME(), EcImeRequestHandler(), ECIsCharNumeric(), ECMenu(), ECSetFont(), ECSetIMEMenu(), ECSize(), EditWndProc(), HanjaKeyHandler(), ImeWndCreateHandler(), MLSetCaretPosition(), and SLSetCaretPosition().

#define ThreadLock pobj,
ptl   )     DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
 

Definition at line 362 of file usercli.h.

Referenced by _UserSoundSentryWorker(), ButtonWndProcWorker(), ComboBoxWndProcWorker(), DefDlgProcWorker(), DefFrameProcWorker(), DefMDIChildProcWorker(), DlgDirListA(), DlgDirListComboBoxA(), DlgDirListComboBoxW(), DlgDirListW(), DrawSwitchWndHilite(), FullScreenCleanup(), InternalDialogBox(), IsDialogMessageA(), IsDialogMessageW(), ListBoxWndProcWorker(), MDIClientWndProcWorker(), NtUserDeleteMenu(), NtUserDrawAnimatedRects(), NtUserInvalidateRect(), NtUserOpenClipboard(), NtUserRemoveMenu(), NtUserSetActiveWindow(), NtUserSetCapture(), NtUserSetClipboardViewer(), NtUserSetFocus(), NtUserThunkedMenuInfo(), NtUserThunkedMenuItemInfo(), NtUserValidateRect(), ReceiverDied(), RemoteRedrawRectangle(), SfnOUTCBOXSTRING(), SfnOUTLBOXSTRING(), SoundSentryTimer(), StaticNotifyParent(), TimersProc(), xxxAddFullScreen(), xxxbFullscreenSwitch(), xxxBNOwnerDraw(), xxxBNPaint(), xxxBNReleaseCapture(), xxxButtonNotifyParent(), xxxCalcValidRects(), xxxCBCalcControlRects(), xxxCBCompleteEditWindow(), xxxCBDir(), xxxCBGetFocusHelper(), xxxCBGetTextHelper(), xxxCBGetTextLengthHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBKillFocusHelper(), xxxCBMessageItemHandler(), xxxCBNotifyParent(), xxxCBPosition(), xxxCBSetDroppedSize(), xxxCBSetEditItemHeight(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxCBUpdateListBoxWindow(), xxxChildResize(), xxxCreateDefaultImeWindow(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxDDETrackWindowDying(), xxxDestroyThreadInfo(), xxxDispatchMessage(), xxxDoHotKeyStuff(), xxxDoScroll(), xxxDrawDragRect(), xxxDrawMenuBarTemp(), xxxDrawMenuBarUnderlines(), xxxDW_SendDestroyMessages(), xxxEnableMenuItem(), xxxEndMenuLoop(), xxxFindString(), xxxGetControlBrush(), xxxGNM_FindNextMnem(), xxxGotoNextMnem(), xxxHandleMenuMessages(), xxxHandleNCMouseGuys(), xxxHelpLoop(), xxxHotTrackMenu(), xxxHungAppDemon(), xxxInsertMenuItem(), xxxLBBinarySearchString(), xxxLBCreate(), xxxLBGetBrush(), xxxLBInsertItem(), xxxLBoxCtlCharInput(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBoxDeleteItem(), xxxLBoxDrawItem(), xxxMakeWindowForegroundWithState(), xxxMDIActivate(), xxxMDIDestroy(), xxxMenuBarDraw(), xxxMenuWindowProc(), xxxMNCancel(), xxxMNChar(), xxxMNDoubleClick(), xxxMNInvertItem(), xxxMNKeyDown(), xxxMNLoop(), xxxMNMouseMove(), xxxMNOpenHierarchy(), xxxMNSelectItem(), xxxMNStartMenu(), xxxMNSwitchToAlternateMenu(), xxxMNUpdateDraggingInfo(), xxxMNUpdateShownMenu(), xxxNotifyOwner(), xxxPaintIconsInSwitchWindow(), xxxQueryDropObject(), xxxRealDrawMenuItem(), xxxRealizePalette(), xxxReceiveMessage(), xxxRedrawHungWindow(), xxxRedrawWindow(), xxxRemoveDefaultButton(), xxxSBWndProc(), xxxSendMinRectMessages(), xxxSetClassIcon(), xxxSetConsoleCaretInfo(), xxxSetMenuInfo(), xxxSetParent(), xxxSetWindowData(), xxxSwitchToThisWindow(), xxxSysCommand(), xxxTrackMouse(), xxxTrackPopupMenuEx(), xxxTranslateAccelerator(), xxxUpdateTray(), xxxUserResetDisplayDevice(), xxxWindowFromPoint(), and xxxWindowHitTest2().

#define ThreadLockAlways pobj,
ptl   )     DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
 

Definition at line 363 of file usercli.h.

Referenced by DefDlgProcWorker(), DefMDIChildProcWorker(), DrawIconCallBack(), IsDialogMessageW(), MDIClientWndProcWorker(), NtUserEnableMenuItem(), NtUserEndDeferWindowPosEx(), NtUserSendMessageCallback(), NtUserSendNotifyMessage(), PopState(), ResetSharedDesktops(), UserRedrawDesktop(), xxxActiveWindowTracking(), xxxArrangeIconicWindows(), xxxBroadcastPaletteChanged(), xxxButtonDrawCheck(), xxxButtonEvent(), xxxCalcClientRect(), xxxCalcValidRects(), xxxCancelMouseMoveTracking(), xxxCapture(), xxxChangeClipboardChain(), xxxCheckDefPushButton(), xxxCheckFullScreen(), xxxCheckImeShowStatus(), xxxChildResize(), xxxCleanupDdeConv(), xxxCleanupDesktopMenu(), xxxClientShutdown2(), xxxDDETrackGetMessageHook(), xxxDDETrackPostHook(), xxxDDETrackWindowDying(), xxxDefWindowProc(), xxxDesktopThread(), xxxDesktopWndProc(), xxxDlgDirListHelper(), xxxDoScrollMenu(), xxxDrawClipboard(), xxxDW_SendDestroyMessages(), xxxDWP_SetCursor(), xxxDWPPrint(), xxxEndMenuLoop(), xxxExpandBitmap(), xxxFocusSetInputContext(), xxxFreeWindow(), xxxGetRenderData(), xxxHandleMenuMessages(), xxxHelpLoop(), xxxInitActivateDlg(), xxxInternalEnumWindow(), xxxInvalidateDesktopOnPaletteChange(), xxxKeyEvent(), xxxLoadSysMenu(), xxxMenuWindowProc(), xxxMNCloseHierarchy(), xxxMNDestroyHandler(), xxxMNDragOver(), xxxMNFindWindowFromPoint(), xxxMNHideNextHierarchy(), xxxMNLoop(), xxxMNOpenHierarchy(), xxxMNSetGapState(), xxxMNStartMenuState(), xxxProcessNotifyWinEvent(), xxxResetTooltip(), xxxSendChangedMsgs(), xxxSendClipboardMessage(), xxxSendMenuDrawItemMessage(), xxxSendMessageToUI(), xxxSendOpenStatusNotify(), xxxSetDeskWallpaper(), xxxSetForegroundWindow(), xxxSetIMEShowStatus(), xxxSetSysMenu(), xxxShowOwnedWindows(), xxxSysCommand(), xxxTooltipHandleTimer(), xxxTrackMouseMove(), xxxTrackPopupMenuEx(), xxxUserPowerStateCalloutWorker(), zzzAnimateCursor(), and zzzChangeStates().

#define ThreadLockAlwaysWithPti pti,
pobj,
ptl   )     DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
 

Definition at line 365 of file usercli.h.

Referenced by _PostMessage(), MESSAGECALL(), NtUserCreateWindowEx(), NtUserDrawMenuBarTemp(), NtUserFlashWindowEx(), NtUserGetControlColor(), NtUserGetMenuItemRect(), NtUserHiliteMenuItem(), NtUserMenuItemFromPoint(), NtUserSetShellWindowEx(), NtUserSetSystemMenu(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), xxxActivateKeyboardLayout(), xxxActivateOnMinimize(), xxxActivateWindow(), xxxCallHook2(), xxxCancelTracking(), xxxCreateWindowEx(), xxxCsEvent(), xxxDeactivate(), xxxDefWindowProc(), xxxDesktopThread(), xxxDesktopWndProc(), xxxDestroyWindow(), xxxDragObject(), xxxDWP_ProcessVirtKey(), xxxEndDeferWindowPosEx(), xxxEnumDisplayMonitors(), xxxFreeWindow(), xxxFW_DestroyAllChildren(), xxxImmActivateLayout(), xxxImmUnloadLayout(), xxxInitSendValidateMinMaxInfo(), xxxInternalActivateKeyboardLayout(), xxxInternalDoSyncPaint(), xxxInternalGetMessage(), xxxInternalUnloadKeyboardLayout(), xxxLoadKeyboardLayoutEx(), xxxMenuWindowProc(), xxxMetricsRecalc(), xxxMinMaximize(), xxxMouseActivate(), xxxMoveSize(), xxxNextWindow(), xxxOldNextWindow(), xxxProcessEventMessage(), xxxScanSysQueue(), xxxSendBSMtoDesktop(), xxxSetForegroundWindow2(), xxxSwitchDesktop(), zzzInvalidateDCCache(), and zzzSetWindowsHookEx().

#define ThreadLockWithPti pti,
pobj,
ptl   )     DBG_UNREFERENCED_LOCAL_VARIABLE(*ptl)
 

Definition at line 364 of file usercli.h.

Referenced by _ReplyMessage(), CancelInputState(), NtUserChangeClipboardChain(), NtUserCreateWindowEx(), NtUserDragObject(), NtUserDrawCaptionTemp(), NtUserFillWindow(), NtUserPaintDesktop(), NtUserSetMenu(), NtUserSetParent(), NtUserSetWindowPos(), xxxActivateThisWindow(), xxxCallHook2(), xxxCallJournalPlaybackHook(), xxxCheckFocus(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxDeactivate(), xxxDefWindowProc(), xxxDesktopWndProc(), xxxDestroyWindow(), xxxDragObject(), xxxEndDeferWindowPosEx(), xxxInitSendValidateMinMaxInfo(), xxxInternalActivateKeyboardLayout(), xxxIsDragging(), xxxMinMaximize(), xxxMouseActivate(), xxxNextWindow(), xxxOldNextWindow(), xxxScanSysQueue(), xxxSendFocusMessages(), xxxSetFocus(), xxxSnapWindow(), xxxSwitchDesktop(), xxxSwitchWndProc(), xxxWindowEvent(), zzzInternalDestroyCaret(), and zzzSetCursor().

#define ThreadUnlock ptl   )     (ptl)
 

Definition at line 366 of file usercli.h.

Referenced by _PostMessage(), _ReplyMessage(), _UserSoundSentryWorker(), ButtonWndProcWorker(), CancelInputState(), ComboBoxWndProcWorker(), DefDlgProcWorker(), DefFrameProcWorker(), DefMDIChildProcWorker(), DestroyThreadsObjects(), DlgDirListA(), DlgDirListComboBoxA(), DlgDirListComboBoxW(), DlgDirListW(), DrawIconCallBack(), DrawSwitchWndHilite(), FullScreenCleanup(), InternalDialogBox(), IsDialogMessageA(), IsDialogMessageW(), ListBoxWndProcWorker(), MDIClientWndProcWorker(), MESSAGECALL(), NtUserChangeClipboardChain(), NtUserCreateWindowEx(), NtUserDeleteMenu(), NtUserDragObject(), NtUserDrawAnimatedRects(), NtUserDrawCaptionTemp(), NtUserDrawMenuBarTemp(), NtUserEnableMenuItem(), NtUserEndDeferWindowPosEx(), NtUserFillWindow(), NtUserFlashWindowEx(), NtUserGetControlColor(), NtUserGetMenuItemRect(), NtUserHiliteMenuItem(), NtUserInvalidateRect(), NtUserMenuItemFromPoint(), NtUserOpenClipboard(), NtUserPaintDesktop(), NtUserRemoveMenu(), NtUserSendMessageCallback(), NtUserSendNotifyMessage(), NtUserSetActiveWindow(), NtUserSetCapture(), NtUserSetClipboardViewer(), NtUserSetFocus(), NtUserSetMenu(), NtUserSetParent(), NtUserSetShellWindowEx(), NtUserSetSystemMenu(), NtUserSetWindowPos(), NtUserThunkedMenuInfo(), NtUserThunkedMenuItemInfo(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), NtUserValidateRect(), PopState(), ReceiverDied(), RemoteRedrawRectangle(), ResetSharedDesktops(), SfnOUTCBOXSTRING(), SfnOUTLBOXSTRING(), SoundSentryTimer(), StaticNotifyParent(), TimersProc(), UserRedrawDesktop(), xxxActivateKeyboardLayout(), xxxActivateOnMinimize(), xxxActivateThisWindow(), xxxActivateWindow(), xxxActiveWindowTracking(), xxxAddFullScreen(), xxxArrangeIconicWindows(), xxxbFullscreenSwitch(), xxxBNOwnerDraw(), xxxBNPaint(), xxxBNReleaseCapture(), xxxBroadcastPaletteChanged(), xxxButtonDrawCheck(), xxxButtonEvent(), xxxButtonNotifyParent(), xxxCalcClientRect(), xxxCalcValidRects(), xxxCallHook2(), xxxCallJournalPlaybackHook(), xxxCancelMouseMoveTracking(), xxxCancelTracking(), xxxCapture(), xxxCBCalcControlRects(), xxxCBCompleteEditWindow(), xxxCBDir(), xxxCBGetFocusHelper(), xxxCBGetTextHelper(), xxxCBGetTextLengthHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBKillFocusHelper(), xxxCBMessageItemHandler(), xxxCBNotifyParent(), xxxCBPosition(), xxxCBSetDroppedSize(), xxxCBSetEditItemHeight(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxCBUpdateListBoxWindow(), xxxChangeClipboardChain(), xxxCheckDefPushButton(), xxxCheckFocus(), xxxCheckFullScreen(), xxxCheckImeShowStatus(), xxxChildResize(), xxxCleanupDdeConv(), xxxCleanupDesktopMenu(), xxxClientShutdown2(), xxxCreateDefaultImeWindow(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxCsEvent(), xxxDDETrackGetMessageHook(), xxxDDETrackPostHook(), xxxDDETrackWindowDying(), xxxDeactivate(), xxxDefWindowProc(), xxxDesktopThread(), xxxDesktopWndProc(), xxxDestroyThreadInfo(), xxxDestroyWindow(), xxxDispatchMessage(), xxxDlgDirListHelper(), xxxDoHotKeyStuff(), xxxDoScroll(), xxxDoScrollMenu(), xxxDragObject(), xxxDrawClipboard(), xxxDrawDragRect(), xxxDrawMenuBarTemp(), xxxDrawMenuBarUnderlines(), xxxDW_SendDestroyMessages(), xxxDWP_ProcessVirtKey(), xxxDWP_SetCursor(), xxxDWPPrint(), xxxEnableMenuItem(), xxxEndDeferWindowPosEx(), xxxEndMenuLoop(), xxxEnumDisplayMonitors(), xxxExpandBitmap(), xxxFindString(), xxxFocusSetInputContext(), xxxFreeWindow(), xxxFW_DestroyAllChildren(), xxxGetControlBrush(), xxxGetRenderData(), xxxGNM_FindNextMnem(), xxxGotoNextMnem(), xxxHandleMenuMessages(), xxxHandleNCMouseGuys(), xxxHelpLoop(), xxxHotTrackMenu(), xxxHungAppDemon(), xxxImmActivateLayout(), xxxImmUnloadLayout(), xxxInitActivateDlg(), xxxInitSendValidateMinMaxInfo(), xxxInsertMenuItem(), xxxInternalActivateKeyboardLayout(), xxxInternalDoSyncPaint(), xxxInternalEnumWindow(), xxxInternalGetMessage(), xxxInternalUnloadKeyboardLayout(), xxxInvalidateDesktopOnPaletteChange(), xxxIsDragging(), xxxKeyEvent(), xxxLBBinarySearchString(), xxxLBCreate(), xxxLBGetBrush(), xxxLBInsertItem(), xxxLBoxCtlCharInput(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBoxDeleteItem(), xxxLBoxDrawItem(), xxxLoadKeyboardLayoutEx(), xxxLoadSysMenu(), xxxMakeWindowForegroundWithState(), xxxMDIActivate(), xxxMDIDestroy(), xxxMenuBarDraw(), xxxMenuWindowProc(), xxxMetricsRecalc(), xxxMinMaximize(), xxxMNCancel(), xxxMNChar(), xxxMNCloseHierarchy(), xxxMNDestroyHandler(), xxxMNDoubleClick(), xxxMNDragOver(), xxxMNFindWindowFromPoint(), xxxMNHideNextHierarchy(), xxxMNInvertItem(), xxxMNKeyDown(), xxxMNLoop(), xxxMNMouseMove(), xxxMNOpenHierarchy(), xxxMNSelectItem(), xxxMNSetGapState(), xxxMNStartMenu(), xxxMNStartMenuState(), xxxMNSwitchToAlternateMenu(), xxxMNUpdateDraggingInfo(), xxxMNUpdateShownMenu(), xxxMouseActivate(), xxxMoveSize(), xxxNextWindow(), xxxNotifyOwner(), xxxOldNextWindow(), xxxPaintIconsInSwitchWindow(), xxxProcessEventMessage(), xxxProcessNotifyWinEvent(), xxxQueryDropObject(), xxxRealDrawMenuItem(), xxxRealizePalette(), xxxReceiveMessage(), xxxRedrawHungWindow(), xxxRedrawWindow(), xxxRemoveDefaultButton(), xxxResetTooltip(), xxxSBWndProc(), xxxScanSysQueue(), xxxScrollWindowEx(), xxxSendBSMtoDesktop(), xxxSendChangedMsgs(), xxxSendChildNCPaint(), xxxSendClipboardMessage(), xxxSendFocusMessages(), xxxSendMenuDrawItemMessage(), xxxSendMessageToUI(), xxxSendMinRectMessages(), xxxSendOpenStatusNotify(), xxxSetClassIcon(), xxxSetConsoleCaretInfo(), xxxSetDeskWallpaper(), xxxSetFocus(), xxxSetForegroundWindow(), xxxSetForegroundWindow2(), xxxSetIMEShowStatus(), xxxSetMenuInfo(), xxxSetParent(), xxxSetSysMenu(), xxxSetWindowData(), xxxShowOwnedWindows(), xxxSnapWindow(), xxxSwitchDesktop(), xxxSwitchToThisWindow(), xxxSwitchWndProc(), xxxSysCommand(), xxxTooltipHandleTimer(), xxxTrackMouse(), xxxTrackMouseMove(), xxxTrackPopupMenuEx(), xxxTranslateAccelerator(), xxxUpdateOtherThreadsWindows(), xxxUpdateThreadsWindows(), xxxUpdateTray(), xxxUpdateWindow2(), xxxUserPowerStateCalloutWorker(), xxxUserResetDisplayDevice(), xxxWindowEvent(), xxxWindowFromPoint(), xxxWindowHitTest(), xxxWindowHitTest2(), zzzAnimateCursor(), zzzChangeStates(), zzzInternalDestroyCaret(), zzzInvalidateDCCache(), zzzSetCursor(), and zzzSetWindowsHookEx().

#define UNDO_DELETE   2 /* We can undo the user's deletion of characters */
 

Definition at line 526 of file usercli.h.

Referenced by ECDeleteText(), ECMergeUndoInsertInfo(), MLUndo(), and SLUndo().

#define UNDO_INSERT   1 /* We can undo the user's insertion of characters */
 

Definition at line 525 of file usercli.h.

Referenced by ECDeleteText(), ECMergeUndoInsertInfo(), MLUndo(), and SLUndo().

#define UNDO_NONE   0 /* We can't undo the last operation. */
 

Definition at line 524 of file usercli.h.

Referenced by ECDeleteText(), ECMenu(), ECMergeUndoInsertInfo(), EditWndProc(), MLUndo(), SLCreate(), and SLUndo().

#define UNICODE_RLM   0x200f
 

Definition at line 2019 of file usercli.h.

Referenced by SoftModalMessageBox().

#define Unlock ppobj   )     (*ppobj = NULL)
 

Definition at line 368 of file usercli.h.

Referenced by _DestroyCursor(), _DestroyMenu(), _SetCursorIconData(), ButtonWndProcWorker(), CancelInputState(), CreateBitmapStrip(), CreateSpb(), DestroyAniIcon(), DestroyClass(), DestroyClassSmIcon(), DestroyKL(), DestroyThreadsHotKeys(), DestroyThreadsObjects(), DestroyWindowsHotKeys(), DisownClipboard(), DWP_SetHotKey(), FindHotKey(), ForceEmptyClipboard(), FreeDdeConv(), FreeSpb(), FreeThreadsWindowHooks(), FreeTimer(), FreeWindowStation(), FullScreenCleanup(), ImeCanDestroyDefIME(), ImeWndProcWorker(), InitiateWin32kCleanup(), InternalRegisterClassEx(), LockWindowUpdate2(), LockWndMenu(), MDIClientWndProcWorker(), MmUnlockPages(), MNFreePopup(), PopState(), ReceiverDied(), RemoveNotify(), StaticWndProcWorker(), UnlinkConv(), UnlinkWindow(), UnloadCursorsAndIcons(), UnlockAndFreeCPDs(), UnlockDesktopMenu(), UnlockMFMWFPWindow(), UnlockNotifyWindow(), UnlockPopupMenu(), UnlockPopupMenuWindow(), UnlockSubMenu(), UnlockWndMenu(), Win32kNtUserCleanup(), xxxButtonEvent(), xxxCapture(), xxxCBCompleteEditWindow(), xxxCBNcDestroyHandler(), xxxChildResize(), xxxCleanupDesktopMenu(), xxxCloseClipboard(), xxxCreateDesktop(), xxxDeactivate(), xxxDesktopThread(), xxxDestroyLBox(), xxxDestroyThreadDDEObject(), xxxDestroyThreadInfo(), xxxDestroyWindow(), xxxDW_DestroyOwnedWindows(), xxxEndScroll(), xxxFreeKeyboardLayouts(), xxxFreeWindow(), xxxHandleMenuMessages(), xxxKeyEvent(), xxxMakeWindowForegroundWithState(), xxxMDIDestroy(), xxxMNCloseHierarchy(), xxxMNOpenHierarchy(), xxxMNSwitchToAlternateMenu(), xxxMoveSize(), xxxNextWindow(), xxxSBTrackInit(), xxxSetLPITEMInfo(), xxxSetWindowData(), xxxSnapWindow(), xxxSwitchDesktop(), ZapActiveAndFocus(), zzzAttachToQueue(), zzzDestroyQueue(), and zzzInternalDestroyCaret().

#define UNLOCKRESOURCE hResData,
hModule   )     ((*(pfnUnlockResource))(hResData, hModule))
 

Definition at line 913 of file usercli.h.

Referenced by CommonLoadMenu(), CreateDialogParamA(), CreateDialogParamW(), DialogBoxParamA(), GetIconIdEx(), LoadAcc(), LoadBmp(), LoadStringOrError(), and ObjectFromDIBResource().

#define UPPERCASE   1
 

Definition at line 439 of file usercli.h.

Referenced by ComboBoxWndProcWorker(), ListBoxWndProcWorker(), xxxCBCreateHandler(), and xxxLBInsertItem().

#define UserCallbackReturn   NtCallbackReturn
 

Definition at line 2154 of file usercli.h.

Referenced by __ClientLoadOLE(), __ClientRegisterDragDrop(), and __ClientRevokeDragDrop().

#define UserGlobalAlloc flags,
size   )     GlobalAlloc(flags, size)
 

Definition at line 125 of file usercli.h.

Referenced by _ClientCopyDDEOut1(), AllocAndSetDDEData(), CopyDDEData(), ECCopy(), ECDeleteText(), ECResultStrHandler(), InternalCreateDataHandle(), MaybeTranslateExecuteData(), MB_CopyToClipboard(), and PackDDElParam().

#define UserGlobalFree  )     GlobalFree((HANDLE)(h))
 

Definition at line 124 of file usercli.h.

Referenced by _ClientCopyDDEIn1(), _ClientCopyDDEOut1(), CopyDDEData(), CreateLocalMemHandle(), DeleteClientClipboardHandle(), ECEmptyUndo(), ECMergeUndoInsertInfo(), ECNcDestroyHandler(), ECResultStrHandler(), FreeDDElParam(), GetClipboardData(), LoadAppDlls(), MESSAGECALL(), MLUndo(), and SLUndo().

#define USERGLOBALLOCK h,
 )     p = GlobalLock((HANDLE)(h))
 

Definition at line 128 of file usercli.h.

Referenced by _ClientCopyDDEIn1(), _ClientCopyDDEOut1(), _ClientGetDDEFlags(), _ClientGetDDEHookData(), AllocAndSetDDEData(), ClSpontAdviseData(), ConvertMemHandle(), CopyDDEData(), DdeAccessData(), DdeAddData(), DdeClientTransaction(), DdeGetData(), DeleteClientClipboardHandle(), ECCopy(), ExtractDDEDataInfo(), FixupDdeExecuteIfNecessary(), FreeDDEData(), InternalCreateDataHandle(), MaybeTranslateExecuteData(), MB_CopyToClipboard(), MESSAGECALL(), MLPasteText(), SLPasteText(), and SvStartAdviseUpdate().

#define UserGlobalReAlloc pmem,
cnt,
flags   )     GlobalReAlloc(pmem,cnt,flags)
 

Definition at line 129 of file usercli.h.

Referenced by DdeAddData(), and ECDeleteText().

#define UserGlobalSize pmem   )     GlobalSize(pmem)
 

Definition at line 130 of file usercli.h.

Referenced by _ClientCopyDDEIn1(), _ClientGetDDEHookData(), CopyDDEData(), DdeAccessData(), DdeAddData(), and DdeGetData().

#define USERGLOBALUNLOCK  )     GlobalUnlock((HANDLE)(h))
 

Definition at line 123 of file usercli.h.

Referenced by _ClientCopyDDEIn1(), _ClientCopyDDEIn2(), _ClientCopyDDEOut1(), _ClientCopyDDEOut2(), _ClientGetDDEFlags(), _ClientGetDDEHookData(), AllocAndSetDDEData(), ClSpontAdviseData(), ConvertMemHandle(), CopyDDEData(), DdeAddData(), DdeClientTransaction(), DdeGetData(), DdeUnaccessData(), DeleteClientClipboardHandle(), ECCopy(), ExtractDDEDataInfo(), FixupDdeExecuteIfNecessary(), FreeDDEData(), InternalCreateDataHandle(), MaybeTranslateExecuteData(), MB_CopyToClipboard(), MESSAGECALL(), MLPasteText(), SLPasteText(), and SvStartAdviseUpdate().

#define UserLocalAlloc uFlag,
uBytes   )     HeapAlloc(pUserHeap, uFlag, (uBytes))
 

Definition at line 958 of file usercli.h.

Referenced by AllocLookasideEntry(), bCleanConvertedTTFs(), BuildHwndList(), CascadeWindowsEnum(), CliImmInitializeHotKeys(), CopyDibHdr(), CreateAniIcon(), CreateIcoCurIndirect(), DefWindowProcWorker(), DIBFromBitmap(), DlgDirSelectComboBoxExA(), DlgDirSelectExA(), ECCalcMarginForDBCSFont(), ECDoIMEMenuCommand(), ECSetFont(), EnumDisplaySettingsEx(), FixupDdeExecuteIfNecessary(), GrowMem(), IconFromBestImage(), InitHStrings(), InitLookaside(), InternalEnumObjects(), InternalEnumProps(), LBSetTabStops(), LoadAcc(), LoadAniIcon(), MDIActivateDlgInit(), MDIClientWndProcWorker(), MESSAGECALL(), MLSetTabStops(), PSMGetTextExtent(), ReaderWndProc(), ReadIconGuts(), SetSysColorsTemp(), SmartStretchDIBits(), TextAlloc(), UserLpkPSMTextOut(), UserRtlAllocMem(), vSweepFonts(), xxxCBCompleteEditWindow(), xxxCBGetTextHelper(), xxxCBInternalUpdateEditWindow(), xxxCBUpdateListBoxWindow(), xxxLBInsertItem(), xxxLBoxCtlCharInput(), and xxxLBSetCount().

#define UserLocalFlags  )     0
 

Definition at line 964 of file usercli.h.

#define UserLocalFree  )     HeapFree(pUserHeap, 0, (LPSTR)(p))
 

Definition at line 960 of file usercli.h.

Referenced by _ClientEventCallback(), ArrangeWindows(), bCleanConvertedTTFs(), BuildHwndList(), CascadeWindowsEnum(), CharLowerBuffA(), CharUpperBuffA(), CliImmInitializeHotKeys(), ComboBoxWndProcWorker(), ConvertDIBBitmap(), ConvertDIBIcon(), CopyBmp(), CreateAniIcon(), CreateIcoCurIndirect(), CreateIMEUI(), DefFrameProcWorker(), DefWindowProcWorker(), DlgDirListA(), DlgDirListComboBoxA(), DlgDirSelectComboBoxExA(), DlgDirSelectExA(), DrawStateA(), DrawTextExA(), ECCalcMarginForDBCSFont(), ECDoIMEMenuCommand(), ECNcDestroyHandler(), ECSetFont(), EndTaskModalDialog(), FixupDdeExecuteIfNecessary(), FreeLookasideEntry(), GetTabbedTextExtentA(), IconFromBestImage(), InitLookaside(), InternalEnumObjects(), InternalEnumProps(), InternalEnumWindows(), LBSetTabStops(), ListBoxWndProcWorker(), LoadAcc(), LoadAniIcon(), LoadBitmapA(), LoadCursorA(), LoadCursorFromFileA(), LoadIconA(), LoadImageA(), MDIClientWndProcWorker(), MessageBoxExA(), MessageBoxIndirectA(), MessageBoxWorker(), MESSAGECALL(), MLSetTabStops(), PrivateExtractIconExA(), PrivateExtractIconsA(), PSMGetTextExtent(), ReaderWndProc(), ReadIconFromFileMap(), ReadIconGuts(), SendNotifyMessage(), SetSysColorsTemp(), SmartStretchDIBits(), SoftModalMessageBox(), StartTaskModalDialog(), TabbedTextOutA(), UnmaximizeChildWindows(), UserLpkPSMTextOut(), UserRtlFreeMem(), vSweepFonts(), WOWFindResourceExWCover(), WOWLoadBitmapA(), wvsprintfA(), wvsprintfW(), xxxCBCompleteEditWindow(), xxxCBGetTextHelper(), xxxCBInternalUpdateEditWindow(), xxxCBUpdateListBoxWindow(), xxxDestroyLBox(), xxxLBResetContent(), and xxxSetFrameTitle().

#define UserLocalHandle  )     (HLOCAL)(p)
 

Definition at line 965 of file usercli.h.

#define UserLocalLock  )     (LPSTR)(p)
 

Definition at line 962 of file usercli.h.

#define UserLocalReAlloc p,
uBytes,
uFlags   )     HeapReAlloc(pUserHeap, uFlags, (LPSTR)(p), (uBytes))
 

Definition at line 959 of file usercli.h.

Referenced by DrawTextExA(), ECSetFont(), GrowMem(), MLInsertchLine(), MLSetTabStops(), xxxLBInitStorage(), xxxLBInsertItem(), and xxxLBSetCount().

#define UserLocalSize  )     HeapSize(pUserHeap, 0, (LPSTR)(p))
 

Definition at line 961 of file usercli.h.

Referenced by MLInsertchLine().

#define UserLocalUnlock  ) 
 

Definition at line 963 of file usercli.h.

#define VALIDATECLASSANDSIZE pwnd,
inFNID   ) 
 

Definition at line 227 of file usercli.h.

Referenced by ButtonWndProcWorker(), ComboBoxWndProcWorker(), DefDlgProcWorker(), EditWndProcWorker(), ImeWndProcWorker(), ListBoxWndProcWorker(), MDIClientWndProcWorker(), StaticWndProcWorker(), xxxDesktopWndProc(), xxxMenuWindowProc(), xxxSBWndProc(), xxxSwitchWndProc(), and xxxTooltipWndProc().

#define VALIDATEHMENU hmenu   )     ((PMENU)HMValidateHandle(hmenu, TYPE_MENU))
 

Definition at line 196 of file usercli.h.

Referenced by CheckMenuItem(), CheckMenuRadioItem(), EnableMenuItem(), GetMenuContextHelpId(), GetMenuDefaultItem(), GetMenuInfo(), GetMenuItemCount(), GetMenuItemID(), GetMenuState(), GetSubMenu(), SetMenuItemInfoStruct(), and ValidateMENUITEMINFO().

#define VALIDATEHMONITOR hmonitor   )     ((PMONITOR)HMValidateSharedHandle(hmonitor, TYPE_MONITOR))
 

Definition at line 197 of file usercli.h.

Referenced by CascadeWindowsEnum(), GetMonitorInfo(), and TileWindowsEnum().

#define VERKEY_BACKSLASH   0xDC /* Vertual key for '\' character */
 

Definition at line 1753 of file usercli.h.

Referenced by xxxLBoxCtlKeyInput().

#define VERKEY_SLASH   0xBF /* Vertual key for '/' character */
 

Definition at line 1752 of file usercli.h.

Referenced by xxxLBoxCtlKeyInput().

#define WINDOW pmdi   )     (pmdi->hmenuWindow)
 

Definition at line 2070 of file usercli.h.

Referenced by AppendToWindowsMenu(), ChangeDibColors(), DefMDIChildProcWorker(), DefWindowProcWorker(), DrawBox(), DrawEdge(), DrawGrip(), LoadBmp(), MDIClientWndProcWorker(), MDISetMenu(), xxxDefWindowProc(), xxxDrawCaptionTemp(), xxxLBSetCaret(), xxxMDIActivate(), and xxxRedrawHungWindow().

#define WINDOWLIST_PROP_NAME   TEXT("SysBW")
 

Definition at line 2015 of file usercli.h.

Referenced by MB_DlgProcWorker().

#define WOWGLOBALFREE pmem   )     GlobalFree(pmem)
 

Definition at line 131 of file usercli.h.

Referenced by _ClientCopyDDEIn1(), _ClientCopyDDEIn2(), _ClientFreeDDEHandle(), AllocAndSetDDEData(), ClRespAdviseAck(), ClRespExecuteAck(), ClStartAdvise(), CopyDDEData(), DumpDDEMessage(), FreeDDEData(), InternalCreateDataHandle(), InternalFreeDataHandle(), MaybeTranslateExecuteData(), SvSpontAdvise(), and SvSpontExecute().

#define WS_MDIALLOWED   (WS_MINIMIZE | WS_MAXIMIZE | WS_CLIPCHILDREN | WS_DISABLED | WS_HSCROLL | WS_VSCROLL | 0x0000FFFFL)
 

Definition at line 2057 of file usercli.h.

Referenced by CreateMDIChild().

#define WS_MDICOMMANDS   (WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
 

Definition at line 2056 of file usercli.h.

#define WS_MDISTYLE   (WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU|WS_CAPTION|WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX)
 

Definition at line 2055 of file usercli.h.

Referenced by CreateMDIChild().


Typedef Documentation

typedef struct tagACCELCACHE ACCELCACHE
 

Referenced by AddAccResource().

typedef struct tagBLOCK BLOCK
 

Referenced by ECCalcChangeSelection().

typedef LRESULT(APIENTRY * CFNSCSENDMESSAGE)(HWND, UINT, WPARAM, LPARAM, ULONG_PTR, DWORD, BOOL)
 

Definition at line 48 of file usercli.h.

typedef struct tagCURSORRESOURCE CURSORRESOURCE
 

Referenced by ReadIconGuts().

typedef HRESULT(* DODDPROC)(LPDATAOBJECT, LPDROPSOURCE, DWORD, LPDWORD)
 

Definition at line 2101 of file usercli.h.

typedef struct tagED ED
 

Referenced by EditWndProcWorker().

typedef struct tagEDITWND EDITWND
 

Referenced by RW_RegisterControls().

typedef struct _FILEINFO FILEINFO
 

Referenced by LoadCursorIconFromResource(), and RtlLoadObjectFromDIBFile().

typedef int(WINAPI * GENERICPROC)()
 

Definition at line 174 of file usercli.h.

Referenced by _ClientGetListboxString().

typedef struct tagGETPROCINFO GETPROCINFO
 

Referenced by LoadOLEOnce().

typedef struct _IN_STRING IN_STRING
 

Referenced by SystemParametersInfo().

typedef struct _LARGE_IN_STRING LARGE_IN_STRING
 

Referenced by _CreateWindowEx().

typedef struct tagLBItem LBItem
 

Referenced by LBGetItemData().

typedef struct tagLBODItem LBODItem
 

Referenced by LBGetItemData().

typedef struct _LOOKASIDE LOOKASIDE
 

typedef struct tagBLOCK * LPBLOCK
 

Referenced by ECFindXORblks().

typedef struct tagLBItem * lpLBItem
 

Referenced by GetLpszItem().

typedef struct tagLBODItem * lpLBODItem
 

Referenced by LBGetItemData().

typedef struct tagREADERMODE * LPREADERMODE
 

typedef STRIPINFO FAR* LPSTRIPINFO
 

Definition at line 770 of file usercli.h.

Referenced by GetActualNegA().

typedef struct tagMDIACTIVATEPOS MDIACTIVATEPOS
 

Referenced by MDIActivateDlgInit().

typedef struct tagMNIDROPTARGET MNIDROPTARGET
 

Referenced by __ClientRegisterDragDrop().

typedef HRESULT(* OLEINITIALIZEPROC)(LPVOID)
 

Definition at line 2097 of file usercli.h.

Referenced by LoadOLEOnce().

typedef HRESULT(* OLEUNINITIALIZEPROC)(VOID)
 

Definition at line 2098 of file usercli.h.

typedef struct tagACCELCACHE * PACCELCACHE
 

typedef struct tagCURSORRESOURCE * PCURSORRESOURCE
 

typedef struct tagED * PED
 

typedef struct tagEDITWND * PEDITWND
 

Referenced by EditWndProcWorker().

typedef struct _FILEINFO * PFILEINFO
 

typedef struct _IN_STRING * PIN_STRING
 

Referenced by InitClsMenuName().

typedef struct _LARGE_IN_STRING * PLARGE_IN_STRING
 

Referenced by RtlCaptureLargeAnsiString().

typedef struct _LOOKASIDE * PLOOKASIDE
 

Referenced by InitLookaside().

typedef struct tagMDIACTIVATEPOS * PMDIACTIVATEPOS
 

Referenced by MDIActivateDlgSize().

typedef struct tagMNIDROPTARGET * PMNIDROPTARGET
 

Referenced by __ClientRegisterDragDrop().

typedef struct tagED ** PPED
 

typedef struct tagREADERINFO * PREADERINFO
 

Referenced by FReader2Dim().

typedef struct tagREADERMODE * PREADERMODE
 

Referenced by ReaderWndProc().

typedef struct tagREADERWND * PREADERWND
 

Referenced by ReaderWndProc().

typedef struct tagSHORTCREATE * PSHORTCREATE
 

Referenced by CreateMDIChild().

typedef struct tagSTAT * PSTAT
 

Referenced by ChopText().

typedef struct tagSTATWND * PSTATWND
 

Referenced by ChopText().

typedef struct tagUNDO * PUNDO
 

Referenced by ECSaveUndo().

typedef struct tagREADERINFO READERINFO
 

Referenced by ReaderWndProc().

typedef struct tagREADERMODE READERMODE
 

Referenced by ReaderWndProc().

typedef LONG(CALLBACK* READERMODEPROC)(LPARAM lParam, int nCode, int dx, int dy)
 

Definition at line 2160 of file usercli.h.

typedef struct tagREADERWND READERWND
 

typedef HRESULT(* REGISTERDDPROC)(HWND, LPDROPTARGET)
 

Definition at line 2099 of file usercli.h.

Referenced by __ClientRegisterDragDrop().

typedef HRESULT(* REVOKEDDPROC)(HWND)
 

Definition at line 2100 of file usercli.h.

Referenced by __ClientRevokeDragDrop().

typedef struct tagSHORTCREATE SHORTCREATE
 

Referenced by _CreateWindowEx().

typedef struct tagSTAT STAT
 

Referenced by StaticWndProcWorker().

typedef struct tagSTATWND STATWND
 

Referenced by RW_RegisterControls().

typedef struct _TL TL
 

Referenced by SoundSentryTimer().

typedef struct tagUNDO UNDO
 

Referenced by ECSaveUndo().

typedef BITMAPCOREHEADER UNALIGNED* UPBITMAPCOREHEADER
 

Definition at line 924 of file usercli.h.

Referenced by RtlLoadObjectFromDIBFile().

typedef BITMAPINFO UNALIGNED* UPBITMAPINFO
 

Definition at line 922 of file usercli.h.

typedef BITMAPINFOHEADER UNALIGNED* UPBITMAPINFOHEADER
 

Definition at line 923 of file usercli.h.

Referenced by CopyDibHdr(), ExtractIconFromEXE(), HowManyColors(), and RtlLoadObjectFromDIBFile().


Function Documentation

BOOL _ClientFreeLibrary HANDLE  hmod  ) 
 

DWORD _ClientGetListboxString PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPSTR  lParam,
ULONG_PTR  xParam,
PROC  xpfn
 

Definition at line 1513 of file clmsg.c.

References DWORD, GENERICPROC, and msg.

01520 { 01521 return ((GENERICPROC)xpfn)(pwnd, msg, wParam, (LPARAM)lParam, xParam); 01522 }

HWND _CreateWindowEx DWORD  dwExStyle,
LPCTSTR  pClassName,
LPCTSTR  pWindowName,
DWORD  dwStyle,
int  x,
int  y,
int  nWidth,
int  nHeight,
HWND  hwndParent,
HMENU  hmenu,
HANDLE  hModule,
LPVOID  pParam,
DWORD  dwFlags
 

Definition at line 1197 of file client/ntstubs.c.

References _LARGE_STRING::bAnsi, BEGINCALL, BOOL, _LARGE_STRING::Buffer, CLEANUPLPSTRW, CreateMDIChild(), CW_FLAGS_DIFFHMOD, tagSHORTCREATE::cx, tagSHORTCREATE::cy, dwFlags, DWORD, ENDCALL, ERRORTRAP, _LARGE_IN_STRING::fAllocated, FALSE, FNID_MDICLIENT, GETEXPWINVER, GETFNID, tagSHORTCREATE::hMenu, IS_PTR, L, LARGE_IN_STRING, _LARGE_STRING::Length, _LARGE_STRING::MaximumLength, MDICompleteChildCreation(), MSGERROR, NtUserCreateWindowEx(), NULL, PBYTE, _LARGE_IN_STRING::pstr, RtlCaptureLargeAnsiString(), RtlInitLargeAnsiString(), RtlInitLargeUnicodeString(), SHORTCREATE, _LARGE_IN_STRING::strCapture, tagSHORTCREATE::style, TRUE, UINT, ValidateHwnd, VER40, WS_EX_ANSICREATOR, WS_EX_MDICHILD, tagSHORTCREATE::x, and tagSHORTCREATE::y.

Referenced by CreateWindowEx(), EnterReaderMode(), InternalDdeInitialize(), UserRegisterWowHandlers(), and xxxCBCreateHandler().

01211 { 01212 LARGE_IN_STRING strClassName; 01213 LARGE_STRING strWindowName; 01214 PLARGE_STRING pstrClassName; 01215 PLARGE_STRING pstrWindowName; 01216 DWORD dwExpWinVerAndFlags; 01217 01218 /* 01219 * Make sure cleanup will work successfully 01220 */ 01221 strClassName.fAllocated = FALSE; 01222 01223 /* 01224 * To be compatible with Chicago, we test the validity of 01225 * the ExStyle bits and fail if any invalid bits are found. 01226 * And for backward compatibilty with NT apps, we only fail for 01227 * new apps (post NT 3.1). 01228 */ 01229 01230 // BOGUS 01231 01232 if (dwExStyle & 0x00000800L) { 01233 dwExStyle |= WS_EX_TOOLWINDOW; 01234 dwExStyle &= 0xfffff7ffL; 01235 } 01236 01237 dwExpWinVerAndFlags = (DWORD)(WORD)GETEXPWINVER(hModule); 01238 if ((dwExStyle & ~WS_EX_VALID50) && (dwExpWinVerAndFlags >= VER40) ) { 01239 RIPMSG0(RIP_ERROR, "Invalid 5.0 ExStyle\n"); 01240 return NULL; 01241 } 01242 { 01243 01244 BOOL fMDIchild = FALSE; 01245 MDICREATESTRUCT mdics; 01246 HMENU hSysMenu; 01247 01248 BEGINCALL() 01249 01250 if ((fMDIchild = (BOOL)(dwExStyle & WS_EX_MDICHILD))) { 01251 SHORTCREATE sc; 01252 PWND pwndParent; 01253 01254 pwndParent = ValidateHwnd(hwndParent); 01255 01256 if ((pwndParent == NULL) || (GETFNID(pwndParent) != FNID_MDICLIENT)) { 01257 RIPMSG0(RIP_ERROR, "Invalid parent for MDI child window\n"); 01258 MSGERROR(); 01259 } 01260 01261 mdics.lParam = (LPARAM)pParam; 01262 pParam = &mdics; 01263 mdics.x = sc.x = x; 01264 mdics.y = sc.y = y; 01265 mdics.cx = sc.cx = nWidth; 01266 mdics.cy = sc.cy = nHeight; 01267 mdics.style = sc.style = dwStyle; 01268 mdics.hOwner = hModule; 01269 mdics.szClass = pClassName; 01270 mdics.szTitle = pWindowName; 01271 01272 if (!CreateMDIChild(&sc, &mdics, dwExpWinVerAndFlags, &hSysMenu, pwndParent)) 01273 MSGERROR(); 01274 01275 x = sc.x; 01276 y = sc.y; 01277 nWidth = sc.cx; 01278 nHeight = sc.cy; 01279 dwStyle = sc.style; 01280 hmenu = sc.hMenu; 01281 } 01282 01283 /* 01284 * Set up class and window name. If the window name is an 01285 * ordinal, make it look like a string so the callback thunk 01286 * will be able to ensure it is in the correct format. 01287 */ 01288 pstrWindowName = NULL; 01289 if (dwFlags & CW_FLAGS_ANSI) { 01290 dwExStyle = dwExStyle | WS_EX_ANSICREATOR; 01291 if (IS_PTR(pClassName)) { 01292 RtlCaptureLargeAnsiString(&strClassName, 01293 (PCHAR)pClassName, TRUE); 01294 pstrClassName = (PLARGE_STRING)strClassName.pstr; 01295 } else 01296 pstrClassName = (PLARGE_STRING)pClassName; 01297 01298 if (pWindowName != NULL) { 01299 if (*(PBYTE)pWindowName == 0xff) { 01300 strWindowName.bAnsi = TRUE; 01301 strWindowName.Buffer = (PVOID)pWindowName; 01302 strWindowName.Length = 3; 01303 strWindowName.MaximumLength = 3; 01304 } else 01305 RtlInitLargeAnsiString((PLARGE_ANSI_STRING)&strWindowName, 01306 (LPSTR)pWindowName, (UINT)-1); 01307 pstrWindowName = &strWindowName; 01308 } 01309 } else { 01310 if (IS_PTR(pClassName)) { 01311 RtlInitLargeUnicodeString( 01312 (PLARGE_UNICODE_STRING)&strClassName.strCapture, 01313 pClassName, (UINT)-1); 01314 pstrClassName = (PLARGE_STRING)&strClassName.strCapture; 01315 } else 01316 pstrClassName = (PLARGE_STRING)pClassName; 01317 01318 if (pWindowName != NULL) { 01319 if (pWindowName != NULL && 01320 *(PWORD)pWindowName == 0xffff) { 01321 strWindowName.bAnsi = FALSE; 01322 strWindowName.Buffer = (PVOID)pWindowName; 01323 strWindowName.Length = 4; 01324 strWindowName.MaximumLength = 4; 01325 } else 01326 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&strWindowName, 01327 pWindowName, (UINT)-1); 01328 pstrWindowName = &strWindowName; 01329 } 01330 } 01331 if (dwFlags & CW_FLAGS_DIFFHMOD) { 01332 dwExpWinVerAndFlags |= CW_FLAGS_DIFFHMOD; 01333 } 01334 01335 retval = (ULONG_PTR)NtUserCreateWindowEx( 01336 dwExStyle, 01337 pstrClassName, 01338 pstrWindowName, 01339 dwStyle, 01340 x, 01341 y, 01342 nWidth, 01343 nHeight, 01344 hwndParent, 01345 hmenu, 01346 hModule, 01347 pParam, 01348 dwExpWinVerAndFlags); 01349 01350 // If this is an MDI child, we need to do some more to complete the 01351 // process of creating an MDI child. 01352 if (retval && fMDIchild) { 01353 MDICompleteChildCreation((HWND)retval, hSysMenu, ((dwStyle & WS_VISIBLE) != 0L), (BOOL)((dwStyle & WS_DISABLED)!= 0L)); 01354 } 01355 01356 01357 ERRORTRAP(0); 01358 CLEANUPLPSTRW(strClassName); 01359 ENDCALL(HWND); 01360 } 01361 }

BOOL _DefSetText HWND  hwnd,
LPCWSTR  pstr,
BOOL  bAnsi
 

Definition at line 1171 of file client/ntstubs.c.

References BEGINCALL, BOOL, DWORD, ENDCALL, ERRORTRAP, NtUserDefSetText(), NULL, PLARGE_ANSI_STRING, RtlInitLargeAnsiString(), RtlInitLargeUnicodeString(), and UINT.

Referenced by ButtonWndProcWorker(), MDIClientWndProcWorker(), StaticWndProcWorker(), and xxxSetFrameTitle().

01175 { 01176 LARGE_STRING str; 01177 01178 BEGINCALL() 01179 01180 if (lpszText) { 01181 if (bAnsi) 01182 RtlInitLargeAnsiString((PLARGE_ANSI_STRING)&str, 01183 (LPSTR)lpszText, (UINT)-1); 01184 else 01185 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&str, 01186 lpszText, (UINT)-1); 01187 } 01188 01189 retval = (DWORD)NtUserDefSetText( 01190 hwnd, 01191 lpszText ? &str : NULL); 01192 01193 ERRORTRAP(0); 01194 ENDCALL(BOOL); 01195 }

PWND _FindDlgItem PWND  pwndParent,
DWORD  id
 

Definition at line 749 of file dlgmgr2.c.

References _GetDlgItem(), _NextControl(), NULL, tagWND::spmenu, TestWF, and WFWIN40COMPAT.

Referenced by DefDlgProcWorker(), IsDialogMessageW(), and xxxCheckDefPushButton().

00750 { 00751 PWND pwndChild; 00752 PWND pwndOrig; 00753 00754 // QUICK TRY: 00755 pwndChild = _GetDlgItem(pwndParent, id); 00756 if (pwndChild || !TestWF(pwndParent, WFWIN40COMPAT)) 00757 return(pwndChild); 00758 00759 pwndOrig = _NextControl(pwndParent, NULL, CWP_SKIPINVISIBLE); 00760 if (pwndOrig == pwndParent) 00761 return(NULL); 00762 00763 pwndChild = pwndOrig; 00764 00765 // VerifyWindow(pwndChild); 00766 00767 do 00768 { 00769 if (PtrToUlong(pwndChild->spmenu) == id) 00770 return(pwndChild); 00771 00772 pwndChild = _NextControl(pwndParent, pwndChild, CWP_SKIPINVISIBLE); 00773 } 00774 while (pwndChild && (pwndChild != pwndOrig)); 00775 00776 return(NULL); 00777 }

BOOL APIENTRY _FreeResource HANDLE  hResData,
HINSTANCE  hModule
 

Definition at line 1499 of file clres.c.

References BOOL, and FALSE.

01502 { 01503 UNREFERENCED_PARAMETER(hResData); 01504 UNREFERENCED_PARAMETER(hModule); 01505 01506 return FALSE; 01507 }

PWND _GetChildControl PWND  pwndDlg,
PWND  pwndLevel
 

Definition at line 125 of file dlgmgrc.c.

References NULL, REBASEPWND, TestWF, TestwndChild, and WEFCONTROLPARENT.

Referenced by _GetNextDlgGroupItem(), _GetNextDlgTabItem(), _NextSibblingOrAncestor(), GetNextDlgHelpItem(), xxxGNM_FindNextMnem(), and xxxRemoveDefaultButton().

00125 { 00126 PWND pwndControl = NULL; 00127 00128 while (pwndChild && TestwndChild(pwndChild) && (pwndChild != pwndRoot)) { 00129 pwndControl = pwndChild; 00130 pwndChild = REBASEPWND(pwndChild, spwndParent); 00131 00132 if (TestWF(pwndChild, WEFCONTROLPARENT)) 00133 break; 00134 } 00135 00136 return(pwndControl); 00137 }

ULONG_PTR _GetClassData PCLS  pcls,
PWND  pwnd,
int  index,
BOOL  bAnsi
 

Definition at line 100 of file classc.c.

References afClassDWord, aiClassOffset, BYTE, CPD_ANSI_TO_UNICODE, CPD_UNICODE_TO_ANSI, CPD_WNDTOCLS, CSF_ANSIPROC, tagCLS::CSF_flags, CSF_SERVERSIDEPROC, CSF_WOWCLASS, CSF_WOWEXTRA, DWORD, GetCPD(), INDEX_OFFSET, IS_PTR, tagCLS::lpszClientAnsiMenuName, tagCLS::lpszClientUnicodeMenuName, MapClientNeuterToClientPfn(), MapServerToClientPfn(), NtUserCallHwndParam(), PtoH, and PWCFromPCLS.

Referenced by _GetClassLongPtr(), GetClassWord(), and GetClassWOWWords().

00105 { 00106 KERNEL_ULONG_PTR dwData; 00107 DWORD dwCPDType = 0; 00108 00109 index -= INDEX_OFFSET; 00110 00111 if (index < 0) { 00112 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00113 return 0; 00114 } 00115 00116 UserAssert(index >= 0); 00117 UserAssert(index < sizeof(afClassDWord)); 00118 UserAssert(sizeof(afClassDWord) == sizeof(aiClassOffset)); 00119 if (afClassDWord[index] == sizeof(DWORD)) { 00120 dwData = *(DWORD *)(((BYTE *)pcls) + aiClassOffset[index]); 00121 } else if (afClassDWord[index] == sizeof(KERNEL_ULONG_PTR)) { 00122 dwData = *(KERNEL_ULONG_PTR *)(((BYTE *)pcls) + aiClassOffset[index]); 00123 } else { 00124 dwData = (DWORD)*(WORD *)(((BYTE *)pcls) + aiClassOffset[index]); 00125 } 00126 00127 index += INDEX_OFFSET; 00128 00129 /* 00130 * If we're returning an icon or cursor handle, do the reverse 00131 * mapping here. 00132 */ 00133 switch(index) { 00134 case GCLP_MENUNAME: 00135 if (IS_PTR(pcls->lpszMenuName)) { 00136 /* 00137 * The Menu Name is a real string: return the client-side address. 00138 * (If the class was registered by another app this returns an 00139 * address in that app's addr. space, but it's the best we can do) 00140 */ 00141 dwData = bAnsi ? 00142 (ULONG_PTR)pcls->lpszClientAnsiMenuName : 00143 (ULONG_PTR)pcls->lpszClientUnicodeMenuName; 00144 } 00145 break; 00146 00147 case GCLP_HICON: 00148 case GCLP_HCURSOR: 00149 case GCLP_HICONSM: 00150 /* 00151 * We have to go to the kernel to convert the pcursor to a handle because 00152 * cursors are allocated out of POOL, which is not accessable from the client. 00153 */ 00154 if (dwData) { 00155 dwData = NtUserCallHwndParam(PtoH(pwnd), index, SFI_GETCLASSICOCUR); 00156 } 00157 break; 00158 00159 case GCLP_WNDPROC: 00160 { 00161 00162 /* 00163 * Always return the client wndproc in case this is a server 00164 * window class. 00165 */ 00166 00167 if (pcls->CSF_flags & CSF_SERVERSIDEPROC) { 00168 dwData = MapServerToClientPfn(dwData, bAnsi); 00169 } else { 00170 KERNEL_ULONG_PTR dwT = dwData; 00171 00172 dwData = MapClientNeuterToClientPfn(pcls, dwT, bAnsi); 00173 00174 /* 00175 * If the client mapping didn't change the window proc then see if 00176 * we need a callproc handle. 00177 */ 00178 if (dwData == dwT) { 00179 /* 00180 * Need to return a CallProc handle if there is an Ansi/Unicode mismatch 00181 */ 00182 if (bAnsi != !!(pcls->CSF_flags & CSF_ANSIPROC)) { 00183 dwCPDType |= bAnsi ? CPD_ANSI_TO_UNICODE : CPD_UNICODE_TO_ANSI; 00184 } 00185 } 00186 } 00187 00188 if (dwCPDType) { 00189 ULONG_PTR dwCPD; 00190 00191 dwCPD = GetCPD(pwnd, dwCPDType | CPD_WNDTOCLS, KERNEL_ULONG_PTR_TO_ULONG_PTR(dwData)); 00192 00193 if (dwCPD) { 00194 dwData = dwCPD; 00195 } else { 00196 RIPMSG0(RIP_WARNING, "GetClassLong unable to alloc CPD returning handle\n"); 00197 } 00198 } 00199 } 00200 break; 00201 00202 case GCL_CBCLSEXTRA: 00203 if ((pcls->CSF_flags & CSF_WOWCLASS) && (pcls->CSF_flags & CSF_WOWEXTRA)) { 00204 /* 00205 * The 16-bit app changed its Extra bytes value. Return the changed 00206 * value. FritzS 00207 */ 00208 00209 return PWCFromPCLS(pcls)->iClsExtra; 00210 } 00211 else 00212 return pcls->cbclsExtra; 00213 00214 break; 00215 00216 /* 00217 * WOW uses a pointer straight into the class structure. 00218 */ 00219 case GCLP_WOWWORDS: 00220 if (pcls->CSF_flags & CSF_WOWCLASS) { 00221 return ((ULONG_PTR)PWCFromPCLS(pcls)); 00222 } else 00223 return 0; 00224 00225 case GCL_STYLE: 00226 dwData &= CS_VALID; 00227 break; 00228 } 00229 00230 return KERNEL_ULONG_PTR_TO_ULONG_PTR(dwData); 00231 }

DWORD _GetClassLong PWND  pwnd,
int  index,
BOOL  bAnsi
 

HCURSOR _GetCursorFrameInfo HCURSOR  hcur,
LPWSTR  id,
int  iFrame,
LPDWORD  pjifRate,
LPINT  pccur
 

long _GetDialogBaseUnits VOID   ) 
 

PWND _GetDlgItem PWND  ,
int 
 

Definition at line 141 of file client/wow.c.

References NULL, REBASEPWND, and tagWND::spmenu.

Referenced by _FindDlgItem(), ChopText(), DefDlgProcWorker(), DlgDirSelectComboBoxExW(), GetDlgItem(), and xxxDlgDirListHelper().

00144 { 00145 if (pwnd != NULL) { 00146 pwnd = REBASEPWND(pwnd, spwndChild); 00147 while (pwnd != NULL) { 00148 if (PtrToLong(pwnd->spmenu) == id) 00149 break; 00150 pwnd = REBASEPWND(pwnd, spwndNext); 00151 } 00152 } 00153 00154 return pwnd; 00155 }

PWND _GetNextDlgGroupItem PWND  pwndDlg,
PWND  pwnd,
BOOL  fPrev
 

Definition at line 439 of file dlgmgrc.c.

References _GetChildControl(), BOOL, FALSE, TestWF, TRUE, UT_NextGroupItem(), UT_PrevGroupItem(), WFDISABLED, and WFVISIBLE.

Referenced by GetNextDlgGroupItem(), IsDialogMessageW(), xxxBNReleaseCapture(), and xxxGNM_FindNextMnem().

00443 { 00444 PWND pwndCurrent; 00445 BOOL fOnceAround = FALSE; 00446 00447 pwnd = pwndCurrent = _GetChildControl(pwndDlg, pwnd); 00448 00449 do { 00450 pwnd = (fPrev ? UT_PrevGroupItem(pwndDlg, pwnd) : 00451 UT_NextGroupItem(pwndDlg, pwnd)); 00452 00453 if (pwnd == pwndCurrent) 00454 fOnceAround = TRUE; 00455 00456 if (!pwndCurrent) 00457 pwndCurrent = pwnd; 00458 } 00459 while (!fOnceAround && ((TestWF(pwnd, WFDISABLED) || !TestWF(pwnd, WFVISIBLE)))); 00460 00461 return pwnd; 00462 }

PWND _GetNextDlgTabItem PWND  pwndDlg,
PWND  pwnd,
BOOL  fPrev
 

Definition at line 348 of file dlgmgrc.c.

References _GetChildControl(), _IsDescendant(), _NextControl(), _PrevControl(), and NULL.

Referenced by DefDlgProcWorker(), GetNextDlgTabItem(), InternalCreateDialog(), IsDialogMessageW(), and xxxGotoNextMnem().

00352 { 00353 PWND pwndSave; 00354 00355 if (pwnd == pwndDlg) 00356 pwnd = NULL; 00357 else 00358 { 00359 pwnd = _GetChildControl(pwndDlg, pwnd); 00360 if (pwnd && !_IsDescendant(pwndDlg, pwnd)) 00361 return(NULL); 00362 } 00363 00364 // 00365 // BACKWARD COMPATIBILITY 00366 // 00367 // Note that the result when there are no tabstops of 00368 // IGetNextDlgTabItem(pwndDlg, NULL, FALSE) was the last item, now 00369 // will be the first item. We could put a check for fRecurse here 00370 // and do the old thing if not set. 00371 // 00372 00373 // We are going to bug out if we hit the first child a second time. 00374 00375 pwndSave = pwnd; 00376 00377 pwnd = (fPrev ? _PrevControl(pwndDlg, pwnd, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED) : 00378 _NextControl(pwndDlg, pwnd, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED)); 00379 00380 if (!pwnd) 00381 goto AllOver; 00382 00383 while ((pwnd != pwndSave) && (pwnd != pwndDlg)) { 00384 UserAssert(pwnd); 00385 00386 if (!pwndSave) 00387 pwndSave = pwnd; 00388 00389 if ((pwnd->style & (WS_TABSTOP | WS_VISIBLE | WS_DISABLED)) == (WS_TABSTOP | WS_VISIBLE)) 00390 // Found it. 00391 break; 00392 00393 pwnd = (fPrev ? _PrevControl(pwndDlg, pwnd, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED) : 00394 _NextControl(pwndDlg, pwnd, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED)); 00395 } 00396 00397 AllOver: 00398 return pwnd; 00399 }

DWORD _GetWindowLong PWND  pwnd,
int  index,
BOOL  bAnsi
 

WORD _GetWindowWord PWND  pwnd,
int  index
 

Definition at line 26 of file getsetc.c.

References tagBUTN::buttonState, BYTE, CBFNID, tagWND::cbwndExtra, DWORD, tagWND::dwUserData, FNID_BUTTON, FNID_DIALOG, FNID_MDICLIENT, GETFNID, and UINT.

Referenced by GetWindowWord().

00029 { 00030 if (GETFNID(pwnd) != 0) { 00031 if ((index >= 0) && (index < 00032 (int)(CBFNID(pwnd->fnid)-sizeof(WND)))) { 00033 00034 switch (GETFNID(pwnd)) { 00035 case FNID_MDICLIENT: 00036 if (index == 0) 00037 break; 00038 goto DoDefault; 00039 00040 case FNID_BUTTON: 00041 /* 00042 * CorelDraw does a get/set on the first button window word. 00043 * Allow it to. 00044 */ 00045 if (index == 0) { 00046 /* 00047 * Since we now use a lookaside buffer for the control's 00048 * private data, we need to indirect into this structure. 00049 */ 00050 PBUTN pbutn = ((PBUTNWND)pwnd)->pbutn; 00051 if (!pbutn || (LONG_PTR)pbutn == (LONG_PTR)-1) { 00052 return 0; 00053 } else { 00054 return (WORD)(pbutn->buttonState); 00055 } 00056 } 00057 goto DoDefault; 00058 00059 case FNID_DIALOG: 00060 if (index == DWLP_USER) 00061 return LOWORD(((PDIALOG)pwnd)->unused); 00062 if (index == DWLP_USER+2) 00063 return HIWORD(((PDIALOG)pwnd)->unused); 00064 goto DoDefault; 00065 00066 default: 00067 DoDefault: 00068 RIPERR3(ERROR_INVALID_INDEX, 00069 RIP_WARNING, 00070 "GetWindowWord: Trying to read private server data pwnd=(%#p) index=(%ld) fnid=(%lX)", 00071 pwnd, index, (DWORD)pwnd->fnid); 00072 return 0; 00073 break; 00074 } 00075 } 00076 } 00077 00078 if (index == GWLP_USERDATA) 00079 return (WORD)pwnd->dwUserData; 00080 00081 if ((index < 0) || ((UINT)index + sizeof(WORD) > (UINT)pwnd->cbwndExtra)) { 00082 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00083 return 0; 00084 } else { 00085 return *((WORD UNALIGNED *)((BYTE *)(pwnd + 1) + index)); 00086 } 00087 }

HKL _LoadKeyboardLayoutEx HANDLE  hFile,
UINT  offTable,
HKL  hkl,
LPCWSTR  pwszKL,
UINT  KbdInputLocale,
UINT  Flags
 

Referenced by LoadKeyboardLayoutWorker().

LPSTR APIENTRY _LockResource HANDLE  hResData,
HINSTANCE  hModule
 

Definition at line 1509 of file clres.c.

01512 { 01513 UNREFERENCED_PARAMETER(hModule); 01514 01515 return (LPSTR)(hResData); 01516 }

PWND _NextControl PWND  pwndDlg,
PWND  pwnd,
UINT  uFlags
 

Definition at line 207 of file dlgmgrc.c.

References _IsDescendant(), _NextSibblingOrAncestor(), BOOL, FALSE, NULL, REBASEPWND, tagWND::spwndParent, TestWF, TRUE, WEFCONTROLPARENT, WFDISABLED, and WFVISIBLE.

Referenced by _FindDlgItem(), _GetNextDlgTabItem(), _PrevControl(), GetNextDlgHelpItem(), UT_NextGroupItem(), UT_PrevGroupItem(), xxxGNM_FindNextMnem(), and xxxRemoveDefaultButton().

00211 { 00212 BOOL fSkip, fAncestor; 00213 PWND pwndLast, pwndSibblingLoop; 00214 /* Bug 272874 - joejo 00215 * 00216 * Stop infinite loop by only looping a finite number of times and 00217 * then bailing. 00218 */ 00219 int nLoopCount = 0; 00220 00221 UserAssert (pwndRoot != NULL); 00222 00223 if (pwndStart == NULL) { 00224 // Start with pwndRoot's first child 00225 pwndStart = REBASEPWND(pwndRoot, spwndChild); 00226 pwndLast = pwndStart; 00227 fAncestor = FALSE; 00228 } else { 00229 UserAssert ((pwndRoot != pwndStart) && _IsDescendant(pwndRoot, pwndStart)); 00230 00231 // Save starting handle and get next one 00232 pwndLast = pwndStart; 00233 pwndSibblingLoop = pwndStart; 00234 fAncestor = TRUE; 00235 goto TryNextOne; 00236 } 00237 00238 00239 // If no more controls, game over 00240 if (pwndStart == NULL) { 00241 return pwndRoot; 00242 } 00243 00244 // Search for a non WS_EX_CONTROLPARENT window; if a window should be skipped, 00245 // try its spwndNext; otherwise, walk down its child chain. 00246 pwndSibblingLoop = pwndStart; 00247 do { 00248 00249 //If not WS_EX_CONTROLPARENT parent, done. 00250 if (!TestWF(pwndStart, WEFCONTROLPARENT)) { 00251 return pwndStart; 00252 } 00253 00254 // Do they want to skip this window? 00255 fSkip = ((uFlags & CWP_SKIPINVISIBLE) && !TestWF(pwndStart, WFVISIBLE)) 00256 || ((uFlags & CWP_SKIPDISABLED) && TestWF(pwndStart, WFDISABLED)); 00257 00258 00259 // Remember the current window 00260 pwndLast = pwndStart; 00261 00262 // Walk down child chain? 00263 if (!fSkip && !fAncestor) { 00264 pwndStart = _NextControl (pwndStart, NULL, uFlags); 00265 // If it found one, done. 00266 if (pwndStart != pwndLast) { 00267 return pwndStart; 00268 } 00269 } 00270 00271 TryNextOne: 00272 // Try the next one. 00273 pwndStart = _NextSibblingOrAncestor (pwndRoot, pwndStart); 00274 if (pwndStart == NULL) { 00275 break; 00276 } 00277 00278 // If parents are the same, we are still in the same sibbling chain 00279 if (pwndLast->spwndParent == pwndStart->spwndParent) { 00280 // If we had just moved up the parent chain last time around, 00281 // mark this as the beginning of the new sibbling chain. 00282 // Otherwise, check if we've looped through all sibblings already. 00283 if (fAncestor) { 00284 // Beggining of new sibbling chain. 00285 pwndSibblingLoop = pwndStart; 00286 } else if (pwndStart == pwndSibblingLoop) { 00287 // Already visited all sibblings, so done. 00288 break; 00289 } 00290 fAncestor = FALSE; 00291 } else { 00292 // We must have moved up the parent chain, so don't 00293 // walk down the child chain right away (try the next window first) 00294 // Eventhough we are on a new sibbling chain, we don't update 00295 // pwndSibblingLoop yet; this is because we must walk down this 00296 // child chain again to make sure we visit all the descendents 00297 fAncestor = TRUE; 00298 } 00299 00300 /* Bug 272874 - joejo 00301 * 00302 * Stop infinite loop by only looping a finite number of times and 00303 * then bailing. 00304 */ 00305 } while (nLoopCount++ < 256 * 4); 00306 00307 // It couldn't find one... 00308 return pwndRoot; 00309 }

BOOL _PeekMessage LPMSG  pmsg,
HWND  hwnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg,
BOOL  bAnsi
 

Definition at line 556 of file client/ntstubs.c.

References BEGINCALL, BOOL, BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER, BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_SERVER, DWORD, ENDCALL, ERRORTRAP, GET_DBCS_MESSAGE_IF_EXIST, NtUserPeekMessage(), PeekMessage(), RtlWCSMessageWParamCharToMB(), and TRUE.

Referenced by PeekMessage().

00563 { 00564 BEGINCALL() 00565 00566 if (bAnsi) { 00567 // 00568 // If we have pushed message for DBCS messaging, we should pass this one 00569 // to Apps at first... 00570 // 00571 GET_DBCS_MESSAGE_IF_EXIST( 00572 PeekMessage,pmsg,wMsgFilterMin,wMsgFilterMax,((wRemoveMsg & PM_REMOVE) ? TRUE:FALSE)); 00573 } 00574 00575 retval = (DWORD)NtUserPeekMessage( 00576 pmsg, 00577 hwnd, 00578 wMsgFilterMin, 00579 wMsgFilterMax, 00580 wRemoveMsg); 00581 00582 if (retval) { 00583 // May have a bit more work to do if this MSG is for an ANSI app 00584 00585 if (bAnsi) { 00586 if (RtlWCSMessageWParamCharToMB(pmsg->message, &(pmsg->wParam))) { 00587 WPARAM dwAnsi = pmsg->wParam; 00588 // 00589 // Build DBCS-ware wParam. (for EM_SETPASSWORDCHAR...) 00590 // 00591 BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_SERVER( 00592 pmsg,dwAnsi,TRUE,((wRemoveMsg & PM_REMOVE) ? TRUE:FALSE)); 00593 } else { 00594 retval = 0; 00595 } 00596 } else { 00597 // 00598 // Only LOWORD of WPARAM is valid for WM_CHAR.... 00599 // (Mask off DBCS messaging information.) 00600 // 00601 BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_SERVER(pmsg->message,pmsg->wParam); 00602 } 00603 } 00604 00605 ExitPeekMessage: 00606 00607 ERRORTRAP(0); 00608 ENDCALL(BOOL); 00609 }

PWND _PrevControl PWND  pwndDlg,
PWND  pwnd,
UINT  uFlags
 

Definition at line 78 of file dlgmgrc.c.

References _NextControl(), BOOL, FALSE, NULL, TestWF, TRUE, and WEFCONTROLPARENT.

Referenced by _GetNextDlgTabItem(), UT_NextGroupItem(), and UT_PrevGroupItem().

00082 { 00083 BOOL fFirstFound; 00084 PWND pwndNext; 00085 PWND pwnd, pwndFirst; 00086 00087 if (!pwndStart) 00088 return(NULL); 00089 00090 UserAssert(pwndRoot != pwndStart); 00091 UserAssert(!TestWF(pwndStart, WEFCONTROLPARENT)); 00092 00093 pwnd = _NextControl(pwndRoot, NULL, uFlags); 00094 00095 pwndFirst = pwnd; 00096 fFirstFound = FALSE; 00097 while (pwndNext = _NextControl(pwndRoot, pwnd, uFlags)) { 00098 00099 if (pwndNext == pwndStart) 00100 break; 00101 00102 if (pwndNext == pwndFirst) { 00103 if (fFirstFound) { 00104 RIPMSG0(RIP_WARNING, "_PrevControl: Loop Detected"); 00105 break; 00106 } else { 00107 fFirstFound = TRUE; 00108 } 00109 } 00110 00111 pwnd = pwndNext; 00112 } 00113 00114 return pwnd; 00115 }

BOOL _SetCursorIconData HCURSOR  hCursor,
PCURSORDATA  pcur
 

Definition at line 1138 of file client/ntstubs.c.

References BEGINCALL, BOOL, CLEANUPLPWSTR, COPYLPWSTRIDOPT, COPYLPWSTROPT, DWORD, ENDCALL, ERRORTRAP, _IN_STRING::fAllocated, FALSE, tagCURSORDATA::lpModName, tagCURSORDATA::lpName, NtUserSetCursorIconData(), PCURSORDATA, and _IN_STRING::pstr.

01141 { 01142 IN_STRING strModName; 01143 IN_STRING strResName; 01144 01145 /* 01146 * Make sure cleanup will work successfully 01147 */ 01148 strModName.fAllocated = FALSE; 01149 strResName.fAllocated = FALSE; 01150 01151 BEGINCALL() 01152 01153 COPYLPWSTROPT(&strModName, pcur->lpModName); 01154 COPYLPWSTRIDOPT(&strResName, pcur->lpName); 01155 01156 retval = (DWORD)NtUserSetCursorIconData(hCursor, 01157 strModName.pstr, 01158 strResName.pstr, 01159 pcur); 01160 01161 ERRORTRAP(0); 01162 01163 CLEANUPLPWSTR(strModName); 01164 CLEANUPLPWSTR(strResName); 01165 01166 ENDCALL(BOOL); 01167 }

LONG _SetWindowLong HWND  hWnd,
int  nIndex,
LONG  dwNewLong,
BOOL  bAnsi
 

HHOOK _SetWindowsHookEx HANDLE  hmod,
LPTSTR  pszLib,
DWORD  idThread,
int  nFilterType,
PROC  pfnFilterProc,
DWORD  dwFlags
 

Definition at line 258 of file client/ntstubs.c.

References BEGINCALL, CLEANUPLPWSTR, dwFlags, ENDCALL, ERRORTRAP, _IN_STRING::fAllocated, FALSE, FIRSTCOPYLPWSTROPT, NtUserSetWindowsHookEx(), and _IN_STRING::pstr.

Referenced by SetWindowsHookExAW().

00265 { 00266 IN_STRING strLib; 00267 00268 /* 00269 * Make sure cleanup will work successfully 00270 */ 00271 strLib.fAllocated = FALSE; 00272 00273 BEGINCALL() 00274 00275 FIRSTCOPYLPWSTROPT(&strLib, pszLib); 00276 00277 retval = (ULONG_PTR)NtUserSetWindowsHookEx( 00278 hmod, 00279 strLib.pstr, 00280 idThread, 00281 nFilterType, 00282 pfnFilterProc, 00283 dwFlags); 00284 00285 ERRORTRAP(0); 00286 CLEANUPLPWSTR(strLib); 00287 ENDCALL(HHOOK); 00288 }

BOOL APIENTRY _UnlockResource HANDLE  hResData,
HINSTANCE  hModule
 

Definition at line 1518 of file clres.c.

References BOOL, and TRUE.

01521 { 01522 UNREFERENCED_PARAMETER(hResData); 01523 UNREFERENCED_PARAMETER(hModule); 01524 01525 return TRUE; 01526 }

PVOID AllocLookasideEntry PLOOKASIDE  pla  ) 
 

Definition at line 299 of file rtlinit.c.

References AllocateFromZone, _LOOKASIDE::EntrySize, gcsLookaside, _LOOKASIDE::LookasideZone, NULL, and UserLocalAlloc.

Referenced by ValidateDialogPwnd().

00301 { 00302 PVOID pEntry; 00303 00304 // 00305 // Attempt to get an entry from the zone. If this fails, then 00306 // LocalAlloc the entry 00307 // 00308 00309 RtlEnterCriticalSection(&gcsLookaside); 00310 pEntry = AllocateFromZone(&pla->LookasideZone); 00311 RtlLeaveCriticalSection(&gcsLookaside); 00312 00313 if ( !pEntry ) { 00314 00315 /* 00316 * Allocate a local structure. 00317 */ 00318 #if DBG 00319 pla->AllocSlowCalls++; 00320 #endif // DBG 00321 if ((pEntry = UserLocalAlloc(0, pla->EntrySize)) == NULL) 00322 return NULL; 00323 } 00324 RtlZeroMemory(pEntry, pla->EntrySize); 00325 #if DBG 00326 pla->AllocCalls++; 00327 00328 if (pla->AllocCalls - pla->DelCalls > pla->AllocHiWater ) { 00329 pla->AllocHiWater = pla->AllocCalls - pla->DelCalls; 00330 } 00331 #endif // DBG 00332 00333 return pEntry; 00334 }

BOOL BitBltSysBmp HDC  hdc,
int  x,
int  y,
UINT  i
 

Definition at line 29 of file mngrayc.c.

00030 { 00031 POEMBITMAPINFO pOem = gpsi->oembmi + i; 00032 00033 return(NtUserBitBltSysBmp(hdc, x, y, pOem->cx, pOem->cy, pOem->x, pOem->y, SRCCOPY)); 00034 }

DWORD BuildHwndList HDESK  hdesk,
HWND  hwndNext,
BOOL  fEnumChildren,
DWORD  idThread,
HWND **  phwndFirst
 

Definition at line 37 of file clenum.c.

References DWORD, NT_SUCCESS, NTSTATUS(), NtUserBuildHwndList(), NULL, phwndCache, Status, UINT, UserLocalAlloc, and UserLocalFree.

00043 { 00044 UINT cHwnd; 00045 HWND *phwndFirst; 00046 NTSTATUS Status; 00047 int cTries; 00048 00049 /* 00050 * Allocate a buffer to hold the names. 00051 */ 00052 cHwnd = 64; 00053 phwndFirst = (HWND *)InterlockedExchangePointer(&(PVOID)phwndCache, 0); 00054 if (phwndFirst == NULL) { 00055 phwndFirst = UserLocalAlloc(0, cHwnd * sizeof(HWND)); 00056 if (phwndFirst == NULL) 00057 return 0; 00058 } 00059 00060 Status = NtUserBuildHwndList(hdesk, hwndNext, fEnumChildren, 00061 idThread, cHwnd, phwndFirst, &cHwnd); 00062 00063 /* 00064 * If the buffer wasn't big enough, reallocate 00065 * the buffer and try again. 00066 */ 00067 cTries = 0; 00068 while (Status == STATUS_BUFFER_TOO_SMALL) { 00069 UserLocalFree(phwndFirst); 00070 00071 /* 00072 * If we can't seem to get it right, 00073 * call it quits 00074 */ 00075 if (cTries++ == 10) 00076 return 0; 00077 00078 phwndFirst = UserLocalAlloc(0, cHwnd * sizeof(HWND)); 00079 if (phwndFirst == NULL) 00080 return 0; 00081 00082 Status = NtUserBuildHwndList(hdesk, hwndNext, fEnumChildren, 00083 idThread, cHwnd, phwndFirst, &cHwnd); 00084 } 00085 00086 if (!NT_SUCCESS(Status) || cHwnd <= 1) { 00087 UserLocalFree(phwndFirst); 00088 return 0; 00089 } 00090 00091 *pphwndFirst = phwndFirst; 00092 return cHwnd - 1; 00093 }

LRESULT APIENTRY ButtonWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1907 of file btnctl.c.

References ButtonWndProcWorker(), DefWindowProcWorker(), FNID_BUTTON, FWINDOWMSG, L, NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

01912 { 01913 PWND pwnd; 01914 01915 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01916 return (0L); 01917 } 01918 01919 /* 01920 * If the control is not interested in this message, 01921 * pass it to DefWindowProc. 01922 */ 01923 if (!FWINDOWMSG(message, FNID_BUTTON)) 01924 return DefWindowProcWorker(pwnd, message, wParam, lParam, TRUE); 01925 01926 return ButtonWndProcWorker(pwnd, message, wParam, lParam, TRUE); 01927 }

LRESULT APIENTRY ButtonWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1929 of file btnctl.c.

References ButtonWndProcWorker(), DefWindowProcWorker(), FALSE, FNID_BUTTON, FWINDOWMSG, L, NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

01934 { 01935 PWND pwnd; 01936 01937 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01938 return (0L); 01939 } 01940 01941 /* 01942 * If the control is not interested in this message, 01943 * pass it to DefWindowProc. 01944 */ 01945 if (!FWINDOWMSG(message, FNID_BUTTON)) 01946 return DefWindowProcWorker(pwnd, message, wParam, lParam, FALSE); 01947 01948 return ButtonWndProcWorker(pwnd, message, wParam, lParam, FALSE); 01949 }

LRESULT ButtonWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 1338 of file btnctl.c.

References _DefSetText(), _GetClientRect(), APIENTRY, tagCLS::atomClassName, tagSERVERINFO::atomSysClass, BFIMAGEMASK, BFNOTIFY, BFPUSHLIKE, BFTYPEMASK, BNCalcRect(), BNReleaseDC(), BNSetFont(), BOOL, BST_CAPTURED, BST_CHECKMASK, BST_DONTCLICK, BST_INBMCLICK, BST_INCLICK, BST_MOUSE, BUTN, ButtonLookaside, BUTTONSTATE, CBR_GROUPTEXT, CheckLock, ClearWindowState(), DBT_FOCUS, DefWindowProcWorker(), DWORD, FALSE, FNID_BUTTON, FNID_CLEANEDUP_BIT, tagBUTN::fPaintKbdCuesOnly, FreeLookasideEntry(), FWINABLE, gpsi, tagBUTN::hFont, tagBUTN::hImage, HW, HWq, ICLS_DIALOG, IMAGE_BMMAX, INITCONTROLLOOKASIDE, ISBSTEXTOROD, IsValidImage, IsVisible(), L, LOBYTE, NotifyWinEvent(), NtUserAlterWindowStyle(), NtUserBeginPaint(), NtUserEndPaint(), NtUserInvalidateRect(), NtUserSetWindowFNID(), NULL, PaintRect(), PBF_PUSHABLE, PBUTNWND, PtInRect(), REBASEALWAYS, REBASEPWND, RepaintButton(), SendMessageWorker(), SetWindowState(), tagBUTN::spwnd, tagWND::spwndParent, TestWF, TestwndChild, ThreadLock, ThreadUnlock, TRUE, UINT, Unlock, VALIDATECLASSANDSIZE, WEFRIGHT, WFTABSTOP, WFVISIBLE, WFWIN31COMPAT, WFWIN40COMPAT, xxxBNDrawText(), xxxBNGetDC(), xxxBNOwnerDraw(), xxxBNPaint(), xxxBNReleaseCapture(), xxxBNSetCapture(), xxxButtonDrawCheck(), xxxButtonDrawNewState(), xxxButtonNotifyParent(), and xxxDrawButton().

Referenced by ButtonWndProcA(), ButtonWndProcW(), and ClientThreadSetup().

01344 { 01345 HWND hwnd = HWq(pwnd); 01346 UINT bsWnd; 01347 UINT wOldState; 01348 RECT rc; 01349 POINT pt; 01350 HDC hdc; 01351 HBRUSH hbr; 01352 PAINTSTRUCT ps; 01353 TL tlpwndParent; 01354 PBUTN pbutn; 01355 PWND pwndParent; 01356 static BOOL fInit = TRUE; 01357 LONG lResult; 01358 01359 CheckLock(pwnd); 01360 01361 bsWnd = TestWF(pwnd, BFTYPEMASK); 01362 01363 VALIDATECLASSANDSIZE(pwnd, FNID_BUTTON); 01364 INITCONTROLLOOKASIDE(&ButtonLookaside, BUTN, spwnd, 8); 01365 01366 /* 01367 * Get the pbutn for the given window now since we will use it a lot in 01368 * various handlers. This was stored using SetWindowLong(hwnd,0,pbutn) when 01369 * we initially created the button control. 01370 */ 01371 pbutn = ((PBUTNWND)pwnd)->pbutn; 01372 01373 switch (message) { 01374 case WM_NCHITTEST: 01375 if (bsWnd == LOBYTE(BS_GROUPBOX)) { 01376 return (LONG)HTTRANSPARENT; 01377 } else { 01378 goto CallDWP; 01379 } 01380 01381 case WM_ERASEBKGND: 01382 if (bsWnd == LOBYTE(BS_OWNERDRAW)) { 01383 01384 /* 01385 * Handle erase background for owner draw buttons. 01386 */ 01387 _GetClientRect(pwnd, &rc); 01388 ThreadLock(pwnd->spwndParent, &tlpwndParent); 01389 pwndParent = REBASEPWND(pwnd, spwndParent); 01390 PaintRect(HW(pwndParent), hwnd, (HDC)wParam, (HBRUSH)CTLCOLOR_BTN, &rc); 01391 ThreadUnlock(&tlpwndParent); 01392 } 01393 01394 /* 01395 * Do nothing for other buttons, but don't let DefWndProc() do it 01396 * either. It will be erased in xxxBNPaint(). 01397 */ 01398 return (LONG)TRUE; 01399 01400 case WM_PRINTCLIENT: 01401 xxxBNPaint(pbutn, (HDC)wParam); 01402 break; 01403 01404 case WM_PAINT: 01405 01406 /* 01407 * If wParam != NULL, then this is a subclassed paint. 01408 */ 01409 if ((hdc = (HDC)wParam) == NULL) 01410 hdc = NtUserBeginPaint(hwnd, &ps); 01411 01412 if (IsVisible(pwnd)) 01413 xxxBNPaint(pbutn, hdc); 01414 01415 if (!wParam) 01416 NtUserEndPaint(hwnd, &ps); 01417 break; 01418 01419 case WM_SETFOCUS: 01420 BUTTONSTATE(pbutn) |= BST_FOCUS; 01421 if ((hdc = xxxBNGetDC(pbutn, NULL)) != NULL) { 01422 xxxBNDrawText(pbutn, hdc, DBT_FOCUS, FALSE); 01423 01424 BNReleaseDC(pbutn, hdc); 01425 } 01426 01427 if (TestWF(pwnd, BFNOTIFY)) 01428 xxxButtonNotifyParent(pwnd, BN_SETFOCUS); 01429 01430 if (!(BUTTONSTATE(pbutn) & BST_INCLICK)) { 01431 switch (bsWnd) { 01432 case LOBYTE(BS_RADIOBUTTON): 01433 case LOBYTE(BS_AUTORADIOBUTTON): 01434 if (!(BUTTONSTATE(pbutn) & BST_DONTCLICK)) { 01435 if (!(BUTTONSTATE(pbutn) & BST_CHECKMASK)) { 01436 xxxButtonNotifyParent(pwnd, BN_CLICKED); 01437 } 01438 } 01439 break; 01440 } 01441 } 01442 break; 01443 01444 case WM_GETDLGCODE: 01445 switch (bsWnd) { 01446 case LOBYTE(BS_DEFPUSHBUTTON): 01447 wParam = DLGC_DEFPUSHBUTTON; 01448 break; 01449 01450 case LOBYTE(BS_PUSHBUTTON): 01451 case LOBYTE(BS_PUSHBOX): 01452 wParam = DLGC_UNDEFPUSHBUTTON; 01453 break; 01454 01455 case LOBYTE(BS_AUTORADIOBUTTON): 01456 case LOBYTE(BS_RADIOBUTTON): 01457 wParam = DLGC_RADIOBUTTON; 01458 break; 01459 01460 case LOBYTE(BS_GROUPBOX): 01461 return (LONG)DLGC_STATIC; 01462 01463 case LOBYTE(BS_CHECKBOX): 01464 case LOBYTE(BS_AUTOCHECKBOX): 01465 01466 /* 01467 * If this is a char that is a '=/+', or '-', we want it 01468 */ 01469 if (lParam && ((LPMSG)lParam)->message == WM_CHAR) { 01470 switch (wParam) { 01471 case TEXT('='): 01472 case TEXT('+'): 01473 case TEXT('-'): 01474 wParam = DLGC_WANTCHARS; 01475 break; 01476 01477 default: 01478 wParam = 0; 01479 } 01480 } else { 01481 wParam = 0; 01482 } 01483 break; 01484 01485 default: 01486 wParam = 0; 01487 } 01488 return (LONG)(wParam | DLGC_BUTTON); 01489 01490 case WM_CAPTURECHANGED: 01491 if (BUTTONSTATE(pbutn) & BST_CAPTURED) { 01492 // Unwittingly, we've been kicked out of capture, 01493 // so undepress etc. 01494 if (BUTTONSTATE(pbutn) & BST_MOUSE) 01495 SendMessageWorker(pwnd, BM_SETSTATE, FALSE, 0, FALSE); 01496 BUTTONSTATE(pbutn) &= ~(BST_CAPTURED | BST_MOUSE); 01497 } 01498 break; 01499 01500 case WM_KILLFOCUS: 01501 01502 /* 01503 * If we are losing the focus and we are in "capture mode", click 01504 * the button. This allows tab and space keys to overlap for 01505 * fast toggle of a series of buttons. 01506 */ 01507 if (BUTTONSTATE(pbutn) & BST_MOUSE) { 01508 01509 /* 01510 * If for some reason we are killing the focus, and we have the 01511 * mouse captured, don't notify the parent we got clicked. This 01512 * breaks Omnis Quartz otherwise. 01513 */ 01514 SendMessageWorker(pwnd, BM_SETSTATE, FALSE, 0, FALSE); 01515 } 01516 01517 xxxBNReleaseCapture(pbutn, TRUE); 01518 01519 BUTTONSTATE(pbutn) &= ~BST_FOCUS; 01520 if ((hdc = xxxBNGetDC(pbutn, NULL)) != NULL) { 01521 xxxBNDrawText(pbutn, hdc, DBT_FOCUS, FALSE); 01522 01523 BNReleaseDC(pbutn, hdc); 01524 } 01525 01526 if (TestWF(pwnd, BFNOTIFY)) 01527 xxxButtonNotifyParent(pwnd, BN_KILLFOCUS); 01528 01529 /* 01530 * Since the bold border around the defpushbutton is done by 01531 * someone else, we need to invalidate the rect so that the 01532 * focus rect is repainted properly. 01533 */ 01534 NtUserInvalidateRect(hwnd, NULL, FALSE); 01535 break; 01536 01537 case WM_LBUTTONDBLCLK: 01538 01539 /* 01540 * Double click messages are recognized for BS_RADIOBUTTON, 01541 * BS_USERBUTTON, and BS_OWNERDRAW styles. For all other buttons, 01542 * double click is handled like a normal button down. 01543 */ 01544 switch (bsWnd) { 01545 default: 01546 if (!TestWF(pwnd, BFNOTIFY)) 01547 goto btnclick; 01548 01549 case LOBYTE(BS_USERBUTTON): 01550 case LOBYTE(BS_RADIOBUTTON): 01551 case LOBYTE(BS_OWNERDRAW): 01552 xxxButtonNotifyParent(pwnd, BN_DOUBLECLICKED); 01553 break; 01554 } 01555 break; 01556 01557 case WM_LBUTTONUP: 01558 if (BUTTONSTATE(pbutn) & BST_MOUSE) { 01559 xxxBNReleaseCapture(pbutn, TRUE); 01560 } 01561 break; 01562 01563 case WM_MOUSEMOVE: 01564 if (!(BUTTONSTATE(pbutn) & BST_MOUSE)) { 01565 break; 01566 } 01567 01568 /* 01569 *** FALL THRU ** 01570 */ 01571 case WM_LBUTTONDOWN: 01572 btnclick: 01573 if (xxxBNSetCapture(pbutn, BST_MOUSE)) { 01574 _GetClientRect(pwnd, &rc); 01575 POINTSTOPOINT(pt, lParam); 01576 SendMessageWorker(pwnd, BM_SETSTATE, PtInRect(&rc, pt), 0, FALSE); 01577 } 01578 break; 01579 01580 case WM_CHAR: 01581 if (BUTTONSTATE(pbutn) & BST_MOUSE) 01582 goto CallDWP; 01583 01584 if (bsWnd != LOBYTE(BS_CHECKBOX) && 01585 bsWnd != LOBYTE(BS_AUTOCHECKBOX)) 01586 goto CallDWP; 01587 01588 switch (wParam) { 01589 case TEXT('+'): 01590 case TEXT('='): 01591 wParam = 1; // we must Set the check mark on. 01592 goto SetCheck; 01593 01594 case TEXT('-'): 01595 wParam = 0; // Set the check mark off. 01596 SetCheck: 01597 // Must notify only if the check status changes 01598 if ((WORD)(BUTTONSTATE(pbutn) & BST_CHECKMASK) != (WORD)wParam) 01599 { 01600 // We must check/uncheck only if it is AUTO 01601 if (bsWnd == LOBYTE(BS_AUTOCHECKBOX)) 01602 { 01603 if (xxxBNSetCapture(pbutn, 0)) 01604 { 01605 SendMessageWorker(pwnd, BM_SETCHECK, wParam, 0, FALSE); 01606 01607 xxxBNReleaseCapture(pbutn, TRUE); 01608 } 01609 } 01610 01611 xxxButtonNotifyParent(pwnd, BN_CLICKED); 01612 } 01613 break; 01614 01615 default: 01616 goto CallDWP; 01617 } 01618 break; 01619 01620 case BM_CLICK: 01621 // Don't recurse into this code! 01622 if (BUTTONSTATE(pbutn) & BST_INBMCLICK) 01623 break; 01624 01625 BUTTONSTATE(pbutn) |= BST_INBMCLICK; 01626 SendMessageWorker(pwnd, WM_LBUTTONDOWN, 0, 0, FALSE); 01627 SendMessageWorker(pwnd, WM_LBUTTONUP, 0, 0, FALSE); 01628 BUTTONSTATE(pbutn) &= ~BST_INBMCLICK; 01629 01630 /* 01631 *** FALL THRU ** 01632 */ 01633 01634 case WM_KEYDOWN: 01635 if (BUTTONSTATE(pbutn) & BST_MOUSE) 01636 break; 01637 01638 if (wParam == VK_SPACE) { 01639 if (xxxBNSetCapture(pbutn, 0)) { 01640 SendMessageWorker(pwnd, BM_SETSTATE, TRUE, 0, FALSE); 01641 } 01642 } else { 01643 xxxBNReleaseCapture(pbutn, FALSE); 01644 } 01645 break; 01646 01647 case WM_KEYUP: 01648 case WM_SYSKEYUP: 01649 if (BUTTONSTATE(pbutn) & BST_MOUSE) { 01650 goto CallDWP; 01651 } 01652 01653 /* 01654 * Don't cancel the capture mode on the up of the tab in case the 01655 * guy is overlapping tab and space keys. 01656 */ 01657 if (wParam == VK_TAB) { 01658 goto CallDWP; 01659 } 01660 01661 /* 01662 * WARNING: pwnd is history after this call! 01663 */ 01664 xxxBNReleaseCapture(pbutn, (wParam == VK_SPACE)); 01665 01666 if (message == WM_SYSKEYUP) { 01667 goto CallDWP; 01668 } 01669 break; 01670 01671 case BM_GETSTATE: 01672 return (LONG)BUTTONSTATE(pbutn); 01673 01674 case BM_SETSTATE: 01675 wOldState = (UINT)(BUTTONSTATE(pbutn) & BST_PUSHED); 01676 if (wParam) { 01677 BUTTONSTATE(pbutn) |= BST_PUSHED; 01678 } else { 01679 BUTTONSTATE(pbutn) &= ~BST_PUSHED; 01680 } 01681 01682 if ((hdc = xxxBNGetDC(pbutn, &hbr)) != NULL) { 01683 if (bsWnd == LOBYTE(BS_USERBUTTON)) { 01684 xxxButtonNotifyParent(pwnd, (UINT)(wParam ? BN_PUSHED : BN_UNPUSHED)); 01685 } else if (bsWnd == LOBYTE(BS_OWNERDRAW)) { 01686 if (wOldState != (UINT)(BUTTONSTATE(pbutn) & BST_PUSHED)) { 01687 /* 01688 * Only notify for drawing if state has changed.. 01689 */ 01690 xxxBNOwnerDraw(pbutn, hdc, ODA_SELECT); 01691 } 01692 } else { 01693 xxxButtonDrawNewState(pbutn, hdc, hbr, wOldState); 01694 } 01695 01696 BNReleaseDC(pbutn, hdc); 01697 } 01698 if (FWINABLE() && (wOldState != (BOOL)(BUTTONSTATE(pbutn) & BST_PUSHED))) { 01699 NotifyWinEvent(EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01700 } 01701 break; 01702 01703 case BM_GETCHECK: 01704 return (LONG)(BUTTONSTATE(pbutn) & BST_CHECKMASK); 01705 01706 case BM_SETCHECK: 01707 switch (bsWnd) { 01708 case LOBYTE(BS_RADIOBUTTON): 01709 case LOBYTE(BS_AUTORADIOBUTTON): 01710 if (wParam) { 01711 SetWindowState(pwnd, WFTABSTOP); 01712 } else { 01713 ClearWindowState(pwnd, WFTABSTOP); 01714 } 01715 01716 /* 01717 *** FALL THRU ** 01718 */ 01719 case LOBYTE(BS_CHECKBOX): 01720 case LOBYTE(BS_AUTOCHECKBOX): 01721 if (wParam) { 01722 wParam = 1; 01723 } 01724 goto CheckIt; 01725 01726 case LOBYTE(BS_3STATE): 01727 case LOBYTE(BS_AUTO3STATE): 01728 if (wParam > BST_INDETERMINATE) { 01729 wParam = BST_INDETERMINATE; 01730 } 01731 CheckIt: 01732 if ((UINT)(BUTTONSTATE(pbutn) & BST_CHECKMASK) != (UINT)wParam) { 01733 BUTTONSTATE(pbutn) &= ~BST_CHECKMASK; 01734 BUTTONSTATE(pbutn) |= (UINT)wParam; 01735 01736 if (!IsVisible(pwnd)) 01737 break; 01738 01739 if ((hdc = xxxBNGetDC(pbutn, &hbr)) != NULL) { 01740 if (TestWF(pwnd, BFPUSHLIKE)) { 01741 xxxDrawButton(pbutn, hdc, PBF_PUSHABLE); 01742 } else { 01743 xxxButtonDrawCheck(pbutn, hdc, hbr); 01744 } 01745 BNReleaseDC(pbutn, hdc); 01746 } 01747 01748 if (FWINABLE()) 01749 NotifyWinEvent(EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01750 } 01751 break; 01752 } 01753 break; 01754 01755 case BM_SETSTYLE: 01756 NtUserAlterWindowStyle(hwnd, BS_TYPEMASK, (DWORD)wParam); 01757 01758 if (lParam) { 01759 NtUserInvalidateRect(hwnd, NULL, TRUE); 01760 } 01761 if (FWINABLE()) { 01762 NotifyWinEvent(EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01763 } 01764 break; 01765 01766 case WM_SETTEXT: 01767 01768 /* 01769 * In case the new group name is longer than the old name, 01770 * this paints over the old name before repainting the group 01771 * box with the new name. 01772 */ 01773 if (bsWnd == LOBYTE(BS_GROUPBOX)) { 01774 hdc = xxxBNGetDC(pbutn, &hbr); 01775 if (hdc != NULL) { 01776 BNCalcRect(pwnd, hdc, &rc, CBR_GROUPTEXT, 0); 01777 NtUserInvalidateRect(hwnd, &rc, TRUE); 01778 01779 pwndParent = REBASEPWND(pwnd, spwndParent); 01780 ThreadLock(pwnd->spwndParent, &tlpwndParent); 01781 PaintRect(HW(pwndParent), hwnd, hdc, hbr, &rc); 01782 ThreadUnlock(&tlpwndParent); 01783 01784 BNReleaseDC(pbutn, hdc); 01785 } 01786 } 01787 01788 lResult = _DefSetText(hwnd, (LPWSTR)lParam, (BOOL)fAnsi); 01789 01790 if (FWINABLE()) { 01791 NotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hwnd, OBJID_WINDOW, INDEXID_CONTAINER); 01792 } 01793 goto DoEnable; 01794 01795 /* 01796 *** FALL THRU ** 01797 */ 01798 case WM_ENABLE: 01799 lResult = 0L; 01800 DoEnable: 01801 RepaintButton(pbutn); 01802 return lResult; 01803 01804 case WM_SETFONT: 01805 /* 01806 * wParam - handle to the font 01807 * lParam - if true, redraw else don't 01808 */ 01809 BNSetFont(pbutn, (HFONT)wParam, (BOOL)(lParam != 0)); 01810 break; 01811 01812 case WM_GETFONT: 01813 return (LRESULT)pbutn->hFont; 01814 01815 case BM_GETIMAGE: 01816 case BM_SETIMAGE: 01817 if (!IsValidImage(wParam, TestWF(pwnd, BFIMAGEMASK), IMAGE_BMMAX)) { 01818 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid button image type"); 01819 } else { 01820 HANDLE hOld = pbutn->hImage; 01821 01822 if (message == BM_SETIMAGE) { 01823 pbutn->hImage = (HANDLE)lParam; 01824 if (TestWF(pwnd, WFVISIBLE)) { 01825 NtUserInvalidateRect(hwnd, NULL, TRUE); 01826 } 01827 } 01828 return (LRESULT)hOld; 01829 } 01830 break; 01831 01832 case WM_NCDESTROY: 01833 case WM_FINALDESTROY: 01834 if (pbutn) { 01835 Unlock(&pbutn->spwnd); 01836 FreeLookasideEntry(&ButtonLookaside, pbutn); 01837 } 01838 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); 01839 break; 01840 01841 case WM_NCCREATE: 01842 // Borland's OBEX has a button with style 0x98; We didn't strip 01843 // these bits in win3.1 because we checked for 0x08. 01844 // Stripping these bits cause a GP Fault in OBEX. 01845 // For win3.1 guys, I use the old code to strip the style bits. 01846 // 01847 if (TestWF(pwnd, WFWIN31COMPAT)) { 01848 if(((!TestWF(pwnd, WFWIN40COMPAT)) && 01849 (((LOBYTE(pwnd->style)) & (LOBYTE(~BS_LEFTTEXT))) == LOBYTE(BS_USERBUTTON))) || 01850 (TestWF(pwnd, WFWIN40COMPAT) && 01851 (bsWnd == LOBYTE(BS_USERBUTTON)))) 01852 { 01853 // BS_USERBUTTON is no longer allowed for 3.1 and beyond. 01854 // Just turn to normal push button. 01855 NtUserAlterWindowStyle(hwnd, BS_TYPEMASK, 0); 01856 RIPMSG0(RIP_WARNING, "BS_USERBUTTON no longer supported"); 01857 } 01858 } 01859 if (TestWF(pwnd,WEFRIGHT)) { 01860 NtUserAlterWindowStyle(hwnd, BS_RIGHT | BS_RIGHTBUTTON, BS_RIGHT | BS_RIGHTBUTTON); 01861 } 01862 goto CallDWP; 01863 01864 case WM_INPUTLANGCHANGEREQUEST: 01865 01866 // 01867 // #115190 01868 // If the window is one of controls on top of dialogbox, 01869 // let the parent dialog handle it. 01870 // 01871 if (TestwndChild(pwnd) && pwnd->spwndParent) { 01872 PWND pwndParent = REBASEPWND(pwnd, spwndParent); 01873 if (pwndParent) { 01874 PCLS pclsParent = REBASEALWAYS(pwndParent, pcls); 01875 01876 UserAssert(pclsParent != NULL); 01877 if (pclsParent->atomClassName == gpsi->atomSysClass[ICLS_DIALOG]) { 01878 RIPMSG0(RIP_VERBOSE, "Button: WM_INPUTLANGCHANGEREQUEST is sent to parent.\n"); 01879 return SendMessageWorker(pwndParent, message, wParam, lParam, FALSE); 01880 } 01881 } 01882 } 01883 goto CallDWP; 01884 01885 case WM_UPDATEUISTATE: 01886 { 01887 DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 01888 if (ISBSTEXTOROD(pwnd)) { 01889 pbutn->fPaintKbdCuesOnly = TRUE; 01890 RepaintButton(pbutn); 01891 pbutn->fPaintKbdCuesOnly = FALSE; 01892 } 01893 } 01894 break; 01895 01896 default: 01897 CallDWP: 01898 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 01899 } 01900 01901 return 0L; 01902 }

long CBNcCreateHandler PCBOX  ,
PWND 
 

Definition at line 31 of file comboini.c.

References CBFHASSTRINGS, CBFOWNERDRAW, ClearWindowState(), tagCBox::f3DCombo, HIBYTE, SetWindowState(), tagCBox::styleSave, TestWF, TRUE, WEFCLIENTEDGE, WEFEDGEMASK, WFBORDER, WFHSCROLL, WFVSCROLL, and WFWIN40COMPAT.

Referenced by ComboBoxWndProcWorker().

00034 { 00035 /* 00036 * Save the style bits so that we have them when we create the client area 00037 * of the combo box window. 00038 */ 00039 pcbox->styleSave = pwnd->style & (WS_VSCROLL | WS_HSCROLL); 00040 00041 if (!TestWF(pwnd, CBFOWNERDRAW)) 00042 // Add in CBS_HASSTRINGS if the style is implied... 00043 SetWindowState(pwnd, CBFHASSTRINGS); 00044 00045 UserAssert(HIBYTE(WFVSCROLL) == HIBYTE(WFHSCROLL)); 00046 UserAssert(HIBYTE(WFHSCROLL) == HIBYTE(WFBORDER)); 00047 ClearWindowState(pwnd, WFVSCROLL | WFHSCROLL | WFBORDER); 00048 00049 // 00050 // If the window is 4.0 compatible or has a CLIENTEDGE, draw the combo 00051 // in 3D. Otherwise, use a flat border. 00052 // 00053 if (TestWF(pwnd, WFWIN40COMPAT) || TestWF(pwnd, WEFCLIENTEDGE)) 00054 pcbox->f3DCombo = TRUE; 00055 00056 ClearWindowState(pwnd, WEFEDGEMASK); 00057 00058 return (LONG)TRUE; 00059 }

INT CItemInWindow PLBIV  ,
BOOL 
 

Definition at line 526 of file lboxctl2.c.

References _GetClientRect(), CItemInWindowVarOwnerDraw(), tagLBIV::cyChar, tagLBIV::fMultiColumn, INT, tagLBIV::itemsPerColumn, tagLBIV::numberOfColumns, tagLBIV::OwnerDraw, OWNERDRAWVAR, and tagLBIV::spwnd.

Referenced by LastFullVisible(), LBGetItemRect(), LBSetCItemFullMax(), xxxAlterHilite(), xxxCheckRedraw(), xxxInsureVisible(), xxxInvertLBItem(), xxxLBButtonUp(), xxxLBPaint(), and xxxResetWorld().

00529 { 00530 RECT rect; 00531 00532 if (plb->OwnerDraw == OWNERDRAWVAR) { 00533 return CItemInWindowVarOwnerDraw(plb, fPartial); 00534 } 00535 00536 if (plb->fMultiColumn) { 00537 return plb->itemsPerColumn * (plb->numberOfColumns + (fPartial ? 1 : 0)); 00538 } 00539 00540 _GetClientRect(plb->spwnd, &rect); 00541 00542 /* 00543 * fPartial must be considered only if the listbox height is not an 00544 * integral multiple of character height. 00545 * A part of the fix for Bug #3727 -- 01/14/91 -- SANKAR -- 00546 */ 00547 UserAssert(plb->cyChar); 00548 return (INT)((rect.bottom / plb->cyChar) + 00549 ((rect.bottom % plb->cyChar)? (fPartial ? 1 : 0) : 0)); 00550 }

INT CItemInWindowVarOwnerDraw PLBIV  ,
BOOL 
 

Definition at line 101 of file lboxvar.c.

References _GetClientRect(), tagLBIV::cMac, INT, tagLBIV::iTop, LBGetItemRect(), and tagLBIV::spwnd.

Referenced by CItemInWindow().

00104 { 00105 RECT rect; 00106 INT sItem; 00107 INT clientbottom; 00108 00109 _GetClientRect(plb->spwnd, (LPRECT)&rect); 00110 clientbottom = rect.bottom; 00111 00112 /* 00113 * Find the number of var height ownerdraw items which are visible starting 00114 * from plb->iTop. 00115 */ 00116 for (sItem = plb->iTop; sItem < plb->cMac; sItem++) { 00117 00118 /* 00119 * Find out if the item is visible or not 00120 */ 00121 if (!LBGetItemRect(plb, sItem, (LPRECT)&rect)) { 00122 00123 /* 00124 * This is the first item which is completely invisible, so return 00125 * how many items are visible. 00126 */ 00127 return (sItem - plb->iTop); 00128 } 00129 00130 if (!fPartial && rect.bottom > clientbottom) { 00131 00132 /* 00133 * If we only want fully visible items, then if this item is 00134 * visible, we check if the bottom of the item is below the client 00135 * rect, so we return how many are fully visible. 00136 */ 00137 return (sItem - plb->iTop - 1); 00138 } 00139 } 00140 00141 /* 00142 * All the items are visible 00143 */ 00144 return (plb->cMac - plb->iTop); 00145 }

void ClearWindowState PWND  pwnd,
UINT  flags
 

Definition at line 3373 of file client.c.

References HWq, NtUserCallHwndParam(), and TestWF.

03376 { 03377 if (TestWF(pwnd, flags)) 03378 NtUserCallHwndParam(HWq(pwnd), flags, SFI_CLEARWINDOWSTATE); 03379 }

void ClientEmptyClipboard void   ) 
 

Definition at line 353 of file client.c.

References DeleteClientClipboardHandle(), gcsClipboard, gphn, _HANDLENODE::handleClient, NULL, pfnWowEmptyClipBoard, PHANDLENODE, and _HANDLENODE::pnext.

Referenced by OpenClipboard().

00354 { 00355 PHANDLENODE phnNext; 00356 PHANDLENODE phnT; 00357 00358 RtlEnterCriticalSection(&gcsClipboard); 00359 00360 phnT = gphn; 00361 while (phnT != NULL) { 00362 phnNext = phnT->pnext; 00363 00364 if (phnT->handleClient != (HANDLE)0) 00365 DeleteClientClipboardHandle(phnT); 00366 00367 LocalFree(phnT); 00368 00369 phnT = phnNext; 00370 } 00371 gphn = NULL; 00372 00373 /* 00374 * Tell wow to cleanup it's clipboard stuff 00375 */ 00376 if (pfnWowEmptyClipBoard) { 00377 pfnWowEmptyClipBoard(); 00378 } 00379 00380 RtlLeaveCriticalSection(&gcsClipboard); 00381 }

VOID CliImmInitializeHotKeys DWORD  dwAction,
HKL  hkl
 

Definition at line 129 of file immhotky.c.

References BOOL, CliGetImeHotKeysFromRegistry(), CliGetPreloadKeyboardLayouts(), CliImmSetHotKeyWorker(), CliSetDefaultImeHotKeys(), DefaultHotKeyNumC, DefaultHotKeyNumJ, DefaultHotKeyNumT, DefaultHotKeyTableC, DefaultHotKeyTableJ, DefaultHotKeyTableT, tagFE_KEYBOARDS::fCHS, tagFE_KEYBOARDS::fCHT, tagFE_KEYBOARDS::fJPN, tagFE_KEYBOARDS::fKOR, ISHK_INITIALIZE, NtUserGetKeyboardLayoutList(), NULL, SetFeKeyboardFlags(), UINT, UserLocalAlloc, UserLocalFree, and VOID().

Referenced by LoadKeyboardLayoutWorker(), UnloadKeyboardLayout(), and UpdatePerUserSystemParameters().

00130 { 00131 FE_KEYBOARDS feKbds = { 0, 0, 0, 0, }; 00132 BOOL fFoundAny; 00133 00134 UNREFERENCED_PARAMETER(hkl); 00135 00136 // First, initialize the hotkey list 00137 CliImmSetHotKeyWorker(0, 0, 0, NULL, ISHK_INITIALIZE); 00138 00139 // Check if the user has customized IME hotkeys 00140 // (they're stored in the registry) 00141 fFoundAny = CliGetImeHotKeysFromRegistry(); 00142 00143 if (dwAction == ISHK_INITIALIZE) { 00144 TAGMSG0(DBGTAG_IMM, "Setting IME HotKeys for Init.\n"); 00145 00146 // Get the user's default locale and set its flag 00147 SetFeKeyboardFlags(LANGIDFROMLCID(GetUserDefaultLCID()), &feKbds); 00148 00149 // Get preloaded keyboards' locales and set their flags 00150 CliGetPreloadKeyboardLayouts(&feKbds); 00151 00152 } 00153 else { 00154 UINT i; 00155 UINT nLayouts; 00156 LPHKL lphkl; 00157 00158 TAGMSG0(DBGTAG_IMM, "Setting IME HotKeys for Add.\n"); 00159 00160 nLayouts = NtUserGetKeyboardLayoutList(0, NULL); 00161 if (nLayouts == 0) { 00162 return; 00163 } 00164 lphkl = UserLocalAlloc(0, nLayouts * sizeof(HKL)); 00165 if (lphkl == NULL) { 00166 return; 00167 } 00168 NtUserGetKeyboardLayoutList(nLayouts, lphkl); 00169 for (i = 0; i < nLayouts; ++i) { 00170 // 00171 // Set language flags. By its definition, LOWORD(hkl) is LANGID 00172 // 00173 SetFeKeyboardFlags(LOWORD(HandleToUlong(lphkl[i])), &feKbds); 00174 } 00175 UserLocalFree(lphkl); 00176 } 00177 00178 if (feKbds.fJPN) { 00179 TAGMSG0(DBGTAG_IMM, "JPN KL Preloaded.\n"); 00180 CliSetDefaultImeHotKeys(DefaultHotKeyTableJ, DefaultHotKeyNumJ, fFoundAny); 00181 } 00182 00183 if (feKbds.fKOR) { 00184 TAGMSG0(DBGTAG_IMM, "KOR KL Preloaded, but KOR hotkeys will not be registered.\n"); 00185 } 00186 00187 if (feKbds.fCHT) { 00188 TAGMSG0(DBGTAG_IMM, "CHT KL Preloaded.\n"); 00189 CliSetDefaultImeHotKeys(DefaultHotKeyTableT, DefaultHotKeyNumT, fFoundAny); 00190 } 00191 if (feKbds.fCHS) { 00192 TAGMSG0(DBGTAG_IMM, "CHS KL Preloaded.\n"); 00193 CliSetDefaultImeHotKeys(DefaultHotKeyTableC, DefaultHotKeyNumC, fFoundAny); 00194 } 00195 }

LRESULT APIENTRY ComboBoxWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1335 of file combo.c.

References ComboBoxWndProcWorker(), DefWindowProcWorker(), FNID_COMBOBOX, FWINDOWMSG, L, NULL, SYSMET, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

01340 { 01341 PWND pwnd; 01342 01343 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01344 return (0L); 01345 } 01346 01347 /* 01348 * If the control is not interested in this message, 01349 * pass it to DefWindowProc. 01350 */ 01351 if (!FWINDOWMSG(message, FNID_COMBOBOX) && 01352 !(SYSMET(PENWINDOWS) && 01353 (message >= WM_PENWINFIRST && message <= WM_PENWINLAST))) 01354 return DefWindowProcWorker(pwnd, message, wParam, lParam, TRUE); 01355 01356 return ComboBoxWndProcWorker(pwnd, message, wParam, lParam, TRUE); 01357 }

LRESULT APIENTRY ComboBoxWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1359 of file combo.c.

References ComboBoxWndProcWorker(), DefWindowProcWorker(), FALSE, FNID_COMBOBOX, FWINDOWMSG, L, NULL, SYSMET, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

01364 { 01365 PWND pwnd; 01366 01367 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01368 return (0L); 01369 } 01370 01371 /* 01372 * If the control is not interested in this message, 01373 * pass it to DefWindowProc. 01374 */ 01375 if (!FWINDOWMSG(message, FNID_COMBOBOX) && 01376 !(SYSMET(PENWINDOWS) && 01377 (message >= WM_PENWINFIRST && message <= WM_PENWINLAST))) 01378 return DefWindowProcWorker(pwnd, message, wParam, lParam, FALSE); 01379 01380 return ComboBoxWndProcWorker(pwnd, message, wParam, lParam, FALSE); 01381 }

LRESULT ComboBoxWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 207 of file combo.c.

References _ClientToScreen(), _IsChild(), _ScreenToClient(), abs, APIENTRY, BOOL, tagCBox::buttonrc, BYTE, CBNcCreateHandler(), CBOX, tagCBox::CBoxStyle, CheckLock, ComboBoxDBCharHandler(), ComboboxLookaside, ComboBoxMsgOKInInit(), tagCBox::cxCombo, tagCBox::cxDrop, tagCBox::cyCombo, tagCBox::cyDrop, DefWindowProcWorker(), DWORD, tagCBox::editrc, FALSE, tagCBox::fButtonPressed, tagCBox::fCase, tagCBox::fExtendedUI, tagCBox::fFocus, tagCBox::fLBoxVisible, tagCBox::fMouseDown, FNID_COMBOBOX, tagCBox::fNoEdit, tagCBox::fNoRedraw, tagCBox::fRightAlign, tagCBox::fRtoLReading, FWINABLE, GetContextHelpId(), GetKeyState(), tagCBox::hFont, HW, HWq, INITCONTROLLOOKASIDE, IS_DBCS_ENABLED, IsComboVisible, tagLBIV::iTypeSearch, L, LPVOID, max, NotifyWinEvent(), NtUserBeginPaint(), NtUserEnableWindow, NtUserEndPaint(), NtUserInvalidateRect(), NtUserReleaseCapture, NtUserSetCapture(), NtUserSetFocus(), NULL, PLBIV, PLBWND, tagLBIV::pszTypeSearch, PtInRect(), PTR_TO_ID, tagWND::rcClient, tagWND::rcWindow, REBASEPWND, SDROPDOWN, SDROPDOWNLIST, SDROPPABLE, SEDITABLE, SendMessage(), SendMessageWorker(), SHORT, tagWND::spmenu, tagCBox::spwndEdit, tagCBox::spwndList, SYSMET, TestWF, THREAD_CODEPAGE, ThreadLock, ThreadUnlock, TRUE, UINT, UPPERCASE, UserLocalFree, VALIDATECLASSANDSIZE, ValidateHwnd, WEFRIGHT, WEFRTLREADING, WFDISABLED, WFVISIBLE, WFWIN40COMPAT, xxxCBCommandHandler(), xxxCBCompleteEditWindow(), xxxCBCreateHandler(), xxxCBDir(), xxxCBGetFocusHelper(), xxxCBGetTextHelper(), xxxCBGetTextLengthHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBKillFocusHelper(), xxxCBMessageItemHandler(), xxxCBNcDestroyHandler(), xxxCBPaint(), xxxCBPosition(), xxxCBSetEditItemHeight(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxCBSizeHandler(), xxxCBUpdateListBoxWindow(), and xxxPressButton().

Referenced by ClientThreadSetup(), ComboBoxWndProcA(), ComboBoxWndProcW(), ECNcDestroyHandler(), and xxxDestroyLBox().

00213 { 00214 HWND hwnd = HWq(pwnd); 00215 PCBOX pcbox; 00216 POINT pt; 00217 TL tlpwndEdit; 00218 TL tlpwndList; 00219 PAINTSTRUCT ps; 00220 LPWSTR lpwsz = NULL; 00221 LRESULT lReturn; 00222 static BOOL fInit = TRUE; 00223 int i; 00224 00225 CheckLock(pwnd); 00226 00227 VALIDATECLASSANDSIZE(pwnd, FNID_COMBOBOX); 00228 INITCONTROLLOOKASIDE(&ComboboxLookaside, CBOX, spwnd, 8); 00229 00230 /* 00231 * Get the pcbox for the given window now since we will use it a lot in 00232 * various handlers. This is stored by NtUserSetWindowLongPtr() in the 00233 * INITCONTROLLOOKASIDE macro above. 00234 */ 00235 pcbox = ((PCOMBOWND)pwnd)->pcbox; 00236 00237 /* 00238 * Protect the combobox during the initialization. 00239 */ 00240 if (pcbox->spwndList == NULL) { 00241 LRESULT lRet; 00242 00243 if (!ComboBoxMsgOKInInit(message, &lRet)) { 00244 RIPMSG2(RIP_WARNING, "ComboBoxWndProcWorker: msg=%04x is sent to hwnd=%08x in the middle of initialization.", 00245 message, hwnd); 00246 return lRet; 00247 } 00248 } 00249 00250 /* 00251 * Dispatch the various messages we can receive 00252 */ 00253 switch (message) { 00254 case CBEC_KILLCOMBOFOCUS: 00255 00256 /* 00257 * Private message coming from editcontrol informing us that the combo 00258 * box is losing the focus to a window which isn't in this combo box. 00259 */ 00260 xxxCBKillFocusHelper(pcbox); 00261 break; 00262 00263 case WM_COMMAND: 00264 00265 /* 00266 * So that we can handle notification messages from the listbox and 00267 * edit control. 00268 */ 00269 return xxxCBCommandHandler(pcbox, (DWORD)wParam, (HWND)lParam); 00270 00271 case WM_STYLECHANGED: 00272 UserAssert(pcbox->spwndList != NULL); 00273 { 00274 LONG OldStyle; 00275 LONG NewStyle = 0; 00276 00277 pcbox->fRtoLReading = (TestWF(pwnd, WEFRTLREADING) != 0); 00278 pcbox->fRightAlign = (TestWF(pwnd, WEFRIGHT) != 0); 00279 if (pcbox->fRtoLReading) 00280 NewStyle |= (WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR); 00281 if (pcbox->fRightAlign) 00282 NewStyle |= WS_EX_RIGHT; 00283 00284 ThreadLock(pcbox->spwndList, &tlpwndList); 00285 OldStyle = GetWindowLong(HWq(pcbox->spwndList), GWL_EXSTYLE) & ~(WS_EX_RIGHT|WS_EX_RTLREADING|WS_EX_LEFTSCROLLBAR); 00286 SetWindowLong(HWq(pcbox->spwndList), GWL_EXSTYLE, OldStyle|NewStyle); 00287 ThreadUnlock(&tlpwndList); 00288 00289 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 00290 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00291 OldStyle = GetWindowLong(HWq(pcbox->spwndEdit), GWL_EXSTYLE) & ~(WS_EX_RIGHT|WS_EX_RTLREADING|WS_EX_LEFTSCROLLBAR); 00292 SetWindowLong(HWq(pcbox->spwndEdit), GWL_EXSTYLE, OldStyle|NewStyle); 00293 ThreadUnlock(&tlpwndEdit); 00294 } 00295 xxxCBPosition(pcbox); 00296 NtUserInvalidateRect(hwnd, NULL, FALSE); 00297 } 00298 break; 00299 00300 case WM_CTLCOLORMSGBOX: 00301 case WM_CTLCOLOREDIT: 00302 case WM_CTLCOLORLISTBOX: 00303 case WM_CTLCOLORBTN: 00304 case WM_CTLCOLORDLG: 00305 case WM_CTLCOLORSCROLLBAR: 00306 case WM_CTLCOLORSTATIC: 00307 case WM_CTLCOLOR: 00308 // 00309 // Causes compatibility problems for 3.X apps. Forward only 00310 // for 4.0 00311 // 00312 if (TestWF(pwnd, WFWIN40COMPAT)) { 00313 TL tlpwndParent; 00314 LRESULT ret; 00315 PWND pwndParent; 00316 00317 pwndParent = REBASEPWND(pwnd, spwndParent); 00318 ThreadLock(pwndParent, &tlpwndParent); 00319 ret = SendMessage(HW(pwndParent), message, wParam, lParam); 00320 ThreadUnlock(tlpwndParent); 00321 return ret; 00322 } else 00323 return(DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi)); 00324 break; 00325 00326 case WM_GETTEXT: 00327 if (pcbox->fNoEdit) { 00328 return xxxCBGetTextHelper(pcbox, (int)wParam, (LPWSTR)lParam, fAnsi); 00329 } 00330 goto CallEditSendMessage; 00331 break; 00332 00333 case WM_GETTEXTLENGTH: 00334 00335 /* 00336 * If the is not edit control, CBS_DROPDOWNLIST, then we have to 00337 * ask the list box for the size 00338 */ 00339 00340 if (pcbox->fNoEdit) { 00341 return xxxCBGetTextLengthHelper(pcbox, fAnsi); 00342 } 00343 00344 // FALL THROUGH 00345 00346 case WM_CLEAR: 00347 case WM_CUT: 00348 case WM_PASTE: 00349 case WM_COPY: 00350 case WM_SETTEXT: 00351 goto CallEditSendMessage; 00352 break; 00353 00354 case WM_CREATE: 00355 00356 /* 00357 * wParam - not used 00358 * lParam - Points to the CREATESTRUCT data structure for the window. 00359 */ 00360 return xxxCBCreateHandler(pcbox, pwnd); 00361 00362 case WM_ERASEBKGND: 00363 00364 /* 00365 * Just return 1L so that the background isn't erased 00366 */ 00367 return 1L; 00368 00369 case WM_GETFONT: 00370 return (LRESULT)pcbox->hFont; 00371 00372 case WM_PRINT: 00373 if (!DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi)) 00374 return(FALSE); 00375 00376 if ((lParam & PRF_OWNED) && (pcbox->CBoxStyle & SDROPPABLE) && 00377 TestWF(pcbox->spwndList, WFVISIBLE)) { 00378 TL tpwndList; 00379 int iDC = SaveDC((HDC) wParam); 00380 OffsetWindowOrgEx((HDC) wParam, 0, pwnd->rcWindow.top - pcbox->spwndList->rcWindow.top, NULL); 00381 lParam &= ~PRF_CHECKVISIBLE; 00382 ThreadLock(pcbox->spwndList, &tpwndList); 00383 SendMessageWorker(pcbox->spwndList, WM_PRINT, wParam, lParam, FALSE); 00384 RestoreDC((HDC) wParam, iDC); 00385 } 00386 return TRUE; 00387 00388 case WM_PRINTCLIENT: 00389 xxxCBPaint(pcbox, (HDC) wParam); 00390 break; 00391 00392 case WM_PAINT: { 00393 HDC hdc; 00394 00395 /* 00396 * wParam - perhaps a hdc 00397 */ 00398 hdc = (wParam) ? (HDC) wParam : NtUserBeginPaint(hwnd, &ps); 00399 00400 if (IsComboVisible(pcbox)) 00401 xxxCBPaint(pcbox, hdc); 00402 00403 if (!wParam) 00404 NtUserEndPaint(hwnd, &ps); 00405 break; 00406 } 00407 case WM_GETDLGCODE: 00408 00409 /* 00410 * wParam - not used 00411 * lParam - not used 00412 */ 00413 { 00414 LRESULT code = DLGC_WANTCHARS | DLGC_WANTARROWS; 00415 00416 // If the listbox is dropped and the ENTER key is pressed, 00417 // we want this message so we can close up the listbox 00418 if ((lParam != 0) && 00419 (((LPMSG)lParam)->message == WM_KEYDOWN) && 00420 pcbox->fLBoxVisible && 00421 ((wParam == VK_RETURN) || (wParam == VK_ESCAPE))) 00422 { 00423 code |= DLGC_WANTMESSAGE; 00424 } 00425 return code; 00426 } 00427 /* 00428 * No fall through 00429 */ 00430 00431 case WM_SETFONT: 00432 xxxCBSetFontHandler(pcbox, (HANDLE)wParam, LOWORD(lParam)); 00433 break; 00434 00435 case WM_SYSKEYDOWN: 00436 if (lParam & 0x20000000L) /* Check if the alt key is down */ { 00437 00438 /* 00439 * Handle Combobox support. We want alt up or down arrow to behave 00440 * like F4 key which completes the combo box selection 00441 */ 00442 if (lParam & 0x1000000) { 00443 00444 /* 00445 * This is an extended key such as the arrow keys not on the 00446 * numeric keypad so just drop the combobox. 00447 */ 00448 if (wParam == VK_DOWN || wParam == VK_UP) 00449 goto DropCombo; 00450 00451 goto CallDWP; 00452 } 00453 00454 if (GetKeyState(VK_NUMLOCK) & 0x1) { 00455 /* 00456 * If numlock down, just send all system keys to dwp 00457 */ 00458 goto CallDWP; 00459 } else { 00460 00461 /* 00462 * We just want to ignore keys on the number pad... 00463 */ 00464 if (!(wParam == VK_DOWN || wParam == VK_UP)) 00465 goto CallDWP; 00466 } 00467 DropCombo: 00468 if (!pcbox->fLBoxVisible) { 00469 00470 /* 00471 * If the listbox isn't visible, just show it 00472 */ 00473 xxxCBShowListBoxWindow(pcbox, TRUE); 00474 } else { 00475 00476 /* 00477 * Ok, the listbox is visible. So hide the listbox window. 00478 */ 00479 if (!xxxCBHideListBoxWindow(pcbox, TRUE, TRUE)) 00480 return(0L); 00481 } 00482 } 00483 goto CallDWP; 00484 break; 00485 00486 case WM_KEYDOWN: 00487 /* 00488 * If the listbox is dropped and the ENTER key is pressed, 00489 * close up the listbox successfully. If ESCAPE is pressed, 00490 * close it up like cancel. 00491 */ 00492 if (pcbox->fLBoxVisible) { 00493 if ((wParam == VK_RETURN) || (wParam == VK_ESCAPE)) { 00494 xxxCBHideListBoxWindow(pcbox, TRUE, (wParam != VK_ESCAPE)); 00495 break; 00496 } 00497 } 00498 // FALL THROUGH 00499 00500 case WM_CHAR: 00501 if (fAnsi && IS_DBCS_ENABLED() && IsDBCSLeadByteEx(THREAD_CODEPAGE(), (BYTE)wParam)) { 00502 return ComboBoxDBCharHandler(pcbox, hwnd, message, wParam, lParam); 00503 } 00504 00505 if (pcbox->fNoEdit) { 00506 goto CallListSendMessage; 00507 } 00508 else 00509 goto CallEditSendMessage; 00510 break; 00511 00512 case WM_LBUTTONDBLCLK: 00513 case WM_LBUTTONDOWN: 00514 00515 #ifdef COLOR_HOTTRACKING 00516 pcbox->fButtonHotTracked = FALSE; 00517 #endif // COLOR_HOTTRACKING 00518 00519 /* 00520 * Set the focus to the combo box if we get a mouse click on it. 00521 */ 00522 if (!pcbox->fFocus) { 00523 NtUserSetFocus(hwnd); 00524 if (!pcbox->fFocus) { 00525 00526 /* 00527 * Don't do anything if we still don't have the focus. 00528 */ 00529 break; 00530 } 00531 } 00532 00533 /* 00534 * If user clicked in button rect and we are a combobox with edit, then 00535 * drop the listbox. (The button rect is 0 if there is no button so the 00536 * ptinrect will return false.) If a drop down list (no edit), clicking 00537 * anywhere on the face causes the list to drop. 00538 */ 00539 00540 POINTSTOPOINT(pt, lParam); 00541 if ((pcbox->CBoxStyle == SDROPDOWN && 00542 PtInRect(&pcbox->buttonrc, pt)) || 00543 pcbox->CBoxStyle == SDROPDOWNLIST) { 00544 00545 /* 00546 * Set the fMouseDown flag so that we can handle clicking on 00547 * the popdown button and dragging into the listbox (when it just 00548 * dropped down) to make a selection. 00549 */ 00550 pcbox->fButtonPressed = TRUE; 00551 if (pcbox->fLBoxVisible) { 00552 if (pcbox->fMouseDown) { 00553 pcbox->fMouseDown = FALSE; 00554 NtUserReleaseCapture(); 00555 } 00556 xxxPressButton(pcbox, FALSE); 00557 00558 if (!xxxCBHideListBoxWindow(pcbox, TRUE, TRUE)) 00559 return(0L); 00560 } else { 00561 xxxCBShowListBoxWindow(pcbox, FALSE); 00562 00563 // Setting and resetting this flag must always be followed 00564 // imediately by SetCapture or ReleaseCapture 00565 // 00566 pcbox->fMouseDown = TRUE; 00567 NtUserSetCapture(hwnd); 00568 if (FWINABLE()) { 00569 NotifyWinEvent(EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, INDEX_COMBOBOX_BUTTON); 00570 } 00571 } 00572 } 00573 break; 00574 00575 case WM_MOUSEWHEEL: 00576 /* 00577 * Handle only scrolling. 00578 */ 00579 if (wParam & (MK_CONTROL | MK_SHIFT)) 00580 goto CallDWP; 00581 00582 /* 00583 * If the listbox is visible, send it the message to scroll. 00584 */ 00585 if (pcbox->fLBoxVisible) 00586 goto CallListSendMessage; 00587 00588 /* 00589 * If we're in extended UI mode or the edit control isn't yet created, 00590 * bail. 00591 */ 00592 if (pcbox->fExtendedUI || pcbox->spwndEdit == NULL) 00593 return TRUE; 00594 00595 /* 00596 * Emulate arrow up/down messages to the edit control. 00597 */ 00598 i = abs(((short)HIWORD(wParam))/WHEEL_DELTA); 00599 wParam = ((short)HIWORD(wParam) > 0) ? VK_UP : VK_DOWN; 00600 00601 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00602 while (i-- > 0) { 00603 SendMessageWorker( 00604 pcbox->spwndEdit, WM_KEYDOWN, wParam, 0, fAnsi); 00605 } 00606 ThreadUnlock(&tlpwndEdit); 00607 return TRUE; 00608 00609 case WM_CAPTURECHANGED: 00610 if (!(TestWF(pwnd, WFWIN40COMPAT))) 00611 return 0; 00612 00613 if ((pcbox->fMouseDown)) { 00614 pcbox->fMouseDown = FALSE; 00615 xxxPressButton(pcbox, FALSE); 00616 00617 // 00618 // Pop combo listbox back up, canceling. 00619 // 00620 if (pcbox->fLBoxVisible) 00621 xxxCBHideListBoxWindow(pcbox, TRUE, FALSE); 00622 } 00623 break; 00624 00625 case WM_LBUTTONUP: 00626 xxxPressButton(pcbox, FALSE); 00627 00628 /* 00629 * Clear this flag so that mouse moves aren't sent to the listbox 00630 */ 00631 if (pcbox->fMouseDown) { 00632 pcbox->fMouseDown = FALSE; 00633 00634 if (pcbox->CBoxStyle == SDROPDOWN) { 00635 // If an item in the listbox matches the text in the edit 00636 // control, scroll it to the top of the listbox. Select the 00637 // item only if the mouse button isn't down otherwise we 00638 // will select the item when the mouse button goes up. 00639 xxxCBUpdateListBoxWindow(pcbox, TRUE); 00640 xxxCBCompleteEditWindow(pcbox); 00641 } 00642 NtUserReleaseCapture(); 00643 00644 // Now, we want listbox to track mouse moves while mouse up 00645 // until mouse down, and select items as though they were 00646 // clicked on. 00647 if (TestWF(pwnd, WFWIN40COMPAT)) { 00648 00649 ThreadLock(pcbox->spwndList, &tlpwndList); 00650 SendMessageWorker(pcbox->spwndList, LBCB_STARTTRACK, FALSE, 0, FALSE); 00651 ThreadUnlock(&tlpwndList); 00652 } 00653 } 00654 #ifdef COLOR_HOTTRACKING 00655 HotTrack(pcbox); 00656 break; 00657 00658 case WM_MOUSELEAVE: 00659 pcbox->fButtonHotTracked = FALSE; 00660 NtUserInvalidateRect(hwnd, &pcbox->buttonrc, TRUE); 00661 #endif // COLOR_HOTTRACKING 00662 break; 00663 00664 case WM_MOUSEMOVE: 00665 if (pcbox->fMouseDown) { 00666 POINTSTOPOINT(pt, lParam); 00667 00668 // Note conversion of INT bit field to BOOL (1 or 0) 00669 00670 if (PtInRect(&pcbox->buttonrc, pt) != !!pcbox->fButtonPressed) { 00671 xxxPressButton(pcbox, (pcbox->fButtonPressed == 0)); 00672 } 00673 00674 _ClientToScreen(pwnd, &pt); 00675 if (PtInRect(&pcbox->spwndList->rcClient, pt)) { 00676 00677 /* 00678 * This handles dropdown comboboxes/listboxes so that clicking 00679 * on the dropdown button and dragging into the listbox window 00680 * will let the user make a listbox selection. 00681 */ 00682 pcbox->fMouseDown = FALSE; 00683 NtUserReleaseCapture(); 00684 00685 if (pcbox->CBoxStyle & SEDITABLE) { 00686 00687 /* 00688 * If an item in the listbox matches the text in the edit 00689 * control, scroll it to the top of the listbox. Select the 00690 * item only if the mouse button isn't down otherwise we 00691 * will select the item when the mouse button goes up. 00692 */ 00693 00694 /* 00695 * We need to select the item which matches the editcontrol 00696 * so that if the user drags out of the listbox, we don't 00697 * cancel back to his origonal selection 00698 */ 00699 xxxCBUpdateListBoxWindow(pcbox, TRUE); 00700 } 00701 00702 /* 00703 * Convert point to listbox coordinates and send a buttondown 00704 * message to the listbox window. 00705 */ 00706 _ScreenToClient(pcbox->spwndList, &pt); 00707 lParam = POINTTOPOINTS(pt); 00708 message = WM_LBUTTONDOWN; 00709 goto CallListSendMessage; 00710 } 00711 } 00712 #ifdef COLOR_HOTTRACKING 00713 HotTrack(pcbox); 00714 #endif // COLOR_HOTTRACKING 00715 break; 00716 00717 case WM_NCDESTROY: 00718 case WM_FINALDESTROY: 00719 xxxCBNcDestroyHandler(pwnd, pcbox); 00720 break; 00721 00722 case WM_SETFOCUS: 00723 if (pcbox->fNoEdit) { 00724 00725 /* 00726 * There is no editcontrol so set the focus to the combo box itself. 00727 */ 00728 xxxCBGetFocusHelper(pcbox); 00729 } else if (pcbox->spwndEdit) { 00730 /* 00731 * Set the focus to the edit control window if there is one 00732 */ 00733 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00734 NtUserSetFocus(HWq(pcbox->spwndEdit)); 00735 ThreadUnlock(&tlpwndEdit); 00736 } 00737 break; 00738 00739 case WM_KILLFOCUS: 00740 00741 /* 00742 * wParam has the new focus hwnd 00743 */ 00744 if (wParam != 0) 00745 wParam = (WPARAM)ValidateHwnd((HWND)wParam); 00746 if ((wParam == 0) || !_IsChild(pwnd, (PWND)wParam)) { 00747 00748 /* 00749 * We only give up the focus if the new window getting the focus 00750 * doesn't belong to the combo box. 00751 */ 00752 xxxCBKillFocusHelper(pcbox); 00753 } 00754 00755 UserAssert(pcbox->spwndList); 00756 { 00757 PLBIV plb = ((PLBWND)pcbox->spwndList)->pLBIV; 00758 00759 if ((plb != NULL) && (plb != (PLBIV)-1)) { 00760 plb->iTypeSearch = 0; 00761 if (plb->pszTypeSearch) { 00762 UserLocalFree(plb->pszTypeSearch); 00763 plb->pszTypeSearch = NULL; 00764 } 00765 } 00766 } 00767 break; 00768 00769 case WM_SETREDRAW: 00770 00771 /* 00772 * wParam - specifies state of the redraw flag. nonzero = redraw 00773 * lParam - not used 00774 */ 00775 00776 /* 00777 * effects: Sets the state of the redraw flag for this combo box 00778 * and its children. 00779 */ 00780 pcbox->fNoRedraw = (UINT)!((BOOL)wParam); 00781 00782 /* 00783 * Must check pcbox->spwnEdit in case we get this message before 00784 * WM_CREATE - PCBOX won't be initialized yet. (Eudora does this) 00785 */ 00786 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 00787 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00788 SendMessageWorker(pcbox->spwndEdit, message, wParam, lParam, FALSE); 00789 ThreadUnlock(&tlpwndEdit); 00790 } 00791 goto CallListSendMessage; 00792 break; 00793 00794 case WM_ENABLE: 00795 00796 /* 00797 * Invalidate the rect to cause it to be drawn in grey for its 00798 * disabled view or ungreyed for non-disabled view. 00799 */ 00800 NtUserInvalidateRect(hwnd, NULL, FALSE); 00801 if ((pcbox->CBoxStyle & SEDITABLE) && pcbox->spwndEdit) { 00802 00803 /* 00804 * Enable/disable the edit control window 00805 */ 00806 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00807 NtUserEnableWindow(HWq(pcbox->spwndEdit), (TestWF(pwnd, WFDISABLED) == 0)); 00808 ThreadUnlock(&tlpwndEdit); 00809 } 00810 00811 /* 00812 * Enable/disable the listbox window 00813 */ 00814 UserAssert(pcbox->spwndList); 00815 ThreadLock(pcbox->spwndList, &tlpwndList); 00816 NtUserEnableWindow(HWq(pcbox->spwndList), (TestWF(pwnd, WFDISABLED) == 0)); 00817 ThreadUnlock(&tlpwndList); 00818 break; 00819 00820 case WM_SIZE: 00821 00822 /* 00823 * wParam - defines the type of resizing fullscreen, sizeiconic, 00824 * sizenormal etc. 00825 * lParam - new width in LOWORD, new height in HIGHUINT of client area 00826 */ 00827 UserAssert(pcbox->spwndList); 00828 if (LOWORD(lParam) == 0 || HIWORD(lParam) == 0) { 00829 00830 /* 00831 * If being sized to a zero width or to a zero height or we aren't 00832 * fully initialized, just return. 00833 */ 00834 return 0; 00835 } 00836 00837 // OPTIMIZATIONS -- first check if old and new widths are the same 00838 if (pcbox->cxCombo == pwnd->rcWindow.right - pwnd->rcWindow.left) { 00839 int iNewHeight = pwnd->rcWindow.bottom - pwnd->rcWindow.top; 00840 00841 // now check if new height is the dropped down height 00842 if (pcbox->fLBoxVisible) { 00843 // Check if new height is the full size height 00844 if (pcbox->cyDrop + pcbox->cyCombo == iNewHeight) 00845 return(0L); 00846 } else { 00847 // Check if new height is the closed up height 00848 if (pcbox->cyCombo == iNewHeight) 00849 return(0L); 00850 } 00851 } 00852 00853 xxxCBSizeHandler(pcbox); 00854 break; 00855 00856 case CB_GETDROPPEDSTATE: 00857 00858 /* 00859 * returns 1 if combo is dropped down else 0 00860 * wParam - not used 00861 * lParam - not used 00862 */ 00863 return pcbox->fLBoxVisible; 00864 00865 case CB_GETDROPPEDCONTROLRECT: 00866 00867 /* 00868 * wParam - not used 00869 * lParam - lpRect which will get the dropped down window rect in 00870 * screen coordinates. 00871 */ 00872 ((LPRECT)lParam)->left = pwnd->rcWindow.left; 00873 ((LPRECT)lParam)->top = pwnd->rcWindow.top; 00874 ((LPRECT)lParam)->right = pwnd->rcWindow.left + max(pcbox->cxDrop, pcbox->cxCombo); 00875 ((LPRECT)lParam)->bottom = pwnd->rcWindow.top + pcbox->cyCombo + pcbox->cyDrop; 00876 break; 00877 00878 case CB_SETDROPPEDWIDTH: 00879 if (pcbox->CBoxStyle & SDROPPABLE) { 00880 if (wParam) { 00881 wParam = max(wParam, (UINT)pcbox->cxCombo); 00882 00883 if (wParam != (UINT) pcbox->cxDrop) 00884 { 00885 pcbox->cxDrop = (int)wParam; 00886 xxxCBPosition(pcbox); 00887 } 00888 } 00889 } 00890 // fall thru 00891 00892 case CB_GETDROPPEDWIDTH: 00893 if (pcbox->CBoxStyle & SDROPPABLE) 00894 return((LRESULT) max(pcbox->cxDrop, pcbox->cxCombo)); 00895 else 00896 return(CB_ERR); 00897 break; 00898 00899 case CB_DIR: 00900 /* 00901 * wParam - Dos attribute value. 00902 * lParam - Points to a file specification string 00903 */ 00904 if (fAnsi && lParam != 0) { 00905 if (MBToWCS((LPSTR)lParam, -1, &lpwsz, -1, TRUE) == 0) 00906 return CB_ERR; 00907 lParam = (LPARAM)lpwsz; 00908 } 00909 lReturn = xxxCBDir(pcbox, LOWORD(wParam), (LPWSTR)lParam); 00910 if (fAnsi && lParam != 0) { 00911 UserLocalFree(lpwsz); 00912 } 00913 return lReturn; 00914 00915 case CB_SETEXTENDEDUI: 00916 00917 /* 00918 * wParam - specifies state to set extendui flag to. 00919 * Currently only 1 is allowed. Return CB_ERR (-1) if 00920 * failure else 0 if success. 00921 */ 00922 if (pcbox->CBoxStyle & SDROPPABLE) { 00923 if (!wParam) { 00924 pcbox->fExtendedUI = 0; 00925 return 0; 00926 } 00927 00928 if (wParam == 1) { 00929 pcbox->fExtendedUI = 1; 00930 return 0; 00931 } 00932 00933 RIPERR1(ERROR_INVALID_PARAMETER, 00934 RIP_WARNING, 00935 "Invalid parameter \"wParam\" (%ld) to ComboBoxWndProcWorker", 00936 wParam); 00937 00938 } else { 00939 RIPERR1(ERROR_INVALID_MESSAGE, 00940 RIP_WARNING, 00941 "Invalid message (%ld) sent to ComboBoxWndProcWorker", 00942 message); 00943 } 00944 00945 return CB_ERR; 00946 00947 case CB_GETEXTENDEDUI: 00948 if (pcbox->CBoxStyle & SDROPPABLE) { 00949 if (pcbox->fExtendedUI) 00950 return TRUE; 00951 } 00952 return FALSE; 00953 00954 case CB_GETEDITSEL: 00955 00956 /* 00957 * wParam - not used 00958 * lParam - not used 00959 * effects: Gets the selection range for the given edit control. The 00960 * starting BYTE-position is in the low order word. It contains the 00961 * the BYTE-position of the first nonselected character after the end 00962 * of the selection in the high order word. Returns CB_ERR if no 00963 * editcontrol. 00964 */ 00965 message = EM_GETSEL; 00966 goto CallEditSendMessage; 00967 break; 00968 00969 case CB_LIMITTEXT: 00970 00971 /* 00972 * wParam - max number of bytes that can be entered 00973 * lParam - not used 00974 * effects: Specifies the maximum number of bytes of text the user may 00975 * enter. If maxLength is 0, we may enter MAXINT number of BYTES. 00976 */ 00977 message = EM_LIMITTEXT; 00978 goto CallEditSendMessage; 00979 break; 00980 00981 case CB_SETEDITSEL: 00982 00983 /* 00984 * wParam - ichStart 00985 * lParam - ichEnd 00986 * 00987 */ 00988 message = EM_SETSEL; 00989 00990 wParam = (int)(SHORT)LOWORD(lParam); 00991 lParam = (int)(SHORT)HIWORD(lParam); 00992 goto CallEditSendMessage; 00993 break; 00994 00995 case CB_ADDSTRING: 00996 00997 /* 00998 * wParam - not used 00999 * lParam - Points to null terminated string to be added to listbox 01000 */ 01001 if (!pcbox->fCase) 01002 message = LB_ADDSTRING; 01003 else 01004 message = (pcbox->fCase & UPPERCASE) ? LB_ADDSTRINGUPPER : LB_ADDSTRINGLOWER; 01005 goto CallListSendMessage; 01006 break; 01007 01008 case CB_DELETESTRING: 01009 01010 /* 01011 * wParam - index to string to be deleted 01012 * lParam - not used 01013 */ 01014 message = LB_DELETESTRING; 01015 goto CallListSendMessage; 01016 break; 01017 01018 case CB_INITSTORAGE: 01019 // wParamLo - number of items 01020 // lParam - number of bytes of string space 01021 message = LB_INITSTORAGE; 01022 goto CallListSendMessage; 01023 01024 case CB_SETTOPINDEX: 01025 // wParamLo - index to make top 01026 // lParam - not used 01027 message = LB_SETTOPINDEX; 01028 goto CallListSendMessage; 01029 01030 case CB_GETTOPINDEX: 01031 // wParamLo / lParam - not used 01032 message = LB_GETTOPINDEX; 01033 goto CallListSendMessage; 01034 01035 case CB_GETCOUNT: 01036 01037 /* 01038 * wParam - not used 01039 * lParam - not used 01040 */ 01041 message = LB_GETCOUNT; 01042 goto CallListSendMessage; 01043 break; 01044 01045 case CB_GETCURSEL: 01046 01047 /* 01048 * wParam - not used 01049 * lParam - not used 01050 */ 01051 message = LB_GETCURSEL; 01052 goto CallListSendMessage; 01053 break; 01054 01055 case CB_GETLBTEXT: 01056 01057 /* 01058 * wParam - index of string to be copied 01059 * lParam - buffer that is to receive the string 01060 */ 01061 message = LB_GETTEXT; 01062 goto CallListSendMessage; 01063 break; 01064 01065 case CB_GETLBTEXTLEN: 01066 01067 /* 01068 * wParam - index to string 01069 * lParam - now used for cbANSI 01070 */ 01071 message = LB_GETTEXTLEN; 01072 goto CallListSendMessage; 01073 break; 01074 01075 case CB_INSERTSTRING: 01076 01077 /* 01078 * wParam - position to receive the string 01079 * lParam - points to the string 01080 */ 01081 if (!pcbox->fCase) 01082 message = LB_INSERTSTRING; 01083 else 01084 message = (pcbox->fCase & UPPERCASE) ? LB_INSERTSTRINGUPPER : LB_INSERTSTRINGLOWER; 01085 goto CallListSendMessage; 01086 break; 01087 01088 case CB_RESETCONTENT: 01089 01090 /* 01091 * wParam - not used 01092 * lParam - not used 01093 * If we come here before WM_CREATE has been processed, 01094 * pcbox->spwndList will be NULL. 01095 */ 01096 UserAssert(pcbox->spwndList); 01097 ThreadLock(pcbox->spwndList, &tlpwndList); 01098 SendMessageWorker(pcbox->spwndList, LB_RESETCONTENT, 0, 0, FALSE); 01099 ThreadUnlock(&tlpwndList); 01100 xxxCBInternalUpdateEditWindow(pcbox, NULL); 01101 break; 01102 01103 case CB_GETHORIZONTALEXTENT: 01104 message = LB_GETHORIZONTALEXTENT; 01105 goto CallListSendMessage; 01106 01107 case CB_SETHORIZONTALEXTENT: 01108 message = LB_SETHORIZONTALEXTENT; 01109 goto CallListSendMessage; 01110 01111 case CB_FINDSTRING: 01112 01113 /* 01114 * wParam - index of starting point for search 01115 * lParam - points to prefix string 01116 */ 01117 message = LB_FINDSTRING; 01118 goto CallListSendMessage; 01119 break; 01120 01121 case CB_FINDSTRINGEXACT: 01122 01123 /* 01124 * wParam - index of starting point for search 01125 * lParam - points to a exact string 01126 */ 01127 message = LB_FINDSTRINGEXACT; 01128 goto CallListSendMessage; 01129 break; 01130 01131 case CB_SELECTSTRING: 01132 01133 /* 01134 * wParam - index of starting point for search 01135 * lParam - points to prefix string 01136 */ 01137 UserAssert(pcbox->spwndList); 01138 ThreadLock(pcbox->spwndList, &tlpwndList); 01139 lParam = SendMessageWorker(pcbox->spwndList, LB_SELECTSTRING, 01140 wParam, lParam, fAnsi); 01141 ThreadUnlock(&tlpwndList); 01142 xxxCBInternalUpdateEditWindow(pcbox, NULL); 01143 return lParam; 01144 01145 case CB_SETCURSEL: 01146 01147 /* 01148 * wParam - Contains index to be selected 01149 * lParam - not used 01150 * If we come here before WM_CREATE has been processed, 01151 * pcbox->spwndList will be NULL. 01152 */ 01153 01154 UserAssert(pcbox->spwndList); 01155 01156 ThreadLock(pcbox->spwndList, &tlpwndList); 01157 lParam = SendMessageWorker(pcbox->spwndList, LB_SETCURSEL, wParam, lParam, FALSE); 01158 if (lParam != -1) { 01159 SendMessageWorker(pcbox->spwndList, LB_SETTOPINDEX, wParam, 0, FALSE); 01160 } 01161 ThreadUnlock(&tlpwndList); 01162 xxxCBInternalUpdateEditWindow(pcbox, NULL); 01163 return lParam; 01164 01165 case CB_GETITEMDATA: 01166 message = LB_GETITEMDATA; 01167 goto CallListSendMessage; 01168 break; 01169 01170 case CB_SETITEMDATA: 01171 message = LB_SETITEMDATA; 01172 goto CallListSendMessage; 01173 break; 01174 01175 case CB_SETITEMHEIGHT: 01176 if (wParam == -1) { 01177 if (HIWORD(lParam) != 0) 01178 return CB_ERR; 01179 return xxxCBSetEditItemHeight(pcbox, LOWORD(lParam)); 01180 } 01181 01182 message = LB_SETITEMHEIGHT; 01183 goto CallListSendMessage; 01184 break; 01185 01186 case CB_GETITEMHEIGHT: 01187 if (wParam == -1) 01188 return pcbox->editrc.bottom - pcbox->editrc.top; 01189 01190 message = LB_GETITEMHEIGHT; 01191 goto CallListSendMessage; 01192 break; 01193 01194 case CB_SHOWDROPDOWN: 01195 01196 /* 01197 * wParam - True then drop down the listbox if possible else hide it 01198 * lParam - not used 01199 */ 01200 if (wParam && !pcbox->fLBoxVisible) { 01201 xxxCBShowListBoxWindow(pcbox, TRUE); 01202 } else { 01203 if (!wParam && pcbox->fLBoxVisible) { 01204 xxxCBHideListBoxWindow(pcbox, TRUE, FALSE); 01205 } 01206 } 01207 break; 01208 01209 case CB_SETLOCALE: 01210 01211 /* 01212 * wParam - locale id 01213 * lParam - not used 01214 */ 01215 message = LB_SETLOCALE; 01216 goto CallListSendMessage; 01217 break; 01218 01219 case CB_GETLOCALE: 01220 01221 /* 01222 * wParam - not used 01223 * lParam - not used 01224 */ 01225 message = LB_GETLOCALE; 01226 goto CallListSendMessage; 01227 break; 01228 01229 case WM_MEASUREITEM: 01230 case WM_DELETEITEM: 01231 case WM_DRAWITEM: 01232 case WM_COMPAREITEM: 01233 return xxxCBMessageItemHandler(pcbox, message, (LPVOID)lParam); 01234 01235 case WM_NCCREATE: 01236 01237 /* 01238 * wParam - Contains a handle to the window being created 01239 * lParam - Points to the CREATESTRUCT data structure for the window. 01240 */ 01241 return CBNcCreateHandler(pcbox, pwnd); 01242 01243 case WM_PARENTNOTIFY: 01244 if (LOWORD(wParam) == WM_DESTROY) { 01245 if ((HWND)lParam == HW(pcbox->spwndEdit)) { 01246 pcbox->CBoxStyle &= ~SEDITABLE; 01247 pcbox->fNoEdit = TRUE; 01248 pcbox->spwndEdit = pwnd; 01249 } else if ((HWND)lParam == HW(pcbox->spwndList)) { 01250 pcbox->CBoxStyle &= ~SDROPPABLE; 01251 pcbox->spwndList = NULL; 01252 } 01253 } 01254 break; 01255 01256 case WM_UPDATEUISTATE: 01257 /* 01258 * Propagate the change to the list control, if any 01259 */ 01260 UserAssert(pcbox->spwndList); 01261 ThreadLock(pcbox->spwndList, &tlpwndList); 01262 SendMessageWorker(pcbox->spwndList, WM_UPDATEUISTATE, 01263 wParam, lParam, fAnsi); 01264 ThreadUnlock(&tlpwndList); 01265 goto CallDWP; 01266 01267 case WM_HELP: 01268 { 01269 LPHELPINFO lpHelpInfo; 01270 01271 /* Check if this message is form a child of this combo 01272 */ 01273 if ((lpHelpInfo = (LPHELPINFO)lParam) != NULL && 01274 ((pcbox->spwndEdit && lpHelpInfo->iCtrlId == (SHORT)(PTR_TO_ID(pcbox->spwndEdit->spmenu))) || 01275 lpHelpInfo->iCtrlId == (SHORT)(PTR_TO_ID(pcbox->spwndList->spmenu)) )) { 01276 01277 // BUGBUG - What to do here? 01278 lpHelpInfo->iCtrlId = (SHORT)(PTR_TO_ID(pwnd->spmenu)); 01279 lpHelpInfo->hItemHandle = hwnd; 01280 lpHelpInfo->dwContextId = GetContextHelpId(pwnd); 01281 } 01282 } 01283 /* 01284 * Fall through to DefWindowProc 01285 */ 01286 01287 default: 01288 01289 if (SYSMET(PENWINDOWS) && 01290 (message >= WM_PENWINFIRST && message <= WM_PENWINLAST)) 01291 goto CallEditSendMessage; 01292 01293 CallDWP: 01294 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 01295 } /* switch (message) */ 01296 01297 return TRUE; 01298 01299 /* 01300 * The following forward messages off to the child controls. 01301 */ 01302 CallEditSendMessage: 01303 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 01304 /* 01305 * pcbox->spwndEdit will be NULL if we haven't done WM_CREATE yet! 01306 */ 01307 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 01308 lReturn = SendMessageWorker(pcbox->spwndEdit, message, 01309 wParam, lParam, fAnsi); 01310 ThreadUnlock(&tlpwndEdit); 01311 } 01312 else { 01313 RIPERR0(ERROR_INVALID_COMBOBOX_MESSAGE, RIP_VERBOSE, ""); 01314 lReturn = CB_ERR; 01315 } 01316 return lReturn; 01317 01318 CallListSendMessage: 01319 /* 01320 * pcbox->spwndList will be NULL if we haven't done WM_CREATE yet! 01321 */ 01322 UserAssert(pcbox->spwndList); 01323 ThreadLock(pcbox->spwndList, &tlpwndList); 01324 lReturn = SendMessageWorker(pcbox->spwndList, message, 01325 wParam, lParam, fAnsi); 01326 ThreadUnlock(&tlpwndList); 01327 return lReturn; 01328 01329 } /* ComboBoxWndProcWorker */

LRESULT APIENTRY ComboListBoxWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 788 of file lb1.c.

References DefWindowProcWorker(), FNID_LISTBOX, FWINDOWMSG, L, ListBoxWndProcWorker(), NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

00793 { 00794 PWND pwnd; 00795 00796 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00797 return (0L); 00798 } 00799 00800 /* 00801 * If the control is not interested in this message, 00802 * pass it to DefWindowProc. 00803 */ 00804 if (!FWINDOWMSG(message, FNID_LISTBOX)) 00805 return DefWindowProcWorker(pwnd, message, wParam, lParam, TRUE); 00806 00807 return ListBoxWndProcWorker(pwnd, message, wParam, lParam, TRUE); 00808 }

LRESULT APIENTRY ComboListBoxWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 810 of file lb1.c.

References DefWindowProcWorker(), FALSE, FNID_LISTBOX, FWINDOWMSG, L, ListBoxWndProcWorker(), NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

00815 { 00816 PWND pwnd; 00817 00818 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00819 return (0L); 00820 } 00821 00822 /* 00823 * If the control is not interested in this message, 00824 * pass it to DefWindowProc. 00825 */ 00826 if (!FWINDOWMSG(message, FNID_LISTBOX)) 00827 return DefWindowProcWorker(pwnd, message, wParam, lParam, FALSE); 00828 00829 return ListBoxWndProcWorker(pwnd, message, wParam, lParam, FALSE); 00830 }

LRESULT ComboListBoxWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

HBITMAP ConvertDIBBitmap UPBITMAPINFOHEADER  lpbih,
DWORD  cxDesired,
DWORD  cyDesired,
UINT  flags,
LPBITMAPINFOHEADER *  lplpbih,
LPSTR *  lplpBits
 

Referenced by ConvertDIBIcon(), CopyBmp(), ObjectFromDIBResource(), RtlLoadObjectFromDIBFile(), and WOWLoadBitmapA().

HICON ConvertDIBIcon LPBITMAPINFOHEADER  lpbih,
HINSTANCE  hmod,
LPCWSTR  lpName,
BOOL  fIcon,
DWORD  cxNew,
DWORD  cyNew,
UINT  LR_flags
 

Definition at line 3344 of file clres.c.

References BitmapFromDIB(), BOOL, ChangeDibColors(), ConvertDIBBitmap(), CreateIcoCur(), CURSORF_ACONFRAME, CURSORF_FROMRESOURCE, CURSORF_GLOBAL, CURSORF_LRSHARED, FALSE, hmodUser, INT, MAX_PATH, MultDiv, NULL, PTR_TO_ID, szUSER32, UserLocalFree, and WowGetModuleFileName().

Referenced by CreateIconFromResourceEx(), LoadCursorIconFromFileMap(), ObjectFromDIBResource(), ReadIconFromFileMap(), and WowServerLoadCreateCursorIcon().

03352 { 03353 LPBITMAPINFOHEADER lpbihNew = NULL; 03354 LPSTR lpBitsNextMask = NULL; 03355 HICON hicoNew = NULL; 03356 BOOL fOldFormat = FALSE; 03357 CURSORDATA cur; 03358 WCHAR achModName[MAX_PATH]; 03359 03360 /* 03361 * Because Icons/Cursors always get public bitmaps, we cannot use 03362 * LR_CREATEDIBSECTION on them. 03363 */ 03364 if (LR_flags & LR_CREATEDIBSECTION) 03365 LR_flags = (LR_flags & ~LR_CREATEDIBSECTION) | LR_CREATEREALDIB; 03366 03367 RtlZeroMemory(&cur, sizeof(cur)); 03368 03369 if (!fIcon) { 03370 /* 03371 * Cursors have an extra two words preceeding the BITMAPINFOHEADER 03372 * indicating the hot-spot. After doing the increments, the 03373 * pointer should be at the dib-header. 03374 */ 03375 cur.xHotspot = (short)(int)*(((LPWORD)lpbih)++); 03376 cur.yHotspot = (short)(int)*(((LPWORD)lpbih)++); 03377 } 03378 03379 /* 03380 * Get the XOR/Color mask. 03381 * The XOR bits are first in the DIB because the header info 03382 * pertains to them. 03383 * The AND mask is always monochrome. 03384 */ 03385 lpBitsNextMask = NULL; // not passing lpBits in. 03386 cur.hbmColor = ConvertDIBBitmap(lpbih, 03387 cxNew, 03388 cyNew, 03389 LR_flags, 03390 &lpbihNew, 03391 &lpBitsNextMask); 03392 if (cur.hbmColor == NULL) 03393 return NULL; 03394 03395 if (hmod == NULL) { 03396 cur.lpModName = NULL; 03397 } else { 03398 cur.CURSORF_flags = CURSORF_FROMRESOURCE; 03399 if (hmod == hmodUser) { 03400 cur.lpModName = szUSER32; 03401 } else { 03402 WowGetModuleFileName(hmod, 03403 achModName, 03404 sizeof(achModName) / sizeof(WCHAR)); 03405 cur.lpModName = achModName; 03406 } 03407 } 03408 cur.rt = (fIcon ? PTR_TO_ID(RT_ICON) : PTR_TO_ID(RT_CURSOR)); 03409 cur.lpName = (LPWSTR)lpName; 03410 cur.bpp = lpbihNew->biBitCount * lpbihNew->biPlanes; 03411 03412 if (cxNew == 0) 03413 cxNew = lpbihNew->biWidth; 03414 03415 if (cyNew == 0) 03416 cyNew = lpbihNew->biHeight / 2; 03417 03418 if (!fIcon) { 03419 03420 cur.xHotspot = MultDiv(cur.xHotspot, 03421 cxNew, 03422 lpbihNew->biWidth); 03423 cur.yHotspot = MultDiv(cur.yHotspot, 03424 cyNew, 03425 lpbihNew->biHeight / 2); 03426 } else { 03427 03428 /* 03429 * For an icon the hot spot is the center of the icon 03430 */ 03431 cur.xHotspot = (INT)(cxNew) / 2; 03432 cur.yHotspot = (INT)(cyNew) / 2; 03433 } 03434 03435 /* 03436 * Setup header for monochrome DIB. Note that we use the COPY. 03437 */ 03438 ChangeDibColors(lpbihNew, LR_MONOCHROME); 03439 03440 if (lpBitsNextMask != NULL) { 03441 cur.hbmMask = BitmapFromDIB(cxNew, 03442 cyNew * 2, 03443 1, 03444 1, 03445 0, 03446 lpbihNew->biWidth, 03447 lpbihNew->biHeight, 03448 lpBitsNextMask, 03449 (LPBITMAPINFO)lpbihNew, 03450 NULL); 03451 if (cur.hbmMask == NULL) { 03452 DeleteObject(cur.hbmColor); 03453 UserLocalFree(lpbihNew); 03454 return NULL; 03455 } 03456 03457 } else { 03458 cur.hbmMask = cur.hbmColor; 03459 cur.hbmColor = NULL; 03460 } 03461 03462 cur.cx = cxNew; 03463 cur.cy = cyNew * 2; 03464 03465 /* 03466 * Free our dib header copy allocated by ConvertDIBBitmap 03467 */ 03468 UserLocalFree(lpbihNew); 03469 03470 if (LR_flags & LR_SHARED) 03471 cur.CURSORF_flags |= CURSORF_LRSHARED; 03472 03473 if (LR_flags & LR_GLOBAL) 03474 cur.CURSORF_flags |= CURSORF_GLOBAL; 03475 03476 if (LR_flags & LR_ACONFRAME) 03477 cur.CURSORF_flags |= CURSORF_ACONFRAME; 03478 03479 return CreateIcoCur(&cur); 03480 }

HANDLE ConvertMemHandle HANDLE  hMem,
UINT  cbNULL
 

Definition at line 189 of file client/ntstubs.c.

References BEGINCALL, ENDCALL, ERRORTRAP, MSGERROR, NtUserConvertMemHandle(), NULL, UINT, USERGLOBALLOCK, and USERGLOBALUNLOCK.

Referenced by GetClipboardData(), and SetClipboardData().

00192 { 00193 UINT cbData; 00194 LPBYTE lpData; 00195 00196 BEGINCALL() 00197 00198 if (GlobalFlags(hData) == GMEM_INVALID_HANDLE) { 00199 RIPMSG0(RIP_WARNING, "ConvertMemHandle hMem is not valid\n"); 00200 MSGERROR(); 00201 } 00202 00203 if (!(cbData = (UINT)GlobalSize(hData))) 00204 MSGERROR(); 00205 00206 USERGLOBALLOCK(hData, lpData); 00207 if (lpData == NULL) { 00208 MSGERROR(); 00209 } 00210 00211 /* 00212 * Make sure text formats are NULL terminated. 00213 */ 00214 switch (cbNULL) { 00215 case 2: 00216 lpData[cbData - 2] = 0; 00217 // FALL THROUGH 00218 case 1: 00219 lpData[cbData - 1] = 0; 00220 } 00221 00222 retval = (ULONG_PTR)NtUserConvertMemHandle(lpData, cbData); 00223 00224 USERGLOBALUNLOCK(hData); 00225 00226 ERRORTRAP(NULL); 00227 ENDCALL(HANDLE); 00228 }

void CopyLogFontAtoW PLOGFONTW  pdest,
PLOGFONTA  psrc
 

Referenced by MESSAGECALL(), and SystemParametersInfo().

void CopyLogFontWtoA PLOGFONTA  pdest,
PLOGFONTW  psrc
 

Referenced by MESSAGECALL(), and SystemParametersInfo().

HANDLE CreateLocalMemHandle HANDLE  hMem  ) 
 

Definition at line 230 of file client/ntstubs.c.

References BEGINCALL, ENDCALL, ERRORTRAP, MSGERROR, NT_SUCCESS, NTSTATUS(), NtUserCreateLocalMemHandle(), NULL, Status, UINT, and UserGlobalFree.

Referenced by GetClipboardData().

00232 { 00233 UINT cbData; 00234 NTSTATUS Status; 00235 00236 BEGINCALL() 00237 00238 Status = NtUserCreateLocalMemHandle(hMem, NULL, 0, &cbData); 00239 if (Status != STATUS_BUFFER_TOO_SMALL) { 00240 RIPMSG0(RIP_WARNING, "__CreateLocalMemHandle server returned failure\n"); 00241 MSGERROR(); 00242 } 00243 00244 if (!(retval = (ULONG_PTR)GlobalAlloc(GMEM_FIXED, cbData))) 00245 MSGERROR(); 00246 00247 Status = NtUserCreateLocalMemHandle(hMem, (LPBYTE)retval, cbData, NULL); 00248 if (!NT_SUCCESS(Status)) { 00249 RIPMSG0(RIP_WARNING, "__CreateLocalMemHandle server returned failure\n"); 00250 UserGlobalFree((HANDLE)retval); 00251 MSGERROR(); 00252 } 00253 00254 ERRORTRAP(0); 00255 ENDCALL(HANDLE); 00256 }

BOOL CreateMDIChild PSHORTCREATE  pcs,
LPMDICREATESTRUCT  pmcs,
DWORD  dwExpWinVerAndFlags,
HMENU *  phSysMenu,
PWND  pwndParent
 

Definition at line 2794 of file mdiwin.c.

References BOOL, CHILDSYSMENU, CKIDS, tagSHORTCREATE::cx, tagSHORTCREATE::cy, FALSE, FIRST, tagSHORTCREATE::hMenu, IsWindow(), L, MAXED, MDICheckCascadeRect(), NtUserMinMaximize(), NULL, PSHORTCREATE, SendMessage(), tagSHORTCREATE::style, TRUE, VER40, WS_MDIALLOWED, WS_MDISTYLE, tagSHORTCREATE::x, xxxLoadSysMenu(), and tagSHORTCREATE::y.

Referenced by _CreateWindowEx().

02800 { 02801 BOOL fVisible; 02802 RECT rcT; 02803 HMENU hSysMenu = NULL; 02804 HWND hwndPrevMaxed; 02805 PMDI pmdi; 02806 02807 /* 02808 * Get a pointer to the MDI structure 02809 */ 02810 pmdi = ((PMDIWND)(pwndParent))->pmdi; 02811 02812 pmcs->style = psc->style; 02813 02814 // Mask off ignored style bits and add required ones. 02815 psc->style |= (WS_CHILD | WS_CLIPSIBLINGS); 02816 if (!(pwndParent->style & MDIS_ALLCHILDSTYLES)) 02817 { 02818 psc->style &= WS_MDIALLOWED; 02819 psc->style |= (WS_MDISTYLE | WS_VISIBLE); 02820 } 02821 else if (psc->style & WS_POPUP) 02822 { 02823 RIPMSG0(RIP_ERROR, "CreateWindowEx: WS_POPUP not allowed on MDI children"); 02824 if (LOWORD(dwExpWinVerAndFlags) >= VER40) 02825 return FALSE; 02826 } 02827 02828 fVisible = ((psc->style & WS_VISIBLE) != 0L); 02829 02830 // 02831 // Save ORIGINAL parameters in MDICREATESTRUCT. This is for 02832 // compatibility with old WM_MDICREATE. 02833 // 02834 pmcs->x = rcT.left = psc->x; 02835 pmcs->y = rcT.top = psc->y; 02836 pmcs->cx = rcT.right = psc->cx; 02837 pmcs->cy = rcT.bottom = psc->cy; 02838 02839 MDICheckCascadeRect(pwndParent, &rcT); 02840 02841 // 02842 // Setup creation coords 02843 // 02844 psc->x = rcT.left; 02845 psc->y = rcT.top; 02846 psc->cx = rcT.right; 02847 psc->cy = rcT.bottom; 02848 02849 // Load the system menu 02850 if (psc->style & WS_SYSMENU) { 02851 hSysMenu = xxxLoadSysMenu(CHILDSYSMENU); 02852 if (hSysMenu == NULL) { 02853 return FALSE; 02854 } 02855 } 02856 02857 02858 // The window got created ok: now restore the current maximized window 02859 // so we can maximize ourself in its place. 02860 hwndPrevMaxed = MAXED(pmdi); 02861 if (fVisible && IsWindow(hwndPrevMaxed)) 02862 { 02863 if (psc->style & WS_MAXIMIZE) 02864 SendMessage(hwndPrevMaxed, WM_SETREDRAW, (WPARAM)FALSE, 0L); 02865 02866 // we could nuke the hwndPrevMaxed during the SendMessage32 02867 // so recheck just in case, B#11122, [t-arthb] 02868 02869 if ( IsWindow(hwndPrevMaxed) ) 02870 { 02871 NtUserMinMaximize(hwndPrevMaxed, SW_SHOWNORMAL, TRUE); 02872 02873 if ( psc->style & WS_MAXIMIZE ) 02874 SendMessage(hwndPrevMaxed, WM_SETREDRAW, (WPARAM)TRUE, 0L); 02875 } 02876 02877 } 02878 02879 // Set the proper Child Window ID for this MDI child. 02880 psc->hMenu = (HMENU)UIntToPtr( (FIRST(pmdi) + CKIDS(pmdi)) ); 02881 02882 *phSysMenu = hSysMenu; 02883 02884 return TRUE; 02885 }

HMENU CreateMenuFromResource LPBYTE   ) 
 

Definition at line 319 of file clmenu.c.

References MenuLoadChicagoTemplates(), MenuLoadWinTemplates(), NULL, and UINT.

Referenced by CommonLoadMenu(), and WowServerLoadCreateMenu().

00321 { 00322 HMENU hMenu = NULL; 00323 UINT menuTemplateVersion; 00324 UINT menuTemplateHeaderSize; 00325 00326 /* 00327 * Win3 menu resource: First, strip version number word out of the menu 00328 * template. This value should be 0 for Win3, 1 for win4. 00329 */ 00330 menuTemplateVersion = *((WORD *)lpMenuTemplate)++; 00331 if (menuTemplateVersion > 1) { 00332 RIPMSG0(RIP_WARNING, "Menu Version number > 1"); 00333 return NULL; 00334 } 00335 menuTemplateHeaderSize = *((WORD *)lpMenuTemplate)++; 00336 lpMenuTemplate += menuTemplateHeaderSize; 00337 switch (menuTemplateVersion) { 00338 case 0: 00339 MenuLoadWinTemplates(lpMenuTemplate, &hMenu); 00340 break; 00341 00342 case 1: 00343 MenuLoadChicagoTemplates((PMENUITEMTEMPLATE2)lpMenuTemplate, &hMenu, 0, 0); 00344 break; 00345 } 00346 return hMenu; 00347 }

PVOID CsValidateInstance HANDLE  hInst  ) 
 

WORD DbcsCombine HWND  ,
WORD 
 

Definition at line 4109 of file editec.c.

References msg.

Referenced by ComboBoxDBCharHandler(), MLChar(), SLChar(), and xxxLBoxCtlCharInput().

04110 { 04111 MSG msg; 04112 int i = 10; /* loop counter to avoid the infinite loop */ 04113 04114 while (!PeekMessageA(&msg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE)) { 04115 if (--i == 0) 04116 return 0; 04117 Sleep(1); 04118 } 04119 04120 return (WORD)ch | ((WORD)(msg.wParam) << 8); 04121 }

LRESULT DefDlgProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 460 of file dlgmgr.c.

References _FindDlgItem(), _GetDlgItem(), _GetNextDlgTabItem(), _IsChild(), _MonitorFromRect(), BOOL, CALLPROC_WOWCHECKPWW_DLG, CheckLock, ClearWindowState(), CopyRect, DefWindowProcWorker(), DF3DLOOK, DialogLookaside, DLGF_ANSI, DlgSetFocus(), DWORD, FALSE, FillWindow, FNID_COMBOBOX, FNID_DESKTOP, FNID_DIALOG, FNID_STATUS_BITS, FreeLookasideEntry(), FWINABLE, GetDlgItem(), GETFNID, GetFocus(), GetParentDialog(), GetWindowRect(), HW, HWq, IS_IME_ENABLED, IS_MIDEAST_ENABLED, IsInForegroundQueue, MB_DlgProcA(), MB_DlgProcW(), NotifyWinEvent(), NtUserCallHwndParam(), NtUserMessageBeep, NtUserSetCursorPos, NtUserSetThreadState(), NtUserSetWindowLongPtr, NtUserSetWindowPos(), NtUserShowCursor, NULL, PDIALOG, PDLG, PostMessage(), PUSIF_SNAPTO, QF_DIALOGACTIVE, tagWND::rcWindow, REBASEPWND, ReleaseEditDS(), RepositionRect(), ResizeDlgMessage(), RevalidateHwnd, SendMessage(), SetWindowState(), TEST_PUSIF, TestWF, ThreadLock, ThreadLockAlways, ThreadUnlock, TRUE, UINT, VALIDATECLASSANDSIZE, ValidateDialogPwnd(), ValidateHwnd, ValidateHwndNoRip(), WEFCONTROLPARENT, WFDIALOGWINDOW, WFDISABLED, WFWIN40COMPAT, xxxCheckDefPushButton(), xxxRestoreDlgFocus(), and xxxSaveDlgFocus().

Referenced by DefDlgProcA(), and DefDlgProcW().

00466 { 00467 HWND hwnd = HWq(pwnd); 00468 TL tlpwndT1, tlpwndT2, tlpwndT3, tlpwndTop; 00469 PWND pwndT; 00470 PWND pwndT1, pwndT2, pwndT3, pwndTop; 00471 HWND hwndT1; 00472 LRESULT result; 00473 BOOL fSetBit; 00474 DLGPROC pfn; 00475 00476 CheckLock(pwnd); 00477 00478 /* 00479 * use the Win 3.1 documented size 00480 */ 00481 VALIDATECLASSANDSIZE(pwnd, FNID_DIALOG); 00482 00483 /* 00484 * Must do special validation here to make sure pwnd is a dialog window. 00485 */ 00486 if (!ValidateDialogPwnd(pwnd)) 00487 return 0; 00488 00489 if (((PDIALOG)pwnd)->resultWP != 0) 00490 NtUserSetWindowLongPtr(hwnd, DWLP_MSGRESULT, 0, FALSE); 00491 result = 0; // no dialog proc 00492 00493 if (message == WM_FINALDESTROY) { 00494 goto DoCleanup; 00495 } 00496 00497 if ((pfn = PDLG(pwnd)->lpfnDlg) != NULL) { 00498 /* Bug 234292 - joejo 00499 * Since the called window/dialog proc may have a different calling 00500 * convention, we must wrap the call and, check esp and replace with 00501 * a good esp when the call returns. This is what UserCallWinProc* does. 00502 */ 00503 result = CALLPROC_WOWCHECKPWW_DLG(pfn, hwnd, message, wParam, lParam, &(pwnd->state)); 00504 00505 /* 00506 * Get out if the window was destroyed in the dialog proc. 00507 */ 00508 if ((RevalidateHwnd(hwnd)==NULL) || (pwnd->fnid & FNID_STATUS_BITS)) 00509 return result; 00510 } 00511 00512 /* 00513 * SPECIAL CASED ... and DOCUMENTED that way !!! 00514 * These 6, and ONLY these 6, should be hacked in this fashion. 00515 * Anybody who needs the REAL return value to a message should 00516 * use SetDlgMsgResult in WINDOWSX.H 00517 */ 00518 00519 switch (message) 00520 { 00521 case WM_COMPAREITEM: 00522 case WM_VKEYTOITEM: 00523 case WM_CHARTOITEM: 00524 case WM_INITDIALOG: 00525 case WM_QUERYDRAGICON: 00526 return ((LRESULT)(DWORD)result); 00527 00528 case WM_CTLCOLOR: 00529 case WM_CTLCOLORMSGBOX: 00530 case WM_CTLCOLOREDIT: 00531 case WM_CTLCOLORLISTBOX: 00532 case WM_CTLCOLORBTN: 00533 case WM_CTLCOLORDLG: 00534 case WM_CTLCOLORSCROLLBAR: 00535 case WM_CTLCOLORSTATIC: 00536 // QuarkXPress doesn't like finding the WM_CTLCOLOR result in 00537 // resultWP -- we should never be setting resultWP -- that's meant 00538 // as a pass-thru return value -- so let's go back to doing it the 00539 // old way -- Win95B B#21269 -- 03/13/95 -- tracysh (cr: jeffbog) 00540 if (result) 00541 return result; 00542 break; 00543 } 00544 00545 if (!result) { 00546 00547 /* 00548 * Save the result value in case our private memory is freed 00549 * before we return 00550 */ 00551 // result = PDLG(pwnd)->resultWP; 00552 00553 switch (message) { 00554 case WM_CTLCOLOR: 00555 case WM_CTLCOLORMSGBOX: 00556 case WM_CTLCOLOREDIT: 00557 case WM_CTLCOLORLISTBOX: 00558 case WM_CTLCOLORBTN: 00559 case WM_CTLCOLORDLG: 00560 case WM_CTLCOLORSCROLLBAR: 00561 case WM_CTLCOLORSTATIC: 00562 { 00563 // 00564 // HACK OF DEATH: 00565 // To get 3D colors for non 4.0 apps who use 3DLOOK, 00566 // we temporarily add on the 4.0 compat bit, pass this 00567 // down to DWP, and clear it. 00568 // 00569 // Use "result" var for bool saying we have to add/clear 4.0 00570 // compat bit. 00571 00572 fSetBit = (TestWF(pwnd, DF3DLOOK)!= 0) && 00573 (TestWF(pwnd, WFWIN40COMPAT) == 0); 00574 00575 if (fSetBit) 00576 SetWindowState(pwnd, WFWIN40COMPAT); 00577 00578 result = DefWindowProcWorker(pwnd, message, 00579 wParam, lParam, fAnsi); 00580 00581 if (fSetBit) 00582 ClearWindowState(pwnd, WFWIN40COMPAT); 00583 return result; 00584 } 00585 00586 case WM_ERASEBKGND: 00587 FillWindow(hwnd, hwnd, (HDC)wParam, (HBRUSH)CTLCOLOR_DLG); 00588 return TRUE; 00589 00590 case WM_SHOWWINDOW: 00591 00592 /* 00593 * If hiding the window, save the focus. If showing the window 00594 * by means of a SW_* command and the fEnd bit is set, do not 00595 * pass to DWP so it won't get shown. 00596 */ 00597 if (GetParentDialog(pwnd) == pwnd) { 00598 if (!wParam) { 00599 xxxSaveDlgFocus(pwnd); 00600 } else { 00601 00602 if (LOWORD(lParam) != 0 && PDLG(pwnd)->fEnd) 00603 break; 00604 00605 /* 00606 * Snap the cursor to the center of the default button. 00607 * Only do this if the current thread is in the foreground. 00608 * The _ShowCursor() code is added to work around a 00609 * problem with hardware cursors. If change is done 00610 * in the same refresh cycle, the display of the cursor 00611 * would not reflect the new position. 00612 */ 00613 if (TEST_PUSIF(PUSIF_SNAPTO) && 00614 IsInForegroundQueue(hwnd)) { 00615 hwndT1 = GetDlgItem(hwnd, (int)PDLG(pwnd)->result); 00616 if (hwndT1) { 00617 RECT rc; 00618 00619 NtUserShowCursor(FALSE); 00620 00621 GetWindowRect(hwndT1, &rc); 00622 NtUserSetCursorPos(rc.left + ((rc.right - rc.left)/2), 00623 rc.top + ((rc.bottom - rc.top)/2)); 00624 00625 NtUserShowCursor(TRUE); 00626 } 00627 } 00628 } 00629 } 00630 goto CallDWP; 00631 00632 case WM_SYSCOMMAND: 00633 if (GetParentDialog(pwnd) == pwnd) { 00634 /* 00635 * If hiding the window, save the focus. If showing the window 00636 * by means of a SW_* command and the fEnd bit is set, do not 00637 * pass to DWP so it won't get shown. 00638 */ 00639 if ((int)wParam == SC_MINIMIZE) 00640 xxxSaveDlgFocus(pwnd); 00641 } 00642 goto CallDWP; 00643 00644 case WM_ACTIVATE: 00645 pwndT1 = GetParentDialog(pwnd); 00646 if ( pwndT1 != pwnd) { 00647 00648 /* 00649 * This random bit is used during key processing - bit 00650 * 08000000 of WM_CHAR messages is set if a dialog is currently 00651 * active. 00652 */ 00653 NtUserSetThreadState(wParam ? QF_DIALOGACTIVE : 0, QF_DIALOGACTIVE); 00654 } 00655 00656 ThreadLock(pwndT1, &tlpwndT1); 00657 if (wParam != 0) 00658 xxxRestoreDlgFocus(pwndT1); 00659 else 00660 xxxSaveDlgFocus(pwndT1); 00661 00662 ThreadUnlock(&tlpwndT1); 00663 break; 00664 00665 case WM_SETFOCUS: 00666 pwndT1 = GetParentDialog(pwnd); 00667 if (!PDLG(pwndT1)->fEnd && !xxxRestoreDlgFocus(pwndT1)) { 00668 00669 pwndT = _GetNextDlgTabItem(pwndT1, NULL, FALSE); 00670 DlgSetFocus(HW(pwndT)); 00671 } 00672 break; 00673 00674 case WM_CLOSE: 00675 /* 00676 * Make sure cancel button is not disabled before sending the 00677 * IDCANCEL. Note that we need to do this as a message instead 00678 * of directly calling the dlg proc so that any dialog box 00679 * filters get this. 00680 */ 00681 pwndT1 = _GetDlgItem(pwnd, IDCANCEL); 00682 if (pwndT1 && TestWF(pwndT1, WFDISABLED)) 00683 NtUserMessageBeep(0); 00684 else 00685 PostMessage(hwnd, WM_COMMAND, MAKELONG(IDCANCEL, BN_CLICKED), 00686 (LPARAM)HW(pwndT1)); 00687 break; 00688 00689 case WM_NCDESTROY: 00690 case WM_FINALDESTROY: 00691 DoCleanup: 00692 NtUserSetThreadState(0, QF_DIALOGACTIVE); 00693 if (!(pwnd->style & DS_LOCALEDIT)) { 00694 if (PDLG(pwnd)->hData) { 00695 ReleaseEditDS(PDLG(pwnd)->hData); 00696 PDLG(pwnd)->hData = NULL; 00697 } 00698 } 00699 00700 /* 00701 * Delete the user defined font if any 00702 */ 00703 if (PDLG(pwnd)->hUserFont) { 00704 DeleteObject(PDLG(pwnd)->hUserFont); 00705 PDLG(pwnd)->hUserFont = NULL; 00706 } 00707 00708 /* 00709 * Free the dialog memory and mark this as a non-dialog window 00710 */ 00711 FreeLookasideEntry(&DialogLookaside, PDLG(pwnd)); 00712 NtUserCallHwndParam(hwnd, 0, SFI_SETDIALOGPOINTER); 00713 break; 00714 00715 case DM_REPOSITION: 00716 { 00717 RECT rc; 00718 PMONITOR pMonitor; 00719 00720 // DAT recorder APP sends it's own private message 0x402 00721 // through and we mistake it to be DM_REPOSITION. To avoid 00722 // this confusion, we do the following check. 00723 // Fix for Bug#25747 -- 9/29/94 -- 00724 if (!TestWF(pwnd, WEFCONTROLPARENT) || 00725 (GETFNID(pwnd) != FNID_DESKTOP && 00726 GETFNID(REBASEPWND(pwnd, spwndParent)) != FNID_DESKTOP)) { 00727 00728 goto CallDWP; 00729 } 00730 00731 CopyRect(&rc, &pwnd->rcWindow); 00732 pMonitor = _MonitorFromRect(&rc, MONITOR_DEFAULTTOPRIMARY); 00733 RepositionRect(pMonitor, &rc, pwnd->style, pwnd->ExStyle); 00734 NtUserSetWindowPos(hwnd, HWND_TOP, rc.left, rc.top, 00735 rc.right-rc.left, rc.bottom-rc.top, 00736 SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); 00737 } 00738 break; 00739 00740 case DM_SETDEFID: 00741 pwndT1 = GetParentDialog(pwnd); 00742 ThreadLock(pwndT1, &tlpwndT1); 00743 00744 if (!(PDLG(pwndT1)->fEnd)) { 00745 00746 pwndT2 = NULL; 00747 if (PDLG(pwndT1)->result != 0) 00748 pwndT2 = _FindDlgItem(pwndT1, (int)PDLG(pwndT1)->result); 00749 00750 pwndT3 = NULL; 00751 if (wParam != 0) { 00752 pwndT3 = _GetDlgItem(pwnd, (UINT)wParam); 00753 } 00754 00755 ThreadLock(pwndT2, &tlpwndT2); 00756 ThreadLock(pwndT3, &tlpwndT3); 00757 00758 xxxCheckDefPushButton(pwndT1, HW(pwndT2), HW(pwndT3)); 00759 00760 ThreadUnlock(&tlpwndT3); 00761 ThreadUnlock(&tlpwndT2); 00762 00763 PDLG(pwndT1)->result = (UINT)wParam; 00764 // if (PDLG(pwnd)->spwndFocusSave) { 00765 // Lock(&(PDLG(pwnd)->spwndFocusSave), pwndT2); 00766 // } 00767 00768 if (FWINABLE()) { 00769 NotifyWinEvent(EVENT_OBJECT_DEFACTIONCHANGE, HW(pwndT1), OBJID_CLIENT, INDEXID_CONTAINER); 00770 } 00771 } 00772 ThreadUnlock(&tlpwndT1); 00773 return TRUE; 00774 00775 case DM_GETDEFID: 00776 pwndT1 = GetParentDialog(pwnd); 00777 00778 if (!PDLG(pwndT1)->fEnd && PDLG(pwndT1)->result) 00779 return(MAKELONG(PDLG(pwndT1)->result, DC_HASDEFID)); 00780 else 00781 return 0; 00782 break; 00783 00784 /* 00785 * This message was added so that user defined controls that want 00786 * tab keys can pass the tab off to the next/previous control in the 00787 * dialog box. Without this, all they could do was set the focus 00788 * which didn't do the default button stuff. 00789 */ 00790 case WM_NEXTDLGCTL: 00791 pwndTop = GetParentDialog(pwnd); 00792 ThreadLock(pwndTop, &tlpwndTop); 00793 00794 hwndT1 = GetFocus(); 00795 pwndT2 = ValidateHwndNoRip(hwndT1); 00796 if (LOWORD(lParam)) { 00797 if (pwndT2 == NULL) 00798 pwndT2 = pwndTop; 00799 00800 /* 00801 * wParam contains the pwnd of the ctl to set focus to. 00802 */ 00803 if ((pwndT1 = ValidateHwnd((HWND)wParam)) == NULL) { 00804 ThreadUnlock(&tlpwndTop); 00805 return TRUE; 00806 } 00807 } else { 00808 if (pwndT2 == NULL) { 00809 00810 /* 00811 * Set focus to the first tab item. 00812 */ 00813 pwndT1 = _GetNextDlgTabItem(pwndTop, NULL, FALSE); 00814 pwndT2 = pwndTop; 00815 } else { 00816 00817 /* 00818 * If window with focus not a dlg ctl, ignore message. 00819 */ 00820 if (!_IsChild(pwndTop, pwndT2)) { 00821 ThreadUnlock(&tlpwndTop); 00822 return TRUE; 00823 } 00824 /* 00825 * wParam = TRUE for previous, FALSE for next 00826 */ 00827 pwndT1 = _GetNextDlgTabItem(pwndTop, pwndT2, (wParam != 0)); 00828 00829 /* 00830 * If there is no next item, ignore the message. 00831 */ 00832 if (pwndT1 == NULL) { 00833 ThreadUnlock(&tlpwndTop); 00834 return TRUE; 00835 } 00836 } 00837 } 00838 00839 ThreadLock(pwndT1, &tlpwndT1); 00840 ThreadLock(pwndT2, &tlpwndT2); 00841 00842 DlgSetFocus(HW(pwndT1)); 00843 xxxCheckDefPushButton(pwndTop, HW(pwndT2), HW(pwndT1)); 00844 00845 ThreadUnlock(&tlpwndT2); 00846 ThreadUnlock(&tlpwndT1); 00847 ThreadUnlock(&tlpwndTop); 00848 00849 return TRUE; 00850 00851 case WM_ENTERMENULOOP: 00852 00853 /* 00854 * We need to pop up the combo box window if the user brings 00855 * down a menu. 00856 * 00857 * ... FALL THROUGH... 00858 */ 00859 00860 case WM_LBUTTONDOWN: 00861 case WM_NCLBUTTONDOWN: 00862 hwndT1 = GetFocus(); 00863 if (hwndT1 != NULL) { 00864 pwndT1 = ValidateHwndNoRip(hwndT1); 00865 00866 if (GETFNID(pwndT1) == FNID_COMBOBOX) { 00867 00868 /* 00869 * If user clicks anywhere in dialog box and a combo box (or 00870 * the editcontrol of a combo box) has the focus, then hide 00871 * it's listbox. 00872 */ 00873 ThreadLockAlways(pwndT1, &tlpwndT1); 00874 SendMessage(HWq(pwndT1), CB_SHOWDROPDOWN, FALSE, 0); 00875 ThreadUnlock(&tlpwndT1); 00876 00877 } else { 00878 PWND pwndParent; 00879 00880 /* 00881 * It's a subclassed combo box. See if the listbox and edit 00882 * boxes exist (this is a very cheezy evaluation - what if 00883 * these controls are subclassed too? NOTE: Not checking 00884 * for EditWndProc: it's a client proc address. 00885 */ 00886 pwndParent = REBASEPWND(pwndT1, spwndParent); 00887 if (GETFNID(pwndParent) == FNID_COMBOBOX) { 00888 pwndT1 = pwndParent; 00889 ThreadLock(pwndT1, &tlpwndT1); 00890 SendMessage(HWq(pwndT1), CB_SHOWDROPDOWN, FALSE, 0); 00891 ThreadUnlock(&tlpwndT1); 00892 } 00893 } 00894 } 00895 00896 /* 00897 * Always send the message off to DefWndProc 00898 */ 00899 goto CallDWP; 00900 00901 case WM_GETFONT: 00902 return (LRESULT)PDLG(pwnd)->hUserFont; 00903 00904 case WM_VKEYTOITEM: 00905 case WM_COMPAREITEM: 00906 case WM_CHARTOITEM: 00907 case WM_INITDIALOG: 00908 00909 /* 00910 * We need to return the 0 the app may have returned for these 00911 * items instead of calling defwindow proc. 00912 */ 00913 return result; 00914 00915 case WM_NOTIFYFORMAT: 00916 if (lParam == NF_QUERY) 00917 return((PDLG(pwnd)->flags & DLGF_ANSI ) ? NFR_ANSI : NFR_UNICODE); 00918 return result; 00919 00920 case WM_INPUTLANGCHANGEREQUEST: 00921 if (IS_IME_ENABLED() || IS_MIDEAST_ENABLED()) { 00922 /* 00923 * #115190 00924 * For dialogbox itself, buttons/static controls on top of 00925 * dialogbox, we'll simply discard this message. B#3843-win95c 00926 */ 00927 break; 00928 } 00929 if (PDLG(pwnd)->lpfnDlg == MB_DlgProcA || 00930 PDLG(pwnd)->lpfnDlg == MB_DlgProcW) { 00931 break; 00932 } 00933 goto CallDWP; 00934 00935 default: 00936 CallDWP: 00937 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00938 } 00939 } else if ((message == WM_SHOWWINDOW) && result) { 00940 00941 /* 00942 * For a visible-case we want to snap the cursor regardless of 00943 * what was returned from the dialog-handler on the client. If 00944 * we're going visible, snap the cursor to the dialog-button. 00945 */ 00946 if (GetParentDialog(pwnd) == pwnd) { 00947 00948 if (wParam && ((LOWORD(lParam) == 0) || !PDLG(pwnd)->fEnd)) { 00949 00950 /* 00951 * Snap the cursor to the center of the default button. 00952 * Only do this if the current thread is in the foreground. 00953 * The _ShowCursor() code is added to work around a 00954 * problem with hardware cursors. If change is done 00955 * in the same refresh cycle, the display of the cursor 00956 * would not reflect the new position. 00957 */ 00958 if (TEST_PUSIF(PUSIF_SNAPTO) && 00959 IsInForegroundQueue(hwnd)) { 00960 hwndT1 = GetDlgItem(hwnd, (int)PDLG(pwnd)->result); 00961 if (hwndT1) { 00962 RECT rc; 00963 00964 NtUserShowCursor(FALSE); 00965 00966 GetWindowRect(hwndT1, &rc); 00967 NtUserSetCursorPos(rc.left + ((rc.right - rc.left)/2), 00968 rc.top + ((rc.bottom - rc.top)/2)); 00969 00970 NtUserShowCursor(TRUE); 00971 } 00972 } 00973 } 00974 } 00975 } 00976 00977 00978 /* 00979 * If this is still marked as a dialog window then return the real 00980 * result. Otherwise, we've already processed the WM_NCDESTROY message 00981 * and freed our private memory so return the stored value. 00982 */ 00983 if (TestWF(pwnd, WFDIALOGWINDOW)) 00984 return KERNEL_LRESULT_TO_LRESULT(((PDIALOG)pwnd)->resultWP); 00985 else 00986 return result; 00987 }

LRESULT DefWindowProcWorker PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 574 of file clmsg.c.

References _GetClientRect(), _GetDesktopWindow(), BOOL, BYTE, CHAR, CsSendMessage, DO_DROPFILE, DWORD, FALSE, FDEFWINDOWMSG, FindNCHit(), FNID_DEFWINDOWPROC, fpImmGetCompositionStringA, fpImmGetCompositionStringW, fpImmGetContext, fpImmGetDefaultIMEWnd, fpImmReleaseContext, GET_X_LPARAM, GET_Y_LPARAM, GETAPPVER, GetChildParent, GetClientInfo, GetMouseKeyState(), GETPTI, gpsi, tagIMEUI::hIMC, HW, HWq, ImeWndProcWorker(), L, _LARGE_UNICODE_STRING::Length, LoadIconW(), min, NULL, NULL_HIMC, PIMEUI, PIMEWND, ppos, tagWND::rcClient, REBASE, REBASEPTR, REBASEPWND, RtlUnicodeToMultiByteSize(), SendMessageWorker(), SetTaskmanWindow(), SHORT, tagWND::spwndOwner, tagWND::spwndParent, tagWND::strName, SYS_ALTERNATE, SYSHBRUSH, SYSRGB, TEST_KbdCuesPUSIF, TestWF, TestwndChild, THREAD_CODEPAGE, TIF_DISABLEIME, TRUE, UINT, tagSERVERINFO::uiShellMsg, UserLocalAlloc, UserLocalFree, ValidateHwndNoRip(), VER40, WEFPUIACCELHIDDEN, WEFPUIFOCUSHIDDEN, WFANSICREATOR, WFMAXIMIZED, WFMINIMIZED, WFSERVERSIDEPROC, WFWIN40COMPAT, and WINDOW.

Referenced by ButtonWndProcA(), ButtonWndProcW(), ButtonWndProcWorker(), ComboBoxWndProcA(), ComboBoxWndProcW(), ComboBoxWndProcWorker(), ComboListBoxWndProcA(), ComboListBoxWndProcW(), DefDlgProcWorker(), DefFrameProcWorker(), DefMDIChildProcWorker(), DefWindowProc(), DesktopWndProcWorker(), ECGetControlBrush(), ECImeComposition(), ECNcCreate(), EditWndProc(), EditWndProcA(), EditWndProcW(), GetWindowText(), GetWindowTextLength(), ImeWndProcWorker(), IsDialogMessageW(), ListBoxWndProcA(), ListBoxWndProcW(), ListBoxWndProcWorker(), MB_DlgProcWorker(), MDIClientWndProcWorker(), MenuWndProcWorker(), MLEditWndProc(), ScrollBarWndProcWorker(), SendMessageWorker(), SetWindowText(), SLEditWndProc(), and StaticWndProcWorker().

00580 { 00581 HWND hwnd = HWq(pwnd); 00582 int icolBack; 00583 int icolFore; 00584 PWND pwndParent; 00585 HWND hwndDefIme; 00586 PWND pwndDefIme; 00587 PIMEUI pimeui; 00588 00589 #if DBG 00590 if (!gfTurboDWP) { 00591 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00592 FNID_DEFWINDOWPROC, fAnsi); 00593 } else { 00594 #endif 00595 00596 00597 if (FDEFWINDOWMSG(message, DefWindowMsgs)) { 00598 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00599 FNID_DEFWINDOWPROC, fAnsi); 00600 } else if (!FDEFWINDOWMSG(message, DefWindowSpecMsgs)) { 00601 return 0; 00602 } 00603 00604 /* 00605 * Important: If you add cases to the switch statement below, 00606 * add the messages to server.c's gawDefWindowSpecMsgs. 00607 * Similarly if you add cases to dwp.c's DefWindowProc 00608 * which can come from the client, add the messages 00609 * to gawDefWindowMsgs. 00610 */ 00611 00612 switch (message) { 00613 00614 case WM_HELP: 00615 { 00616 PWND pwndDest; 00617 00618 /* 00619 * If this window is a child window, Help message must be passed on 00620 * to it's parent; Else, this must be passed on to the owner window. 00621 */ 00622 pwndDest = (TestwndChild(pwnd) ? pwnd->spwndParent : pwnd->spwndOwner); 00623 if (pwndDest) { 00624 pwndDest = REBASEPTR(pwnd, pwndDest); 00625 if (pwndDest != _GetDesktopWindow()) 00626 return SendMessageW(HWq(pwndDest), WM_HELP, wParam, lParam);; 00627 } 00628 return(0L); 00629 } 00630 00631 case WM_MOUSEWHEEL: 00632 if (TestwndChild(pwnd)) { 00633 pwndParent = REBASEPWND(pwnd, spwndParent); 00634 SendMessageW(HW(pwndParent), WM_MOUSEWHEEL, wParam, lParam); 00635 } 00636 break; 00637 00638 case WM_CONTEXTMENU: 00639 if (TestwndChild(pwnd)) { 00640 pwndParent = REBASEPWND(pwnd, spwndParent); 00641 SendMessageW(HW(pwndParent), WM_CONTEXTMENU, 00642 (WPARAM)hwnd, lParam); 00643 } 00644 break; 00645 00646 /* 00647 * Default handling for WM_CONTEXTMENU support 00648 */ 00649 case WM_RBUTTONUP: 00650 #ifdef USE_MIRRORING 00651 if (TestWF(pwnd, WEFLAYOUTRTL)) { 00652 lParam = MAKELONG(pwnd->rcClient.right - GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) + pwnd->rcClient.top); 00653 } else 00654 #endif 00655 { 00656 lParam = MAKELONG(GET_X_LPARAM(lParam) + pwnd->rcClient.left, GET_Y_LPARAM(lParam) + pwnd->rcClient.top); 00657 } 00658 SendMessageWorker(pwnd, WM_CONTEXTMENU, (WPARAM)hwnd, lParam, fAnsi); 00659 break; 00660 00661 case WM_APPCOMMAND: 00662 if (TestwndChild(pwnd)) { 00663 /* 00664 * Bubble the message to the parent 00665 */ 00666 pwndParent = REBASEPWND(pwnd, spwndParent); 00667 return SendMessageW(HW(pwndParent), WM_APPCOMMAND, wParam, lParam); 00668 } else { 00669 /* 00670 * Call the server side to send the shell hook HSHELL_APPCOMMAND 00671 */ 00672 return CsSendMessage(hwnd, WM_APPCOMMAND, wParam, lParam, 0L, FNID_DEFWINDOWPROC, fAnsi); 00673 } 00674 break; 00675 00676 /* 00677 * Default handling for WM_APPCOMMAND support 00678 */ 00679 case WM_NCXBUTTONUP: 00680 case WM_XBUTTONUP: 00681 { 00682 WORD cmd; 00683 WORD keystate; 00684 LPARAM lParamAppCommand; 00685 00686 switch (GET_XBUTTON_WPARAM(wParam)) { 00687 case XBUTTON1: 00688 cmd = APPCOMMAND_BROWSER_BACKWARD; 00689 break; 00690 00691 case XBUTTON2: 00692 cmd = APPCOMMAND_BROWSER_FORWARD; 00693 break; 00694 00695 default: 00696 cmd = 0; 00697 break; 00698 } 00699 00700 if (cmd == 0) { 00701 break; 00702 } 00703 00704 cmd |= FAPPCOMMAND_MOUSE; 00705 if (message == WM_XBUTTONUP) { 00706 keystate = GET_KEYSTATE_WPARAM(wParam); 00707 } else { 00708 keystate = GetMouseKeyState(); 00709 } 00710 00711 lParamAppCommand = MAKELPARAM(keystate, cmd); 00712 SendMessageWorker(pwnd, WM_APPCOMMAND, (WPARAM)hwnd, lParamAppCommand, fAnsi); 00713 break; 00714 } 00715 00716 case WM_WINDOWPOSCHANGED: { 00717 PWINDOWPOS ppos = (PWINDOWPOS)lParam; 00718 00719 if (!(ppos->flags & SWP_NOCLIENTMOVE)) { 00720 POINT pt = {pwnd->rcClient.left, pwnd->rcClient.top}; 00721 pwndParent = REBASEPWND(pwnd, spwndParent); 00722 00723 if (pwndParent != _GetDesktopWindow()) { 00724 pt.x -= pwndParent->rcClient.left; 00725 pt.y -= pwndParent->rcClient.top; 00726 } 00727 00728 SendMessageWorker(pwnd, WM_MOVE, FALSE, MAKELPARAM(pt.x, pt.y), fAnsi); 00729 } 00730 00731 if ((ppos->flags & SWP_STATECHANGE) || !(ppos->flags & SWP_NOCLIENTSIZE)) { 00732 UINT cmd; 00733 RECT rc; 00734 00735 if (TestWF(pwnd, WFMINIMIZED)) 00736 cmd = SIZEICONIC; 00737 else if (TestWF(pwnd, WFMAXIMIZED)) 00738 cmd = SIZEFULLSCREEN; 00739 else 00740 cmd = SIZENORMAL; 00741 00742 /* 00743 * HACK ALERT: 00744 * If the window is minimized then the real client width and height are 00745 * zero. But, in win3.1 they were non-zero. Under Chicago, PrintShop 00746 * Deluxe ver 1.2 hits a divide by zero. To fix this we fake the width 00747 * and height for old apps to be non-zero values. 00748 * GetClientRect does that job for us. 00749 */ 00750 _GetClientRect(pwnd, &rc); 00751 SendMessageWorker(pwnd, WM_SIZE, cmd, 00752 MAKELONG(rc.right - rc.left, 00753 rc.bottom - rc.top), fAnsi); 00754 } 00755 return 0; 00756 } 00757 00758 case WM_MOUSEACTIVATE: { 00759 PWND pwndT; 00760 LRESULT lt; 00761 00762 /* 00763 * GetChildParent returns either a kernel pointer or NULL. 00764 */ 00765 pwndT = GetChildParent(pwnd); 00766 if (pwndT != NULL) { 00767 pwndT = REBASEPTR(pwnd, pwndT); 00768 lt = SendMessageWorker(pwndT, WM_MOUSEACTIVATE, wParam, lParam, fAnsi); 00769 if (lt != 0) 00770 return lt; 00771 } 00772 00773 /* 00774 * Moving, sizing or minimizing? Activate AFTER we take action. 00775 */ 00776 return ((LOWORD(lParam) == HTCAPTION) && (HIWORD(lParam) == WM_LBUTTONDOWN )) ? 00777 (LONG)MA_NOACTIVATE : (LONG)MA_ACTIVATE; 00778 } 00779 00780 case WM_CTLCOLORSCROLLBAR: 00781 if ((gpsi->BitCount < 8) || 00782 (SYSRGB(3DHILIGHT) != SYSRGB(SCROLLBAR)) || 00783 (SYSRGB(3DHILIGHT) == SYSRGB(WINDOW))) 00784 { 00785 /* 00786 * Remove call to UnrealizeObject(). GDI Handles this for 00787 * brushes on NT. 00788 * 00789 * UnrealizeObject(ghbrGray); 00790 */ 00791 00792 SetBkColor((HDC)wParam, SYSRGB(3DHILIGHT)); 00793 SetTextColor((HDC)wParam, SYSRGB(3DFACE)); 00794 return((LRESULT)gpsi->hbrGray); 00795 } 00796 00797 icolBack = COLOR_3DHILIGHT; 00798 icolFore = COLOR_BTNTEXT; 00799 goto SetColor; 00800 00801 case WM_CTLCOLORBTN: 00802 if (pwnd == NULL) 00803 goto ColorDefault; 00804 00805 if (TestWF(pwnd, WFWIN40COMPAT)) { 00806 icolBack = COLOR_3DFACE; 00807 icolFore = COLOR_BTNTEXT; 00808 } else { 00809 goto ColorDefault; 00810 } 00811 goto SetColor; 00812 00813 case WM_CTLCOLORSTATIC: 00814 case WM_CTLCOLORDLG: 00815 case WM_CTLCOLORMSGBOX: 00816 // We want static controls in dialogs to have the 3D 00817 // background color, but statics in windows to inherit 00818 // their parents' background. 00819 00820 if (pwnd == NULL) 00821 goto ColorDefault; 00822 00823 if (TestWF(pwnd, WFWIN40COMPAT)) { 00824 icolBack = COLOR_3DFACE; 00825 icolFore = COLOR_WINDOWTEXT; 00826 goto SetColor; 00827 } 00828 // ELSE FALL THRU... 00829 00830 case WM_CTLCOLOR: // here for WOW only 00831 case WM_CTLCOLORLISTBOX: 00832 case WM_CTLCOLOREDIT: 00833 ColorDefault: 00834 icolBack = COLOR_WINDOW; 00835 icolFore = COLOR_WINDOWTEXT; 00836 00837 SetColor: 00838 { 00839 SetBkColor((HDC)wParam, gpsi->argbSystem[icolBack]); 00840 SetTextColor((HDC)wParam, gpsi->argbSystem[icolFore]); 00841 return (LRESULT)(SYSHBRUSH(icolBack)); 00842 } 00843 00844 case WM_NCHITTEST: 00845 return FindNCHit(pwnd, (LONG)lParam); 00846 00847 case WM_GETTEXT: 00848 if (wParam != 0) { 00849 00850 LPWSTR lpszText; 00851 UINT cchSrc; 00852 00853 if (pwnd->strName.Length) { 00854 00855 lpszText = REBASE(pwnd, strName.Buffer); 00856 cchSrc = (UINT)pwnd->strName.Length / sizeof(WCHAR); 00857 00858 if (fAnsi) { 00859 00860 LPSTR lpName = (LPSTR)lParam; 00861 00862 /* 00863 * Non-zero retval means some text to copy out. Do not 00864 * copy out more than the requested byte count 00865 * 'chMaxCount'. 00866 */ 00867 cchSrc = WCSToMB(lpszText, 00868 cchSrc, 00869 (LPSTR *)&lpName, 00870 (UINT)(wParam - 1), 00871 FALSE); 00872 00873 lpName[cchSrc] = '\0'; 00874 00875 } else { 00876 00877 LPWSTR lpwName = (LPWSTR)lParam; 00878 00879 cchSrc = min(cchSrc, (UINT)(wParam - 1)); 00880 RtlCopyMemory(lpwName, lpszText, cchSrc * sizeof(WCHAR)); 00881 lpwName[cchSrc] = 0; 00882 } 00883 00884 return cchSrc; 00885 } 00886 00887 /* 00888 * else Null terminate the text buffer since there is no text. 00889 */ 00890 if (fAnsi) { 00891 ((LPSTR)lParam)[0] = 0; 00892 } else { 00893 ((LPWSTR)lParam)[0] = 0; 00894 } 00895 } 00896 00897 return 0; 00898 00899 case WM_GETTEXTLENGTH: 00900 if (pwnd->strName.Length) { 00901 UINT cch; 00902 if (fAnsi) { 00903 RtlUnicodeToMultiByteSize(&cch, 00904 REBASE(pwnd, strName.Buffer), 00905 pwnd->strName.Length); 00906 } else { 00907 cch = pwnd->strName.Length / sizeof(WCHAR); 00908 } 00909 return cch; 00910 } 00911 return 0L; 00912 00913 case WM_QUERYDRAGICON: 00914 /* 00915 * If the window is WIN40COMPAT or has a kernel side procedure 00916 * do not attempt to look into the instance module 00917 */ 00918 if (TestWF(pwnd, WFWIN40COMPAT) || TestWF(pwnd, WFSERVERSIDEPROC)) { 00919 return 0; 00920 } 00921 /* 00922 * For old apps, like the VB3 ones, try to load the icon from resources 00923 * This is how Win95 does. 00924 */ 00925 return (LRESULT)LoadIconW(pwnd->hModule, MAKEINTRESOURCE(1)); 00926 00927 case WM_QUERYOPEN: 00928 case WM_QUERYENDSESSION: 00929 case WM_DEVICECHANGE: 00930 case WM_POWERBROADCAST: 00931 return TRUE; 00932 00933 case WM_KEYDOWN: 00934 if (wParam == VK_F10) { 00935 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00936 FNID_DEFWINDOWPROC, fAnsi); 00937 } 00938 break; 00939 00940 case WM_SYSKEYDOWN: 00941 if ((HIWORD(lParam) & SYS_ALTERNATE) || (wParam == VK_F10) || 00942 (wParam == VK_ESCAPE)) 00943 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00944 FNID_DEFWINDOWPROC, fAnsi); 00945 break; 00946 00947 case WM_CHARTOITEM: 00948 case WM_VKEYTOITEM: 00949 /* 00950 * Do default processing for keystrokes into owner draw listboxes. 00951 */ 00952 return -1; 00953 00954 case WM_ACTIVATE: 00955 if (LOWORD(wParam)) 00956 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00957 FNID_DEFWINDOWPROC, fAnsi); 00958 break; 00959 00960 case WM_SHOWWINDOW: 00961 if (lParam != 0) 00962 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00963 FNID_DEFWINDOWPROC, fAnsi); 00964 break; 00965 00966 case WM_DROPOBJECT: 00967 return DO_DROPFILE; 00968 00969 case WM_WINDOWPOSCHANGING: 00970 /* 00971 * If the window's size is changing, adjust the passed-in size 00972 */ 00973 #define ppos ((WINDOWPOS *)lParam) 00974 if (!(ppos->flags & SWP_NOSIZE)) 00975 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00976 FNID_DEFWINDOWPROC, fAnsi); 00977 #undef ppos 00978 break; 00979 00980 case WM_KLUDGEMINRECT: 00981 { 00982 SHELLHOOKINFO shi; 00983 LPRECT lprc = (LPRECT)lParam; 00984 00985 shi.hwnd = (HWND)wParam; 00986 shi.rc.left = MAKELONG(lprc->left, lprc->top); 00987 shi.rc.top = MAKELONG(lprc->right, lprc->bottom); 00988 00989 if (gpsi->uiShellMsg == 0) 00990 SetTaskmanWindow(NULL); 00991 if (SendMessageWorker(pwnd, gpsi->uiShellMsg, HSHELL_GETMINRECT, 00992 (LPARAM)&shi, fAnsi)) { 00993 // 00994 // Now convert the RECT back from two POINTS structures into two POINT 00995 // structures. 00996 // 00997 lprc->left = (SHORT)LOWORD(shi.rc.left); // Sign extend 00998 lprc->top = (SHORT)HIWORD(shi.rc.left); // Sign extend 00999 lprc->right = (SHORT)LOWORD(shi.rc.top); // Sign extend 01000 lprc->bottom = (SHORT)HIWORD(shi.rc.top); // Sign extend 01001 } 01002 break; 01003 } 01004 01005 case WM_NOTIFYFORMAT: 01006 if (lParam == NF_QUERY) 01007 return(TestWF(pwnd, WFANSICREATOR) ? NFR_ANSI : NFR_UNICODE); 01008 break; 01009 01010 case WM_IME_KEYDOWN: 01011 if (fAnsi) 01012 PostMessageA(hwnd, WM_KEYDOWN, wParam, lParam); 01013 else 01014 PostMessageW(hwnd, WM_KEYDOWN, wParam, lParam); 01015 break; 01016 01017 case WM_IME_KEYUP: 01018 if (fAnsi) 01019 PostMessageA(hwnd, WM_KEYUP, wParam, lParam); 01020 else 01021 PostMessageW(hwnd, WM_KEYUP, wParam, lParam); 01022 break; 01023 01024 case WM_IME_CHAR: 01025 //if (TestCF(pwnd, CFIME)) 01026 // break; 01027 01028 if ( fAnsi ) { 01029 if( IsDBCSLeadByteEx(THREAD_CODEPAGE(),(BYTE)(wParam >> 8)) ) { 01030 PostMessageA(hwnd, 01031 WM_CHAR, 01032 (WPARAM)((BYTE)(wParam >> 8)), // leading byte 01033 1L); 01034 PostMessageA(hwnd, 01035 WM_CHAR, 01036 (WPARAM)((BYTE)wParam), // trailing byte 01037 1L); 01038 } 01039 else 01040 PostMessageA(hwnd, 01041 WM_CHAR, 01042 (WPARAM)(wParam), 01043 1L); 01044 } else { 01045 PostMessageW(hwnd, WM_CHAR, wParam, 1L); 01046 } 01047 break; 01048 01049 case WM_IME_COMPOSITION: 01050 //if (TestCF(pwnd, CFIME)) 01051 // break; 01052 01053 if (lParam & GCS_RESULTSTR) { 01054 HIMC hImc; 01055 DWORD cbLen; 01056 01057 if ((hImc = fpImmGetContext(hwnd)) == NULL_HIMC) 01058 goto dwpime_ToIMEWnd_withchk; 01059 01060 if (fAnsi) { 01061 LPSTR pszBuffer, psz; 01062 01063 /* 01064 * ImmGetComposition returns the size of buffer needed in byte. 01065 */ 01066 if (!(cbLen = fpImmGetCompositionStringA(hImc, GCS_RESULTSTR, NULL, 0))) { 01067 fpImmReleaseContext(hwnd, hImc); 01068 goto dwpime_ToIMEWnd_withchk; 01069 } 01070 01071 pszBuffer = psz = (LPSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, 01072 cbLen + sizeof(CHAR)); 01073 01074 if (pszBuffer == NULL) { 01075 fpImmReleaseContext(hwnd, hImc); 01076 goto dwpime_ToIMEWnd_withchk; 01077 } 01078 01079 fpImmGetCompositionStringA(hImc, GCS_RESULTSTR, psz, cbLen); 01080 01081 while (*psz) { 01082 if (IsDBCSLeadByteEx(THREAD_CODEPAGE(),*psz)) { 01083 if (*(psz+1)) { 01084 SendMessageA( hwnd, 01085 WM_IME_CHAR, 01086 MAKEWPARAM(MAKEWORD(*(psz+1), *psz), 0), 01087 1L ); 01088 psz++; 01089 } 01090 psz++; 01091 } 01092 else 01093 SendMessageA( hwnd, 01094 WM_IME_CHAR, 01095 MAKEWPARAM(MAKEWORD(*(psz++), 0), 0), 01096 1L ); 01097 } 01098 01099 UserLocalFree(pszBuffer); 01100 01101 fpImmReleaseContext(hwnd, hImc); 01102 } 01103 else { 01104 LPWSTR pwszBuffer, pwsz; 01105 01106 /* 01107 * ImmGetComposition returns the size of buffer needed in byte 01108 */ 01109 if (!(cbLen = fpImmGetCompositionStringW(hImc, GCS_RESULTSTR, NULL, 0))) { 01110 fpImmReleaseContext(hwnd, hImc); 01111 goto dwpime_ToIMEWnd_withchk; 01112 } 01113 01114 pwszBuffer = pwsz = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, 01115 cbLen + sizeof(WCHAR)); 01116 01117 if (pwszBuffer == NULL) { 01118 fpImmReleaseContext(hwnd, hImc); 01119 goto dwpime_ToIMEWnd_withchk; 01120 } 01121 01122 fpImmGetCompositionStringW(hImc, GCS_RESULTSTR, pwsz, cbLen); 01123 01124 while (*pwsz) 01125 SendMessageW(hwnd, WM_IME_CHAR, MAKEWPARAM(*pwsz++, 0), 1L); 01126 01127 UserLocalFree(pwszBuffer); 01128 01129 fpImmReleaseContext(hwnd, hImc); 01130 } 01131 } 01132 01133 /* 01134 * Fall through to send to Default IME Window with checking 01135 * activated hIMC. 01136 */ 01137 01138 case WM_IME_STARTCOMPOSITION: 01139 case WM_IME_ENDCOMPOSITION: 01140 dwpime_ToIMEWnd_withchk: 01141 //if (TestCF(pwnd, CFIME)) 01142 // break; 01143 01144 if (GetClientInfo()->dwTIFlags & TIF_DISABLEIME) { 01145 break; 01146 } 01147 /* 01148 * We assume this Wnd uses DefaultIMEWindow. 01149 * If this window has its own IME window, it have to call 01150 * ImmIsUIMessage().... 01151 */ 01152 hwndDefIme = fpImmGetDefaultIMEWnd(hwnd); 01153 01154 if (hwndDefIme == hwnd) { 01155 /* 01156 * VC++ 1.51 TLW0NCL.DLL subclass IME class window 01157 * and pass IME messages to DefWindowProc(). 01158 */ 01159 RIPMSG1(RIP_WARNING, 01160 "IME Class window is hooked and IME message [%X] are sent to DefWindowProc", 01161 message); 01162 ImeWndProcWorker(pwnd, message, wParam, lParam, fAnsi); 01163 break; 01164 } 01165 01166 if ((pwndDefIme = ValidateHwndNoRip(hwndDefIme)) != NULL) { 01167 /* 01168 * If hImc of this window is not activated for IME window, 01169 * we don't send WM_IME_NOTIFY. 01170 */ 01171 pimeui = ((PIMEWND)pwndDefIme)->pimeui; 01172 if (pimeui->hIMC == fpImmGetContext(hwnd)) 01173 return SendMessageWorker(pwndDefIme, message, wParam, lParam, fAnsi); 01174 else 01175 RIPMSG1(RIP_WARNING, 01176 "DefWindowProc can not send WM_IME_message [%X] now", 01177 message); 01178 } 01179 break; 01180 01181 dwpime_ToTopLevel_withchk: 01182 //if (TestCF(pwnd, CFIME)) 01183 // break; 01184 01185 /* 01186 * We assume this Wnd uses DefaultIMEWindow. 01187 * If this window has its own IME window, it have to call 01188 * ImmIsUIMessage().... 01189 */ 01190 hwndDefIme = fpImmGetDefaultIMEWnd(hwnd); 01191 01192 if (hwndDefIme == hwnd) { 01193 /* 01194 * VC++ 1.51 TLW0NCL.DLL subclass IME class window 01195 * and pass IME messages to DefWindowProc(). 01196 */ 01197 RIPMSG1(RIP_WARNING, 01198 "IME Class window is hooked and IME message [%X] are sent to DefWindowProc", 01199 message); 01200 ImeWndProcWorker(pwnd, message, wParam, lParam, fAnsi); 01201 break; 01202 } 01203 01204 pwndDefIme = ValidateHwndNoRip(hwndDefIme); 01205 01206 if ((pwndDefIme = ValidateHwndNoRip(hwndDefIme)) != NULL) { 01207 PWND pwndT, pwndParent; 01208 01209 pwndT = pwnd; 01210 01211 while (TestwndChild(pwndT)) { 01212 pwndParent = REBASEPWND(pwndT, spwndParent); 01213 if (GETPTI(pwndParent) != GETPTI(pwnd)) 01214 break; 01215 pwndT = pwndParent; 01216 } 01217 01218 /* 01219 * If hImc of this window is not activated for IME window, 01220 * we don't send WM_IME_NOTIFY. 01221 */ 01222 if (pwndT != pwnd) { 01223 pimeui = ((PIMEWND)pwndDefIme)->pimeui; 01224 if (pimeui->hIMC == fpImmGetContext(hwnd)) 01225 return SendMessageWorker(pwndT, message, wParam, lParam, fAnsi); 01226 else 01227 RIPMSG1(RIP_WARNING, 01228 "DefWindowProc can not send WM_IME_message [%X] now", 01229 message); 01230 } 01231 else { 01232 /* 01233 * Review !! 01234 * If this is the toplevel window, we pass messages to 01235 * the default IME window... 01236 */ 01237 return SendMessageWorker(pwndDefIme, message, wParam, lParam, fAnsi); 01238 } 01239 } 01240 break; 01241 01242 case WM_IME_NOTIFY: 01243 switch (wParam) { 01244 case IMN_OPENSTATUSWINDOW: 01245 case IMN_CLOSESTATUSWINDOW: 01246 #ifndef WKWOK_DEBUG 01247 goto dwpime_ToIMEWnd_withchk; 01248 #endif 01249 goto dwpime_ToTopLevel_withchk; 01250 01251 default: 01252 goto dwpime_ToIMEWnd_withchk; 01253 } 01254 break; 01255 01256 case WM_IME_REQUEST: 01257 switch (wParam) { 01258 case IMR_QUERYCHARPOSITION: 01259 goto dwpime_ToIMEWnd_withchk; 01260 default: 01261 break; 01262 } 01263 break; 01264 01265 case WM_IME_SYSTEM: 01266 if (wParam == IMS_SETACTIVECONTEXT) { 01267 RIPMSG0(RIP_WARNING, "DefWindowProc received unexpected WM_IME_SYSTEM"); 01268 break; 01269 } 01270 01271 /* 01272 * IMS_SETOPENSTATUS is depended on the activated input context. 01273 * It needs to be sent to only the activated system window. 01274 */ 01275 if (wParam == IMS_SETOPENSTATUS) 01276 goto dwpime_ToIMEWnd_withchk; 01277 01278 /* 01279 * Fall through to send to Default IME Window. 01280 */ 01281 01282 case WM_IME_SETCONTEXT: 01283 //if (TestCF(pwnd, CFIME)) 01284 // break; 01285 01286 hwndDefIme = fpImmGetDefaultIMEWnd(hwnd); 01287 01288 if (hwndDefIme == hwnd) { 01289 /* 01290 * VC++ 1.51 TLW0NCL.DLL subclass IME class window 01291 * and pass IME messages to DefWindowProc(). 01292 */ 01293 RIPMSG1(RIP_WARNING, 01294 "IME Class window is hooked and IME message [%X] are sent to DefWindowProc", 01295 message); 01296 ImeWndProcWorker(pwnd, message, wParam, lParam, fAnsi); 01297 break; 01298 } 01299 01300 if ((pwndDefIme = ValidateHwndNoRip(hwndDefIme)) != NULL) 01301 return SendMessageWorker(pwndDefIme, message, wParam, lParam, fAnsi); 01302 01303 break; 01304 01305 case WM_IME_SELECT: 01306 RIPMSG0(RIP_WARNING, "DefWindowProc should not receive WM_IME_SELECT"); 01307 break; 01308 01309 case WM_IME_COMPOSITIONFULL: 01310 //if (TestCF(pwnd, CFIME)) 01311 // break; 01312 01313 if (GETAPPVER() < VER40) { 01314 /* 01315 * This is a temporary solution for win31app. 01316 * FEREVIEW: For M5 this will call WINNLS message mapping logic 01317 * -yutakan 01318 */ 01319 return SendMessageWorker(pwnd, WM_IME_REPORT, 01320 IR_FULLCONVERT, (LPARAM)0L, fAnsi); 01321 } 01322 break; 01323 01324 case WM_CHANGEUISTATE: 01325 { 01326 WORD wAction = LOWORD(wParam); 01327 WORD wFlags = HIWORD(wParam); 01328 BOOL bRealChange = FALSE; 01329 01330 if (wFlags & ~UISF_VALID || wAction > UIS_LASTVALID || 01331 lParam || !TEST_KbdCuesPUSIF) { 01332 return 0; 01333 } 01334 01335 if (wAction == UIS_INITIALIZE) { 01336 if (gpsi->bLastRITWasKeyboard) { 01337 wAction = UIS_CLEAR; 01338 } else { 01339 wAction = UIS_SET; 01340 } 01341 wFlags = UISF_HIDEFOCUS | UISF_HIDEACCEL; 01342 wParam = MAKEWPARAM(wAction, wFlags); 01343 } 01344 01345 UserAssert(wAction == UIS_SET || wAction == UIS_CLEAR); 01346 /* 01347 * If the state is not going to change, there's nothing to do here 01348 */ 01349 if (wFlags & UISF_HIDEFOCUS) { 01350 bRealChange = (!!TestWF(pwnd, WEFPUIFOCUSHIDDEN)) ^ (wAction == UIS_SET); 01351 } 01352 if (wFlags & UISF_HIDEACCEL) { 01353 bRealChange |= (!!TestWF(pwnd, WEFPUIACCELHIDDEN)) ^ (wAction == UIS_SET); 01354 } 01355 01356 if (!bRealChange) { 01357 break; 01358 } 01359 /* 01360 * Children pass this message up 01361 * Top level windows update send down to themselves WM_UPDATEUISTATE. 01362 * WM_UPDATEUISTATE will change the state bits and broadcast down the message 01363 */ 01364 if (TestwndChild(pwnd)) { 01365 01366 return SendMessageWorker(REBASEPWND(pwnd, spwndParent), WM_CHANGEUISTATE, 01367 wParam, lParam, fAnsi); 01368 } else { 01369 return SendMessageWorker(pwnd, WM_UPDATEUISTATE, wParam, lParam, fAnsi); 01370 } 01371 01372 } 01373 break; 01374 01375 case WM_QUERYUISTATE: 01376 return (TestWF(pwnd, WEFPUIFOCUSHIDDEN) ? UISF_HIDEFOCUS : 0) | 01377 (TestWF(pwnd, WEFPUIACCELHIDDEN) ? UISF_HIDEACCEL : 0); 01378 break; 01379 } 01380 01381 return 0; 01382 01383 #if DBG 01384 } // gfTurboDWP 01385 #endif 01386 }

LRESULT APIENTRY DesktopWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 99 of file clmsg.c.

References DesktopWndProcWorker(), and TRUE.

Referenced by ClientThreadSetup().

00104 { 00105 return DesktopWndProcWorker(hwnd, message, wParam, lParam, TRUE); 00106 }

LRESULT APIENTRY DesktopWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 108 of file clmsg.c.

References DesktopWndProcWorker(), and FALSE.

Referenced by ClientThreadSetup().

00113 { 00114 return DesktopWndProcWorker(hwnd, message, wParam, lParam, FALSE); 00115 }

LRESULT DispatchClientMessage PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  pfn
 

Definition at line 2822 of file client.c.

References CALLPROC_WOWCHECKPWW, GetClientInfo, and ValidateHwndNoRip().

Referenced by ClientThreadSetup().

02828 { 02829 HWND hwnd = GetClientInfo()->CallbackWnd.hwnd; 02830 02831 /* 02832 * Assert that the header comment is legit (must be). 02833 * for WM_TIMERs not associated to a window, pwnd can be NULL. So 02834 * don't rip validating the handle. 02835 */ 02836 UserAssert(pwnd == ValidateHwndNoRip(hwnd)); 02837 02838 /* 02839 * Add assert to catch dispatching messages to a thread not associated 02840 * with a desktop. 02841 */ 02842 UserAssert(GetClientInfo()->ulClientDelta != 0); 02843 02844 /* 02845 * More complicate then regular CALLPROC_WOWCHECK() we want to get the 02846 * PWW so wow doesn't have to 02847 */ 02848 02849 /* Bug 234292 - joejo 02850 * Since the called window/dialog proc may have a different calling 02851 * convention, we must wrap the call and, check esp and replace with 02852 * a good esp when the call returns. This is what UserCallWinProc* does. 02853 */ 02854 #ifdef _WIN64 02855 UNREFERENCED_PARAMETER(pwnd); 02856 #endif 02857 02858 return CALLPROC_WOWCHECKPWW((WNDPROC)pfn, hwnd, message, wParam, lParam, &(pwnd->state)); 02859 02860 }

LRESULT DispatchHookA int  dw,
WPARAM  wParam,
LPARAM  lParam,
HOOKPROC  pfn
 

Referenced by ClientThreadSetup().

LRESULT DispatchHookW int  dw,
WPARAM  wParam,
LPARAM  lParam,
HOOKPROC  pfn
 

Referenced by ClientThreadSetup().

HLOCAL WINAPI DispatchLocalAlloc UINT  uFlags,
UINT  uBytes,
HANDLE  hInstance
 

Definition at line 1549 of file clinit.c.

01553 { 01554 UNREFERENCED_PARAMETER(hInstance); 01555 01556 return LocalAlloc(uFlags, uBytes); 01557 }

HLOCAL WINAPI DispatchLocalFree HLOCAL  hMem,
HANDLE  hInstance
 

Definition at line 1599 of file clinit.c.

01602 { 01603 UNREFERENCED_PARAMETER(hInstance); 01604 01605 return LocalFree(hMem); 01606 }

LPVOID WINAPI DispatchLocalLock HLOCAL  hMem,
HANDLE  hInstance
 

Definition at line 1572 of file clinit.c.

References LPVOID.

01575 { 01576 UNREFERENCED_PARAMETER(hInstance); 01577 01578 return LocalLock(hMem); 01579 }

HLOCAL WINAPI DispatchLocalReAlloc HLOCAL  hMem,
UINT  uBytes,
UINT  uFlags,
HANDLE  hInstance,
PVOID *  ppv
 

Definition at line 1559 of file clinit.c.

01565 { 01566 UNREFERENCED_PARAMETER(hInstance); 01567 UNREFERENCED_PARAMETER(ppv); 01568 01569 return LocalReAlloc(hMem, uBytes, uFlags); 01570 }

UINT WINAPI DispatchLocalSize HLOCAL  hMem,
HANDLE  hInstance
 

Definition at line 1590 of file clinit.c.

References UINT.

01593 { 01594 UNREFERENCED_PARAMETER(hInstance); 01595 01596 return (UINT)LocalSize(hMem); 01597 }

BOOL WINAPI DispatchLocalUnlock HLOCAL  hMem,
HANDLE  hInstance
 

Definition at line 1581 of file clinit.c.

References BOOL.

01584 { 01585 UNREFERENCED_PARAMETER(hInstance); 01586 01587 return LocalUnlock(hMem); 01588 }

BOOL DlgDirSelectHelper LPWSTR  pFileName,
int  cbFileName,
HWND  hwndListBox
 

Definition at line 682 of file lboxctl3.c.

References BOOL, CCHFILEMAX, CHARSTOBYTES, FALSE, INT, L, NULL, RtlInitLargeUnicodeString(), SendMessage(), TABCHAR, TextCopy(), and UINT.

Referenced by DlgDirSelectComboBoxExW(), DlgDirSelectExA(), and DlgDirSelectExW().

00686 { 00687 INT cch; 00688 LPWSTR lpchFile; 00689 BOOL fDir; 00690 INT sItem; 00691 LPWSTR lpchT; 00692 WCHAR rgch[CCHFILEMAX + 2]; 00693 int cchT; 00694 LARGE_UNICODE_STRING str; 00695 00696 /* 00697 * Callers such as DlgDirSelectEx do not validate the existance 00698 * of hwndListBox 00699 */ 00700 if (hwndListBox == NULL) { 00701 RIPERR0(ERROR_CONTROL_ID_NOT_FOUND, RIP_VERBOSE, ""); 00702 return 0; 00703 } 00704 00705 sItem = (INT)SendMessage(hwndListBox, LB_GETCURSEL, 0, 0L); 00706 if (sItem < 0) 00707 return FALSE; 00708 00709 cchT = (INT)SendMessage(hwndListBox, LB_GETTEXT, sItem, (LPARAM)rgch); 00710 UserAssert(cchT < (sizeof(rgch)/sizeof(rgch[0]))); 00711 00712 lpchFile = rgch; 00713 fDir = (*rgch == TEXT('[')); 00714 00715 /* 00716 * Check if all details along with file name are to be returned. Make sure 00717 * we can find the listbox because with drop down combo boxes, the 00718 * GetDlgItem will fail. 00719 * 00720 * Make sure this window has been using the listbox window proc because 00721 * we store some data as a window long. 00722 */ 00723 00724 /* 00725 * Only the file name is to be returned. Find the end of the filename. 00726 */ 00727 lpchT = lpchFile; 00728 while ((*lpchT) && (*lpchT != TABCHAR)) 00729 lpchT++; 00730 *lpchT = TEXT('\0'); 00731 00732 cch = wcslen(lpchFile); 00733 00734 /* 00735 * Selection is drive or directory. 00736 */ 00737 if (fDir) { 00738 lpchFile++; 00739 cch--; 00740 *(lpchFile + cch - 1) = TEXT('\\'); 00741 00742 /* 00743 * Selection is drive 00744 */ 00745 if (rgch[1] == TEXT('-')) { 00746 lpchFile++; 00747 cch--; 00748 *(lpchFile + 1) = TEXT(':'); 00749 *(lpchFile + 2) = 0; 00750 } 00751 } else { 00752 00753 /* 00754 * Selection is file. If filename has no extension, append '.' 00755 */ 00756 lpchT = lpchFile; 00757 for (; (cch > 0) && (*lpchT != TABCHAR); 00758 cch--, lpchT++) { 00759 if (*lpchT == TEXT('.')) 00760 goto Exit; 00761 } 00762 if (*lpchT == TABCHAR) { 00763 memmove(lpchT + 1, lpchT, CHARSTOBYTES(cch + 1)); 00764 *lpchT = TEXT('.'); 00765 } else { 00766 *lpchT++ = TEXT('.'); 00767 *lpchT = 0; 00768 } 00769 } 00770 00771 Exit: 00772 RtlInitLargeUnicodeString(&str, lpchFile, (UINT)-1); 00773 TextCopy(&str, lpszPathSpec, (UINT)chCount); 00774 return fDir; 00775 }

VOID DlgSetFocus HWND  hwnd  ) 
 

Definition at line 152 of file dlgmgr.c.

References NtUserSetFocus(), SendMessage(), and UINT.

Referenced by DefDlgProcWorker(), InternalCreateDialog(), IsDialogMessageW(), and xxxGotoNextMnem().

00154 { 00155 if (((UINT)SendMessage(hwnd, WM_GETDLGCODE, 0, 0)) & DLGC_HASSETSEL) { 00156 SendMessage(hwnd, EM_SETSEL, 0, MAXLONG); 00157 } 00158 00159 NtUserSetFocus(hwnd); 00160 }

BOOL DrawDiagonal HDC  hdc,
LPRECT  lprc,
HBRUSH  hbrTL,
HBRUSH  hbrBR,
UINT  flags
 

Definition at line 345 of file rtl/draw.c.

References BOOL, DrawDiagonalLine(), DWORD, NULL, and UserSelectBrush.

Referenced by DrawEdge().

00351 { 00352 HBRUSH hbrT; 00353 int nDirection; 00354 DWORD dAdjust; 00355 00356 /* 00357 * Away from light source 00358 */ 00359 hbrT = ((flags & BF_BOTTOM) ? hbrBR : hbrTL); 00360 00361 switch (flags & (BF_RECT | BF_DIAGONAL)){ 00362 00363 case BF_DIAGONAL_ENDTOPLEFT: 00364 case BF_DIAGONAL_ENDBOTTOMRIGHT: 00365 nDirection = -1; 00366 break; 00367 00368 default: 00369 nDirection = 1; 00370 break; 00371 } 00372 00373 hbrT = UserSelectBrush(hdc, hbrT); 00374 dAdjust = DrawDiagonalLine(hdc, lprc, nDirection, 1, (flags & ~BF_MIDDLE)); 00375 /* 00376 * Adjust rectangle for next border 00377 */ 00378 if (flags & BF_TOP) 00379 lprc->left += LOWORD(dAdjust); 00380 else 00381 lprc->right -= LOWORD(dAdjust); 00382 00383 if (flags & BF_RIGHT) 00384 lprc->top += HIWORD(dAdjust); 00385 else 00386 lprc->bottom -= HIWORD(dAdjust); 00387 00388 /* 00389 * Moved this to the end to save a check for return value 00390 */ 00391 return (UserSelectBrush(hdc, hbrT) != NULL); 00392 }

ICH ECAdjustIch PED  ,
LPSTR  ,
ICH 
 

Definition at line 4133 of file editec.c.

References ECIsDBCSLeadByte(), tagED::fAnsi, tagED::fDBCS, and ICH.

Referenced by ECAdjustIchNext(), ECCchInWidth(), ECInsertText(), MLBuildchLines(), MLDrawText(), MLInsertText(), MLMouseToIch(), MLSetSelection(), SLChangeSelection(), SLDrawText(), SLMouseToIch(), and SLScrollText().

04134 { 04135 ICH newch = ch; 04136 04137 if (!ped->fAnsi || !ped->fDBCS || newch == 0) 04138 return ( ch ); 04139 04140 if (!ECIsDBCSLeadByte(ped,lpstr[--newch])) 04141 return ( ch ); // previous char is SBCS 04142 while(1) { 04143 if (!ECIsDBCSLeadByte(ped,lpstr[newch])) { 04144 newch++; 04145 break; 04146 } 04147 if (newch) 04148 newch--; 04149 else 04150 break; 04151 } 04152 return ((ch - newch) & 1) ? ch-1 : ch; 04153 }

ICH ECAdjustIchNext PED  ,
LPSTR  ,
ICH 
 

Definition at line 4162 of file editec.c.

References ECAdjustIch(), ECAnsiNext(), FAR, and ICH.

Referenced by MLDrawText(), and SLScrollText().

04163 { 04164 ICH ichNew = ECAdjustIch(ped,lpstr,ch); 04165 LPSTR lpnew = lpstr+ichNew; 04166 04167 // if ch > ichNew then ECAdjustIch adjusted ich. 04168 if (ch > ichNew) 04169 lpnew = ECAnsiNext(ped, lpnew); 04170 04171 return (ICH)(lpnew-lpstr); 04172 }

LPSTR ECAnsiNext PED  ,
LPSTR 
 

Definition at line 3926 of file editec.c.

References ECIsDBCSLeadByte(), and TRUE.

Referenced by ECAdjustIchNext(), ECWord(), and SLDrawLine().

03927 { 03928 return lpCurrent+((ECIsDBCSLeadByte(ped,*lpCurrent)==TRUE) ? 2 : 1); 03929 }

LPSTR ECAnsiPrev PED  ,
LPSTR  ,
LPSTR 
 

Definition at line 3938 of file editec.c.

References ECIsDBCSLeadByte(), and tagED::fDBCS.

Referenced by ECWord(), MLBuildchLines(), and SLDrawLine().

03939 { 03940 LPSTR lpCurrent = lpStr -1; 03941 03942 if (!ped->fDBCS) 03943 return lpCurrent; // just return ( lpStr - 1 ) 03944 03945 if (lpBase >= lpCurrent) 03946 return lpBase; 03947 03948 if (ECIsDBCSLeadByte(ped, *lpCurrent)) // this check makes things faster 03949 return (lpCurrent - 1); // 92/04/04 takaok 03950 03951 do { 03952 lpCurrent--; 03953 if (!ECIsDBCSLeadByte(ped, *lpCurrent)) { 03954 lpCurrent++; 03955 break; 03956 } 03957 } while(lpCurrent != lpBase); 03958 03959 return lpStr - (((lpStr - lpCurrent) & 1) ? 1 : 2); 03960 }

BOOL ECCalcChangeSelection PED  ,
ICH  ,
ICH  ,
LPBLOCK  ,
LPBLOCK 
 

Definition at line 3692 of file editec.c.

References BLOCK, BOOL, ECFindXORblks(), tagBLOCK::EndPos, FALSE, tagED::ichMaxSel, tagED::ichMinSel, max, min, tagBLOCK::StPos, and TRUE.

Referenced by MLChangeSelection(), and SLChangeSelection().

03698 { 03699 BLOCK Blk[2]; 03700 int iBlkCount = 0; 03701 03702 Blk[0].StPos = Blk[0].EndPos = Blk[1].StPos = Blk[1].EndPos = 0xFFFFFFFF; 03703 03704 /* 03705 * Check if the Old selection block existed 03706 */ 03707 if (ichOldMinSel != ichOldMaxSel) { 03708 03709 /* 03710 * Yes! Old block existed. 03711 */ 03712 Blk[0].StPos = OldBlk->StPos; 03713 Blk[0].EndPos = OldBlk->EndPos; 03714 iBlkCount++; 03715 } 03716 03717 /* 03718 * Check if the new Selection block exists 03719 */ 03720 if (ped->ichMinSel != ped->ichMaxSel) { 03721 03722 /* 03723 * Yes! New block exists 03724 */ 03725 Blk[1].StPos = NewBlk->StPos; 03726 Blk[1].EndPos = NewBlk->EndPos; 03727 iBlkCount++; 03728 } 03729 03730 /* 03731 * If both the blocks exist find the XOR of them 03732 */ 03733 if (iBlkCount == 2) { 03734 03735 /* 03736 * Check if both blocks start at the same character position 03737 */ 03738 if (ichOldMinSel == ped->ichMinSel) { 03739 03740 /* 03741 * Check if they end at the same character position 03742 */ 03743 if (ichOldMaxSel == ped->ichMaxSel) 03744 return FALSE; /* Nothing changes */ 03745 03746 Blk[0].StPos = min(NewBlk -> EndPos, OldBlk -> EndPos); 03747 Blk[0].EndPos = max(NewBlk -> EndPos, OldBlk -> EndPos); 03748 Blk[1].StPos = 0xFFFFFFFF; 03749 } else { 03750 if (ichOldMaxSel == ped->ichMaxSel) { 03751 Blk[0].StPos = min(NewBlk->StPos, OldBlk->StPos); 03752 Blk[0].EndPos = max(NewBlk->StPos, OldBlk->StPos); 03753 Blk[1].StPos = 0xFFFFFFFF; 03754 } else { 03755 ECFindXORblks(OldBlk, NewBlk, &Blk[0], &Blk[1]); 03756 } 03757 } 03758 } 03759 03760 RtlCopyMemory(OldBlk, &Blk[0], sizeof(BLOCK)); 03761 RtlCopyMemory(NewBlk, &Blk[1], sizeof(BLOCK)); 03762 03763 return TRUE; /* Yup , There is something to paint */ 03764 }

ICH ECCchInWidth PED  ,
HDC  ,
LPSTR  ,
ICH  ,
int  ,
BOOL 
 

Definition at line 1281 of file editec.c.

References tagED::aveCharWidth, tagED::cbChar, tagED::charPasswordChar, tagED::cPasswordCharWidth, ECAdjustIch(), ECT_CALC, ECTabTheTextOut(), tagED::fAnsi, tagED::fDBCS, tagED::fNonPropFont, tagED::fSingle, ICH, MAXLINELENGTH, NULL, umax, and umin.

Referenced by MLBuildchLines(), MLMouseToIch(), SLCalcXOffsetSpecial(), SLDrawText(), SLInsertText(), SLMouseToIch(), and SLScrollText().

01288 { 01289 int stringExtent; 01290 int cchhigh; 01291 int cchnew = 0; 01292 int cchlow = 0; 01293 SIZE size; 01294 LPSTR lpStart; 01295 01296 if ((width <= 0) || !cch) 01297 return (0); 01298 01299 /* 01300 * Optimize nonproportional fonts for single line ec since they don't have 01301 * tabs. 01302 */ 01303 // 01304 // Change optimize condition for fixed pitch font 01305 // 01306 if (ped->fNonPropFont && ped->fSingle && !ped->fDBCS) { 01307 return (ECAdjustIch( ped, lpText, umin(width/ped->aveCharWidth,(int)cch))); 01308 } 01309 01310 /* 01311 * Check if password hidden chars are being used. 01312 */ 01313 if (ped->charPasswordChar) { 01314 return (umin(width / ped->cPasswordCharWidth, (int)cch)); 01315 } 01316 01317 /* 01318 * ALWAYS RESTRICT TO AT MOST MAXLINELENGTH to avoid overflow... 01319 */ 01320 cch = umin(MAXLINELENGTH, cch); 01321 01322 cchhigh = cch + 1; 01323 while (cchlow < cchhigh - 1) { 01324 cchnew = umax((cchhigh - cchlow) / 2, 1) + cchlow; 01325 01326 lpStart = lpText; 01327 01328 /* 01329 * If we want to figure out how many fit starting at the end and moving 01330 * backwards, make sure we move to the appropriate position in the 01331 * string before calculating the text extent. 01332 */ 01333 if (!fForward) 01334 lpStart += (cch - cchnew)*ped->cbChar; 01335 01336 if (ped->fSingle) { 01337 if (ped->fAnsi) 01338 GetTextExtentPointA(hdc, (LPSTR)lpStart, cchnew, &size); 01339 else 01340 GetTextExtentPointW(hdc, (LPWSTR)lpStart, cchnew, &size); 01341 stringExtent = size.cx; 01342 } else { 01343 stringExtent = ECTabTheTextOut(hdc, 0, 0, 0, 0, 01344 lpStart, 01345 cchnew, 0, 01346 ped, 0, ECT_CALC, NULL ); 01347 } 01348 01349 if (stringExtent > width) { 01350 cchhigh = cchnew; 01351 } else { 01352 cchlow = cchnew; 01353 } 01354 } 01355 // 01356 // Call ECAdjustIch ( generic case ) 01357 // 01358 cchlow = ECAdjustIch( ped, lpText, cchlow ); 01359 return (cchlow); 01360 }

ICH ECCopy PED   ) 
 

Definition at line 2703 of file editec.c.

References tagED::cbChar, tagED::charPasswordChar, CI_16BIT, ECLock(), ECUnlock(), tagED::fAnsi, FAR, GetClientInfo, tagED::hwnd, ICH, tagED::ichMaxSel, tagED::ichMinSel, LHND, NtUserCloseClipboard(), NtUserEmptyClipboard(), NtUserMessageBeep, OpenClipboard(), pfnWowEmptyClipBoard, SetClipboardData(), UserGlobalAlloc, USERGLOBALLOCK, and USERGLOBALUNLOCK.

Referenced by EditWndProc().

02705 { 02706 HANDLE hData; 02707 char *pchSel; 02708 char FAR *lpchClip; 02709 ICH cbData; 02710 02711 /* 02712 * Don't allow copies from password style controls 02713 */ 02714 if (ped->charPasswordChar) { 02715 NtUserMessageBeep(0); 02716 return 0; 02717 } 02718 02719 cbData = (ped->ichMaxSel - ped->ichMinSel) * ped->cbChar; 02720 02721 if (!cbData) 02722 return 0; 02723 02724 if (!OpenClipboard(ped->hwnd)) 02725 return 0; 02726 02727 NtUserEmptyClipboard(); 02728 02729 /* 02730 * If we just called EmptyClipboard in the context of a 16 bit 02731 * app then we also have to tell WOW to nix its 16 handle copy of 02732 * clipboard data. WOW does its own clipboard caching because 02733 * some 16 bit apps use clipboard data even after the clipboard 02734 * has been emptied. See the note in the server code. 02735 * 02736 * Note: this is the only place where EmptyClipboard is called 02737 * for a 16 bit app not going through WOW. If we added others 02738 * we might want to move this into EmptyClipboard and have two 02739 * versions. 02740 */ 02741 if (GetClientInfo()->CI_flags & CI_16BIT) { 02742 pfnWowEmptyClipBoard(); 02743 } 02744 02745 02746 /* 02747 * +1 for the terminating NULL 02748 */ 02749 if (!(hData = UserGlobalAlloc(LHND, (LONG)(cbData + ped->cbChar)))) { 02750 NtUserCloseClipboard(); 02751 return (0); 02752 } 02753 02754 USERGLOBALLOCK(hData, lpchClip); 02755 UserAssert(lpchClip); 02756 pchSel = ECLock(ped); 02757 pchSel = pchSel + (ped->ichMinSel * ped->cbChar); 02758 02759 RtlCopyMemory(lpchClip, pchSel, cbData); 02760 02761 if (ped->fAnsi) 02762 *(lpchClip + cbData) = 0; 02763 else 02764 *(LPWSTR)(lpchClip + cbData) = (WCHAR)0; 02765 02766 ECUnlock(ped); 02767 USERGLOBALUNLOCK(hData); 02768 02769 SetClipboardData( ped->fAnsi ? CF_TEXT : CF_UNICODETEXT, hData); 02770 02771 NtUserCloseClipboard(); 02772 02773 return (cbData); 02774 }

BOOL ECCreate PED  ped,
LONG  windowStyle
 

Definition at line 387 of file edecrare.c.

References BOOL, BYTE, tagED::cchTextMax, tagED::charSet, ECGetEditDC(), ECInitInsert(), ECReleaseEditDC(), tagLPKEDITCALLOUT::EditCreate, tagED::fAutoHScroll, tagED::fNoHideSel, tagED::format, fpLpkEditControl, HW, ICH, MAXTEXT, tagED::pLpkEditCallout, tagED::pwnd, TestWF, THREAD_HKL, TRUE, and WEFRIGHT.

Referenced by MLCreate(), and SLCreate().

00390 { 00391 HDC hdc; 00392 00393 /* 00394 * Get values from the window instance data structure and put them in the 00395 * ped so that we can access them easier. 00396 */ 00397 if (windowStyle & ES_AUTOHSCROLL) 00398 ped->fAutoHScroll = 1; 00399 if (windowStyle & ES_NOHIDESEL) 00400 ped->fNoHideSel = 1; 00401 00402 ped->format = (LOWORD(windowStyle) & LOWORD(ES_FMTMASK)); 00403 if (TestWF(ped->pwnd, WEFRIGHT) && !ped->format) 00404 ped->format = ES_RIGHT; 00405 00406 ped->cchTextMax = MAXTEXT; /* Max # chars we will initially allow */ 00407 00408 /* 00409 * Set up undo initial conditions... (ie. nothing to undo) 00410 */ 00411 ped->ichDeleted = (ICH)-1; 00412 ped->ichInsStart = (ICH)-1; 00413 ped->ichInsEnd = (ICH)-1; 00414 00415 // initial charset value - need to do this BEFORE MLCreate is called 00416 // so that we know not to fool with scrollbars if nessacary 00417 hdc = ECGetEditDC(ped, TRUE); 00418 ped->charSet = (BYTE)GetTextCharset(hdc); 00419 ECReleaseEditDC(ped, hdc, TRUE); 00420 00421 // FE_IME 00422 // EC_INSERT_COMPOSITION_CHARACTER: ECCreate() - call ECInitInsert() 00423 ECInitInsert(ped, THREAD_HKL()); 00424 00425 if(ped->pLpkEditCallout = fpLpkEditControl) { 00426 return ped->pLpkEditCallout->EditCreate(ped, HW(ped->pwnd)); 00427 } else 00428 return TRUE; 00429 }

ICH ECDeleteText PED   ) 
 

Definition at line 2293 of file editec.c.

References tagED::cbChar, tagED::cch, tagED::cchAlloc, CCHALLOCEXTRA, DWORD, ECEmptyUndo(), ECGetEditDC(), ECLock(), ECReleaseEditDC(), ECUnlock(), tagLPKEDITCALLOUT::EditAdjustCaret, tagED::fDirty, tagED::hInstance, tagED::hText, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, LHND, LOCALREALLOC, LOCALSIZE, NULL, tagED::pLpkEditCallout, Pundo, TRUE, UNDO_DELETE, UNDO_INSERT, UNDO_NONE, UserGlobalAlloc, and UserGlobalReAlloc.

Referenced by ECImeComposition(), EditWndProc(), MLDeleteText(), SLChar(), SLPaste(), SLReplaceSel(), and SLUndo().

02295 { 02296 PSTR pedText; 02297 ICH cchDelete; 02298 LPSTR lpDeleteSaveBuffer; 02299 HANDLE hDeletedText; 02300 DWORD bufferOffset; 02301 02302 cchDelete = ped->ichMaxSel - ped->ichMinSel; 02303 02304 if (!cchDelete) 02305 return (0); 02306 02307 /* 02308 * Ok, now lets delete the text. 02309 */ 02310 pedText = ECLock(ped); 02311 02312 /* 02313 * Adjust UNDO fields so that we can undo this delete... 02314 */ 02315 if (ped->undoType == UNDO_NONE) { 02316 UNDODELETEFROMSCRATCH: 02317 if (ped->hDeletedText = UserGlobalAlloc(GPTR, (LONG)((cchDelete+1)*ped->cbChar))) { 02318 ped->undoType = UNDO_DELETE; 02319 ped->ichDeleted = ped->ichMinSel; 02320 ped->cchDeleted = cchDelete; 02321 lpDeleteSaveBuffer = ped->hDeletedText; 02322 RtlCopyMemory(lpDeleteSaveBuffer, pedText + ped->ichMinSel*ped->cbChar, cchDelete*ped->cbChar); 02323 lpDeleteSaveBuffer[cchDelete*ped->cbChar] = 0; 02324 } 02325 } else if (ped->undoType & UNDO_INSERT) { 02326 UNDODELETE: 02327 ECEmptyUndo(Pundo(ped)); 02328 02329 ped->ichInsStart = ped->ichInsEnd = 0xFFFFFFFF; 02330 ped->ichDeleted = 0xFFFFFFFF; 02331 ped->cchDeleted = 0; 02332 goto UNDODELETEFROMSCRATCH; 02333 } else if (ped->undoType == UNDO_DELETE) { 02334 if (ped->ichDeleted == ped->ichMaxSel) { 02335 02336 /* 02337 * Copy deleted text to front of undo buffer 02338 */ 02339 hDeletedText = UserGlobalReAlloc(ped->hDeletedText, (LONG)(cchDelete + ped->cchDeleted + 1)*ped->cbChar, GHND); 02340 if (!hDeletedText) 02341 goto UNDODELETE; 02342 bufferOffset = 0; 02343 ped->ichDeleted = ped->ichMinSel; 02344 } else if (ped->ichDeleted == ped->ichMinSel) { 02345 02346 /* 02347 * Copy deleted text to end of undo buffer 02348 */ 02349 hDeletedText = UserGlobalReAlloc(ped->hDeletedText, (LONG)(cchDelete + ped->cchDeleted + 1)*ped->cbChar, GHND); 02350 if (!hDeletedText) 02351 goto UNDODELETE; 02352 bufferOffset = ped->cchDeleted*ped->cbChar; 02353 } else { 02354 02355 /* 02356 * Clear the current UNDO delete and add the new one since 02357 the deletes aren't contiguous. 02358 */ 02359 goto UNDODELETE; 02360 } 02361 02362 ped->hDeletedText = hDeletedText; 02363 lpDeleteSaveBuffer = (LPSTR)hDeletedText; 02364 if (!bufferOffset) { 02365 02366 /* 02367 * Move text in delete buffer up so that we can insert the next 02368 * text at the head of the buffer. 02369 */ 02370 RtlMoveMemory(lpDeleteSaveBuffer + cchDelete*ped->cbChar, lpDeleteSaveBuffer, 02371 ped->cchDeleted*ped->cbChar); 02372 } 02373 RtlCopyMemory(lpDeleteSaveBuffer + bufferOffset, pedText + ped->ichMinSel*ped->cbChar, 02374 cchDelete*ped->cbChar); 02375 02376 lpDeleteSaveBuffer[(ped->cchDeleted + cchDelete)*ped->cbChar] = 0; 02377 ped->cchDeleted += cchDelete; 02378 } 02379 02380 if (ped->ichMaxSel != ped->cch) { 02381 02382 /* 02383 * We are deleting text from the middle of the buffer so we have to 02384 shift text to the left. 02385 */ 02386 RtlMoveMemory(pedText + ped->ichMinSel*ped->cbChar, pedText + ped->ichMaxSel*ped->cbChar, 02387 (ped->cch - ped->ichMaxSel)*ped->cbChar); 02388 } 02389 02390 if (ped->cchAlloc - ped->cch > CCHALLOCEXTRA) { 02391 02392 /* 02393 * Free some memory since we deleted a lot 02394 */ 02395 LOCALREALLOC(ped->hText, (DWORD)(ped->cch + (CCHALLOCEXTRA / 2))*ped->cbChar, LHND, ped->hInstance, NULL); 02396 ped->cchAlloc = LOCALSIZE(ped->hText, ped->hInstance) / ped->cbChar; 02397 } 02398 02399 ped->cch -= cchDelete; 02400 02401 if (ped->pLpkEditCallout) { 02402 HDC hdc; 02403 02404 hdc = ECGetEditDC (ped, TRUE); 02405 ped->ichMinSel = ped->pLpkEditCallout->EditAdjustCaret (ped, hdc, pedText, ped->ichMinSel); 02406 ECReleaseEditDC (ped, hdc, TRUE); 02407 } 02408 02409 ped->ichCaret = ped->ichMaxSel = ped->ichMinSel; 02410 02411 ECUnlock(ped); 02412 02413 /* 02414 * Set dirty bit 02415 */ 02416 ped->fDirty = TRUE; 02417 02418 return (cchDelete); 02419 }

void ECEmptyUndo PUNDO   ) 
 

Definition at line 1977 of file editec.c.

References tagUNDO::hDeletedText, and UserGlobalFree.

Referenced by ECDeleteText(), ECResetTextInfo(), EditWndProc(), MLEditWndProc(), MLInsertText(), MLPasteText(), MLReplaceSel(), SLEditWndProc(), and SLReplaceSel().

01979 { 01980 if (pundo->hDeletedText) 01981 UserGlobalFree(pundo->hDeletedText); 01982 01983 RtlZeroMemory(pundo, sizeof(UNDO) ); 01984 }

void ECEnableDisableIME PED  ped  ) 
 

Definition at line 1037 of file edecrare.c.

References tagED::charPasswordChar, ECImmSetCompositionFont(), ECImmSetCompositionWindow(), ECInitInsert(), tagED::fFocus, fpImmAssociateContext, fpImmGetContext, fpImmReleaseContext, tagED::fReadOnly, tagED::hImcPrev, tagED::hwnd, NtUserGetCaretPos(), NULL_HIMC, THREAD_HKL, and VOID().

Referenced by ECSetPasswordChar(), and EditWndProc().

01038 { 01039 if ( ped->fReadOnly || ped->charPasswordChar ) { 01040 // 01041 // IME should be disabled 01042 // 01043 HIMC hImc; 01044 hImc = fpImmGetContext( ped->hwnd ); 01045 01046 if ( hImc != NULL_HIMC ) { 01047 fpImmReleaseContext( ped->hwnd, hImc ); 01048 ped->hImcPrev = fpImmAssociateContext( ped->hwnd, NULL_HIMC ); 01049 } 01050 01051 } else { 01052 // 01053 // IME should be enabled 01054 // 01055 if ( ped->hImcPrev != NULL_HIMC ) { 01056 ped->hImcPrev = fpImmAssociateContext( ped->hwnd, ped->hImcPrev ); 01057 01058 // 01059 // Font and the caret position might be changed while 01060 // IME was being disabled. Set those now if the window 01061 // has the focus. 01062 // 01063 if ( ped->fFocus ) { 01064 POINT pt; 01065 01066 ECImmSetCompositionFont( ped ); 01067 01068 NtUserGetCaretPos( &pt ); 01069 ECImmSetCompositionWindow( ped, pt.x, pt.y ); 01070 } 01071 } 01072 } 01073 ECInitInsert(ped, THREAD_HKL()); 01074 }

ICH ECFindTab LPSTR  ,
ICH 
 

void ECFindXORblks LPBLOCK  ,
LPBLOCK  ,
LPBLOCK  ,
LPBLOCK 
 

Definition at line 3652 of file editec.c.

References tagBLOCK::EndPos, LPBLOCK, max, min, and tagBLOCK::StPos.

Referenced by ECCalcChangeSelection().

03657 { 03658 if (lpOldBlk->StPos >= lpNewBlk->StPos) { 03659 lpBlk1->StPos = lpNewBlk->StPos; 03660 lpBlk1->EndPos = min(lpOldBlk->StPos, lpNewBlk->EndPos); 03661 } else { 03662 lpBlk1->StPos = lpOldBlk->StPos; 03663 lpBlk1->EndPos = min(lpNewBlk->StPos, lpOldBlk->EndPos); 03664 } 03665 03666 if (lpOldBlk->EndPos <= lpNewBlk->EndPos) { 03667 lpBlk2->StPos = max(lpOldBlk->EndPos, lpNewBlk->StPos); 03668 lpBlk2->EndPos = lpNewBlk->EndPos; 03669 } else { 03670 lpBlk2->StPos = max(lpNewBlk->EndPos, lpOldBlk->StPos); 03671 lpBlk2->EndPos = lpOldBlk->EndPos; 03672 } 03673 }

HBRUSH ECGetBrush PED  ped,
HDC  hdc
 

Definition at line 1412 of file editec.c.

References BOOL, DWORD, ECGetControlBrush(), tagED::fDisabled, tagED::fReadOnly, tagED::fSingle, GETAPPVER, GetSysColor(), and VER40.

Referenced by MLDrawText(), MLScroll(), SLChangeSelection(), SLDrawLine(), SLDrawText(), SLPaint(), and SLScrollText().

01413 { 01414 HBRUSH hbr; 01415 BOOL f40Compat; 01416 01417 f40Compat = (GETAPPVER() >= VER40); 01418 01419 // Get background brush 01420 if ((ped->fReadOnly || ped->fDisabled) && f40Compat) { 01421 hbr = ECGetControlBrush(ped, hdc, WM_CTLCOLORSTATIC); 01422 } else 01423 hbr = ECGetControlBrush(ped, hdc, WM_CTLCOLOREDIT); 01424 01425 if (ped->fDisabled && (ped->fSingle || f40Compat)) { 01426 DWORD rgb; 01427 01428 // Change text color 01429 rgb = GetSysColor(COLOR_GRAYTEXT); 01430 if (rgb != GetBkColor(hdc)) 01431 SetTextColor(hdc, rgb); 01432 } 01433 return(hbr); 01434 }

HBRUSH ECGetControlBrush PED  ,
HDC  ,
LONG 
 

Definition at line 3776 of file editec.c.

References DefWindowProcWorker(), tagED::fAnsi, GETPTI, tagED::hwnd, NULL, PtiCurrent, REBASEPTR, SendMessageWorker(), tagWND::spwndOwner, tagWND::spwndParent, TestwndPopup, and ValidateHwnd.

Referenced by ECGetBrush().

03780 { 03781 PWND pwndSend; 03782 PWND pwndEdit; 03783 03784 pwndEdit = ValidateHwnd(ped->hwnd); 03785 03786 if (pwndEdit == (PWND)NULL) 03787 return (HBRUSH)0; 03788 03789 if ((pwndSend = (TestwndPopup(pwndEdit) ? pwndEdit->spwndOwner : pwndEdit->spwndParent)) == NULL) 03790 pwndSend = pwndEdit; 03791 else 03792 pwndSend = REBASEPTR(pwndEdit, pwndSend); 03793 03794 UserAssert(pwndSend); 03795 03796 if (PtiCurrent() != GETPTI(pwndSend)) { 03797 return (HBRUSH)DefWindowProcWorker(pwndSend, message, 03798 (WPARAM)hdc, (LPARAM)pwndEdit, ped->fAnsi); 03799 } 03800 03801 /* 03802 * By using the correct A/W call we avoid a c/s transition 03803 * on this SendMessage(). 03804 */ 03805 return (HBRUSH)SendMessageWorker(pwndSend, message, (WPARAM)hdc, 03806 (LPARAM)ped->hwnd, ped->fAnsi); 03807 }

int ECGetDBCSVector PED  ,
HDC  ,
BYTE 
 

Definition at line 3820 of file editec.c.

References BOOL, BYTE, tagED::DBCSVector, DWORD, FALSE, tagED::fAnsi, FAREAST_CHARSET_BITS, fFontAssocStatus, GetACPCharSet(), QueryFontAssocStatus(), and TRUE.

Referenced by ECSetFont().

03821 { 03822 BOOL bDBCSCodePage = FALSE; 03823 /* 03824 * if DEFAUT_CHARSET was passed, we will convert that to Shell charset.. 03825 */ 03826 if (CharSet == DEFAULT_CHARSET) { 03827 CharSet = (BYTE)GetTextCharset(hdc); 03828 03829 /* 03830 * if CharSet is still DEFAULT_CHARSET, it means gdi has some problem.. 03831 * then just return default.. we get charset from CP_ACP.. 03832 */ 03833 if (CharSet == DEFAULT_CHARSET) { 03834 CharSet = (BYTE)GetACPCharSet(); 03835 } 03836 } 03837 03838 switch (CharSet) { 03839 case SHIFTJIS_CHARSET: 03840 case HANGEUL_CHARSET: 03841 case CHINESEBIG5_CHARSET: 03842 case GB2312_CHARSET: 03843 bDBCSCodePage = TRUE; 03844 break; 03845 03846 case ANSI_CHARSET: // 0 03847 case SYMBOL_CHARSET: // 2 03848 case OEM_CHARSET: // 255 03849 if (fFontAssocStatus == 0xffff) 03850 fFontAssocStatus = QueryFontAssocStatus(); 03851 03852 if ((((CharSet + 2) & 0xf) & fFontAssocStatus)) { 03853 bDBCSCodePage = TRUE; 03854 /* 03855 * Bug 117558, etc. 03856 * Try to get a meaningful character set for associated font. 03857 */ 03858 CharSet = (BYTE)GetACPCharSet(); 03859 } else { 03860 bDBCSCodePage = FALSE; 03861 } 03862 break; 03863 03864 default: 03865 bDBCSCodePage = FALSE; 03866 } 03867 03868 if (bDBCSCodePage) { 03869 CHARSETINFO CharsetInfo; 03870 DWORD CodePage; 03871 CPINFO CPInfo; 03872 int lbIX; 03873 03874 if (TranslateCharsetInfo((DWORD *)CharSet, &CharsetInfo, TCI_SRCCHARSET)) { 03875 CodePage = CharsetInfo.ciACP; 03876 } else { 03877 CodePage = CP_ACP; 03878 } 03879 03880 GetCPInfo(CodePage, &CPInfo); 03881 for (lbIX=0 ; CPInfo.LeadByte[lbIX] != 0 ; lbIX+=2) { 03882 ped->DBCSVector[lbIX ] = CPInfo.LeadByte[lbIX]; 03883 ped->DBCSVector[lbIX+1] = CPInfo.LeadByte[lbIX+1]; 03884 } 03885 ped->DBCSVector[lbIX ] = 0x0; 03886 ped->DBCSVector[lbIX+1] = 0x0; 03887 } else { 03888 ped->DBCSVector[0] = 0x0; 03889 ped->DBCSVector[1] = 0x0; 03890 } 03891 03892 // 03893 // Final check: if the font supports DBCS glyphs 03894 // 03895 // If we've got a font with DBCS glyphs, let's mark PED so. 03896 // But since the font's primary charset is the one other than FE, 03897 // we can only support UNICODE Edit control. 03898 // 03899 // a) GDI performs A/W conversion for ANSI apps based on the primary 03900 // character set in hDC, so it will break anyway. 03901 // b) ANSI applications are only supported on their native system locales: 03902 // GetACPCharSet() is expected to return a FE code page. 03903 // c) ANSI Edit control requires DBCSVector, which cannot be 03904 // initialized without a FE code page. 03905 // 03906 if (!ped->fAnsi) { 03907 FONTSIGNATURE fontSig; 03908 03909 GetTextCharsetInfo(hdc, &fontSig, 0); 03910 if (fontSig.fsCsb[0] & FAREAST_CHARSET_BITS) { 03911 bDBCSCodePage = TRUE; 03912 // Since this is UNICODE, we're not 03913 } 03914 } 03915 03916 return bDBCSCodePage; 03917 }

HDC ECGetEditDC PED  ,
BOOL 
 

Definition at line 2492 of file editec.c.

References BOOL, ECSetEditClip(), tagED::hFont, tagED::hwnd, NtUserGetDC(), NtUserHideCaret(), and tagED::xOffset.

Referenced by ECCreate(), ECDeleteText(), ECImeComposition(), ECInsertText(), ECSetCaretHandler(), ECSetPasswordChar(), EditWndProc(), MLBuildchLines(), MLCalcXOffset(), MLDeleteText(), MLEditWndProc(), MLEnsureCaretVisible(), MLInsertText(), MLKeyDown(), MLKillFocus(), MLMouseMotion(), MLMoveSelectionRestricted(), MLScroll(), MLSetFocus(), MLSetSelection(), NextWordLpkCallBack(), SLChar(), SLEditWndProc(), SLInsertText(), SLKeyDown(), SLMouseMotion(), SLMoveSelectionRestricted(), SLPaste(), SLReplaceSel(), SLSetFocus(), and SLSetSelection().

02495 { 02496 HDC hdc; 02497 02498 if (!fFastDC) 02499 NtUserHideCaret(ped->hwnd); 02500 02501 if ( hdc = NtUserGetDC(ped->hwnd) ) { 02502 ECSetEditClip(ped, hdc, (BOOL)(ped->xOffset == 0)); 02503 02504 /* 02505 * Select the proper font for this edit control's dc. 02506 */ 02507 if (ped->hFont) 02508 SelectObject(hdc, ped->hFont); 02509 } 02510 02511 return hdc; 02512 }

int ECGetModKeys int   ) 
 

Definition at line 733 of file editec.c.

References CTRLDOWN, GetKeyState(), NOMODIFY, and SHFTDOWN.

Referenced by MLChar(), MLKeyDown(), and SLKeyDown().

00733 { 00734 int scState; 00735 00736 scState = 0; 00737 00738 if (!keyMods) { 00739 if (GetKeyState(VK_CONTROL) < 0) 00740 scState |= CTRLDOWN; 00741 if (GetKeyState(VK_SHIFT) < 0) 00742 scState |= SHFTDOWN; 00743 } else if (keyMods != NOMODIFY) 00744 scState = keyMods; 00745 00746 return scState; 00747 }

ICH ECGetText PED  ,
ICH  ,
LPSTR  ,
BOOL 
 

Definition at line 246 of file edecrare.c.

References tagED::cbChar, tagED::cch, ECLock(), ECUnlock(), tagED::fAnsi, ICH, and min.

Referenced by EditWndProc(), and SLEditWndProc().

00251 { 00252 PSTR pText; 00253 00254 if (maxCchToCopy) { 00255 00256 /* 00257 * Zero terminator takes the extra byte 00258 */ 00259 if (fNullTerminate) 00260 maxCchToCopy--; 00261 maxCchToCopy = min(maxCchToCopy, ped->cch); 00262 00263 /* 00264 * Zero terminate the string 00265 */ 00266 if (ped->fAnsi) 00267 *(LPSTR)(lpBuffer + maxCchToCopy) = 0; 00268 else 00269 *(((LPWSTR)lpBuffer) + maxCchToCopy) = 0; 00270 00271 pText = ECLock(ped); 00272 RtlCopyMemory(lpBuffer, pText, maxCchToCopy*ped->cbChar); 00273 ECUnlock(ped); 00274 } 00275 00276 return maxCchToCopy; 00277 }

LRESULT ECImeComposition PED  ped,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1337 of file edecrare.c.

References BOOL, BYTE, tagED::cch, tagED::cchTextMax, DefWindowProcWorker(), ECDeleteText(), ECGetEditDC(), ECInOutReconversionMode(), ECNotifyParent(), ECReleaseEditDC(), ECResultStrHandler(), ECSetCaretHandler(), FALSE, tagED::fAnsi, tagED::fInsertCompChr, tagED::fMouseDown, tagED::fNoMoveCaret, fpImmGetContext, fpImmNotifyIME, fpImmReleaseContext, tagED::fReplaceCompChr, tagED::fResultProcess, tagED::fSingle, HIBYTE, tagED::hwnd, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, INT, L, LOBYTE, max, min, MLDeleteText(), MLInsertText(), NtUserMessageBeep, tagED::pwnd, SLDrawText(), SLInsertText(), SLScrollText(), TRUE, and tagED::wImeStatus.

Referenced by EditWndProc().

01338 { 01339 INT ich; 01340 LRESULT lReturn = 1; 01341 HDC hdc; 01342 BOOL fSLTextUpdated = FALSE; 01343 ICH iResult; 01344 HIMC hImc; 01345 BYTE TextBuf[4]; 01346 01347 if (!ped->fInsertCompChr) { 01348 if (lParam & GCS_RESULTSTR) { 01349 ECInOutReconversionMode(ped, FALSE); 01350 01351 if (ped->wImeStatus & EIMES_GETCOMPSTRATONCE) { 01352 ResultAtOnce: 01353 ECResultStrHandler(ped); 01354 lParam &= ~GCS_RESULTSTR; 01355 } 01356 } 01357 return DefWindowProcWorker(ped->pwnd, WM_IME_COMPOSITION, wParam, lParam, ped->fAnsi); 01358 } 01359 01360 // In case of Ansi edit control, the length of minimum composition string 01361 // is 2. Check here maximum byte of edit control. 01362 if( ped->fAnsi && ped->cchTextMax == 1 ) { 01363 HIMC hImc; 01364 01365 hImc = fpImmGetContext( ped->hwnd ); 01366 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0L); 01367 fpImmReleaseContext( ped->hwnd, hImc ); 01368 NtUserMessageBeep(MB_ICONEXCLAMATION); 01369 return lReturn; 01370 } 01371 01372 // Don't move this after CS_NOMOVECARET check. 01373 // In case if skip the message, fNoMoveCaret should not be set. 01374 if ((lParam & CS_INSERTCHAR) && ped->fResultProcess) { 01375 01376 // Now we're in result processing. GCS_RESULTSTR ends up 01377 // to WM_IME_CHAR and WM_CHAR. Since WM_CHAR is posted, 01378 // the message(s) will come later than this CS_INSERTCHAR 01379 // message. This composition character should be handled 01380 // after the WM_CHAR message(s). 01381 // 01382 if(ped->fAnsi) 01383 PostMessageA(ped->hwnd, WM_IME_COMPOSITION, wParam, lParam); 01384 else 01385 PostMessageW(ped->hwnd, WM_IME_COMPOSITION, wParam, lParam); 01386 ped->fResultProcess = FALSE; 01387 return lReturn; 01388 } 01389 01390 // 01391 // If fReplaceCompChr is TRUE, we change the shape of caret. A block 01392 // caret is displayed on the composition character. From the user's 01393 // point of view, there is no difference if the caret is before the 01394 // composition character or after the composition character. When 01395 // the composition character is finalized, the insertion point should 01396 // be moved to after the character, any way. Therefore checking 01397 // CS_NOMOVECARET bit doesn't make sense in our current implementation. 01398 // [takaok] 01399 // 01400 #if 0 01401 if (lParam & CS_NOMOVECARET) 01402 ped->fNoMoveCaret=TRUE; // stick to current caret pos. 01403 else 01404 ped->fNoMoveCaret=FALSE; 01405 #endif 01406 01407 if (lParam & GCS_RESULTSTR) { 01408 01409 if (ped->wImeStatus & EIMES_GETCOMPSTRATONCE) { 01410 goto ResultAtOnce; 01411 } 01412 01413 ped->fResultProcess=TRUE; 01414 if ( ped->fReplaceCompChr ) { 01415 // 01416 // we have a DBCS character to be replaced. 01417 // let's delete it before inserting the new one. 01418 // 01419 ich = (ped->fAnsi) ? 2 : 1; 01420 ped->fReplaceCompChr = FALSE; 01421 ped->ichMaxSel = min(ped->ichCaret + ich, ped->cch); 01422 ped->ichMinSel = ped->ichCaret; 01423 if ( ECDeleteText( ped ) > 0 ) { 01424 if ( ped->fSingle ) { 01425 // 01426 // Update the display 01427 // 01428 ECNotifyParent(ped, EN_UPDATE); 01429 hdc = ECGetEditDC(ped,FALSE); 01430 SLDrawText(ped, hdc, 0); 01431 ECReleaseEditDC(ped,hdc,FALSE); 01432 // 01433 // Tell parent our text contents changed. 01434 // 01435 ECNotifyParent(ped, EN_CHANGE); 01436 } 01437 } 01438 ECSetCaretHandler( ped ); 01439 } 01440 01441 } else if(lParam & CS_INSERTCHAR) { 01442 01443 // 01444 // If we are in the middle of a mousedown command, don't do anything. 01445 // 01446 if (ped->fMouseDown) { 01447 return lReturn; 01448 } 01449 01450 // 01451 // We can safely assume that interimm character is always DBCS. 01452 // 01453 ich = ( ped->fAnsi ) ? 2 : 1; 01454 01455 if ( ped->fReplaceCompChr ) { 01456 // 01457 // we have a character to be replaced. 01458 // let's delete it before inserting the new one. 01459 // when we have a composition characters, the 01460 // caret is placed before the composition character. 01461 // 01462 ped->ichMaxSel = min(ped->ichCaret+ich, ped->cch); 01463 ped->ichMinSel = ped->ichCaret; 01464 } 01465 01466 // 01467 // let's delete current selected text or composition character 01468 // 01469 if ( ped->fSingle ) { 01470 if ( ECDeleteText( ped ) > 0 ) { 01471 fSLTextUpdated = TRUE; 01472 } 01473 } else { 01474 MLDeleteText( ped ); 01475 } 01476 01477 // 01478 // When the composition charcter is canceled, IME may give us NULL wParam, 01479 // with CS_INSERTCHAR flag on. We shouldn't insert a NULL character. 01480 // 01481 if ( wParam != 0 ) { 01482 01483 if ( ped->fAnsi ) { 01484 TextBuf[0] = HIBYTE(LOWORD(wParam)); // leading byte 01485 TextBuf[1] = LOBYTE(LOWORD(wParam)); // trailing byte 01486 TextBuf[2] = '\0'; 01487 } else { 01488 TextBuf[0] = LOBYTE(LOWORD(wParam)); 01489 TextBuf[1] = HIBYTE(LOWORD(wParam)); 01490 TextBuf[2] = '\0'; 01491 TextBuf[3] = '\0'; 01492 } 01493 01494 if ( ped->fSingle ) { 01495 01496 iResult = SLInsertText( ped, (LPSTR)TextBuf, ich ); 01497 if (iResult == 0) { 01498 /* 01499 * Couldn't insert the text, for e.g. the text exceeded the limit. 01500 */ 01501 NtUserMessageBeep(0); 01502 } else if (iResult > 0) { 01503 /* 01504 * Remember we need to update the text. 01505 */ 01506 fSLTextUpdated = TRUE; 01507 } 01508 01509 } else { 01510 01511 iResult = MLInsertText( ped, (LPSTR)TextBuf, ich, TRUE); 01512 } 01513 01514 if ( iResult > 0 ) { 01515 // 01516 // ped->fReplaceCompChr will be reset: 01517 // 01518 // 1) when the character is finalized. 01519 // we will receive GCS_RESULTSTR 01520 // 01521 // 2) when the character is canceled. 01522 // 01523 // we will receive WM_IME_COMPOSITION|CS_INSERTCHAR 01524 // with wParam == 0 (in case of user types backspace 01525 // at the first element of composition character). 01526 // 01527 // or 01528 // 01529 // we will receive WM_IME_ENDCOMPOSITION message 01530 // 01531 ped->fReplaceCompChr = TRUE; 01532 01533 // 01534 // Caret should be placed BEFORE the composition 01535 // character. 01536 // 01537 ped->ichCaret = max( 0, ped->ichCaret - ich); 01538 ECSetCaretHandler( ped ); 01539 } else { 01540 01541 // 01542 // We failed to insert a character. We might run out 01543 // of memory, or reached to the text size limit. let's 01544 // cancel the composition character. 01545 // 01546 hImc = fpImmGetContext(ped->hwnd); 01547 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); 01548 fpImmReleaseContext(ped->hwnd, hImc); 01549 01550 ped->fReplaceCompChr = FALSE; 01551 ECSetCaretHandler( ped ); 01552 } 01553 } else { 01554 // 01555 // the composition character is canceled. 01556 // 01557 ped->fReplaceCompChr = FALSE; 01558 ECSetCaretHandler( ped ); 01559 } 01560 01561 // 01562 // We won't notify parent the text change 01563 // because the composition character has 01564 // not been finalized. 01565 // 01566 if ( fSLTextUpdated ) { 01567 01568 // 01569 // Update the display 01570 // 01571 ECNotifyParent(ped, EN_UPDATE); 01572 01573 hdc = ECGetEditDC(ped,FALSE); 01574 01575 if ( ped->fReplaceCompChr ) { 01576 // 01577 // move back the caret to the original position 01578 // temporarily so that our new block cursor can 01579 // be located within the visible area of window. 01580 // 01581 ped->ichCaret = min( ped->cch, ped->ichCaret + ich); 01582 SLScrollText(ped, hdc); 01583 ped->ichCaret = max( 0, ped->ichCaret - ich); 01584 } else { 01585 SLScrollText(ped, hdc); 01586 } 01587 SLDrawText(ped, hdc, 0); 01588 01589 ECReleaseEditDC(ped,hdc,FALSE); 01590 01591 // 01592 // Tell parent our text contents changed. 01593 // 01594 ECNotifyParent(ped, EN_CHANGE); 01595 } 01596 return lReturn; 01597 } 01598 01599 return DefWindowProcWorker(ped->pwnd, WM_IME_COMPOSITION, wParam, lParam, ped->fAnsi); 01600 }

LRESULT EcImeRequestHandler PED  ,
WPARAM  ,
LPARAM 
 

Definition at line 1735 of file edecrare.c.

References BYTE, tagED::cbChar, ECImmSetCompositionWindow(), ECInOutReconversionMode(), ECLock(), ECUnlock(), tagED::fAnsi, tagED::fFocus, fpImmIsIME, tagED::hText, tagED::ichMaxSel, tagED::ichMinSel, INT, L, lpDest, LPVOID, NULL, THREAD_HKL, TRUE, and UINT.

Referenced by EditWndProc().

01736 { 01737 LRESULT lreturn = 0L; 01738 01739 switch (dwSubMsg) { 01740 case IMR_CONFIRMRECONVERTSTRING: 01741 // Edit control does not allow IME to change it. 01742 break; 01743 01744 case IMR_RECONVERTSTRING: 01745 // 01746 // CHECK VERSION of the structure 01747 // 01748 if (lParam && ((LPRECONVERTSTRING)lParam)->dwVersion != 0) { 01749 RIPMSG1(RIP_WARNING, "EcImeRequestHandler: RECONVERTSTRING dwVersion is not expected.", 01750 ((LPRECONVERTSTRING)lParam)->dwVersion); 01751 return 0L; 01752 } 01753 01754 if (ped && ped->fFocus && ped->hText && fpImmIsIME(THREAD_HKL())) { 01755 UINT cchLen = ped->ichMaxSel - ped->ichMinSel; // holds character count. 01756 if (cchLen == 0) { 01757 // if we have no selection, 01758 // just return 0. 01759 break; 01760 } 01761 01762 UserAssert(ped->cbChar == sizeof(BYTE) || ped->cbChar == sizeof(WCHAR)); 01763 01764 // This Edit Control has selection. 01765 if (lParam == 0) { 01766 // 01767 // IME just want to get required size for buffer. 01768 // cchLen + 1 is needed to reserve room for trailing L'\0'. 01769 // ~~~~ 01770 lreturn = sizeof(RECONVERTSTRING) + (cchLen + 1) * ped->cbChar; 01771 } else { 01772 LPRECONVERTSTRING lpRCS = (LPRECONVERTSTRING)lParam; 01773 LPVOID lpSrc; 01774 LPVOID lpDest = (LPBYTE)lpRCS + sizeof(RECONVERTSTRING); 01775 01776 // check buffer size 01777 // if the given buffer is smaller than actual needed size, 01778 // shrink our size to fit the buffer 01779 if ((INT)lpRCS->dwSize <= sizeof(RECONVERTSTRING) + cchLen * ped->cbChar) { 01780 RIPMSG0(RIP_WARNING, "EcImeRequest: ERR09"); 01781 cchLen = (lpRCS->dwSize - sizeof(RECONVERTSTRING)) / ped->cbChar - ped->cbChar; 01782 } 01783 01784 lpRCS->dwStrOffset = sizeof(RECONVERTSTRING); // buffer begins just after RECONVERTSTRING 01785 lpRCS->dwCompStrOffset = 01786 lpRCS->dwTargetStrOffset = 0; 01787 lpRCS->dwStrLen = 01788 lpRCS->dwCompStrLen = 01789 lpRCS->dwTargetStrLen = cchLen; // StrLen means TCHAR count 01790 01791 lpSrc = ECLock(ped); 01792 if (lpSrc == NULL) { 01793 RIPMSG0(RIP_WARNING, "EcImeRequestHandler: LOCALLOCK(ped) failed."); 01794 } else { 01795 RtlCopyMemory(lpDest, 01796 (LPBYTE)lpSrc + ped->ichMinSel * ped->cbChar, 01797 cchLen * ped->cbChar); 01798 // Null-Terminate the string 01799 if (ped->fAnsi) { 01800 LPBYTE psz = (LPBYTE)lpDest; 01801 psz[cchLen] = '\0'; 01802 } else { 01803 LPWSTR pwsz = (LPWSTR)lpDest; 01804 pwsz[cchLen] = L'\0'; 01805 } 01806 ECUnlock(ped); 01807 // final buffer size 01808 lreturn = sizeof(RECONVERTSTRING) + (cchLen + 1) * ped->cbChar; 01809 01810 ECInOutReconversionMode(ped, TRUE); 01811 ECImmSetCompositionWindow(ped, 0, 0); 01812 } 01813 } 01814 01815 } 01816 break; 01817 } 01818 01819 return lreturn; 01820 }

void ECImmSetCompositionFont PED  ped  ) 
 

Definition at line 1150 of file edecrare.c.

References fpImmGetContext, fpImmReleaseContext, fpImmSetCompositionFontW, tagED::hFont, tagED::hwnd, lf, NULL_HIMC, and VOID().

Referenced by ECEnableDisableIME(), ECSetFont(), and EditWndProc().

01151 { 01152 HIMC hImc; 01153 LOGFONTW lf; 01154 01155 if ( (hImc = fpImmGetContext( ped->hwnd )) != NULL_HIMC ) { 01156 01157 if (ped->hFont) { 01158 GetObjectW( ped->hFont, 01159 sizeof(LOGFONTW), 01160 (LPLOGFONTW)&lf); 01161 } else { 01162 GetObjectW( GetStockObject(SYSTEM_FONT), 01163 sizeof(LOGFONTW), 01164 (LPLOGFONTW)&lf); 01165 } 01166 fpImmSetCompositionFontW( hImc, &lf ); 01167 fpImmReleaseContext( ped->hwnd, hImc ); 01168 } 01169 }

void ECImmSetCompositionWindow PED  ped,
LONG  ,
LONG 
 

Definition at line 1085 of file edecrare.c.

References DWORD, tagED::fAnsi, tagED::fFocus, tagED::fInReconversion, fpImmGetCompositionWindow, fpImmGetContext, fpImmReleaseContext, fpImmSetCompositionWindow, tagED::fSingle, GET_X_LPARAM, GET_Y_LPARAM, GetWindowRect(), tagED::hwnd, tagED::ichMinSel, MapWindowPoints(), NULL_HIMC, tagED::ptScreenBounding, tagED::rcFmt, SetRectEmpty, and VOID().

Referenced by ECDoIMEMenuCommand(), ECEnableDisableIME(), EcImeRequestHandler(), ECSize(), EditWndProc(), MLSetCaretPosition(), and SLSetCaretPosition().

01086 { 01087 COMPOSITIONFORM cf; 01088 COMPOSITIONFORM cft; 01089 RECT rcScreenWindow; 01090 HIMC hImc; 01091 01092 hImc = fpImmGetContext( ped->hwnd ); 01093 if ( hImc != NULL_HIMC ) { 01094 01095 if ( ped->fFocus ) { 01096 GetWindowRect( ped->hwnd, &rcScreenWindow); 01097 // assuming RECT.left is the first and and RECT.top is the second field 01098 MapWindowPoints( ped->hwnd, HWND_DESKTOP, (LPPOINT)&rcScreenWindow, 2); 01099 if (ped->fInReconversion) { 01100 DWORD dwPoint = (DWORD)(ped->fAnsi ? SendMessageA : SendMessageW)(ped->hwnd, EM_POSFROMCHAR, ped->ichMinSel, 0); 01101 01102 x = GET_X_LPARAM(dwPoint); 01103 y = GET_Y_LPARAM(dwPoint); 01104 01105 RIPMSG2(RIP_WARNING, "ECImmSetCompositionWindow: fInReconversion (%d,%d)", x, y); 01106 } 01107 // 01108 // The window currently has the focus. 01109 // 01110 if (ped->fSingle) { 01111 // 01112 // Single line edit control. 01113 // 01114 cf.dwStyle = CFS_POINT; 01115 cf.ptCurrentPos.x = x; 01116 cf.ptCurrentPos.y = y; 01117 SetRectEmpty(&cf.rcArea); 01118 01119 } else { 01120 // 01121 // Multi line edit control. 01122 // 01123 cf.dwStyle = CFS_RECT; 01124 cf.ptCurrentPos.x = x; 01125 cf.ptCurrentPos.y = y; 01126 cf.rcArea = ped->rcFmt; 01127 } 01128 fpImmGetCompositionWindow( hImc, &cft ); 01129 if ( (!RtlEqualMemory(&cf,&cft,sizeof(COMPOSITIONFORM))) || 01130 (ped->ptScreenBounding.x != rcScreenWindow.left) || 01131 (ped->ptScreenBounding.y != rcScreenWindow.top) ) { 01132 01133 ped->ptScreenBounding.x = rcScreenWindow.left; 01134 ped->ptScreenBounding.y = rcScreenWindow.top; 01135 fpImmSetCompositionWindow( hImc, &cf ); 01136 } 01137 } 01138 fpImmReleaseContext( ped->hwnd, hImc ); 01139 } 01140 }

void ECInitInsert PED  ped,
HKL  hkl
 

Definition at line 1183 of file edecrare.c.

References ECSetCaretHandler(), FALSE, tagED::fInsertCompChr, tagED::fKorea, tagED::fNoMoveCaret, fpImmIsIME, tagED::fReplaceCompChr, tagED::fResultProcess, TRUE, and VOID().

Referenced by ECCreate(), ECEnableDisableIME(), and EditWndProc().

01184 { 01185 ped->fKorea = FALSE; 01186 ped->fInsertCompChr = FALSE; 01187 ped->fNoMoveCaret = FALSE; 01188 ped->fResultProcess = FALSE; 01189 01190 if ( fpImmIsIME(hkl) ) { 01191 if ( PRIMARYLANGID(LOWORD(HandleToUlong(hkl))) == LANG_KOREAN ) { 01192 01193 ped->fKorea = TRUE; 01194 } 01195 // 01196 // LATER:this flag should be set based on the IME caps 01197 // retrieved from IME. (Such IME caps should be defined) 01198 // For now, we can safely assume that only Korean IMEs 01199 // set CS_INSERTCHAR. 01200 // 01201 if ( ped->fKorea ) { 01202 ped->fInsertCompChr = TRUE; 01203 } 01204 } 01205 01206 // 01207 // if we had a composition character, the shape of caret 01208 // is changed. We need to reset the caret shape. 01209 // 01210 if ( ped->fReplaceCompChr ) { 01211 ped->fReplaceCompChr = FALSE; 01212 ECSetCaretHandler( ped ); 01213 } 01214 }

void ECInOutReconversionMode PED  ped,
BOOL  fIn
 

Definition at line 402 of file editec.c.

References FALSE, tagED::fFocus, tagED::fInReconversion, tagED::hwnd, NtUserHideCaret(), NtUserShowCaret(), and TRUE.

Referenced by ECDoIMEMenuCommand(), ECImeComposition(), EcImeRequestHandler(), EditWndProc(), MLChar(), MLEditWndProc(), and SLChar().

00403 { 00404 UserAssert(fIn == TRUE || fIn == FALSE); 00405 if (fIn == ped->fInReconversion) { 00406 return; 00407 } 00408 ped->fInReconversion = fIn; 00409 if (ped->fFocus) { 00410 (fIn ? NtUserHideCaret: NtUserShowCaret)(ped->hwnd); 00411 } 00412 00413 return; 00414 }

BOOL ECInsertText PED  ,
LPSTR  ,
ICH
 

Definition at line 2059 of file editec.c.

References BOOL, tagED::cbChar, tagED::cch, tagED::cchAlloc, CCHALLOCEXTRA, CharLowerBuffA(), CharLowerBuffW(), tagED::charSet, CharToOemBuffA(), CharToOemBuffW(), CharUpperBuffA(), CharUpperBuffW(), DWORD, ECAdjustIch(), ECGetEditDC(), ECIsDBCSLeadByte(), ECLock(), ECMergeUndoInsertInfo(), ECReleaseEditDC(), ECUnlock(), tagLPKEDITCALLOUT::EditAdjustCaret, tagLPKEDITCALLOUT::EditVerifyText, FALSE, tagED::fAnsi, tagED::fDirty, GETAPPVER, tagED::hInstance, tagED::hText, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, INT, IS_DBCS_ENABLED, IsCharLowerA(), IsCharLowerW(), LHND, LOCALREALLOC, LOCALSIZE, OemToCharBuffA(), OemToCharBuffW(), tagED::pLpkEditCallout, Pundo, tagED::pwnd, strlen(), TRUE, UNICODE_CARRIAGERETURN, UNICODE_LINEFEED, UNICODE_TAB, and VER50.

Referenced by ECSetText(), MLInsertText(), and SLInsertText().

02063 { 02064 PSTR pedText; 02065 PSTR pTextBuff; 02066 LONG style; 02067 HANDLE hTextCopy; 02068 DWORD allocamt; 02069 02070 // 02071 // If the last byte (lpText[cchInsert - 1]) is a DBCS leading byte 02072 // we need to adjust it. 02073 // 02074 *pcchInsert = ECAdjustIch(ped, lpText, *pcchInsert); 02075 02076 if (!*pcchInsert) 02077 return TRUE; 02078 02079 /* 02080 * Do we already have enough memory?? 02081 */ 02082 if (*pcchInsert >= (ped->cchAlloc - ped->cch)) { 02083 02084 /* 02085 * Allocate what we need plus a little extra. Return FALSE if we are 02086 * unsuccessful. 02087 */ 02088 allocamt = (ped->cch + *pcchInsert) * ped->cbChar; 02089 allocamt += CCHALLOCEXTRA; 02090 02091 // if (!ped->fSingle) { 02092 hTextCopy = LOCALREALLOC(ped->hText, allocamt, LHND, ped->hInstance, &lpText); 02093 if (hTextCopy) { 02094 ped->hText = hTextCopy; 02095 } else { 02096 return FALSE; 02097 } 02098 // } else { 02099 // if (!LocalReallocSafe(ped->hText, allocamt, LHND, pped)) 02100 // return FALSE; 02101 // } 02102 02103 ped->cchAlloc = LOCALSIZE(ped->hText, ped->hInstance) / ped->cbChar; 02104 } 02105 02106 02107 /* 02108 * Ok, we got the memory. Now copy the text into the structure 02109 */ 02110 pedText = ECLock(ped); 02111 02112 if (ped->pLpkEditCallout) { 02113 HDC hdc; 02114 INT iResult; 02115 02116 hdc = ECGetEditDC (ped, TRUE); 02117 iResult = ped->pLpkEditCallout->EditVerifyText (ped, hdc, pedText, ped->ichCaret, lpText, *pcchInsert); 02118 ECReleaseEditDC (ped, hdc, TRUE); 02119 02120 if (iResult == 0) { 02121 ECUnlock (ped); 02122 return TRUE; 02123 } 02124 } 02125 02126 /* 02127 * Get a pointer to the place where text is to be inserted 02128 */ 02129 pTextBuff = pedText + ped->ichCaret * ped->cbChar; 02130 02131 if (ped->ichCaret != ped->cch) { 02132 02133 /* 02134 * We are inserting text into the middle. We have to shift text to the 02135 * right before inserting new text. 02136 */ 02137 memmove(pTextBuff + *pcchInsert * ped->cbChar, pTextBuff, (ped->cch-ped->ichCaret) * ped->cbChar); 02138 } 02139 02140 /* 02141 * Make a copy of the text being inserted in the edit buffer. 02142 * Use this copy for doing UPPERCASE/LOWERCASE ANSI/OEM conversions 02143 * Fix for Bug #3406 -- 01/29/91 -- SANKAR -- 02144 */ 02145 memmove(pTextBuff, lpText, *pcchInsert * ped->cbChar); 02146 ped->cch += *pcchInsert; 02147 02148 /* 02149 * Get the control's style 02150 */ 02151 style = ped->pwnd->style; 02152 02153 /* 02154 * Do the Upper/Lower conversion 02155 */ 02156 if (style & ES_LOWERCASE) { 02157 if (ped->fAnsi) 02158 CharLowerBuffA((LPSTR)pTextBuff, *pcchInsert); 02159 else 02160 CharLowerBuffW((LPWSTR)pTextBuff, *pcchInsert); 02161 } else { 02162 if (style & ES_UPPERCASE) { 02163 if (ped->fAnsi) { 02164 CharUpperBuffA(pTextBuff, *pcchInsert); 02165 } else { 02166 CharUpperBuffW((LPWSTR)pTextBuff, *pcchInsert); 02167 } 02168 } 02169 } 02170 02171 /* 02172 * Do the OEM conversion 02173 */ 02174 if ((style & ES_OEMCONVERT) && 02175 // For backward compatibility with NT4, we don't perform OEM conversion 02176 // for older apps if the system locale is FarEast. 02177 // 02178 (!IS_DBCS_ENABLED() || GETAPPVER() >= VER50 || GetOEMCP() != GetACP())) { 02179 02180 ICH i; 02181 02182 if (ped->fAnsi) { 02183 for (i = 0; i < *pcchInsert; i++) { 02184 // 02185 // We don't need to call CharToOemBuff etc. if the character 02186 // is a double byte character. And, calling ECIsDBCSLeadByte is 02187 // faster and less complicated because we don't have to deal 02188 // with the 2 byte dbcs cases. 02189 // 02190 if (IS_DBCS_ENABLED() && ECIsDBCSLeadByte(ped, *(lpText+i))) { 02191 i++; 02192 continue; 02193 } 02194 02195 // 02196 // Windows Bug (Whistler) 35289 02197 // greek has funny rules for casing, so we need to check for it. 02198 // for nashville we should be doing something more appropriate 02199 // but for now, leave as Win95 golden 02200 // 02201 if (ped->charSet != GREEK_CHARSET && IsCharLowerA(*(pTextBuff + i))) { 02202 CharUpperBuffA(pTextBuff + i, 1); 02203 CharToOemBuffA(pTextBuff + i, pTextBuff + i, 1); 02204 OemToCharBuffA(pTextBuff + i, pTextBuff + i, 1); 02205 CharLowerBuffA(pTextBuff + i, 1); 02206 } else { 02207 CharToOemBuffA(pTextBuff + i, pTextBuff + i, 1); 02208 OemToCharBuffA(pTextBuff + i, pTextBuff + i, 1); 02209 } 02210 } 02211 } else { 02212 // 02213 // Because 'ch' may become DBCS, and have a space for NULL. 02214 // 02215 UCHAR ch[4]; 02216 LPWSTR lpTextW = (LPWSTR)pTextBuff; 02217 02218 for (i = 0; i < *pcchInsert; i++) { 02219 if (*(lpTextW + i) == UNICODE_CARRIAGERETURN || 02220 *(lpTextW + i) == UNICODE_LINEFEED || 02221 *(lpTextW + i) == UNICODE_TAB) { 02222 continue; 02223 } 02224 // 02225 // Windows Bug (Whistler) 35289 02226 // greek has funny rules for casing, so we need to check for it. 02227 // for nashville we should be doing something more appropriate 02228 // but for now, leave as Win95 golden 02229 // 02230 if (ped->charSet != GREEK_CHARSET && IsCharLowerW(*(lpTextW + i))) { 02231 CharUpperBuffW(lpTextW + i, 1); 02232 *(LPDWORD)ch = 0; // make sure the null-terminate. 02233 CharToOemBuffW(lpTextW + i, ch, 1); 02234 // 02235 // We assume any SBCS/DBCS character will converted 02236 // to 1 Unicode char, Otherwise, we may overwrite 02237 // next character... 02238 // 02239 OemToCharBuffW(ch, lpTextW + i, strlen(ch)); 02240 CharLowerBuffW(lpTextW + i, 1); 02241 } else { 02242 *(LPDWORD)ch = 0; // make sure the null-terminate. 02243 CharToOemBuffW(lpTextW + i, ch, 1); 02244 // 02245 // We assume any SBCS/DBCS character will converted 02246 // to 1 Unicode char, Otherwise, we may overwrite 02247 // next character... 02248 // 02249 OemToCharBuffW(ch, lpTextW + i, strlen(ch)); 02250 } 02251 } 02252 } 02253 } 02254 02255 /* Adjust UNDO fields so that we can undo this insert... */ 02256 ECMergeUndoInsertInfo(Pundo(ped), ped->ichCaret, *pcchInsert); 02257 02258 ped->ichCaret += *pcchInsert; 02259 02260 if (ped->pLpkEditCallout) { 02261 HDC hdc; 02262 02263 hdc = ECGetEditDC (ped, TRUE); 02264 ped->ichCaret = ped->pLpkEditCallout->EditAdjustCaret (ped, hdc, pedText, ped->ichCaret); 02265 ECReleaseEditDC (ped, hdc, TRUE); 02266 } 02267 02268 ped->ichMinSel = ped->ichMaxSel = ped->ichCaret; 02269 02270 ECUnlock(ped); 02271 02272 /* 02273 * Set dirty bit 02274 */ 02275 ped->fDirty = TRUE; 02276 02277 return TRUE; 02278 }

void ECInvalidateClient PED  ped,
BOOL  fErase
 

Definition at line 2679 of file editec.c.

References _GetClientRect(), tagED::fFlatBorder, tagED::hwnd, InflateRect(), NtUserInvalidateRect(), NULL, tagED::pwnd, and SYSMET.

Referenced by ECResetTextInfo(), ECSetMargin(), ECUpdateFormat(), EditWndProc(), and SLUndo().

02680 { 02681 if (ped->fFlatBorder) { 02682 RECT rcT; 02683 02684 _GetClientRect(ped->pwnd, &rcT); 02685 InflateRect(&rcT, -SYSMET(CXBORDER), 02686 -SYSMET(CYBORDER)); 02687 NtUserInvalidateRect(ped->hwnd, &rcT, fErase); 02688 } else { 02689 NtUserInvalidateRect(ped->hwnd, NULL, fErase); 02690 } 02691 }

BOOL ECIsCharNumeric PED  ped,
DWORD  keyPress
 

Definition at line 1010 of file edecrare.c.

References BOOL, FALSE, tagED::fAnsi, THREAD_HKL, and TRUE.

Referenced by MLChar(), and SLChar().

01013 { 01014 WORD wCharType; 01015 01016 if (ped->fAnsi) { 01017 char ch = (char)keyPress; 01018 LCID lcid = (LCID)((ULONG_PTR)THREAD_HKL() & 0xFFFF); 01019 GetStringTypeA(lcid, CT_CTYPE1, &ch, 1, &wCharType); 01020 } else { 01021 WCHAR wch = (WCHAR)keyPress; 01022 GetStringTypeW(CT_CTYPE1, &wch, 1, &wCharType); 01023 } 01024 return (wCharType & C1_DIGIT ? TRUE : FALSE); 01025 }

BOOL ECIsDBCSLeadByte PED  ,
BYTE 
 

Definition at line 4083 of file editec.c.

References BOOL, tagED::DBCSVector, FALSE, tagED::fAnsi, tagED::fDBCS, and TRUE.

Referenced by ECAdjustIch(), ECAnsiNext(), ECAnsiPrev(), ECInsertText(), ECNextIch(), ECPrevIch(), ECTabTheTextOut(), ECWord(), MLBuildchLines(), MLChar(), MLMouseMotion(), SLChar(), SLMouseMotion(), and SLMouseToIch().

04084 { 04085 int i; 04086 04087 if (!ped->fDBCS || !ped->fAnsi) 04088 return (FALSE); 04089 04090 for (i = 0; ped->DBCSVector[i]; i += 2) { 04091 if ((ped->DBCSVector[i] <= cch) && (ped->DBCSVector[i+1] >= cch)) 04092 return (TRUE); 04093 } 04094 04095 return (FALSE); 04096 }

PSTR ECLock PED  ped  ) 
 

Definition at line 52 of file editec.c.

References tagED::cbChar, tagED::cch, FALSE, tagED::fEncoded, tagED::hInstance, tagED::hText, tagED::iLockLevel, LOCALLOCK, RtlRunDecodeUnicodeString(), tagED::seed, and USHORT.

Referenced by ECCopy(), ECDeleteText(), ECDoIMEMenuCommand(), ECGetText(), EcImeRequestHandler(), ECInsertText(), ECNextIch(), ECPrevIch(), ECSetCaretHandler(), ECWord(), HanjaKeyHandler(), MLBuildchLines(), MLCalcXOffset(), MLDrawText(), MLEditWndProc(), MLGetLine(), MLIchToXYPos(), MLIchToYPos(), MLInsertCrCrLf(), MLInsertText(), MLKeyDown(), MLLine(), MLMouseMotion(), MLMouseToIch(), MLMoveSelection(), MLMoveSelectionRestricted(), MLSetHandle(), MLSetSelection(), MLStripCrCrLf(), MLUpdateiCaretLine(), NextWordCallBack(), NextWordLpkCallBack(), SLCalcStringWidth(), SLCalcXOffsetSpecial(), SLChangeSelection(), SLDrawLine(), SLDrawText(), SLGetClipRect(), SLIchToLeftXPos(), SLInsertText(), SLMouseMotion(), SLMouseToIch(), SLMoveSelectionRestricted(), and SLScrollText().

00054 { 00055 PSTR ptext = LOCALLOCK(ped->hText, ped->hInstance); 00056 ped->iLockLevel++; 00057 00058 /* 00059 * If this is the first lock of the text and the text is encoded 00060 * decode the text. 00061 */ 00062 //RIPMSG2(RIP_VERBOSE, "lock : %d '%10s'\n", ped->iLockLevel, ptext); 00063 if (ped->iLockLevel == 1 && ped->fEncoded) { 00064 /* 00065 * rtlrundecode can't handle zero length strings 00066 */ 00067 if (ped->cch != 0) { 00068 STRING string; 00069 string.Length = string.MaximumLength = (USHORT)(ped->cch * ped->cbChar); 00070 string.Buffer = ptext; 00071 00072 RtlRunDecodeUnicodeString(ped->seed, (PUNICODE_STRING)&string); 00073 //RIPMSG1(RIP_VERBOSE, "Decoding: '%10s'\n", ptext); 00074 } 00075 ped->fEncoded = FALSE; 00076 } 00077 return ptext; 00078 }

BOOL ECNcCreate PED  ,
PWND  ,
LPCREATESTRUCT 
 

Definition at line 285 of file edecrare.c.

References BOOL, tagED::cbChar, tagED::cchAlloc, CCHALLOCEXTRA, CHAR, tagED::charWidthBuffer, tagED::chLines, ClearWindowState(), DefWindowProcWorker(), DWORD, EditLookaside, EFMULTILINE, EFREADONLY, tagED::f40Compat, FALSE, tagED::fAnsi, tagED::fBorder, tagED::fDisabled, tagED::fEncoded, tagED::fFlatBorder, FNID_CLEANEDUP_BIT, tagED::fReadOnly, FreeLookasideEntry(), tagED::fSingle, tagED::fWin31Compat, GETEXPWINVER, tagED::hImcPrev, tagED::hInstance, tagED::hText, tagED::hwnd, tagED::hwndParent, HWq, tagED::iLockLevel, LHND, tagED::lineHeight, LOCALALLOC, NtUserSetWindowFNID(), NULL, NULL_HIMC, tagED::pTabStops, TestWF, TRUE, WEFEDGEMASK, WFANSICREATOR, WFBORDER, WFDISABLED, and tagED::wImeStatus.

Referenced by EditWndProc().

00289 { 00290 HWND hwnd = HWq(pwnd); 00291 BOOL fAnsi; 00292 00293 fAnsi = TestWF(pwnd, WFANSICREATOR); 00294 00295 /* 00296 * Initialize the ped 00297 */ 00298 ped->fEncoded = FALSE; 00299 ped->iLockLevel = 0; 00300 00301 ped->chLines = NULL; 00302 ped->pTabStops = NULL; 00303 ped->charWidthBuffer = NULL; 00304 ped->fAnsi = fAnsi ? 1 : 0; // Force TRUE to be 1 because its a 1 bit field 00305 ped->cbChar = (WORD)(fAnsi ? sizeof(CHAR) : sizeof(WCHAR)); 00306 ped->hInstance = pwnd->hModule; 00307 // IME 00308 ped->hImcPrev = NULL_HIMC; 00309 00310 { 00311 DWORD dwVer = GETEXPWINVER(lpCreateStruct->hInstance); 00312 00313 ped->fWin31Compat = (dwVer >= 0x030a); 00314 ped->f40Compat = (dwVer >= 0x0400); 00315 } 00316 00317 // 00318 // NOTE: 00319 // The order of the following two checks is important. People can 00320 // create edit fields with a 3D and a normal border, and we don't 00321 // want to disallow that. But we need to detect the "no 3D border" 00322 // border case too. 00323 // 00324 if (TestWF(pwnd, WEFEDGEMASK)) 00325 { 00326 ped->fBorder = TRUE; 00327 } 00328 else if (TestWF(pwnd, WFBORDER)) 00329 { 00330 ClearWindowState(pwnd, WFBORDER); 00331 ped->fFlatBorder = TRUE; 00332 ped->fBorder = TRUE; 00333 } 00334 00335 if (!TestWF(pwnd, EFMULTILINE)) 00336 ped->fSingle = TRUE; 00337 00338 if (TestWF(pwnd, WFDISABLED)) 00339 ped->fDisabled = TRUE; 00340 00341 if (TestWF(pwnd, EFREADONLY)) { 00342 if (!ped->fWin31Compat) { 00343 /* 00344 * BACKWARD COMPATIBILITY HACK 00345 * 00346 * "MileStone" unknowingly sets the ES_READONLY style. So, we strip this 00347 * style here for all Win3.0 apps (this style is new for Win3.1). 00348 * Fix for Bug #12982 -- SANKAR -- 01/24/92 -- 00349 */ 00350 ClearWindowState(pwnd, EFREADONLY); 00351 } else 00352 ped->fReadOnly = TRUE; 00353 } 00354 00355 00356 /* 00357 * Allocate storage for the text for the edit controls. Storage for single 00358 * line edit controls will always get allocated in the local data segment. 00359 * Multiline will allocate in the local ds but the app may free this and 00360 * allocate storage elsewhere... 00361 */ 00362 ped->hText = LOCALALLOC(LHND, CCHALLOCEXTRA*ped->cbChar, ped->hInstance); 00363 if (!ped->hText) { 00364 FreeLookasideEntry(&EditLookaside, ped); 00365 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); /* No ped for this window */ 00366 return FALSE; /* If no_memory error */ 00367 } 00368 00369 ped->cchAlloc = CCHALLOCEXTRA; 00370 ped->lineHeight = 1; 00371 00372 ped->hwnd = hwnd; 00373 ped->hwndParent = lpCreateStruct->hwndParent; 00374 00375 ped->wImeStatus = 0; 00376 00377 return (BOOL)DefWindowProcWorker(pwnd, WM_NCCREATE, 0, 00378 (LPARAM)lpCreateStruct, fAnsi); 00379 }

void ECNcDestroyHandler PWND  ,
PED 
 

Definition at line 439 of file edecrare.c.

References tagED::charWidthBuffer, tagED::chLines, ComboBoxWndProcWorker(), EditLookaside, FALSE, FNID_CLEANEDUP_BIT, FNID_COMBOBOX, FreeLookasideEntry(), GETFNID, tagED::hCaretBitmap, tagED::hInstance, tagED::hText, HWq, LOCALFREE, NtUserSetWindowFNID(), NULL, tagED::pLpkEditCallout, tagED::pTabStops, PTR_TO_ID, REBASEPWND, tagWND::spmenu, UserGlobalFree, and UserLocalFree.

Referenced by EditWndProc().

00442 { 00443 PWND pwndParent; 00444 00445 /* 00446 * ped could be NULL if WM_NCCREATE failed to create it... 00447 */ 00448 if (ped) { 00449 00450 /* 00451 * Free the text buffer (always present?) 00452 */ 00453 LOCALFREE(ped->hText, ped->hInstance); 00454 00455 /* 00456 * Free up undo buffer and line start array (if present) 00457 */ 00458 if (ped->hDeletedText != NULL) 00459 UserGlobalFree(ped->hDeletedText); 00460 00461 /* 00462 * Free tab stop buffer (if present) 00463 */ 00464 if (ped->pTabStops) 00465 UserLocalFree(ped->pTabStops); 00466 00467 /* 00468 * Free line start array (if present) 00469 */ 00470 if (ped->chLines) { 00471 UserLocalFree(ped->chLines); 00472 } 00473 00474 /* 00475 * Free the character width buffer (if present) 00476 */ 00477 if (ped->charWidthBuffer) 00478 UserLocalFree(ped->charWidthBuffer); 00479 00480 /* 00481 * Free the cursor bitmap 00482 */ 00483 if (ped->pLpkEditCallout && ped->hCaretBitmap) { 00484 DeleteObject(ped->hCaretBitmap); 00485 } 00486 00487 /* 00488 * Last but not least, free the ped 00489 */ 00490 FreeLookasideEntry(&EditLookaside, ped); 00491 } 00492 00493 /* 00494 * Set the window's fnid status so that we can ignore rogue messages 00495 */ 00496 NtUserSetWindowFNID(HWq(pwnd), FNID_CLEANEDUP_BIT); 00497 00498 /* 00499 * If we're part of a combo box, let it know we're gone 00500 */ 00501 pwndParent = REBASEPWND(pwnd, spwndParent); 00502 if (pwndParent && GETFNID(pwndParent) == FNID_COMBOBOX) { 00503 ComboBoxWndProcWorker(pwndParent, WM_PARENTNOTIFY, 00504 MAKELONG(WM_DESTROY, PTR_TO_ID(pwnd->spmenu)), (LPARAM)HWq(pwnd), FALSE); 00505 } 00506 }

ICH ECNextIch PED  ,
LPSTR  ,
ICH 
 

Definition at line 3969 of file editec.c.

References ECIsDBCSLeadByte(), ECLock(), ECUnlock(), tagED::fAnsi, tagED::fDBCS, and ICH.

Referenced by MLBuildchLines(), MLDeleteText(), MLMoveSelection(), and SLKeyDown().

03970 { 03971 if (!ped->fDBCS || !ped->fAnsi) { 03972 03973 return (ichCurrent + 1); 03974 03975 } else { 03976 03977 ICH ichRet; 03978 LPSTR pText; 03979 03980 if (pStart) 03981 pText = pStart + ichCurrent; 03982 else 03983 pText = (LPSTR)ECLock(ped) + ichCurrent; 03984 03985 ichRet = ichCurrent + ( ECIsDBCSLeadByte(ped, *pText) ? 2 : 1 ); 03986 03987 if (!pStart) 03988 ECUnlock(ped); 03989 03990 return (ichRet); 03991 } 03992 }

void ECNotifyParent PED  ,
int 
 

Definition at line 2429 of file editec.c.

References DWORD, tagED::hwnd, tagED::hwndParent, PTR_TO_ID, tagED::pwnd, SendMessage(), and tagWND::spmenu.

Referenced by ECImeComposition(), ECResetTextInfo(), ECSetText(), EditWndProc(), MLDeleteText(), MLInsertchLine(), MLInsertCrCrLf(), MLInsertText(), MLKillFocus(), MLScroll(), MLSetFocus(), SLChar(), SLInsertText(), SLKeyDown(), SLKillFocus(), SLPaste(), SLReplaceSel(), SLSetFocus(), and SLUndo().

02432 { 02433 /* 02434 * wParam is NotificationCode (hiword) and WindowID (loword) 02435 * lParam is HWND of control sending the message 02436 * Windows 95 checks for hwndParent != NULL before sending the message, but 02437 * this is surely rare, and SendMessage NULL hwnd does nowt anyway (IanJa) 02438 */ 02439 SendMessage(ped->hwndParent, WM_COMMAND, 02440 (DWORD)MAKELONG(PTR_TO_ID(ped->pwnd->spmenu), notificationCode), 02441 (LPARAM)ped->hwnd); 02442 }

ICH ECPrevIch PED  ,
LPSTR  ,
ICH 
 

Definition at line 4001 of file editec.c.

References ECIsDBCSLeadByte(), ECLock(), ECUnlock(), tagED::fAnsi, tagED::fDBCS, ICH, and tagED::pLpkEditCallout.

Referenced by MLMoveSelection(), SLChar(), and SLKeyDown().

04002 { 04003 LPSTR lpCurrent; 04004 LPSTR lpStr; 04005 LPSTR lpBase; 04006 04007 #ifdef SURROGATE 04008 // Handle Unicode surrogates pairs when CSLPK is loaded 04009 if (ped->fAnsi || !ped->pLpkEditCallout) // if no surrogate processing required 04010 #endif 04011 if (!ped->fDBCS || !ped->fAnsi) 04012 if ( ichCurrent ) 04013 return (ichCurrent - 1); 04014 else 04015 return (ichCurrent); 04016 04017 if (ichCurrent <= 1) 04018 return 0; 04019 04020 if (pStart) 04021 lpBase = pStart; 04022 else 04023 lpBase = ECLock(ped); 04024 04025 #ifdef SURROGATE 04026 04027 // Handle characters represented by multiple codepoints 04028 04029 if (ped->fAnsi) { 04030 04031 // ANSI PrevIch with DBCS support 04032 #endif 04033 04034 lpStr = lpBase + ichCurrent; 04035 lpCurrent = lpStr - 1; 04036 if (ECIsDBCSLeadByte(ped,*lpCurrent)) { 04037 if (!pStart) 04038 ECUnlock(ped); 04039 return (ichCurrent - 2); 04040 } 04041 04042 do { 04043 lpCurrent--; 04044 if (!ECIsDBCSLeadByte(ped, *lpCurrent)) { 04045 lpCurrent++; 04046 break; 04047 } 04048 } while(lpCurrent != lpBase); 04049 04050 if (!pStart) 04051 ECUnlock(ped); 04052 return (ichCurrent - (((lpStr - lpCurrent) & 1) ? 1 : 2)); 04053 04054 #ifdef SURROGATE 04055 04056 } else { 04057 04058 // Unicode PrevIch with surrogate pair support 04059 04060 ichCurrent--; 04061 04062 if ( (((WCHAR*)lpBase)[ichCurrent] & 0xFC00) == 0xDC00 04063 && (((WCHAR*)lpBase)[ichCurrent-1] & 0xFC00) == 0xD800) { 04064 04065 ichCurrent--; 04066 } 04067 04068 if (!pStart) 04069 ECUnlock(ped); 04070 04071 return ichCurrent; 04072 } 04073 #endif 04074 }

void ECReleaseEditDC PED  ,
HDC  ,
BOOL 
 

Definition at line 2524 of file editec.c.

References tagED::hwnd, NtUserShowCaret(), and ReleaseDC().

Referenced by ECCreate(), ECDeleteText(), ECImeComposition(), ECInsertText(), ECSetCaretHandler(), ECSetPasswordChar(), EditWndProc(), MLBuildchLines(), MLCalcXOffset(), MLDeleteText(), MLEditWndProc(), MLEnsureCaretVisible(), MLInsertText(), MLKeyDown(), MLKillFocus(), MLMouseMotion(), MLMoveSelectionRestricted(), MLScroll(), MLSetFocus(), MLSetSelection(), NextWordLpkCallBack(), SLChar(), SLEditWndProc(), SLInsertText(), SLKeyDown(), SLMouseMotion(), SLMoveSelectionRestricted(), SLPaste(), SLReplaceSel(), SLSetFocus(), and SLSetSelection().

02528 { 02529 /* 02530 * Restoring font not necessary 02531 */ 02532 02533 ReleaseDC(ped->hwnd, hdc); 02534 02535 if (!fFastDC) 02536 NtUserShowCaret(ped->hwnd); 02537 }

void ECResetTextInfo PED  ped  ) 
 

Definition at line 2547 of file editec.c.

References _IsWindowVisible(), BOOL, tagED::cLines, ECEmptyUndo(), ECInvalidateClient(), ECNotifyParent(), FALSE, tagED::fDirty, tagED::fSingle, tagED::fWin31Compat, FWINABLE, HW, tagED::hwnd, tagED::iCaretLine, tagED::ichCaret, tagED::ichLinesOnScreen, tagED::ichMaxSel, tagED::ichMinSel, tagED::ichScreenStart, tagED::listboxHwnd, MLBuildchLines(), MLStripCrCrLf(), NotifyWinEvent(), NULL, Pundo, tagED::pwnd, UpdateWindow(), and tagED::xOffset.

Referenced by ECSetText(), and MLSetHandle().

02548 { 02549 // 02550 // Reset caret, selections, scrolling, and dirty information. 02551 // 02552 ped->iCaretLine = ped->ichCaret = 0; 02553 ped->ichMinSel = ped->ichMaxSel = 0; 02554 ped->xOffset = ped->ichScreenStart = 0; 02555 ped->fDirty = FALSE; 02556 02557 ECEmptyUndo(Pundo(ped)); 02558 02559 if (ped->fSingle) { 02560 if (!ped->listboxHwnd) 02561 ECNotifyParent(ped, EN_UPDATE); 02562 } else { 02563 #ifdef BOGUS 02564 // B#14640 02565 // We don't want to strip soft breaks or anything else from text 02566 // that was passed in by the caller. - karlst. 02567 MLStripCrCrLf(ped); 02568 #endif 02569 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 02570 } 02571 02572 if (_IsWindowVisible(ped->pwnd)) { 02573 BOOL fErase; 02574 02575 if (ped->fSingle) 02576 fErase = FALSE; 02577 else 02578 fErase = ((ped->ichLinesOnScreen + ped->ichScreenStart) >= ped->cLines); 02579 02580 // Always redraw whether or not the insert was successful. We might 02581 // have NULL text. Paint() will check the redraw flag for us. 02582 ECInvalidateClient(ped, fErase); 02583 02584 // BACKWARD COMPAT HACK: RAID expects the text to have been updated, 02585 // so we have to do an UpdateWindow here. It moves an edit control 02586 // around with fRedraw == FALSE, so it'll never get the paint message 02587 // with the control in the right place. 02588 if (!ped->fWin31Compat) 02589 UpdateWindow(ped->hwnd); 02590 } 02591 02592 if (ped->fSingle && !ped->listboxHwnd) 02593 ECNotifyParent(ped, EN_CHANGE); 02594 02595 if (FWINABLE()) { 02596 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, HW(ped->pwnd), OBJID_CLIENT, 02597 INDEXID_CONTAINER); 02598 } 02599 }

void ECSaveUndo PUNDO  pundoFrom,
PUNDO  pundoTo,
BOOL  fClear
 

Definition at line 1955 of file editec.c.

References PUNDO, and UNDO.

Referenced by MLInsertText(), MLReplaceSel(), and SLReplaceSel().

01956 { 01957 /* 01958 * Save undo data 01959 */ 01960 RtlCopyMemory(pundoTo, pundoFrom, sizeof(UNDO)); 01961 01962 /* 01963 * Clear passed in undo buffer 01964 */ 01965 if (fClear) 01966 RtlZeroMemory(pundoFrom, sizeof(UNDO) ); 01967 }

void ECSetCaretHandler PED  ped  ) 
 

Definition at line 1225 of file edecrare.c.

References tagED::aveCharWidth, CreateCaret, tagED::cxSysCharWidth, DestroyCaret(), ECGetEditDC(), ECLock(), ECReleaseEditDC(), ECUnlock(), tagED::fAnsi, tagED::fFocus, tagED::fReplaceCompChr, tagED::fSingle, tagED::hwnd, tagED::ichCaret, tagED::lineHeight, MLSetCaretPosition(), NtUserHideCaret(), NtUserShowCaret(), NULL, SLSetCaretPosition(), and TRUE.

Referenced by ECImeComposition(), ECInitInsert(), ECResultStrHandler(), and EditWndProc().

01226 { 01227 HDC hdc; 01228 SIZE size; 01229 PSTR pText; 01230 01231 // if (!ped->fInsertCompChr || ped->fReadOnly) 01232 // return; 01233 01234 // In any case destroy caret beforehand otherwise SetCaretPos() 01235 // will get crazy.. win95d-B#992,B#2370 01236 // 01237 if (ped->fFocus) { 01238 01239 NtUserHideCaret(ped->hwnd); 01240 DestroyCaret(); 01241 if ( ped->fReplaceCompChr ) { 01242 01243 hdc = ECGetEditDC(ped, TRUE ); 01244 pText = ECLock(ped); 01245 01246 if ( ped->fAnsi) 01247 GetTextExtentPointA(hdc, pText + ped->ichCaret, 2, &size); 01248 else 01249 GetTextExtentPointW(hdc, (LPWSTR)pText + ped->ichCaret, 1, &size); 01250 01251 ECUnlock(ped); 01252 ECReleaseEditDC(ped, hdc, TRUE); 01253 01254 CreateCaret(ped->hwnd, (HBITMAP)NULL, size.cx, ped->lineHeight); 01255 } 01256 else { 01257 CreateCaret(ped->hwnd, 01258 (HBITMAP)NULL, 01259 (ped->cxSysCharWidth > ped->aveCharWidth ? 1 : 2), 01260 ped->lineHeight); 01261 } 01262 01263 hdc = ECGetEditDC(ped, TRUE ); 01264 if ( ped->fSingle ) 01265 SLSetCaretPosition( ped, hdc ); 01266 else 01267 MLSetCaretPosition( ped, hdc ); 01268 ECReleaseEditDC(ped, hdc, TRUE); 01269 NtUserShowCaret(ped->hwnd); 01270 } 01271 }

void ECSetEditClip PED  ,
HDC  ,
BOOL 
 

Definition at line 2452 of file editec.c.

References _GetClientRect(), CopyRect, tagED::fFlatBorder, tagED::fWrap, InflateRect(), IntersectRect(), tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, SYSMET, tagED::wLeftMargin, and tagED::wRightMargin.

Referenced by ECGetEditDC(), MLPaint(), MLScroll(), and SLDrawLine().

02453 { 02454 RECT rcClient; 02455 RECT rcClip; 02456 02457 CopyRect(&rcClip, &ped->rcFmt); 02458 02459 if (ped->pLpkEditCallout) { 02460 // Complex script handling chooses whether to write margins later 02461 rcClip.left -= ped->wLeftMargin; 02462 rcClip.right += ped->wRightMargin; 02463 } else { 02464 if (fLeftMargin) /* Should we consider the left margin? */ 02465 rcClip.left -= ped->wLeftMargin; 02466 if (ped->fWrap) /* Should we consider the right margin? */ 02467 rcClip.right += ped->wRightMargin; 02468 } 02469 02470 /* Set clip rectangle to rectClient intersect rectClip */ 02471 /* We must clip for single line edits also. -- B#1360 */ 02472 _GetClientRect(ped->pwnd, &rcClient); 02473 if (ped->fFlatBorder) 02474 InflateRect(&rcClient, -SYSMET(CXBORDER), -SYSMET(CYBORDER)); 02475 02476 IntersectRect(&rcClient, &rcClient, &rcClip); 02477 IntersectClipRect(hdc,rcClient.left, rcClient.top, 02478 rcClient.right, rcClient.bottom); 02479 }

void ECSetFont PED  ,
HFONT  ,
BOOL 
 

Definition at line 708 of file edecrare.c.

References tagED::aveCharWidth, CHAR_WIDTH_BUFFER_LENGTH, tagED::charOverhang, tagED::charPasswordChar, tagED::charSet, tagED::charWidthBuffer, tagED::cxSysCharWidth, tagED::cySysCharHeight, DWORD, ECCalcMarginForDBCSFont(), ECGetCaretWidth, ECGetDBCSVector(), ECImmSetCompositionFont(), ECSetMargin(), ECSetPasswordChar(), ECSize(), tagLPKEDITCALLOUT::EditCreateCaret, tagED::f40Compat, FALSE, tagED::fDBCS, tagED::fFocus, tagED::fNonPropDBCS, tagED::fNonPropFont, fpImmIsIME, tagED::fSingle, tagED::fTrueType, tagED::fWrap, GETAPPVER, GetMaxOverlapChars(), GetNegABCwidthInfo(), gpsi, tagED::hFont, tagED::hwnd, tagED::lineHeight, MLBuildchLines(), NtUserCreateCaret(), NtUserDestroyCaret, NtUserGetDC(), NtUserHideCaret(), NtUserShowCaret(), NULL, tagED::pLpkEditCallout, ReleaseDC(), THREAD_HKL, TRUE, UINT, UserGetCharDimensionsEx(), UserLocalAlloc, UserLocalFree, UserLocalReAlloc, VER40, tagED::wMaxNegA, tagED::wMaxNegAcharPos, tagED::wMaxNegC, and tagED::wMaxNegCcharPos.

Referenced by EditWndProc(), MLCreate(), and SLCreate().

00712 { 00713 short i; 00714 TEXTMETRIC TextMetrics; 00715 HDC hdc; 00716 HFONT hOldFont=NULL; 00717 UINT wBuffSize; 00718 LPINT lpCharWidthBuff; 00719 DWORD dwMaxOverlapChars; 00720 CHWIDTHINFO cwi; 00721 UINT uExtracharPos; 00722 00723 hdc = NtUserGetDC(ped->hwnd); 00724 00725 if (ped->hFont = hfont) { 00726 // 00727 // Since the default font is the system font, no need to select it in 00728 // if that's what the user wants. 00729 // 00730 if (!(hOldFont = SelectObject(hdc, hfont))) { 00731 hfont = ped->hFont = NULL; 00732 } 00733 00734 // 00735 // Get the metrics and ave char width for the currently selected font 00736 // 00737 00738 // 00739 // Call Vertical font-aware AveWidth compute function... 00740 // 00741 // FE_SB 00742 ped->aveCharWidth = UserGetCharDimensionsEx(hdc, hfont, &TextMetrics, &ped->lineHeight); 00743 00744 /* 00745 * This might fail when people uses network fonts (or bad fonts). 00746 */ 00747 if (ped->aveCharWidth == 0) { 00748 RIPMSG0(RIP_WARNING, "ECSetFont: GdiGetCharDimensions failed"); 00749 if (hOldFont != NULL) { 00750 SelectObject(hdc, hOldFont); 00751 } 00752 00753 /* 00754 * We've messed up the ped so let's reset the font. 00755 * Note that we won't recurse more than once because we'll 00756 * pass hfont == NULL. 00757 * Too bad WM_SETFONT doesn't return a value. 00758 */ 00759 ECSetFont(ped, NULL, fRedraw); 00760 return; 00761 } 00762 } else { 00763 ped->aveCharWidth = gpsi->cxSysFontChar; 00764 ped->lineHeight = gpsi->cySysFontChar; 00765 TextMetrics = gpsi->tmSysFont; 00766 } 00767 00768 ped->charOverhang = TextMetrics.tmOverhang; 00769 00770 //assume that they don't have any negative widths at all. 00771 ped->wMaxNegA = ped->wMaxNegC = ped->wMaxNegAcharPos = ped->wMaxNegCcharPos = 0; 00772 00773 00774 // Check if Proportional Width Font 00775 // 00776 // NOTE: as SDK doc says about TEXTMETRIC: 00777 // TMPF_FIXED_PITCH 00778 // If this bit is set the font is a variable pitch font. If this bit is clear 00779 // the font is a fixed pitch font. Note very carefully that those meanings are 00780 // the opposite of what the constant name implies. 00781 // 00782 // Thus we have to reverse the value using logical not (fNonPropFont has 1 bit width) 00783 // 00784 ped->fNonPropFont = !(TextMetrics.tmPitchAndFamily & FIXED_PITCH); 00785 00786 // Check for a TrueType font 00787 // Older app OZWIN chokes if we allocate a bigger buffer for TrueType fonts 00788 // So, for apps older than 4.0, no special treatment for TrueType fonts. 00789 if (ped->f40Compat && (TextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { 00790 ped->fTrueType = GetCharWidthInfo(hdc, &cwi); 00791 #if DBG 00792 if (!ped->fTrueType) { 00793 RIPMSG0(RIP_WARNING, "ECSetFont: GetCharWidthInfo Failed"); 00794 } 00795 #endif 00796 } else { 00797 ped->fTrueType = FALSE; 00798 } 00799 00800 // FE_SB 00801 // 00802 // In DBCS Windows, Edit Control must handle Double Byte Character 00803 // if tmCharSet field of textmetrics is double byte character set 00804 // such as SHIFTJIS_CHARSET(128:Japan), HANGEUL_CHARSET(129:Korea). 00805 // 00806 // We call ECGetDBCSVector even when fAnsi is false so that we could 00807 // treat ped->fAnsi and ped->fDBCS indivisually. I changed ECGetDBCSVector 00808 // function so that it returns 0 or 1, because I would like to set ped->fDBCS 00809 // bit field here. 00810 // 00811 ped->fDBCS = ECGetDBCSVector(ped,hdc,TextMetrics.tmCharSet); 00812 ped->charSet = TextMetrics.tmCharSet; 00813 00814 if (ped->fDBCS) { 00815 // 00816 // Free the character width buffer if ped->fDBCS. 00817 // 00818 // I expect single GetTextExtentPoint call is faster than multiple 00819 // GetTextExtentPoint call (because the graphic engine has a cache buffer). 00820 // See editec.c/ECTabTheTextOut(). 00821 // 00822 if (ped->charWidthBuffer) { 00823 LocalFree(ped->charWidthBuffer); 00824 ped->charWidthBuffer = NULL; 00825 } 00826 00827 // 00828 // if FullWidthChar : HalfWidthChar == 2 : 1.... 00829 // 00830 // TextMetrics.tmMaxCharWidth = FullWidthChar width 00831 // ped->aveCharWidth = HalfWidthChar width 00832 // 00833 if (ped->fNonPropFont && 00834 ((ped->aveCharWidth * 2) == TextMetrics.tmMaxCharWidth)) { 00835 ped->fNonPropDBCS = TRUE; 00836 } else { 00837 ped->fNonPropDBCS = FALSE; 00838 } 00839 00840 } else { 00841 00842 // 00843 // Since the font has changed, let us obtain and save the character width 00844 // info for this font. 00845 // 00846 // First left us find out if the maximum chars that can overlap due to 00847 // negative widths. Since we can't access USER globals, we make a call here. 00848 // 00849 if (!(ped->fSingle || ped->pLpkEditCallout)) { // Is this a multiline edit control with no LPK present? 00850 // 00851 // For multiline edit controls, we maintain a buffer that contains 00852 // the character width information. 00853 // 00854 wBuffSize = (ped->fTrueType) ? (CHAR_WIDTH_BUFFER_LENGTH * sizeof(ABC)) : 00855 (CHAR_WIDTH_BUFFER_LENGTH * sizeof(int)); 00856 00857 if (ped->charWidthBuffer) { /* If buffer already present */ 00858 lpCharWidthBuff = ped->charWidthBuffer; 00859 ped->charWidthBuffer = UserLocalReAlloc(lpCharWidthBuff, wBuffSize, HEAP_ZERO_MEMORY); 00860 if (ped->charWidthBuffer == NULL) { 00861 UserLocalFree((HANDLE)lpCharWidthBuff); 00862 } 00863 } else { 00864 ped->charWidthBuffer = UserLocalAlloc(HEAP_ZERO_MEMORY, wBuffSize); 00865 } 00866 00867 if (ped->charWidthBuffer != NULL) { 00868 if (ped->fTrueType) { 00869 ped->fTrueType = GetNegABCwidthInfo(ped, hdc); 00870 } 00871 00872 /* 00873 * It is possible that the above attempts could have failed and reset 00874 * the value of fTrueType. So, let us check that value again. 00875 */ 00876 if (!ped->fTrueType) { 00877 if (!GetCharWidthA(hdc, 0, CHAR_WIDTH_BUFFER_LENGTH-1, ped->charWidthBuffer)) { 00878 UserLocalFree((HANDLE)ped->charWidthBuffer); 00879 ped->charWidthBuffer=NULL; 00880 } else { 00881 /* 00882 * We need to subtract out the overhang associated with 00883 * each character since GetCharWidth includes it... 00884 */ 00885 for (i=0;i < CHAR_WIDTH_BUFFER_LENGTH;i++) 00886 ped->charWidthBuffer[i] -= ped->charOverhang; 00887 } 00888 } 00889 } /* if (ped->charWidthBuffer != NULL) */ 00890 } /* if (!ped->fSingle) */ 00891 } /* if (ped->fDBCS) */ 00892 00893 { 00894 /* 00895 * Calculate MaxNeg A C metrics 00896 */ 00897 dwMaxOverlapChars = GetMaxOverlapChars(); 00898 if (ped->fTrueType) { 00899 if (cwi.lMaxNegA < 0) 00900 ped->wMaxNegA = -cwi.lMaxNegA; 00901 else 00902 ped->wMaxNegA = 0; 00903 if (cwi.lMaxNegC < 0) 00904 ped->wMaxNegC = -cwi.lMaxNegC; 00905 else 00906 ped->wMaxNegC = 0; 00907 if (cwi.lMinWidthD != 0) { 00908 ped->wMaxNegAcharPos = (ped->wMaxNegA + cwi.lMinWidthD - 1) / cwi.lMinWidthD; 00909 ped->wMaxNegCcharPos = (ped->wMaxNegC + cwi.lMinWidthD - 1) / cwi.lMinWidthD; 00910 if (ped->wMaxNegA + ped->wMaxNegC > (UINT)cwi.lMinWidthD) { 00911 uExtracharPos = (ped->wMaxNegA + ped->wMaxNegC - 1) / cwi.lMinWidthD; 00912 ped->wMaxNegAcharPos += uExtracharPos; 00913 ped->wMaxNegCcharPos += uExtracharPos; 00914 } 00915 } else { 00916 ped->wMaxNegAcharPos = LOWORD(dwMaxOverlapChars); // Left 00917 ped->wMaxNegCcharPos = HIWORD(dwMaxOverlapChars); // Right 00918 } 00919 00920 } else if (ped->charOverhang != 0) { 00921 /* 00922 * Some bitmaps fonts (i.e., italic) have under/overhangs; 00923 * this is pretty much like having negative A and C widths. 00924 */ 00925 ped->wMaxNegA = ped->wMaxNegC = ped->charOverhang; 00926 ped->wMaxNegAcharPos = LOWORD(dwMaxOverlapChars); // Left 00927 ped->wMaxNegCcharPos = HIWORD(dwMaxOverlapChars); // Right 00928 } 00929 } /* if (ped->fDBCS) */ 00930 00931 if (!hfont) { 00932 // 00933 // We are getting the stats for the system font so update the system 00934 // font fields in the ed structure since we use these when calculating 00935 // some spacing. 00936 // 00937 ped->cxSysCharWidth = ped->aveCharWidth; 00938 ped->cySysCharHeight= ped->lineHeight; 00939 } else if (hOldFont) 00940 SelectObject(hdc, hOldFont); 00941 00942 if (ped->fFocus) { 00943 // 00944 // Update the caret. 00945 // 00946 NtUserHideCaret(ped->hwnd); 00947 NtUserDestroyCaret(); 00948 00949 if (ped->pLpkEditCallout) { 00950 ped->pLpkEditCallout->EditCreateCaret (ped, hdc, ECGetCaretWidth(), ped->lineHeight, 0); 00951 } 00952 else { 00953 NtUserCreateCaret(ped->hwnd, (HBITMAP)NULL, ECGetCaretWidth(), ped->lineHeight); 00954 } 00955 NtUserShowCaret(ped->hwnd); 00956 } 00957 00958 ReleaseDC(ped->hwnd, hdc); 00959 00960 // 00961 // Update password character. 00962 // 00963 if (ped->charPasswordChar) 00964 ECSetPasswordChar(ped, ped->charPasswordChar); 00965 00966 // 00967 // If it is a TrueType font and it's a new app, set both the margins at the 00968 // max negative width values for all types of the edit controls. 00969 // (NOTE: Can't use ped->f40Compat here because edit-controls inside dialog 00970 // boxes without DS_LOCALEDIT style are always marked as 4.0 compat. 00971 // This is the fix for NETBENCH 3.0) 00972 // 00973 00974 if (ped->fTrueType && (GETAPPVER() >= VER40)) 00975 if (ped->fDBCS) { 00976 // For DBCS TrueType Font, we calc margin from ABC width. 00977 ECCalcMarginForDBCSFont(ped, fRedraw); 00978 } else { 00979 ECSetMargin(ped, EC_LEFTMARGIN | EC_RIGHTMARGIN, 00980 MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO), fRedraw); 00981 } 00982 00983 // 00984 // We need to calc maxPixelWidth when font changes. 00985 // If the word-wrap is ON, then this is done in MLSize() called later. 00986 // 00987 if((!ped->fSingle) && (!ped->fWrap)) 00988 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 00989 00990 // 00991 // Recalc the layout. 00992 // 00993 ECSize(ped, NULL, fRedraw); 00994 00995 if ( ped->fFocus && fpImmIsIME(THREAD_HKL()) ) { 00996 ECImmSetCompositionFont( ped ); 00997 } 00998 }

void ECSetMargin PED  ,
UINT  ,
long  ,
BOOL 
 

Definition at line 49 of file edecrare.c.

References tagED::aveCharWidth, BOOL, ECInvalidateClient(), FALSE, min, tagED::rcFmt, TRUE, UINT, tagED::wLeftMargin, tagED::wMaxNegA, tagED::wMaxNegC, and tagED::wRightMargin.

Referenced by ECCalcMarginForDBCSFont(), ECSetFont(), and EditWndProc().

00050 { 00051 BOOL fUseFontInfo = FALSE; 00052 UINT wValue, wOldLeftMargin, wOldRightMargin; 00053 00054 00055 if (wFlags & EC_LEFTMARGIN) /* Set the left margin */ { 00056 00057 if ((int) (wValue = (int)(short)LOWORD(lMarginValues)) < 0) { 00058 fUseFontInfo = TRUE; 00059 wValue = min((ped->aveCharWidth / 2), (int)ped->wMaxNegA); 00060 } 00061 00062 ped->rcFmt.left += wValue - ped->wLeftMargin; 00063 wOldLeftMargin = ped->wLeftMargin; 00064 ped->wLeftMargin = wValue; 00065 } 00066 00067 if (wFlags & EC_RIGHTMARGIN) /* Set the Right margin */ { 00068 00069 if ((int) (wValue = (int)(short)HIWORD(lMarginValues)) < 0) { 00070 fUseFontInfo = TRUE; 00071 wValue = min((ped->aveCharWidth / 2), (int)ped->wMaxNegC); 00072 } 00073 00074 ped->rcFmt.right -= wValue - ped->wRightMargin; 00075 wOldRightMargin = ped->wRightMargin; 00076 ped->wRightMargin = wValue; 00077 } 00078 00079 if (fUseFontInfo) { 00080 if (ped->rcFmt.right - ped->rcFmt.left < 2 * ped->aveCharWidth) { 00081 RIPMSG0(RIP_WARNING, "ECSetMargin: rcFmt is too narrow for EC_USEFONTINFO"); 00082 00083 if (wFlags & EC_LEFTMARGIN) /* Reset the left margin */ { 00084 ped->rcFmt.left += wOldLeftMargin - ped->wLeftMargin; 00085 ped->wLeftMargin = wOldLeftMargin; 00086 } 00087 00088 if (wFlags & EC_RIGHTMARGIN) /* Reset the Right margin */ { 00089 ped->rcFmt.right -= wOldRightMargin - ped->wRightMargin; 00090 ped->wRightMargin = wOldRightMargin; 00091 } 00092 00093 return; 00094 } 00095 } 00096 00097 // NtUserInvalidateRect(ped->hwnd, NULL, TRUE); 00098 if (fRedraw) { 00099 ECInvalidateClient(ped, TRUE); 00100 } 00101 }

void ECSetPasswordChar PED  ,
UINT 
 

Definition at line 516 of file edecrare.c.

References tagED::charPasswordChar, ClearWindowState(), tagED::cPasswordCharWidth, ECEnableDisableIME(), ECGetEditDC(), ECReleaseEditDC(), EFPASSWORD, tagED::fAnsi, max, tagED::pwnd, SetWindowState(), and TRUE.

Referenced by ECSetFont(), EditWndProc(), and SLCreate().

00519 { 00520 HDC hdc; 00521 SIZE size; 00522 00523 ped->charPasswordChar = pwchar; 00524 00525 if (pwchar) { 00526 hdc = ECGetEditDC(ped, TRUE); 00527 if (ped->fAnsi) 00528 GetTextExtentPointA(hdc, (LPSTR)&pwchar, 1, &size); 00529 else 00530 GetTextExtentPointW(hdc, (LPWSTR)&pwchar, 1, &size); 00531 00532 GetTextExtentPointW(hdc, (LPWSTR)&pwchar, 1, &size); 00533 ped->cPasswordCharWidth = max(size.cx, 1); 00534 ECReleaseEditDC(ped, hdc, TRUE); 00535 } 00536 if (pwchar) 00537 SetWindowState(ped->pwnd, EFPASSWORD); 00538 else 00539 ClearWindowState(ped->pwnd, EFPASSWORD); 00540 00541 ECEnableDisableIME(ped); 00542 }

BOOL ECSetText PED  ,
LPSTR 
 

Definition at line 2612 of file editec.c.

References BOOL, tagED::cbChar, tagED::cch, tagED::cchAlloc, CCHALLOCEXTRA, ECInsertText(), ECNotifyParent(), ECResetTextInfo(), FALSE, tagED::fAnsi, tagED::fSingle, tagED::hInstance, tagED::hText, tagED::hwnd, ICH, tagED::ichCaret, IsWindow(), LHND, LOCALREALLOC, LOCALSIZE, min, NULL, StringLength(), and TRUE.

Referenced by EditWndProc(), MLCreate(), and SLCreate().

02615 { 02616 ICH cchLength; 02617 ICH cchSave = ped->cch; 02618 ICH ichCaretSave = ped->ichCaret; 02619 HWND hwndSave = ped->hwnd; 02620 HANDLE hText; 02621 02622 ped->cch = ped->ichCaret = 0; 02623 02624 ped->cchAlloc = LOCALSIZE(ped->hText, ped->hInstance) / ped->cbChar; 02625 if (!lpstr) { 02626 hText = LOCALREALLOC(ped->hText, CCHALLOCEXTRA*ped->cbChar, LHND, ped->hInstance, &lpstr); 02627 if (hText != NULL) { 02628 ped->hText = hText; 02629 } else { 02630 return FALSE; 02631 } 02632 } else { 02633 cchLength = StringLength(lpstr, ped->fAnsi); 02634 02635 #ifdef NEVER 02636 // win3.1 does limit single line edit controls to 32K (minus 3) but NT doesn't 02637 02638 if (ped->fSingle) { 02639 /* 02640 * Limit single line edit controls to 32K 02641 */ 02642 cchLength = min(cchLength, (ICH)(0x7FFD/ped->cbChar)); 02643 } 02644 #endif 02645 02646 /* 02647 * Add the text 02648 */ 02649 if (cchLength && !ECInsertText(ped, lpstr, &cchLength)) { 02650 02651 /* 02652 * Restore original state and notify parent we ran out of memory. 02653 */ 02654 ped->cch = cchSave; 02655 ped->ichCaret = ichCaretSave; 02656 ECNotifyParent(ped, EN_ERRSPACE); 02657 return FALSE; 02658 } 02659 } 02660 02661 ped->cchAlloc = LOCALSIZE(ped->hText, ped->hInstance) / ped->cbChar; 02662 02663 if (IsWindow(hwndSave)) 02664 ECResetTextInfo(ped); 02665 02666 return TRUE; 02667 }

void ECSize PED  ,
LPRECT  ,
BOOL 
 

Definition at line 597 of file edecrare.c.

References _GetClientRect(), tagED::aveCharWidth, CopyRect, ECImmSetCompositionWindow(), FALSE, tagED::fBorder, tagED::fCaretHidden, tagED::fFlatBorder, tagED::fFocus, fpImmIsIME, tagED::fSingle, tagED::hwnd, InflateRect(), tagED::lineHeight, min, MLSize(), NtUserGetCaretPos(), NtUserInvalidateRect(), NULL, tagED::pwnd, tagED::rcFmt, SYSMET, THREAD_HKL, TRUE, tagED::wLeftMargin, and tagED::wRightMargin.

Referenced by ECSetFont(), MLEditWndProc(), and SLEditWndProc().

00601 { 00602 RECT rc; 00603 00604 /* 00605 * BiDi VB32 Creates an Edit Control and immediately sends a WM_SIZE 00606 * message which causes EXSize to be called before ECSetFont, which 00607 * in turn causes a divide by zero exception below. This check for 00608 * ped->lineHeight will pick it up safely. [samera] 3/5/97 00609 */ 00610 if(ped->lineHeight == 0) 00611 return; 00612 00613 // assume that we won't be able to display the caret 00614 ped->fCaretHidden = TRUE; 00615 00616 00617 if ( lprc ) 00618 CopyRect(&rc, lprc); 00619 else 00620 _GetClientRect(ped->pwnd, &rc); 00621 00622 if (!(rc.right - rc.left) || !(rc.bottom - rc.top)) { 00623 if (ped->rcFmt.right - ped->rcFmt.left) 00624 return; 00625 00626 rc.left = 0; 00627 rc.top = 0; 00628 rc.right = ped->aveCharWidth * 10; 00629 rc.bottom = ped->lineHeight; 00630 } 00631 00632 if (!lprc) { 00633 // subtract the margins from the given rectangle -- 00634 // make sure that this rectangle is big enough to have these margins. 00635 if ((rc.right - rc.left) > (int)(ped->wLeftMargin + ped->wRightMargin)) { 00636 rc.left += ped->wLeftMargin; 00637 rc.right -= ped->wRightMargin; 00638 } 00639 } 00640 00641 // 00642 // Leave space so text doesn't touch borders. 00643 // For 3.1 compatibility, don't subtract out vertical borders unless 00644 // there is room. 00645 // 00646 if (ped->fBorder) { 00647 int cxBorder = SYSMET(CXBORDER); 00648 int cyBorder = SYSMET(CYBORDER); 00649 00650 if (ped->fFlatBorder) 00651 { 00652 cxBorder *= 2; 00653 cyBorder *= 2; 00654 } 00655 00656 if (rc.bottom < rc.top + ped->lineHeight + 2*cyBorder) 00657 cyBorder = 0; 00658 00659 InflateRect(&rc, -cxBorder, -cyBorder); 00660 } 00661 00662 // Is the resulting rectangle too small? Don't change it then. 00663 if ((!ped->fSingle) && ((rc.right - rc.left < (int) ped->aveCharWidth) || 00664 ((rc.bottom - rc.top) / ped->lineHeight == 0))) 00665 return; 00666 00667 // now, we know we're safe to display the caret 00668 ped->fCaretHidden = FALSE; 00669 00670 CopyRect(&ped->rcFmt, &rc); 00671 00672 if (ped->fSingle) 00673 ped->rcFmt.bottom = min(rc.bottom, rc.top + ped->lineHeight); 00674 else 00675 MLSize(ped, fRedraw); 00676 00677 if (fRedraw) { 00678 NtUserInvalidateRect(ped->hwnd, NULL, TRUE); 00679 // UpdateWindow31(ped->hwnd); Evaluates to NOP in Chicago - Johnl 00680 } 00681 00682 // FE_IME 00683 // ECSize() - call ECImmSetCompositionWindow() 00684 // 00685 // normally this isn't needed because WM_SIZE will cause 00686 // WM_PAINT and the paint handler will take care of IME 00687 // composition window. However when the edit window is 00688 // restored from maximized window and client area is out 00689 // of screen, the window will not be redrawn. 00690 // 00691 if (ped->fFocus && fpImmIsIME(THREAD_HKL())) { 00692 POINT pt; 00693 00694 NtUserGetCaretPos(&pt); 00695 ECImmSetCompositionWindow(ped, pt.x, pt.y); 00696 } 00697 }

UINT ECTabTheTextOut HDC  ,
int  ,
int  ,
int  ,
int  ,
LPSTR  ,
int  ,
ICH  ,
PED  ,
int  ,
BOOL  ,
LPSTRIPINFO 
 

Definition at line 770 of file editec.c.

References tagED::aveCharWidth, BOOL, tagED::cbChar, CHAR_WIDTH_BUFFER_LENGTH, tagED::charOverhang, tagED::charWidthBuffer, ECFindTabA(), ECFindTabW(), ECIsDBCSLeadByte(), ECT_SELECTED, FALSE, tagED::fAnsi, tagED::fDBCS, tagED::fTrueType, GetActualNegA(), STRIPINFO::ichString, INT, L, tagED::lineHeight, STRIPINFO::lpString, max, MAXCLIPENDPOS, MAXLINELENGTH, min, STRIPINFO::nCount, NULL, PINT, tagED::pTabStops, TRUE, UINT, tagED::wMaxNegA, tagED::wMaxNegC, and STRIPINFO::XStartPos.

Referenced by ECCchInWidth(), MLDrawText(), and MLGetLineWidth().

00783 { 00784 int nTabPositions; // Count of tabstops in tabstop array. 00785 LPINT lpintTabStopPositions; // Tab stop positions in pixels. 00786 00787 int cch; 00788 UINT textextent; 00789 int xEnd; 00790 int pixeltabstop = 0; 00791 int i; 00792 int cxCharWidth; 00793 RECT rc; 00794 BOOL fOpaque; 00795 BOOL fFirstPass = TRUE; 00796 PINT charWidthBuff; 00797 00798 int iTabLength; 00799 int nConsecutiveTabs; 00800 int xStripStPos; 00801 int xStripEndPos; 00802 int xEndOfStrip; 00803 STRIPINFO RedrawStripInfo; 00804 STRIPINFO NegAInfo; 00805 LPSTR lpTab; 00806 LPWSTR lpwTab; 00807 UINT wNegCwidth, wNegAwidth; 00808 int xRightmostPoint = xClipStPos; 00809 int xTabStartPos; 00810 int iSavedBkMode = 0; 00811 WCHAR wchar; 00812 SIZE size; 00813 ABC abc ; 00814 00815 // Algorithm: Draw the strip opaquely first. If a tab length is so 00816 // small that the portions of text on either side of a tab overlap with 00817 // the other, then this will result in some clipping. So, such portion 00818 // of the strip is remembered in "RedrawStripInfo" and redrawn 00819 // transparently later to compensate the clippings. 00820 // NOTE: "RedrawStripInfo" can hold info about just one portion. So, if 00821 // more than one portion of the strip needs to be redrawn transparently, 00822 // then we "merge" all such portions into a single strip and redraw that 00823 // strip at the end. 00824 00825 if (fDraw) { 00826 // To begin with, let us assume that there is no Negative C for this 00827 // strip and initialize the Negative Width Info structure. 00828 NegCInfoForStrip->nCount = 0; 00829 NegCInfoForStrip->XStartPos = xClipEndPos; 00830 00831 // We may not have to redraw any portion of this strip. 00832 RedrawStripInfo.nCount = 0; 00833 00834 fOpaque = (GetBkMode(hdc) == OPAQUE) || (fDraw == ECT_SELECTED); 00835 } 00836 #if DBG 00837 else { 00838 // 00839 // Both MLGetLineWidth() and ECCchInWidth() should be clipping 00840 // nCount to avoid overflow. 00841 // 00842 if (nCount > MAXLINELENGTH) 00843 RIPMSG0(RIP_WARNING, "ECTabTheTextOut: nCount > MAXLINELENGTH"); 00844 } 00845 #endif 00846 00847 // Let us define the Clip rectangle. 00848 rc.left = xClipStPos; 00849 rc.right = xClipEndPos; 00850 rc.top = y; 00851 rc.bottom = y + ped->lineHeight; 00852 00853 // Check if anything needs to be drawn. 00854 if (!lpstring || !nCount) { 00855 if (fDraw) 00856 ExtTextOutW(hdc, xClipStPos, y, 00857 (fOpaque ? ETO_OPAQUE | ETO_CLIPPED : ETO_CLIPPED), 00858 &rc, L"", 0, 0L); 00859 return(0L); 00860 } 00861 00862 // 00863 // Starting position 00864 // 00865 xEnd = xStart; 00866 00867 cxCharWidth = ped->aveCharWidth; 00868 00869 nTabPositions = (ped->pTabStops ? *(ped->pTabStops) : 0); 00870 if (ped->pTabStops) { 00871 lpintTabStopPositions = (LPINT)(ped->pTabStops+1); 00872 if (nTabPositions == 1) { 00873 pixeltabstop = lpintTabStopPositions[0]; 00874 if (!pixeltabstop) 00875 pixeltabstop = 1; 00876 } 00877 } else { 00878 lpintTabStopPositions = NULL; 00879 pixeltabstop = 8*cxCharWidth; 00880 } 00881 00882 // The first time we will draw the strip Opaquely. If some portions need 00883 // to be redrawn , then we will set the mode to TRANSPARENT and 00884 // jump to this location to redraw those portions. 00885 00886 RedrawStrip: 00887 while (nCount) { 00888 wNegCwidth = ped->wMaxNegC; 00889 00890 // Search for the first TAB in this strip; also compute the extent 00891 // of the the strip upto and not including the tab character. 00892 // 00893 // Note - If the langpack is loaded, there will be no charWidthBuffer. 00894 // 00895 if (ped->charWidthBuffer) { // Do we have a character width buffer? 00896 textextent = 0; 00897 cch = nCount; 00898 00899 if (ped->fTrueType) { // If so, does it have ABC widths? 00900 00901 UINT iRightmostPoint = 0; 00902 UINT wCharIndex; 00903 PABC pABCwidthBuff; 00904 00905 pABCwidthBuff = (PABC) ped->charWidthBuffer; 00906 00907 if ( ped->fAnsi ) { 00908 for (i = 0; i < nCount; i++) { 00909 00910 if (lpstring[i] == VK_TAB) { 00911 cch = i; 00912 break; 00913 } 00914 00915 wCharIndex = (UINT)(((unsigned char *)lpstring)[i]); 00916 if (wCharIndex < CHAR_WIDTH_BUFFER_LENGTH) { 00917 textextent += (UINT)(pABCwidthBuff[wCharIndex].abcA + 00918 pABCwidthBuff[wCharIndex].abcB); 00919 } else { // not in cache, will ask driver 00920 GetCharABCWidthsA(hdc, wCharIndex, wCharIndex, &abc); 00921 textextent += abc.abcA + abc.abcB ; 00922 } 00923 00924 if (textextent > iRightmostPoint) 00925 iRightmostPoint = textextent; 00926 00927 if (wCharIndex < CHAR_WIDTH_BUFFER_LENGTH) { 00928 textextent += pABCwidthBuff[wCharIndex].abcC; 00929 } else { // not in cache 00930 textextent += abc.abcC; 00931 } 00932 00933 if (textextent > iRightmostPoint) 00934 iRightmostPoint = textextent; 00935 } 00936 00937 } else { // Unicode 00938 for (i = 0; i < nCount; i++) { 00939 WCHAR UNALIGNED * lpwstring = (WCHAR UNALIGNED *)lpstring; 00940 00941 if (lpwstring[i] == VK_TAB) { 00942 cch = i; 00943 break; 00944 } 00945 00946 wCharIndex = lpwstring[i] ; 00947 if ( wCharIndex < CHAR_WIDTH_BUFFER_LENGTH ) 00948 textextent += pABCwidthBuff[wCharIndex].abcA + 00949 pABCwidthBuff[wCharIndex].abcB; 00950 else { 00951 GetCharABCWidthsW(hdc, wCharIndex, wCharIndex, &abc) ; 00952 textextent += abc.abcA + abc.abcB ; 00953 } 00954 00955 /* 00956 * Note that abcC could be negative so we need this 00957 * statement here *and* below 00958 */ 00959 if (textextent > iRightmostPoint) 00960 iRightmostPoint = textextent; 00961 00962 if ( wCharIndex < CHAR_WIDTH_BUFFER_LENGTH ) 00963 textextent += pABCwidthBuff[wCharIndex].abcC; 00964 else 00965 textextent += abc.abcC ; 00966 00967 if (textextent > iRightmostPoint) 00968 iRightmostPoint = textextent; 00969 } 00970 } 00971 00972 wNegCwidth = (int)(iRightmostPoint - textextent); 00973 } else { // !ped->fTrueType 00974 // No! This is not a TrueType font; So, we have only character 00975 // width info in this buffer. 00976 00977 charWidthBuff = ped->charWidthBuffer; 00978 00979 if ( ped->fAnsi ) { 00980 // Initially assume no tabs exist in the text so cch=nCount. 00981 for (i = 0; i < nCount; i++) { 00982 if (lpstring[i] == VK_TAB) { 00983 cch = i; 00984 break; 00985 } 00986 00987 // 00988 // Call GetTextExtentPoint for dbcs/hankaku characters 00989 // 00990 if (ped->fDBCS && (i+1 < nCount) 00991 && ECIsDBCSLeadByte(ped,lpstring[i])) { 00992 GetTextExtentPointA(hdc, &lpstring[i], 2, &size); 00993 textextent += size.cx; 00994 i++; 00995 } else if ((UCHAR)lpstring[i] >= CHAR_WIDTH_BUFFER_LENGTH) { 00996 // Skip this GetExtentPoint call for non hankaku code points 00997 // Or if the character is in the width cache. 00998 GetTextExtentPointA(hdc, &lpstring[i], 1, &size); 00999 textextent += size.cx; 01000 } else { 01001 textextent += (UINT)(charWidthBuff[(UINT)(((unsigned char *)lpstring)[i])]); 01002 } 01003 } 01004 } else { 01005 LPWSTR lpwstring = (LPWSTR) lpstring ; 01006 INT cchUStart; // start of unicode character count 01007 01008 for (i = 0; i < nCount; i++) { 01009 if (lpwstring[i] == VK_TAB) { 01010 cch = i; 01011 break; 01012 } 01013 01014 wchar = lpwstring[i]; 01015 if (wchar >= CHAR_WIDTH_BUFFER_LENGTH) { 01016 01017 /* 01018 * We have a Unicode character that is not in our 01019 * cache, get all the characters outside the cache 01020 * before getting the text extent on this part of the 01021 * string. 01022 */ 01023 cchUStart = i; 01024 while (wchar >= CHAR_WIDTH_BUFFER_LENGTH && 01025 wchar != VK_TAB && i < nCount) { 01026 wchar = lpwstring[++i]; 01027 } 01028 01029 GetTextExtentPointW(hdc, (LPWSTR)lpwstring + cchUStart, 01030 i-cchUStart, &size); 01031 textextent += size.cx; 01032 01033 01034 if (wchar == VK_TAB || i >= nCount) { 01035 cch = i; 01036 break; 01037 } 01038 /* 01039 * We have a char that is in the cache, fall through. 01040 */ 01041 } 01042 /* 01043 * The width of this character is in the cache buffer. 01044 */ 01045 textextent += ped->charWidthBuffer[wchar]; 01046 } 01047 } 01048 } // fTrueType else. 01049 01050 nCount -= cch; 01051 } else { // If we don't have a buffer that contains the width info. 01052 /* 01053 * Gotta call the driver to do our text extent. 01054 */ 01055 01056 if ( ped->fAnsi ) { 01057 cch = (int)ECFindTabA(lpstring, nCount); 01058 GetTextExtentPointA(hdc, lpstring, cch, &size) ; 01059 } else { 01060 cch = (int)ECFindTabW((LPWSTR) lpstring, nCount); 01061 GetTextExtentPointW(hdc, (LPWSTR)lpstring, cch, &size); 01062 } 01063 nCount -= cch; 01064 // 01065 // Subtruct Overhang for Italic fonts. 01066 // 01067 textextent = (size.cx - ped->charOverhang); 01068 } 01069 01070 // 01071 // textextent is computed. 01072 // 01073 01074 xStripStPos = xEnd; 01075 xEnd += (int)textextent; 01076 xStripEndPos = xEnd; 01077 01078 // We will consider the negative widths only if when we draw opaquely. 01079 if (fFirstPass && fDraw) { 01080 xRightmostPoint = max(xStripEndPos + (int)wNegCwidth, xRightmostPoint); 01081 01082 // Check if this strip peeps beyond the clip region. 01083 if (xRightmostPoint > xClipEndPos) { 01084 if (!NegCInfoForStrip->nCount) { 01085 NegCInfoForStrip->lpString = lpstring; 01086 NegCInfoForStrip->ichString = ichString; 01087 NegCInfoForStrip->nCount = nCount+cch; 01088 NegCInfoForStrip->XStartPos = xStripStPos; 01089 } 01090 } 01091 } /* if (fFirstPass && fDraw) */ 01092 01093 if ( ped->fAnsi ) 01094 lpTab = lpstring + cch; // Possibly Points to a tab character. 01095 else 01096 lpwTab = ((LPWSTR)lpstring) + cch ; 01097 01098 // we must consider all the consecutive tabs and calculate the 01099 // the begining of next strip. 01100 nConsecutiveTabs = 0; 01101 while (nCount && 01102 (ped->fAnsi ? (*lpTab == VK_TAB) : (*lpwTab == VK_TAB))) { 01103 // Find the next tab position and update the x value. 01104 xTabStartPos = xEnd; 01105 if (pixeltabstop) 01106 xEnd = (((xEnd-iTabOrigin)/pixeltabstop)*pixeltabstop) + 01107 pixeltabstop + iTabOrigin; 01108 else { 01109 for (i = 0; i < nTabPositions; i++) { 01110 if (xEnd < (lpintTabStopPositions[i] + iTabOrigin)) { 01111 xEnd = (lpintTabStopPositions[i] + iTabOrigin); 01112 break; 01113 } 01114 } 01115 01116 // Check if all the tabstops set are exhausted; Then start using 01117 // default tab stop positions. 01118 if (i == nTabPositions) { 01119 pixeltabstop = 8*cxCharWidth; 01120 xEnd = ((xEnd - iTabOrigin)/pixeltabstop)*pixeltabstop + 01121 pixeltabstop + iTabOrigin; 01122 } 01123 } 01124 01125 if (fFirstPass && fDraw) { 01126 xRightmostPoint = max(xEnd, xRightmostPoint); 01127 01128 /* Check if this strip peeps beyond the clip region */ 01129 if (xRightmostPoint > xClipEndPos) { 01130 if (!NegCInfoForStrip->nCount) { 01131 NegCInfoForStrip->ichString = ichString + cch + nConsecutiveTabs; 01132 NegCInfoForStrip->nCount = nCount; 01133 NegCInfoForStrip->lpString = (ped->fAnsi ? 01134 lpTab : (LPSTR) lpwTab); 01135 NegCInfoForStrip->XStartPos = xTabStartPos; 01136 } 01137 } 01138 } /* if(fFirstPass) */ 01139 01140 nConsecutiveTabs++; 01141 nCount--; 01142 ped->fAnsi ? lpTab++ : (LPSTR) (lpwTab++) ; // Move to the next character. 01143 } // while(*lpTab == TAB) // 01144 01145 if (fDraw) { 01146 if (fFirstPass) { 01147 // Is anything remaining to be drawn in this strip? 01148 if (!nCount) 01149 rc.right = xEnd; // No! We are done. 01150 else { 01151 // "x" is the effective starting position of next strip. 01152 iTabLength = xEnd - xStripEndPos; 01153 01154 // Check if there is a possibility of this tab length being too small 01155 // compared to the negative A and C widths if any. 01156 if ((wNegCwidth + (wNegAwidth = ped->wMaxNegA)) > (UINT)iTabLength) { 01157 // Unfortunately, there is a possiblity of an overlap. 01158 // Let us find out the actual NegA for the next strip. 01159 wNegAwidth = GetActualNegA( 01160 hdc, 01161 ped, 01162 xEnd, 01163 lpstring + (cch + nConsecutiveTabs)*ped->cbChar, 01164 ichString + cch + nConsecutiveTabs, 01165 nCount, 01166 &NegAInfo); 01167 } 01168 01169 // Check if they actually overlap // 01170 if ((wNegCwidth + wNegAwidth) <= (UINT)iTabLength) { 01171 // No overlap between the strips. This is the ideal situation. 01172 rc.right = xEnd - wNegAwidth; 01173 } else { 01174 // Yes! They overlap. 01175 rc.right = xEnd; 01176 01177 // See if negative C width is too large compared to tab length. 01178 if (wNegCwidth > (UINT)iTabLength) { 01179 // Must redraw transparently a part of the current strip later. 01180 if (RedrawStripInfo.nCount) { 01181 // A previous strip also needs to be redrawn; So, merge this 01182 // strip to that strip. 01183 RedrawStripInfo.nCount = (ichString - 01184 RedrawStripInfo.ichString) + cch; 01185 } else { 01186 RedrawStripInfo.nCount = cch; 01187 RedrawStripInfo.lpString = lpstring; 01188 RedrawStripInfo.ichString = ichString; 01189 RedrawStripInfo.XStartPos = xStripStPos; 01190 } 01191 } 01192 01193 if (wNegAwidth) { 01194 // Must redraw transparently the first part of the next strip later. 01195 if (RedrawStripInfo.nCount) { 01196 // A previous strip also needs to be redrawn; So, merge this 01197 // strip to that strip. 01198 RedrawStripInfo.nCount = (NegAInfo.ichString - RedrawStripInfo.ichString) + 01199 NegAInfo.nCount; 01200 } else 01201 RedrawStripInfo = NegAInfo; 01202 } 01203 } 01204 } // else (!nCount) // 01205 } // if (fFirstPass) // 01206 01207 if (rc.left < xClipEndPos) { 01208 if (fFirstPass) { 01209 // If this is the end of the strip, then complete the rectangle. 01210 if ((!nCount) && (xClipEndPos == MAXCLIPENDPOS)) 01211 rc.right = max(rc.right, xClipEndPos); 01212 else 01213 rc.right = min(rc.right, xClipEndPos); 01214 } 01215 01216 // Draw the current strip. 01217 if (rc.left < rc.right) 01218 if ( ped->fAnsi ) 01219 ExtTextOutA(hdc, 01220 xStripStPos, 01221 y, 01222 (fFirstPass && fOpaque ? (ETO_OPAQUE | ETO_CLIPPED) : ETO_CLIPPED), 01223 (LPRECT)&rc, lpstring, cch, 0L); 01224 else 01225 ExtTextOutW(hdc, 01226 xStripStPos, 01227 y, 01228 (fFirstPass && fOpaque ? (ETO_OPAQUE | ETO_CLIPPED) : ETO_CLIPPED), 01229 (LPRECT)&rc, (LPWSTR)lpstring, cch, 0L); 01230 01231 } 01232 01233 if (fFirstPass) 01234 rc.left = max(rc.right, xClipStPos); 01235 ichString += (cch+nConsecutiveTabs); 01236 } // if (fDraw) // 01237 01238 // Skip over the tab and the characters we just drew. 01239 lpstring += (cch + nConsecutiveTabs) * ped->cbChar; 01240 } // while (nCount) // 01241 01242 xEndOfStrip = xEnd; 01243 01244 // check if we need to draw some portions transparently. 01245 if (fFirstPass && fDraw && RedrawStripInfo.nCount) { 01246 iSavedBkMode = SetBkMode(hdc, TRANSPARENT); 01247 fFirstPass = FALSE; 01248 01249 nCount = RedrawStripInfo.nCount; 01250 rc.left = xClipStPos; 01251 rc.right = xClipEndPos; 01252 lpstring = RedrawStripInfo.lpString; 01253 ichString = RedrawStripInfo.ichString; 01254 xEnd = RedrawStripInfo.XStartPos; 01255 goto RedrawStrip; // Redraw Transparently. 01256 } 01257 01258 if (iSavedBkMode) // Did we change the Bk mode? 01259 SetBkMode(hdc, iSavedBkMode); // Then, let us set it back! 01260 01261 return((UINT)(xEndOfStrip - xStart)); 01262 }

void ECUnlock PED  ped  ) 
 

Definition at line 86 of file editec.c.

References tagED::cbChar, tagED::cch, tagED::charPasswordChar, tagED::fEncoded, tagED::hInstance, tagED::hText, tagED::iLockLevel, LOCALLOCK, LOCALUNLOCK, RtlRunEncodeUnicodeString(), tagED::seed, TRUE, and USHORT.

Referenced by ECCopy(), ECDeleteText(), ECDoIMEMenuCommand(), ECGetText(), EcImeRequestHandler(), ECInsertText(), ECNextIch(), ECPrevIch(), ECSetCaretHandler(), ECWord(), HanjaKeyHandler(), MLBuildchLines(), MLCalcXOffset(), MLDrawText(), MLEditWndProc(), MLGetLine(), MLIchToXYPos(), MLIchToYPos(), MLInsertCrCrLf(), MLKeyDown(), MLLine(), MLMouseMotion(), MLMouseToIch(), MLMoveSelection(), MLMoveSelectionRestricted(), MLSetHandle(), MLSetSelection(), MLStripCrCrLf(), MLUpdateiCaretLine(), NextWordCallBack(), NextWordLpkCallBack(), SLCalcStringWidth(), SLCalcXOffsetSpecial(), SLChangeSelection(), SLDrawLine(), SLDrawText(), SLGetClipRect(), SLIchToLeftXPos(), SLInsertText(), SLMouseMotion(), SLMouseToIch(), SLMoveSelectionRestricted(), and SLScrollText().

00088 { 00089 /* 00090 * if we are removing the last lock on the text and the password 00091 * character is set then encode the text 00092 */ 00093 //RIPMSG1(RIP_VERBOSE, "unlock: %d '%10s'\n", ped->iLockLevel, ped->ptext); 00094 if (ped->charPasswordChar && ped->iLockLevel == 1 && ped->cch != 0) { 00095 UNICODE_STRING string; 00096 string.Length = string.MaximumLength = (USHORT)(ped->cch * ped->cbChar); 00097 string.Buffer = LOCALLOCK(ped->hText, ped->hInstance); 00098 00099 RtlRunEncodeUnicodeString(&(ped->seed), &string); 00100 //RIPMSG1(RIP_VERBOSE, "Encoding: '%10s'\n", ped->ptext); 00101 ped->fEncoded = TRUE; 00102 LOCALUNLOCK(ped->hText, ped->hInstance); 00103 } 00104 LOCALUNLOCK(ped->hText, ped->hInstance); 00105 ped->iLockLevel--; 00106 }

void ECUpdateFormat PED  ped,
DWORD  dwStyle,
DWORD  dwExStyle
 

Definition at line 4185 of file editec.c.

References ECInvalidateClient(), FALSE, tagED::format, tagED::fRtoLReading, tagED::fWrap, MLBuildchLines(), MLScroll(), MLUpdateiCaretLine(), NULL, TRUE, and UINT.

Referenced by MLEditWndProc(), and SLEditWndProc().

04189 { 04190 UINT fNewRtoLReading; 04191 UINT uiNewFormat; 04192 04193 // Extract new format and reading order from style 04194 04195 fNewRtoLReading = dwExStyle & WS_EX_RTLREADING ? 1 : 0; 04196 uiNewFormat = dwStyle & ES_FMTMASK; 04197 04198 04199 // WS_EX_RIGHT is ignored unless dwStyle is ES_LEFT 04200 04201 if (uiNewFormat == ES_LEFT && dwExStyle & WS_EX_RIGHT) { 04202 uiNewFormat = ES_RIGHT; 04203 } 04204 04205 04206 // Internally ES_LEFT and ES_RIGHT are swapped for RtoLReading order 04207 // (Think of them as ES_LEADING and ES_TRAILING) 04208 04209 if (fNewRtoLReading) { 04210 switch (uiNewFormat) { 04211 case ES_LEFT: uiNewFormat = ES_RIGHT; break; 04212 case ES_RIGHT: uiNewFormat = ES_LEFT; break; 04213 } 04214 } 04215 04216 04217 // Format change does not cause redisplay by itself 04218 04219 ped->format = uiNewFormat; 04220 04221 04222 // Refresh display on change of reading order 04223 04224 if (fNewRtoLReading != ped->fRtoLReading) { 04225 04226 ped->fRtoLReading = fNewRtoLReading; 04227 04228 if (ped->fWrap) { 04229 // Redo wordwrap 04230 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 04231 MLUpdateiCaretLine(ped); 04232 } else { 04233 // Refresh horizontal scrollbar display 04234 MLScroll(ped, FALSE, 0xffffffff, 0, TRUE); 04235 } 04236 ECInvalidateClient(ped, TRUE); 04237 } 04238 }

void ECWord PED  ,
ICH  ,
BOOL  ,
ICH ,
ICH
 

Definition at line 1552 of file editec.c.

References BOOL, tagED::cbChar, tagED::cch, CHAR, tagED::charPasswordChar, ECAnsiNext(), ECAnsiPrev(), ECIsDBCSLeadByte(), ECLock(), ECUnlock(), FALSE, tagED::fAnsi, ICH, ISDELIMETERA, ISDELIMETERW, tagED::lpfnNextWord, min, NextWordCallBack(), NextWordLpkCallBack(), tagED::pLpkEditCallout, TRUE, and UserIsFullWidth().

Referenced by MLBuildchLines(), MLKeyDown(), MLMouseMotion(), SLKeyDown(), and SLMouseMotion().

01558 { 01559 BOOL charLocated = FALSE; 01560 BOOL spaceLocated = FALSE; 01561 01562 if ((!ichStart && fLeft) || (ichStart == ped->cch && !fLeft)) { 01563 01564 /* 01565 * We are at the beginning of the text (looking left) or we are at end 01566 * of text (looking right), no word here 01567 */ 01568 if (pichMin) *pichMin=0; 01569 if (pichMax) *pichMax=0; 01570 return; 01571 } 01572 01573 /* 01574 * Don't give out hints about word breaks if password chars are being used, 01575 */ 01576 if (ped->charPasswordChar) { 01577 if (pichMin) *pichMin=0; 01578 if (pichMax) *pichMax=ped->cch; 01579 return; 01580 } 01581 01582 if (ped->fAnsi) { 01583 PSTR pText; 01584 PSTR pWordMinSel; 01585 PSTR pWordMaxSel; 01586 PSTR pPrevChar; 01587 01588 UserAssert(ped->cbChar == sizeof(CHAR)); 01589 01590 if (ped->lpfnNextWord) { 01591 NextWordCallBack(ped, ichStart, fLeft, pichMin, pichMax); 01592 return; 01593 } 01594 01595 if (ped->pLpkEditCallout) { 01596 NextWordLpkCallBack(ped, ichStart, fLeft, pichMin, pichMax); 01597 return; 01598 } 01599 01600 pText = ECLock(ped); 01601 pWordMinSel = pWordMaxSel = pText + ichStart; 01602 01603 /* 01604 * if fLeft: Move pWordMinSel to the left looking for the start of a word. 01605 * If we start at a space, we will include spaces in the selection as we 01606 * move left untill we find a nonspace character. At that point, we continue 01607 * looking left until we find a space. Thus, the selection will consist of 01608 * a word with its trailing spaces or, it will consist of any leading at the 01609 * beginning of a line of text. 01610 */ 01611 01612 /* 01613 * if !fLeft: (ie. right word) Move pWordMinSel looking for the start of a 01614 * word. If the pWordMinSel points to a character, then we move left 01615 * looking for a space which will signify the start of the word. If 01616 * pWordMinSel points to a space, we look right till we come upon a 01617 * character. pMaxWord will look right starting at pMinWord looking for the 01618 * end of the word and its trailing spaces. 01619 */ 01620 01621 if (fLeft || !ISDELIMETERA(*pWordMinSel) && *pWordMinSel != 0x0D) { 01622 01623 /* 01624 * If we are moving left or if we are moving right and we are not on a 01625 * space or a CR (the start of a word), then we was look left for the 01626 * start of a word which is either a CR or a character. We do this by 01627 * looking left till we find a character (or if CR we stop), then we 01628 * continue looking left till we find a space or LF. 01629 */ 01630 while (pWordMinSel > pText && ((!ISDELIMETERA(*(pWordMinSel - 1)) && 01631 *(pWordMinSel - 1) != 0x0A) || !charLocated)) { 01632 01633 /* 01634 * Treat double byte character as a word ( in ansi pWordMinSel loop ) 01635 */ 01636 pPrevChar = ECAnsiPrev( ped, pText, pWordMinSel ); 01637 01638 /* 01639 ** we are looking right ( !fLeft ). 01640 ** if current character is a double byte chararacter or 01641 ** previous character is a double byte character, we 01642 ** are on the beggining of a word. 01643 */ 01644 if ( !fLeft && ( ISDELIMETERA( *pPrevChar ) || 01645 *pPrevChar == 0x0A || 01646 ECIsDBCSLeadByte(ped, *pWordMinSel) || 01647 pWordMinSel - pPrevChar == 2 ) ) { 01648 /* 01649 * If we are looking for the start of the word right, then we 01650 * stop when we have found it. (needed in case charLocated is 01651 * still FALSE) 01652 */ 01653 break; 01654 } 01655 01656 if ( pWordMinSel - pPrevChar == 2 ) { 01657 /* 01658 ** previous character is a double byte character. 01659 ** if we are in a word ( charLocated == TRUE ) 01660 ** current position is the beginning of the word 01661 ** if we are not in a word ( charLocated == FALSE ) 01662 ** the previous character is what we looking for. 01663 */ 01664 if ( ! charLocated ) { 01665 pWordMinSel = pPrevChar; 01666 } 01667 break; 01668 } 01669 pWordMinSel = pPrevChar; 01670 01671 if (!ISDELIMETERA(*pWordMinSel) && *pWordMinSel != 0x0A) { 01672 01673 /* 01674 * We have found the last char in the word. Continue looking 01675 * backwards till we find the first char of the word 01676 */ 01677 charLocated = TRUE; 01678 01679 /* 01680 * We will consider a CR the start of a word 01681 */ 01682 if (*pWordMinSel == 0x0D) 01683 break; 01684 } 01685 } 01686 } else { 01687 while ((ISDELIMETERA(*pWordMinSel) || *pWordMinSel == 0x0A) && pWordMinSel < pText + ped->cch) 01688 pWordMinSel++; 01689 } 01690 01691 /* 01692 * Adjust the initial position of pWordMaxSel ( in ansi ) 01693 */ 01694 pWordMaxSel = ECAnsiNext(ped, pWordMinSel); 01695 pWordMaxSel = min(pWordMaxSel, pText + ped->cch); 01696 01697 /* 01698 ** If pWordMinSel points a double byte character AND 01699 ** pWordMaxSel points non space 01700 ** then 01701 ** pWordMaxSel points the beggining of next word. 01702 */ 01703 if ( ( pWordMaxSel - pWordMinSel == 2 ) && ! ISDELIMETERA(*pWordMaxSel) ) 01704 goto FastReturnA; 01705 if (*pWordMinSel == 0x0D) { 01706 if (pWordMinSel > pText && *(pWordMinSel - 1) == 0x0D) 01707 /* So that we can treat CRCRLF as one word also. */ 01708 pWordMinSel--; 01709 else if (*(pWordMinSel + 1) == 0x0D) 01710 /* Move MaxSel on to the LF */ 01711 pWordMaxSel++; 01712 } 01713 01714 01715 01716 /* 01717 * Check if we have a one character word 01718 */ 01719 if (ISDELIMETERA(*pWordMaxSel)) 01720 spaceLocated = TRUE; 01721 01722 /* 01723 * Move pWordMaxSel to the right looking for the end of a word and its 01724 * trailing spaces. WordMaxSel stops on the first character of the next 01725 * word. Thus, we break either at a CR or at the first nonspace char after 01726 * a run of spaces or LFs. 01727 */ 01728 while ((pWordMaxSel < pText + ped->cch) && (!spaceLocated || (ISDELIMETERA(*pWordMaxSel)))) { 01729 if (*pWordMaxSel == 0x0D) 01730 break; 01731 01732 /* 01733 * Treat double byte character as a word ( in ansi pWordMaxSel loop ) 01734 */ 01735 /* 01736 ** if it's a double byte character then 01737 ** we are at the beginning of next word 01738 ** which is a double byte character. 01739 */ 01740 if (ECIsDBCSLeadByte( ped, *pWordMaxSel)) 01741 break; 01742 01743 pWordMaxSel++; 01744 01745 if (ISDELIMETERA(*pWordMaxSel)) 01746 spaceLocated = TRUE; 01747 01748 if (*(pWordMaxSel - 1) == 0x0A) 01749 break; 01750 } 01751 01752 /* 01753 * label for fast return ( for Ansi ) 01754 */ 01755 FastReturnA: 01756 ECUnlock(ped); 01757 01758 if (pichMin) *pichMin = (ICH)(pWordMinSel - pText); 01759 if (pichMax) *pichMax = (ICH)(pWordMaxSel - pText); 01760 return; 01761 01762 } else { // !fAnsi 01763 LPWSTR pwText; 01764 LPWSTR pwWordMinSel; 01765 LPWSTR pwWordMaxSel; 01766 BOOL charLocated = FALSE; 01767 BOOL spaceLocated = FALSE; 01768 PWSTR pwPrevChar; 01769 01770 UserAssert(ped->cbChar == sizeof(WCHAR)); 01771 01772 if (ped->lpfnNextWord) { 01773 NextWordCallBack(ped, ichStart, fLeft, pichMin, pichMax); 01774 return; 01775 } 01776 01777 if (ped->pLpkEditCallout) { 01778 NextWordLpkCallBack(ped, ichStart, fLeft, pichMin, pichMax); 01779 return; 01780 } 01781 01782 pwText = (LPWSTR)ECLock(ped); 01783 pwWordMinSel = pwWordMaxSel = pwText + ichStart; 01784 01785 /* 01786 * if fLeft: Move pWordMinSel to the left looking for the start of a word. 01787 * If we start at a space, we will include spaces in the selection as we 01788 * move left untill we find a nonspace character. At that point, we continue 01789 * looking left until we find a space. Thus, the selection will consist of 01790 * a word with its trailing spaces or, it will consist of any leading at the 01791 * beginning of a line of text. 01792 */ 01793 01794 /* 01795 * if !fLeft: (ie. right word) Move pWordMinSel looking for the start of a 01796 * word. If the pWordMinSel points to a character, then we move left 01797 * looking for a space which will signify the start of the word. If 01798 * pWordMinSel points to a space, we look right till we come upon a 01799 * character. pMaxWord will look right starting at pMinWord looking for the 01800 * end of the word and its trailing spaces. 01801 */ 01802 01803 01804 if (fLeft || (!ISDELIMETERW(*pwWordMinSel) && *pwWordMinSel != 0x0D)) 01805 /* If we are moving left or if we are moving right and we are not on a 01806 * space or a CR (the start of a word), then we was look left for the 01807 * start of a word which is either a CR or a character. We do this by 01808 * looking left till we find a character (or if CR we stop), then we 01809 * continue looking left till we find a space or LF. 01810 */ { 01811 while (pwWordMinSel > pwText && ((!ISDELIMETERW(*(pwWordMinSel - 1)) && *(pwWordMinSel - 1) != 0x0A) || !charLocated)) { 01812 /* 01813 * Treat double byte character as a word ( in unicode pwWordMinSel loop ) 01814 */ 01815 pwPrevChar = pwWordMinSel - 1; 01816 /* 01817 ** we are looking right ( !fLeft ). 01818 ** 01819 ** if current character is a double width chararacter 01820 ** or previous character is a double width character, 01821 ** we are on the beggining of a word. 01822 */ 01823 if (!fLeft && (ISDELIMETERW( *pwPrevChar) || 01824 *pwPrevChar == 0x0A || 01825 UserIsFullWidth(CP_ACP,*pwWordMinSel) || 01826 UserIsFullWidth(CP_ACP,*pwPrevChar))) { 01827 /* 01828 * If we are looking for the start of the word right, then we 01829 * stop when we have found it. (needed in case charLocated is 01830 * still FALSE) 01831 */ 01832 break; 01833 } 01834 01835 if (UserIsFullWidth(CP_ACP,*pwPrevChar)) { 01836 /* 01837 ** Previous character is a double width character. 01838 ** 01839 ** if we are in a word ( charLocated == TRUE ) 01840 ** current position is the beginning of the word 01841 ** if we are not in a word ( charLocated == FALSE ) 01842 ** the previous character is what we looking for. 01843 */ 01844 if ( ! charLocated ) { 01845 pwWordMinSel = pwPrevChar; 01846 } 01847 break; 01848 } 01849 pwWordMinSel = pwPrevChar; 01850 01851 if (!ISDELIMETERW(*pwWordMinSel) && *pwWordMinSel != 0x0A) 01852 /* 01853 * We have found the last char in the word. Continue looking 01854 * backwards till we find the first char of the word 01855 */ { 01856 charLocated = TRUE; 01857 01858 /* 01859 * We will consider a CR the start of a word 01860 */ 01861 if (*pwWordMinSel == 0x0D) 01862 break; 01863 } 01864 } 01865 } else { 01866 01867 /* 01868 * We are moving right and we are in between words so we need to move 01869 * right till we find the start of a word (either a CR or a character. 01870 */ 01871 while ((ISDELIMETERW(*pwWordMinSel) || *pwWordMinSel == 0x0A) && pwWordMinSel < pwText + ped->cch) 01872 pwWordMinSel++; 01873 } 01874 01875 pwWordMaxSel = min((pwWordMinSel + 1), (pwText + ped->cch)); 01876 01877 /* 01878 ** If pwWordMinSel points a double width character AND 01879 ** pwWordMaxSel points non space 01880 ** then 01881 ** pwWordMaxSel points the beggining of next word. 01882 */ 01883 if (UserIsFullWidth(CP_ACP,*pwWordMinSel) && ! ISDELIMETERW(*pwWordMaxSel)) 01884 goto FastReturnW; 01885 if (*pwWordMinSel == 0x0D) { 01886 if (pwWordMinSel > pwText && *(pwWordMinSel - 1) == 0x0D) 01887 /* So that we can treat CRCRLF as one word also. */ 01888 pwWordMinSel--; 01889 else if (*(pwWordMinSel + 1) == 0x0D) 01890 /* Move MaxSel on to the LF */ 01891 pwWordMaxSel++; 01892 } 01893 01894 01895 01896 /* 01897 * Check if we have a one character word 01898 */ 01899 if (ISDELIMETERW(*pwWordMaxSel)) 01900 spaceLocated = TRUE; 01901 01902 /* 01903 * Move pwWordMaxSel to the right looking for the end of a word and its 01904 * trailing spaces. WordMaxSel stops on the first character of the next 01905 * word. Thus, we break either at a CR or at the first nonspace char after 01906 * a run of spaces or LFs. 01907 */ 01908 while ((pwWordMaxSel < pwText + ped->cch) && (!spaceLocated || (ISDELIMETERW(*pwWordMaxSel)))) { 01909 if (*pwWordMaxSel == 0x0D) 01910 break; 01911 01912 /* 01913 * treat double byte character as a word ( in unicode pwWordMaxSel loop ) 01914 */ 01915 /* 01916 ** if it's a double width character 01917 ** then we are at the beginning of 01918 ** the next word which is a double 01919 ** width character. 01920 */ 01921 if (UserIsFullWidth(CP_ACP,*pwWordMaxSel)) 01922 break; 01923 01924 pwWordMaxSel++; 01925 01926 if (ISDELIMETERW(*pwWordMaxSel)) 01927 spaceLocated = TRUE; 01928 01929 01930 if (*(pwWordMaxSel - 1) == 0x0A) 01931 break; 01932 } 01933 01934 /* 01935 * label for fast return ( for Unicode ) 01936 */ 01937 FastReturnW: 01938 ECUnlock(ped); 01939 01940 if (pichMin) *pichMin = (ICH)(pwWordMinSel - pwText); 01941 if (pichMax) *pichMax = (ICH)(pwWordMaxSel - pwText); 01942 return; 01943 } 01944 }

LRESULT EditWndProc PWND  ,
UINT  ,
WPARAM  ,
LPARAM 
 

Definition at line 2904 of file editec.c.

References _GetClientRect(), BOOL, tagED::cch, tagED::cchTextMax, tagED::charPasswordChar, CI_16BIT, ClearWindowState(), tagED::cLines, CopyRect, DefWindowProcWorker(), DWORD, ECClearText(), ECCopy(), ECCutText(), ECDeleteText(), ECEmptyUndo(), ECEnableDisableIME(), ECGetEditDC(), ECGetText(), ECImeComposition(), EcImeRequestHandler(), ECImmSetCompositionFont(), ECImmSetCompositionWindow(), ECInitInsert(), ECInOutReconversionMode(), ECInvalidateClient(), ECIsAncestorActive(), ECMenu(), ECNcCreate(), ECNcDestroyHandler(), ECNotifyParent(), ECReleaseEditDC(), ECSetCaretHandler(), ECSetFont(), ECSetMargin(), ECSetPasswordChar(), ECSetText(), EFREADONLY, tagED::fAllowRTL, FALSE, tagED::fAnsi, tagED::fDirty, tagED::fDisabled, tagED::fFocus, FindNCHit(), tagED::fInReconversion, tagED::fInsertCompChr, tagED::fKorea, tagED::fLShift, tagED::fMouseDown, tagED::format, fpImmGetContext, fpImmIsIME, fpImmLockIMC, fpImmNotifyIME, fpImmReleaseContext, fpImmUnlockIMC, tagED::fReadOnly, tagED::fReplaceCompChr, tagED::fRtoLReading, tagED::fSawRButtonDown, tagED::fSingle, tagED::fSwapRoOnUp, GetClientInfo, GetKeyState(), tagED::hFont, tagED::hwnd, HWq, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, L, tagED::lpfnNextWord, MapVirtualKey(), min, MLDeleteText(), MLEditWndProc(), NtUserGetCaretPos(), NULL, NULL_HIMC, tagED::pLpkEditCallout, PtInRect(), tagED::ptScreenBounding, Pundo, tagED::rcFmt, SetWindowState(), SLDrawText(), SLEditWndProc(), SYS_ALTERNATE, TestWF, THREAD_HKL, TRUE, UINT, UNDO_NONE, WFOLDUI, tagED::wImeStatus, tagED::wLeftMargin, and tagED::wRightMargin.

Referenced by EditWndProcWorker().

02909 { 02910 HWND hwnd = HWq(pwnd); 02911 LRESULT lreturn; 02912 PED ped; 02913 02914 /* 02915 * Get the ped for the given window now since we will use it a lot in 02916 * various handlers. This was stored using SetWindowLong(hwnd,0,hped) when 02917 * we initially created the edit control. 02918 */ 02919 ped = ((PEDITWND)pwnd)->ped; 02920 02921 /* 02922 * Dispatch the various messages we can receive 02923 */ 02924 lreturn = 1L; 02925 switch (message) { 02926 02927 /* 02928 * Messages which are handled the same way for both single and multi line 02929 * edit controls. 02930 */ 02931 case WM_KEYDOWN: 02932 // LPK handling of Ctrl/LShift, Ctrl/RShift 02933 if (ped && ped->pLpkEditCallout && ped->fAllowRTL) { 02934 02935 ped->fSwapRoOnUp = FALSE; // Any keydown cancels a ctrl/shift reading order change 02936 02937 switch (wParam) { 02938 case VK_SHIFT: 02939 if ((GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_MENU) & 0x8000)) { 02940 // Left shift or right shift pressed while control held down 02941 // Check that alt (VK_MENU) isn't down to avoid false firing on AltGr which equals Ctrl+Alt. 02942 if (MapVirtualKey((LONG)lParam>>16&0xff, 3) == VK_LSHIFT) { 02943 // User wants left to right reading order 02944 ped->fSwapRoOnUp = (ped->fRtoLReading) || (ped->format & ES_RIGHT) ; 02945 ped->fLShift = TRUE; 02946 } else { 02947 // User wants right to left reading order 02948 ped->fSwapRoOnUp = (!ped->fRtoLReading) || (ped->format & ES_RIGHT); 02949 ped->fLShift = FALSE; 02950 } 02951 } 02952 break; 02953 02954 case VK_LEFT: 02955 if (ped->fRtoLReading) { 02956 wParam = VK_RIGHT; 02957 } 02958 break; 02959 02960 case VK_RIGHT: 02961 if (ped->fRtoLReading) { 02962 wParam = VK_LEFT; 02963 } 02964 break; 02965 } 02966 } 02967 goto HandleEditMsg; 02968 02969 case WM_KEYUP: 02970 if (ped && ped->pLpkEditCallout && ped->fAllowRTL && ped->fSwapRoOnUp) { 02971 02972 BOOL fReadingOrder; 02973 // Complete reading order change detected earlier during keydown 02974 02975 ped->fSwapRoOnUp = FALSE; 02976 fReadingOrder = ped->fRtoLReading; 02977 02978 // Remove any overriding ES_CENTRE or ES_RIGHT format from dwStyle 02979 SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~ES_FMTMASK); 02980 02981 if (ped->fLShift) { 02982 // Set Left to Right reading order and right scrollbar in EX_STYLE 02983 SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) 02984 & ~(WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR)); 02985 02986 // Edit control is LTR now, then notify the parent. 02987 ECNotifyParent(ped, EN_ALIGN_LTR_EC); 02988 // ? Select a keyboard layout appropriate to LTR operation 02989 } else { 02990 // Set Right to Left reading order, right alignment and left scrollbar 02991 SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) 02992 | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR); 02993 02994 // Edit control is RTL now, then notify the parent. 02995 ECNotifyParent(ped, EN_ALIGN_RTL_EC); 02996 // ? Select a keyboard layout appropriate to RTL operation 02997 } 02998 02999 // If reading order didn't change, so we are sure the alignment changed and the edit window didn't invalidate yet. 03000 if (fReadingOrder == (BOOL) ped->fRtoLReading) { 03001 ECInvalidateClient(ped, TRUE); 03002 } 03003 } 03004 goto HandleEditMsg; 03005 03006 case WM_INPUTLANGCHANGE: 03007 if (ped) { 03008 // EC_INSERT_COMPOSITION_CHAR : WM_INPUTLANGCHANGE - call ECInitInsert() 03009 HKL hkl = THREAD_HKL(); 03010 03011 ECInitInsert(ped, hkl); 03012 03013 if (ped->fInReconversion) { 03014 ECInOutReconversionMode(ped, FALSE); 03015 } 03016 03017 // 03018 // Font and caret position might be changed while 03019 // another keyboard layout is active. Set those 03020 // if the edit control has the focus. 03021 // 03022 if (ped->fFocus && fpImmIsIME(hkl)) { 03023 POINT pt; 03024 03025 ECImmSetCompositionFont(ped); 03026 NtUserGetCaretPos(&pt); 03027 ECImmSetCompositionWindow(ped, pt.x, pt.y); 03028 } 03029 } 03030 03031 goto HandleEditMsg; 03032 03033 case WM_COPY: 03034 03035 /* 03036 * wParam - not used 03037 * lParam - not used 03038 */ 03039 lreturn = (LONG)ECCopy(ped); 03040 break; 03041 03042 case WM_CUT: 03043 /* 03044 * 03045 * wParamLo -- unused 03046 * lParam -- unused 03047 */ 03048 ECCutText(ped); 03049 return 0; 03050 03051 case WM_CLEAR: 03052 /* 03053 * wParamLo -- unused 03054 * lParam -- unused 03055 */ 03056 ECClearText(ped); 03057 return 0; 03058 03059 case WM_ENABLE: 03060 03061 /* 03062 * wParam - nonzero if window is enabled else disable window if 0. 03063 * lParam - not used 03064 */ 03065 lreturn = (LONG)(ped->fDisabled = !((BOOL)wParam)); 03066 ECInvalidateClient(ped, TRUE); 03067 break; 03068 03069 case WM_SYSCHAR: 03070 // 03071 // wParamLo -- key value 03072 // lParam -- unused 03073 // 03074 03075 // 03076 // If this is a WM_SYSCHAR message generated by the UNDO 03077 // keystroke we want to EAT IT 03078 // 03079 if ((lParam & SYS_ALTERNATE) && ((WORD)wParam == VK_BACK)) 03080 return TRUE; 03081 else { 03082 return DefWindowProcWorker(pwnd, message, wParam, lParam, ped->fAnsi); 03083 } 03084 break; 03085 03086 case EM_GETLINECOUNT: 03087 03088 /* 03089 * wParam - not used 03090 lParam - not used 03091 */ 03092 lreturn = (LONG)ped->cLines; 03093 break; 03094 03095 case EM_GETMODIFY: 03096 03097 /* 03098 * wParam - not used 03099 lParam - not used 03100 */ 03101 03102 /* 03103 * Gets the state of the modify flag for this edit control. 03104 */ 03105 lreturn = (LONG)ped->fDirty; 03106 break; 03107 03108 case EM_SETMODIFY: 03109 03110 /* 03111 * wParam - specifies the new value for the modify flag 03112 lParam - not used 03113 */ 03114 03115 /* 03116 * Sets the state of the modify flag for this edit control. 03117 */ 03118 ped->fDirty = (wParam != 0); 03119 break; 03120 03121 case EM_GETRECT: 03122 03123 /* 03124 * wParam - not used 03125 lParam - pointer to a RECT data structure that gets the dimensions. 03126 */ 03127 03128 /* 03129 * Copies the rcFmt rect to *lpRect. 03130 */ 03131 CopyRect((LPRECT)lParam, (LPRECT)&ped->rcFmt); 03132 lreturn = (LONG)TRUE; 03133 break; 03134 03135 case WM_GETFONT: 03136 03137 /* 03138 * wParam - not used 03139 lParam - not used 03140 */ 03141 lreturn = (LRESULT)ped->hFont; 03142 break; 03143 03144 case WM_SETFONT: 03145 03146 /* 03147 * wParam - handle to the font 03148 lParam - redraw if true else don't 03149 */ 03150 ECSetFont(ped, (HANDLE)wParam, (BOOL)LOWORD(lParam)); 03151 break; 03152 03153 case WM_GETTEXT: 03154 03155 /* 03156 * wParam - max number of _bytes_ (not characters) to copy 03157 * lParam - buffer to copy text to. Text is 0 terminated. 03158 */ 03159 lreturn = (LRESULT)ECGetText(ped, (ICH)wParam, (LPSTR)lParam, TRUE); 03160 break; 03161 03162 case WM_SETTEXT: 03163 // 03164 // wParamLo -- unused 03165 // lParam -- LPSTR, null-terminated, with new text. 03166 // 03167 lreturn = (LRESULT)ECSetText(ped, (LPSTR)lParam); 03168 break; 03169 03170 case WM_GETTEXTLENGTH: 03171 03172 /* 03173 * Return count of CHARs!!! 03174 */ 03175 lreturn = (LONG)ped->cch; 03176 break; 03177 03178 case WM_NCDESTROY: 03179 case WM_FINALDESTROY: 03180 03181 /* 03182 * wParam - not used 03183 lParam - not used 03184 */ 03185 ECNcDestroyHandler(pwnd, ped); 03186 return 0; 03187 03188 /* 03189 * Most apps (i.e. everyone but Quicken) don't pass on the rbutton 03190 * messages when they do something with 'em inside of subclassed 03191 * edit fields. As such, we keep track of whether we saw the 03192 * down before the up. If we don't see the up, then DefWindowProc 03193 * won't generate the context menu message, so no big deal. If 03194 * we didn't see the down, then don't let WM_CONTEXTMENU do 03195 * anything. 03196 * 03197 * We also might want to not generate WM_CONTEXTMENUs for old 03198 * apps when the mouse is captured. 03199 */ 03200 03201 case WM_RBUTTONDOWN: 03202 ped->fSawRButtonDown = TRUE; 03203 goto HandleEditMsg; 03204 03205 case WM_RBUTTONUP: 03206 if (ped->fSawRButtonDown) { 03207 ped->fSawRButtonDown = FALSE; 03208 if (!ped->fInReconversion) { 03209 goto HandleEditMsg; 03210 } 03211 } 03212 // Don't pass this on to DWP so WM_CONTEXTMENU isn't generated. 03213 return 0; 03214 03215 case WM_CONTEXTMENU: { 03216 POINT pt ; 03217 int nHit = FindNCHit(pwnd, (LONG)lParam); 03218 if ((nHit == HTVSCROLL) || (nHit == HTHSCROLL)) { 03219 return DefWindowProcWorker(pwnd, message, wParam, lParam, ped->fAnsi); 03220 } 03221 POINTSTOPOINT(pt, lParam); 03222 if (!TestWF(pwnd, WFOLDUI) && ECIsAncestorActive(hwnd)) 03223 ECMenu(hwnd, ped, &pt); 03224 } 03225 return 0; 03226 03227 case EM_CANUNDO: 03228 03229 /* 03230 * wParam - not used 03231 lParam - not used 03232 */ 03233 lreturn = (LONG)(ped->undoType != UNDO_NONE); 03234 break; 03235 03236 case EM_EMPTYUNDOBUFFER: 03237 03238 /* 03239 * wParam - not used 03240 lParam - not used 03241 */ 03242 ECEmptyUndo(Pundo(ped)); 03243 break; 03244 03245 case EM_GETMARGINS: 03246 // 03247 // wParam -- unused 03248 // lParam -- unused 03249 // 03250 return(MAKELONG(ped->wLeftMargin, ped->wRightMargin)); 03251 03252 case EM_SETMARGINS: 03253 // 03254 // wParam -- EC_ margin flags 03255 // lParam -- LOWORD is left, HIWORD is right margin 03256 // 03257 ECSetMargin(ped, (UINT)wParam, (DWORD)lParam, TRUE); 03258 return 0; 03259 03260 case EM_GETSEL: 03261 03262 /* 03263 * Gets the selection range for the given edit control. The 03264 * starting position is in the low order word. It contains the position 03265 * of the first nonselected character after the end of the selection in 03266 * the high order word. 03267 */ 03268 if ((PDWORD)wParam != NULL) { 03269 *((PDWORD)wParam) = ped->ichMinSel; 03270 } 03271 if ((PDWORD)lParam != NULL) { 03272 *((PDWORD)lParam) = ped->ichMaxSel; 03273 } 03274 lreturn = MAKELONG(ped->ichMinSel,ped->ichMaxSel); 03275 break; 03276 03277 case EM_GETLIMITTEXT: 03278 // 03279 // wParamLo -- unused 03280 // lParam -- unused 03281 // 03282 return(ped->cchTextMax); 03283 03284 case EM_SETLIMITTEXT: /* Renamed from EM_LIMITTEXT in Chicago */ 03285 /* 03286 * wParam - max number of CHARACTERS that can be entered 03287 * lParam - not used 03288 */ 03289 03290 /* 03291 * Specifies the maximum number of characters of text the user may 03292 * enter. If maxLength is 0, we may enter MAXINT number of CHARACTERS. 03293 */ 03294 if (ped->fSingle) { 03295 if (wParam) { 03296 wParam = min(0x7FFFFFFEu, wParam); 03297 } else { 03298 wParam = 0x7FFFFFFEu; 03299 } 03300 } 03301 03302 if (wParam) { 03303 ped->cchTextMax = (ICH)wParam; 03304 } else { 03305 ped->cchTextMax = 0xFFFFFFFFu; 03306 } 03307 break; 03308 03309 case EM_POSFROMCHAR: 03310 // 03311 // Validate that char index is within text range 03312 // 03313 if (wParam >= ped->cch) { 03314 return(-1L); 03315 } 03316 goto HandleEditMsg; 03317 03318 case EM_CHARFROMPOS: { 03319 // Validate that point is within client of edit field 03320 RECT rc; 03321 POINT pt; 03322 03323 POINTSTOPOINT(pt, lParam); 03324 _GetClientRect(pwnd, &rc); 03325 if (!PtInRect(&rc, pt)) { 03326 return(-1L); 03327 } 03328 goto HandleEditMsg; 03329 } 03330 03331 case EM_SETPASSWORDCHAR: 03332 03333 /* 03334 * wParam - sepecifies the new char to display instead of the 03335 * real text. if null, display the real text. 03336 */ 03337 ECSetPasswordChar(ped, (UINT)wParam); 03338 break; 03339 03340 case EM_GETPASSWORDCHAR: 03341 lreturn = (DWORD)ped->charPasswordChar; 03342 break; 03343 03344 case EM_SETREADONLY: 03345 03346 /* 03347 * wParam - state to set read only flag to 03348 */ 03349 ped->fReadOnly = (wParam != 0); 03350 if (wParam) 03351 SetWindowState(pwnd, EFREADONLY); 03352 else 03353 ClearWindowState(pwnd, EFREADONLY); 03354 lreturn = 1L; 03355 03356 ECEnableDisableIME( ped ); 03357 // We need to redraw the edit field so that the background color 03358 // changes. Read-only edits are drawn in CTLCOLOR_STATIC while 03359 // others are drawn with CTLCOLOR_EDIT. 03360 ECInvalidateClient(ped, TRUE); 03361 break; 03362 03363 case EM_SETWORDBREAKPROC: 03364 03365 /* 03366 * wParam - unused 03367 * lParam - FARPROC address of an app supplied call back function 03368 */ 03369 ped->lpfnNextWord = (EDITWORDBREAKPROCA)lParam; 03370 break; 03371 03372 case EM_GETWORDBREAKPROC: 03373 lreturn = (LRESULT)ped->lpfnNextWord; 03374 break; 03375 03376 // IME 03377 case EM_GETIMESTATUS: 03378 // wParam == sub command 03379 switch (wParam) { 03380 case EMSIS_COMPOSITIONSTRING: 03381 return ped->wImeStatus; 03382 #if 0 // memphis 03383 case EMSIS_GETLBBIT: 03384 return (DWORD)ped->bLBBit; 03385 #endif 03386 } 03387 break; 03388 03389 case EM_SETIMESTATUS: 03390 // wParam == sub command 03391 switch (wParam) { 03392 case EMSIS_COMPOSITIONSTRING: 03393 ped->wImeStatus = (WORD)lParam; 03394 } 03395 break; 03396 03397 03398 case WM_NCCREATE: 03399 lreturn = ECNcCreate(ped, pwnd, (LPCREATESTRUCT)lParam); 03400 break; 03401 03402 case WM_LBUTTONDOWN: 03403 // 03404 // B#3623 03405 // Don't set focus to edit field if it is within an inactive, 03406 // captioned child. 03407 // We might want to version switch this... I haven't found 03408 // any problems by not, but you never know... 03409 // 03410 if (ECIsAncestorActive(hwnd)) { 03411 /* 03412 * Reconversion support: quit reconversion if left button is clicked. 03413 * Otherwise, if the current KL is Korean, finailize the composition string. 03414 */ 03415 if (ped->fInReconversion || ped->fKorea) { 03416 BOOLEAN fReconversion = (BOOLEAN)ped->fInReconversion; 03417 DWORD dwIndex = fReconversion ? CPS_CANCEL : CPS_COMPLETE; 03418 HIMC hImc; 03419 03420 ped->fReplaceCompChr = FALSE; 03421 03422 hImc = fpImmGetContext(ped->hwnd); 03423 if (hImc) { 03424 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, dwIndex, 0); 03425 fpImmReleaseContext(ped->hwnd, hImc); 03426 } 03427 03428 if (fReconversion) { 03429 ECInOutReconversionMode(ped, FALSE); 03430 } 03431 03432 ECSetCaretHandler(ped); 03433 } 03434 03435 goto HandleEditMsg; 03436 } 03437 break; 03438 03439 case WM_MOUSEMOVE: 03440 // 03441 // We only care about mouse messages when mouse is down. 03442 // 03443 if (ped->fMouseDown) 03444 goto HandleEditMsg; 03445 break; 03446 03447 case WM_IME_SETCONTEXT: 03448 // 03449 // If ped->fInsertCompChr is TRUE, that means we will do 03450 // all the composition character drawing by ourself. 03451 // 03452 if ( ped->fInsertCompChr ) { 03453 lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW; 03454 } 03455 03456 if ( wParam ) { 03457 03458 PINPUTCONTEXT pInputContext; 03459 HIMC hImc; 03460 03461 hImc = fpImmGetContext( hwnd ); 03462 if ( (pInputContext = fpImmLockIMC( hImc )) != NULL ) { 03463 pInputContext->fdw31Compat &= ~F31COMPAT_ECSETCFS; 03464 fpImmUnlockIMC( hImc ); 03465 } 03466 if (GetClientInfo()->CI_flags & CI_16BIT) { 03467 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0L); 03468 } 03469 fpImmReleaseContext( hwnd, hImc ); 03470 } 03471 return DefWindowProcWorker(pwnd, message, wParam, lParam, ped->fAnsi); 03472 03473 case WM_IME_ENDCOMPOSITION: 03474 ECInOutReconversionMode(ped, FALSE); 03475 03476 if (ped->fReplaceCompChr) { 03477 ICH ich; 03478 HDC hdc; 03479 // 03480 // we have a DBCS character to be replaced. 03481 // let's delete it before inserting the new one. 03482 // 03483 ich = (ped->fAnsi) ? 2 : 1; 03484 ped->fReplaceCompChr = FALSE; 03485 ped->ichMaxSel = min(ped->ichCaret + ich, ped->cch); 03486 ped->ichMinSel = ped->ichCaret; 03487 if (ped->fSingle) { 03488 if (ECDeleteText( ped ) > 0) { 03489 // 03490 // Update the display 03491 // 03492 ECNotifyParent(ped, EN_UPDATE); 03493 hdc = ECGetEditDC(ped, FALSE); 03494 SLDrawText(ped, hdc, 0); 03495 ECReleaseEditDC(ped, hdc, FALSE); 03496 // 03497 // Tell parent our text contents changed. 03498 // 03499 ECNotifyParent(ped, EN_CHANGE); 03500 } 03501 } 03502 else { 03503 MLDeleteText(ped); 03504 } 03505 03506 ECSetCaretHandler( ped ); 03507 } 03508 return DefWindowProcWorker(pwnd, message, wParam, lParam, ped->fAnsi); 03509 03510 case WM_IME_STARTCOMPOSITION: 03511 if ( ped->fInsertCompChr ) { 03512 // 03513 // BUG BUG 03514 // 03515 // sending WM_IME_xxxCOMPOSITION will let 03516 // IME draw composition window. IME should 03517 // not do that since we cleared 03518 // ISC_SHOWUICOMPOSITIONWINDOW bit when 03519 // we got WM_IME_SETCONTEXT message. 03520 // 03521 // Korean IME should be fixed in the future. 03522 // 03523 break; 03524 03525 } else { 03526 return DefWindowProcWorker(pwnd, message, wParam, lParam, ped->fAnsi); 03527 } 03528 03529 // simple composition character support for FE IME. 03530 case WM_IME_COMPOSITION: 03531 return ECImeComposition(ped, wParam, lParam); 03532 03533 case WM_KILLFOCUS: 03534 // 03535 // when focus is removed from the window, 03536 // composition character should be finalized 03537 // 03538 if (ped && fpImmIsIME(THREAD_HKL())) { 03539 HIMC hImc = fpImmGetContext(hwnd); 03540 03541 if (hImc != NULL_HIMC) { 03542 if (ped->fReplaceCompChr || (ped->wImeStatus & EIMES_COMPLETECOMPSTRKILLFOCUS)) { 03543 // If the composition string to be determined upon kill focus, 03544 // do it now. 03545 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); 03546 } else if (ped->fInReconversion) { 03547 // If the composition string it not to be determined, 03548 // and if we're in reconversion mode, cancel reconversion now. 03549 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); 03550 } 03551 03552 // Get out from reconversion mode 03553 if (ped->fInReconversion) { 03554 ECInOutReconversionMode(ped, FALSE); 03555 } 03556 03557 fpImmReleaseContext(hwnd, hImc); 03558 } 03559 } 03560 goto HandleEditMsg; 03561 break; 03562 03563 case WM_SETFOCUS: 03564 if (ped && !ped->fFocus) { 03565 HKL hkl = THREAD_HKL(); 03566 03567 if (fpImmIsIME(hkl)) { 03568 HIMC hImc; 03569 03570 hImc = fpImmGetContext(hwnd); 03571 if (hImc) { 03572 LPINPUTCONTEXT lpImc; 03573 03574 if (ped->wImeStatus & EIMES_CANCELCOMPSTRINFOCUS) { 03575 // cancel when in-focus 03576 fpImmNotifyIME(hImc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); 03577 } 03578 03579 ECImmSetCompositionFont(ped); 03580 03581 if ((lpImc = fpImmLockIMC(hImc)) != NULL) { 03582 03583 // We presume the CompForm will reset to CFS_DEFAULT, 03584 // when the edit control loses Focus. 03585 // IMEWndProc32 will call ImmSetCompositionWindow with 03586 // CFS_DEFAULT, when it receive WM_IME_SETCONTEXT. 03587 lpImc->fdw31Compat |= F31COMPAT_ECSETCFS; 03588 03589 fpImmUnlockIMC(hImc); 03590 } 03591 fpImmReleaseContext(hwnd, hImc); 03592 } 03593 03594 // 03595 // force to set IME composition window when 03596 // first getting focus. 03597 // 03598 ped->ptScreenBounding.x = -1; 03599 ped->ptScreenBounding.y = -1; 03600 } 03601 ECInitInsert(ped, hkl); 03602 } 03603 goto HandleEditMsg; 03604 break; 03605 03606 case WM_IME_REQUEST: 03607 // simple ImeRequest Handler 03608 return EcImeRequestHandler(ped, wParam, lParam); 03609 03610 case WM_CREATE: 03611 if (ped) 03612 ECEnableDisableIME(ped); 03613 goto HandleEditMsg; 03614 break; 03615 03616 default: 03617 HandleEditMsg: 03618 /* (picked up from NT40FE SP3) 03619 * HACK ALERT: We may receive messages before the PED has been 03620 * allocated (eg: WM_GETMINMAXINFO is sent before WM_NCCREATE) 03621 * so we must test ped before dreferencing. 03622 */ 03623 if (ped != NULL) { 03624 if (ped->fSingle) { 03625 lreturn = SLEditWndProc(hwnd, ped, message, wParam, lParam); 03626 } else { 03627 lreturn = MLEditWndProc(hwnd, ped, message, wParam, lParam); 03628 } 03629 } 03630 } 03631 03632 return lreturn; 03633 }

LRESULT APIENTRY EditWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 2787 of file editec.c.

References DefWindowProcWorker(), EditWndProcWorker(), FNID_EDIT, FWINDOWMSG, NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup(), and EditWndProcWorker().

02792 { 02793 PWND pwnd; 02794 02795 if ((pwnd = ValidateHwnd(hwnd)) == NULL) 02796 return 0; 02797 02798 /* 02799 * If the control is not interested in this message, 02800 * pass it to DefWindowProc. 02801 */ 02802 if (!FWINDOWMSG(message, FNID_EDIT)) 02803 return DefWindowProcWorker(pwnd, message, wParam, lParam, TRUE); 02804 02805 return EditWndProcWorker(pwnd, message, wParam, lParam, TRUE); 02806 }

LRESULT APIENTRY EditWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 2808 of file editec.c.

References DefWindowProcWorker(), EditWndProcWorker(), FALSE, FNID_EDIT, FWINDOWMSG, NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), EditWndProcWorker(), and RW_RegisterControls().

02813 { 02814 PWND pwnd; 02815 02816 if ((pwnd = ValidateHwnd(hwnd)) == NULL) 02817 return 0; 02818 02819 /* 02820 * If the control is not interested in this message, 02821 * pass it to DefWindowProc. 02822 */ 02823 if (!FWINDOWMSG(message, FNID_EDIT)) { 02824 return DefWindowProcWorker(pwnd, message, wParam, lParam, FALSE); 02825 } 02826 02827 return EditWndProcWorker(pwnd, message, wParam, lParam, FALSE); 02828 }

LRESULT EditWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 2831 of file editec.c.

References BOOL, tagMSG_TABLE_ENTRY::bThunkMessage, CsSendMessage, ED, EditLookaside, EditWndProc(), EditWndProcA(), EditWndProcW(), FALSE, tagED::fAnsi, tagED::fInitialized, FNID_CALLWINDOWPROC, FNID_EDIT, HWq, INITCONTROLLOOKASIDE, MessageTable, PEDITWND, TestWF, TRUE, VALIDATECLASSANDSIZE, and WFANSICREATOR.

Referenced by ClientThreadSetup(), EditWndProcA(), and EditWndProcW().

02837 { 02838 PED ped; 02839 HWND hwnd = HWq(pwnd); 02840 static BOOL fInit = TRUE; 02841 02842 VALIDATECLASSANDSIZE(pwnd, FNID_EDIT); 02843 INITCONTROLLOOKASIDE(&EditLookaside, ED, pwnd, 4); 02844 02845 /* 02846 * Get the ped for the given window now since we will use it a lot in 02847 * various handlers. This was stored using SetWindowLong(hwnd,0,hped) when 02848 * we initially created the edit control. 02849 */ 02850 ped = ((PEDITWND)pwnd)->ped; 02851 02852 /* 02853 * Make sure the ANSI flag is set correctly. 02854 */ 02855 if (!ped->fInitialized) { 02856 ped->fInitialized = TRUE; 02857 ped->fAnsi = TestWF(pwnd, WFANSICREATOR) ? TRUE : FALSE; 02858 } 02859 02860 /* 02861 * We just call the regular EditWndProc if the ped is not created, the 02862 * incoming message type already matches the PED type or the message 02863 * does not need any translation. 02864 */ 02865 if (ped->fAnsi == fAnsi || 02866 (message >= WM_USER) || 02867 !MessageTable[message].bThunkMessage) { 02868 return EditWndProc(pwnd, message, wParam, lParam); 02869 } 02870 02871 return CsSendMessage(hwnd, message, wParam, lParam, 02872 fAnsi ? (ULONG_PTR)EditWndProcW : (ULONG_PTR)EditWndProcA, 02873 FNID_CALLWINDOWPROC, fAnsi); 02874 }

BOOL EnterReaderModeHelper HWND  hwnd  ) 
 

Definition at line 415 of file reader.c.

References BOOL, tagREADERMODE::cbSize, tagREADERMODE::dwFlags, EnterReaderMode(), FALSE, FScrollEnabled(), tagREADERMODE::lParam, tagREADERMODE::pfnReaderModeProc, RDRMODE_HORZ, RDRMODE_VERT, ReaderProcInternal(), TRUE, and ValidateHwnd.

Referenced by ListBoxWndProcWorker(), and MLEditWndProc().

00416 { 00417 PWND pwnd = ValidateHwnd(hwnd); 00418 READERMODE rdrm; 00419 00420 rdrm.cbSize = sizeof(READERMODE); 00421 rdrm.pfnReaderModeProc = ReaderProcInternal; 00422 rdrm.lParam = (LPARAM)hwnd; 00423 rdrm.dwFlags = 0; 00424 00425 if (FScrollEnabled(pwnd, TRUE)) { 00426 rdrm.dwFlags |= RDRMODE_VERT; 00427 } 00428 if (FScrollEnabled(pwnd, FALSE)) { 00429 rdrm.dwFlags |= RDRMODE_HORZ; 00430 } 00431 00432 return EnterReaderMode(&rdrm); 00433 }

DWORD Event PEVENT_PACKET  pep  ) 
 

Definition at line 86 of file client/ntstubs.c.

References BEGINCALL, CheckDDECritOut, DWORD, ENDCALL, ERRORTRAP, NtUserEvent(), and pep.

Referenced by BuildQueryDirectoryIrp(), CcCanIWrite(), CcSetValidData(), CcWaitForCurrentLazyWriterActivity(), CcWaitOnActiveCount(), CcZeroData(), DoCallback(), ExAcquireResourceExclusiveLite(), ExpAcquireResourceExclusiveLite(), ExpGetProcessInformation(), ExReinitializeResourceLite(), FsRtlBalanceReads(), FsRtlGetFileSize(), FsRtlNotifyVolumeEvent(), FsRtlOplockBreakToII(), FsRtlOplockBreakToNone(), FsRtlPostPagingFileStackOverflow(), FsRtlPostStackOverflow(), FsRtlpPostStackOverflow(), FsRtlSetFileSize(), FsRtlSyncVolumes(), FsRtlWaitOnIrp(), GetChar(), IoBuildDeviceIoControlRequest(), IoBuildSynchronousFsdRequest(), IoFreeDumpStack(), IoPageRead(), IopCancelAlertedRequest(), IopGetDumpStack(), IopSynchronousApiServiceTail(), IopTrackLink(), IopXxxControlFile(), IoSynchronousPageWrite(), IovBuildDeviceIoControlRequest(), KdUpdateTimeSlipEvent(), KeClearEvent(), KeInitializeEvent(), KePulseEvent(), KeReadStateEvent(), KeResetEvent(), KeSetAutoAlignmentThread(), KeSetEvent(), KeSetEventBoostPriority(), KiWaitTest(), MiDereferenceSession(), MiEnsureAvailablePageOrWait(), MiInitializeReadInProgressPfn(), MiMakeOutswappedPageResident(), MiSegmentDelete(), MiUnmapImageHeaderInHyperSpace(), MmCleanProcessAddressSpace(), MmCopyToCachedPage(), MmCreateSection(), MonitorConv(), MonitorLink(), MonitorStringHandle(), NtClearEvent(), NtCreateEvent(), NtDeviceIoControlFile(), NtFsControlFile(), NtLockFile(), NtNotifyChangeDirectoryFile(), NtNotifyChangeKey(), NtNotifyChangeMultipleKeys(), NtPulseEvent(), NtQueryDirectoryFile(), NtQueryEvent(), NtReadFile(), NtReadFileScatter(), NtResetEvent(), NtSetEvent(), NtSetSystemInformation(), NtWriteFile(), NtWriteFileGather(), ObCreateObjectType(), RtlDeleteTimer(), RtlDeleteTimerQueueEx(), RtlDeregisterWaitEx(), RtlpFreeWaitEvent(), RtlpGetWaitEvent(), RtlpWaitForEvent(), RtlRegisterWait(), SetLastDDEMLError(), UdfPerformDevIoCtrl(), UdfPnpCompletionRoutine(), UdfPnpQueryRemove(), UdfPnpRemove(), UdfPnpSurpriseRemove(), UdfReadSectors(), VdmpQueueIntNormalRoutine(), VdmQueryDirectoryFile(), and VerifierSetEvent().

00088 { 00089 BEGINCALL() 00090 00091 CheckDDECritOut; 00092 00093 retval = (DWORD)NtUserEvent( 00094 pep); 00095 00096 ERRORTRAP(0); 00097 ENDCALL(DWORD); 00098 }

BOOL FChildVisible HWND  hwnd  ) 
 

Definition at line 52 of file winmgrc.c.

References _FChildVisible(), BOOL, NULL, and ValidateHwnd.

Referenced by SLUndo().

00054 { 00055 PWND pwnd; 00056 00057 pwnd = ValidateHwnd(hwnd); 00058 00059 if (pwnd == NULL) 00060 return 0; 00061 00062 return (_FChildVisible(pwnd)); 00063 }

BOOL FillTriangle HDC  hdc,
LPRECT  lprc,
HBRUSH  hbr,
UINT  flags
 

Definition at line 302 of file rtl/draw.c.

References BOOL, DrawDiagonalLine(), NULL, and UserSelectBrush.

Referenced by DrawEdge().

00307 { 00308 HBRUSH hbrT; 00309 int nDirection; 00310 00311 switch (flags & (BF_RECT | BF_DIAGONAL)) { 00312 00313 case BF_DIAGONAL_ENDTOPLEFT: 00314 case BF_DIAGONAL_ENDBOTTOMRIGHT: 00315 nDirection = -1; 00316 break; 00317 00318 default: 00319 nDirection = 1; 00320 break; 00321 } 00322 hbrT = UserSelectBrush(hdc, hbr); 00323 DrawDiagonalLine(hdc, lprc, nDirection, 1, flags); 00324 /* 00325 * Don't care if the above functions failed for a bad hdc 00326 */ 00327 return (UserSelectBrush(hdc, hbrT) != NULL); 00328 }

HCURSOR FindExistingCursorIcon LPWSTR  pszModName,
LPCWSTR  pszResName,
PCURSORFIND  pcfSearch
 

Definition at line 1102 of file client/ntstubs.c.

References BEGINCALL, CLEANUPLPWSTR, COPYLPWSTR, COPYLPWSTRID, ENDCALL, ERRORTRAP, _IN_STRING::fAllocated, FALSE, NtUserFindExistingCursorIcon(), NULL, _IN_STRING::pstr, and szUSER32.

Referenced by CopyImageFromRes(), and LoadIcoCur().

01106 { 01107 IN_STRING strModName; 01108 IN_STRING strResName; 01109 01110 /* 01111 * Make sure cleanup will work successfully 01112 */ 01113 strModName.fAllocated = FALSE; 01114 strResName.fAllocated = FALSE; 01115 01116 BEGINCALL() 01117 01118 if (pszModName == NULL) 01119 pszModName = szUSER32; 01120 01121 COPYLPWSTR(&strModName, pszModName); 01122 COPYLPWSTRID(&strResName, pszResName); 01123 01124 retval = (ULONG_PTR)NtUserFindExistingCursorIcon(strModName.pstr, 01125 strResName.pstr, 01126 pcfSearch); 01127 01128 ERRORTRAP(0); 01129 01130 CLEANUPLPWSTR(strModName); 01131 CLEANUPLPWSTR(strResName); 01132 01133 ENDCALL(HCURSOR); 01134 }

int FindMnemChar LPWSTR  lpstr,
WCHAR  ch,
BOOL  fFirst,
BOOL  fPrefix
 

Definition at line 27 of file dmmnem.c.

References CH_ENGLISHPREFIX, CH_PREFIX, CharLowerW(), DWORD, SHORT, UTCHAR, and VkKeyScanW.

Referenced by xxxGNM_FindNextMnem().

00032 { 00033 WCHAR chc; 00034 WCHAR chnext; 00035 WCHAR chFirst; 00036 00037 while (*lpstr == TEXT(' ')) 00038 lpstr++; 00039 00040 ch = (WCHAR)(ULONG_PTR)CharLowerW((LPWSTR)ULongToPtr( (DWORD)(UTCHAR)ch )); 00041 chFirst = (WCHAR)(ULONG_PTR)CharLowerW((LPWSTR)ULongToPtr( (DWORD)(UTCHAR)(*lpstr) )); 00042 00043 #ifdef FE_SB // FindMnemChar() 00044 // 00045 // HIRO: LATER: CH_ENGLISHPREFIX is obsolete, so entire FE_SB can be removed ? 00046 // 00047 if (fPrefix) { 00048 SHORT wvch, xvkey; 00049 // 00050 // get OEM-dependent virtual key code 00051 // 00052 if ((wvch = VkKeyScanW(ch)) != -1) 00053 wvch &= 0x00FF; 00054 00055 while (chc = *lpstr++) { 00056 // 00057 // This should think about KOREA & TAIWAN case. But probably OK. 00058 // 00059 if ((chc == CH_PREFIX) || (chc == CH_ENGLISHPREFIX)) { 00060 chnext = (WCHAR)(ULONG_PTR)CharLowerW((LPWSTR)ULongToPtr( (DWORD)(UTCHAR)*lpstr )); 00061 00062 if (chnext == CH_PREFIX) 00063 lpstr++; 00064 else if (chnext == ch) 00065 return(0x01); 00066 else { 00067 // 00068 // Compare should be done with virtual key in Kanji menu mode 00069 // in order to accept Digit shortcut key and save English 00070 // windows applications! 00071 // 00072 xvkey = VkKeyScanW(chnext); 00073 if (xvkey != 0xFFFF && ((xvkey & 0x00FF) == wvch)) 00074 return(0x01); 00075 else 00076 return(0x00); 00077 } 00078 } 00079 } 00080 } 00081 #else 00082 if (fPrefix) { 00083 while (chc = *lpstr++) { 00084 if (((WCHAR)CharLower((LPWSTR)(DWORD)(UTCHAR)chc) == CH_PREFIX)) { 00085 chnext = (WCHAR)CharLowerW((LPWSTR)(DWORD)(UTCHAR)*lpstr); 00086 00087 if (chnext == CH_PREFIX) 00088 lpstr++; 00089 else if (chnext == ch) 00090 return 0x01; 00091 else { 00092 return 0x00; 00093 } 00094 } 00095 } 00096 } 00097 #endif // FE_SB 00098 00099 if (fFirst && (ch == chFirst)) 00100 return 0x80; 00101 00102 return 0x00; 00103 }

PWND FindPwndChild PWND  pwndMDI,
UINT  wChildID
 

Definition at line 24 of file mdimenu.c.

References REBASEPWND, tagWND::spmenu, and tagWND::spwndOwner.

Referenced by DefFrameProcWorker(), MDISetMenu(), xxxInitActivateDlg(), and xxxMDIActivate().

00027 { 00028 PWND pwndT; 00029 00030 for (pwndT = REBASEPWND(pwndMDI, spwndChild); 00031 pwndT && (pwndT->spwndOwner || PtrToUlong(pwndT->spmenu) != wChildID); 00032 pwndT = REBASEPWND(pwndT, spwndNext)) 00033 ; 00034 00035 return pwndT; 00036 }

LRESULT fnHkINLPCWPRETSTRUCTA PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Referenced by ClientThreadSetup().

LRESULT fnHkINLPCWPRETSTRUCTW PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Referenced by ClientThreadSetup().

LRESULT fnHkINLPCWPSTRUCTA PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Referenced by ClientThreadSetup().

LRESULT fnHkINLPCWPSTRUCTW PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Referenced by ClientThreadSetup().

void FreeLookasideEntry PLOOKASIDE  pla,
PVOID  pEntry
 

Definition at line 344 of file rtlinit.c.

References FreeToZone, gcsLookaside, _LOOKASIDE::LookasideBase, _LOOKASIDE::LookasideBounds, _LOOKASIDE::LookasideZone, and UserLocalFree.

Referenced by ButtonWndProcWorker(), DefDlgProcWorker(), ECNcCreate(), ECNcDestroyHandler(), ImeWndProcWorker(), StaticWndProcWorker(), xxxCBNcDestroyHandler(), and xxxDestroyLBox().

00347 { 00348 #if DBG 00349 pla->DelCalls++; 00350 #endif // DBG 00351 00352 // 00353 // If the pEntry was from zone, then free to zone 00354 // 00355 if ( (PVOID)pEntry >= pla->LookasideBase && (PVOID)pEntry < pla->LookasideBounds ) { 00356 RtlEnterCriticalSection(&gcsLookaside); 00357 FreeToZone(&pla->LookasideZone,pEntry); 00358 RtlLeaveCriticalSection(&gcsLookaside); 00359 } else { 00360 #if DBG 00361 pla->DelSlowCalls++; 00362 #endif // DBG 00363 UserLocalFree(pEntry); 00364 } 00365 }

UINT GetACPCharSet  ) 
 

Definition at line 133 of file dlgbegin.c.

References DWORD, and UINT.

00134 { 00135 static UINT charset = (UINT)~0; 00136 CHARSETINFO csInfo; 00137 00138 if (charset != (UINT)~0) { 00139 return charset; 00140 } 00141 00142 // Sundown: In the TCI_SRCCODEPAGE case, the GetACP() return value is zero-extended. 00143 if (!TranslateCharsetInfo((DWORD*)UIntToPtr( GetACP() ), &csInfo, TCI_SRCCODEPAGE)) { 00144 return DEFAULT_CHARSET; 00145 } 00146 charset = csInfo.ciCharset; 00147 UserAssert(charset != (UINT)~0); 00148 return csInfo.ciCharset; 00149 }

VOID GetActiveKeyboardName LPWSTR  lpszName  ) 
 

Definition at line 3729 of file client.c.

References CheckValidLayoutName(), DWORD, IS_IME_ENABLED, L, NT_SUCCESS, NtClose(), NtCreateKey(), NtDeleteValueKey(), NtOpenKey(), NtQueryValueKey(), NtSetValueKey(), NTSTATUS(), NULL, RtlInitUnicodeString(), RtlOpenCurrentUser(), UINT, VOID(), and wcsncpycch().

Referenced by CommonCreateWindowStation(), and UpdatePerUserSystemParameters().

03731 { 03732 LPTSTR szKbdActive = TEXT("Active"); 03733 LPTSTR szKbdLayout = TEXT("Keyboard Layout"); 03734 LPTSTR szKbdLayoutPreload = TEXT("Keyboard Layout\\Preload"); 03735 NTSTATUS rc; 03736 DWORD cbSize; 03737 HANDLE UserKeyHandle, hKey, hKeyPreload; 03738 OBJECT_ATTRIBUTES ObjA; 03739 UNICODE_STRING UnicodeString; 03740 ULONG CreateDisposition; 03741 struct { 03742 KEY_VALUE_PARTIAL_INFORMATION KeyInfo; 03743 WCHAR KeyLayoutId[KL_NAMELENGTH]; 03744 } KeyValueId; 03745 03746 /* 03747 * Load initial keyboard name ( HKEY_CURRENT_USER\Keyboard Layout\Preload\1 ) 03748 */ 03749 rc = RtlOpenCurrentUser( MAXIMUM_ALLOWED, &UserKeyHandle ); 03750 if (!NT_SUCCESS( rc )) 03751 { 03752 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could NOT open HKEY_CURRENT_USER (%lx).\n", rc ); 03753 wcscpy( lpszName, L"00000409" ); 03754 return; 03755 } 03756 03757 RtlInitUnicodeString( &UnicodeString, szKbdLayoutPreload ); 03758 InitializeObjectAttributes( &ObjA, 03759 &UnicodeString, 03760 OBJ_CASE_INSENSITIVE, 03761 UserKeyHandle, 03762 NULL ); 03763 rc = NtOpenKey( &hKey, 03764 KEY_ALL_ACCESS, 03765 &ObjA ); 03766 if (NT_SUCCESS( rc )) 03767 { 03768 /* 03769 * Query the value from the registry. 03770 */ 03771 RtlInitUnicodeString( &UnicodeString, L"1" ); 03772 03773 rc = NtQueryValueKey( hKey, 03774 &UnicodeString, 03775 KeyValuePartialInformation, 03776 &KeyValueId, 03777 sizeof(KeyValueId), 03778 &cbSize ); 03779 03780 if ( rc == STATUS_BUFFER_OVERFLOW ) { 03781 RIPMSG0(RIP_WARNING, "GetActiveKeyboardName - Buffer overflow."); 03782 rc = STATUS_SUCCESS; 03783 } 03784 if (NT_SUCCESS( rc )) { 03785 wcsncpycch( lpszName, (LPWSTR)KeyValueId.KeyInfo.Data, KL_NAMELENGTH - 1 ); 03786 lpszName[KL_NAMELENGTH - 1] = L'\0'; 03787 } else { 03788 /* 03789 * Error reading value...use default 03790 */ 03791 wcscpy( lpszName, L"00000409" ); 03792 } 03793 03794 NtClose( hKey ); 03795 NtClose( UserKeyHandle ); 03796 if (IS_IME_ENABLED()) { 03797 CheckValidLayoutName( lpszName ); 03798 } 03799 return; 03800 } 03801 03802 /* 03803 * NOTE: The code below is only executed the first time a user logs 03804 * on after an upgrade from NT3.x to NT4.0. 03805 */ 03806 /* 03807 * The Preload key does not exist in the registry. Try reading the 03808 * old registry entry "Keyboard Layout\Active". If it exists, we 03809 * convert it to the new style Preload key. 03810 */ 03811 RtlInitUnicodeString( &UnicodeString, szKbdLayout ); 03812 InitializeObjectAttributes( &ObjA, 03813 &UnicodeString, 03814 OBJ_CASE_INSENSITIVE, 03815 UserKeyHandle, 03816 NULL ); 03817 rc = NtOpenKey( &hKey, 03818 KEY_ALL_ACCESS, 03819 &ObjA ); 03820 03821 NtClose( UserKeyHandle ); 03822 03823 if (!NT_SUCCESS( rc )) 03824 { 03825 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could not determine active keyboard layout (%lx).\n", rc ); 03826 wcscpy( lpszName, L"00000409" ); 03827 return; 03828 } 03829 03830 /* 03831 * Query the value from the registry. 03832 */ 03833 RtlInitUnicodeString( &UnicodeString, szKbdActive ); 03834 03835 rc = NtQueryValueKey( hKey, 03836 &UnicodeString, 03837 KeyValuePartialInformation, 03838 &KeyValueId, 03839 sizeof(KeyValueId), 03840 &cbSize ); 03841 03842 if ( rc == STATUS_BUFFER_OVERFLOW ) { 03843 RIPMSG0(RIP_WARNING, "GetActiveKeyboardName - Buffer overflow."); 03844 rc = STATUS_SUCCESS; 03845 } 03846 if (NT_SUCCESS( rc )) { 03847 wcsncpycch( lpszName, (LPWSTR)KeyValueId.KeyInfo.Data, KL_NAMELENGTH - 1 ); 03848 lpszName[KL_NAMELENGTH - 1] = L'\0'; 03849 } else { 03850 /* 03851 * Error reading value...use default 03852 */ 03853 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could not query active keyboard layout (%lx).\n", rc ); 03854 wcscpy( lpszName, L"00000409" ); 03855 NtClose( hKey ); 03856 return; 03857 } 03858 03859 /* 03860 * if 'Active' keyboard layout is for Japanese/Korean layout. just put 03861 * IME prefix, because user prefer to have keyboard layout with IME as 03862 * default. 03863 */ 03864 if (IS_IME_ENABLED()) { 03865 UINT wLanguageId = (UINT)wcstoul(lpszName, NULL, 16); 03866 03867 /* 03868 * Default keyboard layout values. 03869 * 03870 * [LATER, if needed] 03871 * 03872 * The hard-codeed default value might be wanted 03873 * come from registry or somewhere... 03874 */ 03875 CONST LPWSTR lpszJapaneseDefaultLayout = L"E0010411"; 03876 CONST LPWSTR lpszKoreanDefaultLayout = L"E0010412"; 03877 03878 /* 03879 * Need to mask off hi-word to look up locale ID, because 03880 * NEC PC-9800 Series version of Windows NT 3.5 contains 03881 * bogus value in hi-word. 03882 */ 03883 wLanguageId &= 0x0000FFFF; 03884 03885 if (PRIMARYLANGID(wLanguageId) == LANG_JAPANESE) { 03886 03887 /* 03888 * Set Japanese default layout Id. 03889 */ 03890 wcscpy(lpszName,lpszJapaneseDefaultLayout); 03891 03892 } else if (PRIMARYLANGID(wLanguageId) == LANG_KOREAN) { 03893 03894 /* 03895 * Set Korean default layout Id. 03896 */ 03897 wcscpy(lpszName,lpszKoreanDefaultLayout); 03898 } 03899 } 03900 03901 /* 03902 * We have the Active value. Now create the Preload key. 03903 */ 03904 RtlInitUnicodeString( &UnicodeString, L"Preload" ); 03905 InitializeObjectAttributes( &ObjA, 03906 &UnicodeString, 03907 OBJ_CASE_INSENSITIVE, 03908 hKey, 03909 NULL ); 03910 rc = NtCreateKey( &hKeyPreload, 03911 STANDARD_RIGHTS_WRITE | 03912 KEY_QUERY_VALUE | 03913 KEY_ENUMERATE_SUB_KEYS | 03914 KEY_SET_VALUE | 03915 KEY_CREATE_SUB_KEY, 03916 &ObjA, 03917 0, 03918 NULL, 03919 0, 03920 &CreateDisposition ); 03921 03922 if (!NT_SUCCESS( rc )) 03923 { 03924 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could NOT create Preload key (%lx).\n", rc ); 03925 NtClose( hKey ); 03926 return; 03927 } 03928 03929 /* 03930 * Set the new value entry. 03931 */ 03932 RtlInitUnicodeString( &UnicodeString, L"1" ); 03933 rc = NtSetValueKey( hKeyPreload, 03934 &UnicodeString, 03935 0, 03936 REG_SZ, 03937 lpszName, 03938 (wcslen(lpszName)+1) * sizeof(WCHAR) 03939 ); 03940 03941 if (!NT_SUCCESS( rc )) 03942 { 03943 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could NOT create value entry 1 for Preload key (%lx).\n", rc ); 03944 NtClose( hKey ); 03945 NtClose( hKeyPreload ); 03946 return; 03947 } 03948 03949 /* 03950 * Success: attempt to delete the Active value key. 03951 */ 03952 RtlInitUnicodeString( &UnicodeString, szKbdActive ); 03953 rc = NtDeleteValueKey( hKey, &UnicodeString ); 03954 03955 if (!NT_SUCCESS( rc )) 03956 { 03957 RIPMSG1( RIP_WARNING, "GetActiveKeyboardName - Could NOT delete value key 'Active'.\n", rc ); 03958 } 03959 NtClose( hKey ); 03960 NtClose( hKeyPreload ); 03961 }

int GetBlkEndLine int  ,
int  ,
BOOL FAR *  ,
int  ,
int 
 

PMONITOR GetDialogMonitor HWND  hwndOwner,
DWORD  dwFlags
 

Definition at line 490 of file dlgbegin.c.

References _MonitorFromWindow(), dwFlags, DWORD, FNID_DESKTOP, GETFNID, GetPrimaryMonitor(), GetWindowThreadProcessId(), NtUserGetForegroundWindow(), NULL, REBASEPWND, and ValidateHwnd.

Referenced by InternalCreateDialog(), and SoftModalMessageBox().

00491 { 00492 PMONITOR pMonitor; 00493 PWND pwnd; 00494 HWND hwndForeground; 00495 DWORD pid; 00496 00497 UserAssert(dwFlags == MONITOR_DEFAULTTONULL || 00498 dwFlags == MONITOR_DEFAULTTOPRIMARY); 00499 00500 pMonitor = NULL; 00501 if (hwndOwner) { 00502 pwnd = ValidateHwnd(hwndOwner); 00503 if (pwnd && GETFNID(pwnd) != FNID_DESKTOP) { 00504 pMonitor = _MonitorFromWindow(pwnd, MONITOR_DEFAULTTOPRIMARY); 00505 } 00506 } else { 00507 /* 00508 * HACK! They passed in no owner and are creating a top level 00509 * dialog window. Does this process own the foreground window? 00510 * If so, pin to that window's monitor. That way 16-bit apps 00511 * will work mostly as expected, and old multithreaded dudes just 00512 * might too. Especially the shell, for whom many system UI pieces 00513 * pop up random dialogs inside of API calls. 00514 */ 00515 00516 hwndForeground = NtUserGetForegroundWindow(); 00517 if (hwndForeground) { 00518 GetWindowThreadProcessId(hwndForeground, &pid); 00519 if (pid == HandleToUlong(NtCurrentTeb()->ClientId.UniqueProcess)) { 00520 pwnd = ValidateHwnd(hwndForeground); 00521 if (pwnd) { 00522 pMonitor = _MonitorFromWindow(pwnd, MONITOR_DEFAULTTOPRIMARY); 00523 } 00524 } 00525 } 00526 } 00527 00528 if (!pMonitor && dwFlags == MONITOR_DEFAULTTOPRIMARY) { 00529 pMonitor = GetPrimaryMonitor(); 00530 } 00531 00532 return pMonitor; 00533 }

__inline PDISPLAYINFO GetDispInfo void   ) 
 

Definition at line 2598 of file usercli.h.

Referenced by _MonitorFromPoint(), and _MonitorFromRect().

02716 {

HANDLE GetEditDS VOID   ) 
 

DWORD GetIcoCurBpp UINT  LR_flags  ) 
 

Definition at line 4096 of file clres.c.

References DWORD, PUSIF_PALETTEDISPLAY, SYSMET, and TEST_PUSIF.

Referenced by CopyBmp(), CopyIcoCur(), LoadIcoCur(), and RtlGetIdFromDirectory().

04098 { 04099 if (lrFlags & LR_MONOCHROME) { 04100 04101 #if DBG 04102 if (lrFlags & LR_VGACOLOR) { 04103 RIPMSG0(RIP_WARNING, "lrFlags has both MONOCHROME and VGACOLOR; assuming MONOCHROME"); 04104 } 04105 #endif 04106 return 1; 04107 04108 } else if ( 04109 TEST_PUSIF(PUSIF_PALETTEDISPLAY) || 04110 (lrFlags & LR_VGACOLOR) || 04111 !SYSMET(SAMEDISPLAYFORMAT)) { 04112 04113 return 4; 04114 } else { 04115 return 0; 04116 } 04117 }

DWORD GetIcoCurHeight DWORD  cyOrg,
BOOL  fIcon,
UINT  LR_flags,
DWORD  cyDesired
 

Definition at line 4074 of file clres.c.

References DWORD, and SYSMET.

Referenced by CopyIcoCur(), CreateIconFromResourceEx(), LoadIcoCur(), RtlGetIdFromDirectory(), and WowServerLoadCreateCursorIcon().

04079 { 04080 if (cyOrg) { 04081 return cyOrg; 04082 } else if (lrFlags & LR_DEFAULTSIZE) { 04083 return (fIcon ? SYSMET(CYICON) : SYSMET(CYCURSOR)); 04084 } else { 04085 return cyDes; 04086 } 04087 }

DWORD GetIcoCurWidth DWORD  cxOrg,
BOOL  fIcon,
UINT  LR_flags,
DWORD  cxDesired
 

Definition at line 4052 of file clres.c.

References DWORD, and SYSMET.

Referenced by CopyIcoCur(), CreateIconFromResourceEx(), LoadIcoCur(), RtlGetIdFromDirectory(), and WowServerLoadCreateCursorIcon().

04057 { 04058 if (cxOrg) { 04059 return cxOrg; 04060 } else if (lrFlags & LR_DEFAULTSIZE) { 04061 return (fIcon ? SYSMET(CXICON) : SYSMET(CXCURSOR)); 04062 } else { 04063 return cxDes; 04064 } 04065 }

VOID GetImmFileName PWSTR   ) 
 

Definition at line 213 of file fareast.c.

References IMMMODULENAME, IMMMODULENAMELEN, MAX_PATH, PATHDLM, UINT, and VOID().

Referenced by _InitializeImmEntryTable(), User32InitializeImmEntryTable(), and UserClientDllInitialize().

00214 { 00215 UINT i = GetSystemDirectoryW(wszImmFile, MAX_PATH); 00216 if (i > 0 && i < MAX_PATH - IMMMODULENAMELEN) { 00217 wszImmFile += i; 00218 if (wszImmFile[-1] != PATHDLM) { 00219 *wszImmFile++ = PATHDLM; 00220 } 00221 } 00222 wcscpy(wszImmFile, IMMMODULENAME); 00223 }

LPWSTR GetLpszItem PLBIV  ,
INT 
 

Definition at line 842 of file lb1.c.

References tagLBIV::cMac, tagLBIV::hStrings, lpLBItem, NULL, tagLBItem::offsz, PBYTE, and tagLBIV::rgpch.

Referenced by LBGetText(), and xxxLBDrawLBItem().

00845 { 00846 LONG offsz; 00847 lpLBItem plbi; 00848 00849 if (sItem < 0 || sItem >= pLBIV->cMac) { 00850 RIPERR1(ERROR_INVALID_PARAMETER, 00851 RIP_WARNING, 00852 "Invalid parameter \"sItem\" (%ld) to GetLpszItem", 00853 sItem); 00854 00855 return NULL; 00856 } 00857 00858 /* 00859 * get pointer to item index array 00860 * NOTE: NOT OWNERDRAW 00861 */ 00862 plbi = (lpLBItem)(pLBIV->rgpch); 00863 offsz = plbi[sItem].offsz; 00864 return (LPWSTR)((PBYTE)(pLBIV->hStrings) + offsz); 00865 }

BOOL GetMenuItemInfoInternalW HMENU  hMenu,
UINT  uID,
BOOL  fByPosition,
LPMENUITEMINFOW  lpmii
 

Referenced by SwitchWindowsMenus().

PWND GetParentDialog PWND  pwndDialog  ) 
 

Definition at line 43 of file dlgmgr.c.

References DFCONTROL, REBASEPWND, TestWF, WEFCONTROLPARENT, WFCHILD, and WFDIALOGWINDOW.

Referenced by DefDlgProcWorker(), IsDialogMessageA(), and IsDialogMessageW().

00044 { 00045 PWND pwndParent; 00046 00047 pwndParent = pwndDialog; 00048 00049 // 00050 // Walk up the parent chain. We're looking for the top-most dialog 00051 // window. Most cases, the window is a top level one. But in case of 00052 // backup app, the window will be a child of some other window. 00053 // 00054 for (; pwndDialog; pwndDialog = REBASEPWND(pwndDialog, spwndParent)) 00055 { 00056 if (TestWF(pwndDialog, WFDIALOGWINDOW)) 00057 { 00058 // 00059 // For old guys: If not DS_RECURSE, then stop here. 00060 // that way old apps which try to do the nested dialog 00061 // stuff in their old limited way don't die. 00062 // 00063 if (TestWF(pwndDialog, WEFCONTROLPARENT)) 00064 pwndParent = pwndDialog; 00065 else if (!TestWF(pwndDialog, DFCONTROL)) 00066 break; 00067 } 00068 00069 if (!TestWF(pwndDialog, WFCHILD)) 00070 break; 00071 } 00072 00073 return(pwndParent); 00074 }

__inline PMONITOR GetPrimaryMonitor void   ) 
 

Definition at line 2604 of file usercli.h.

References BOOL, DWORD, IMEINFOEXCLASS, LPVOID, and UINT.

Referenced by _MonitorFromPoint(), _MonitorFromRect(), FixBogusSWP(), GetDialogMonitor(), GetMonitorInfo(), GetParentArrangeRect(), GetRealClientRect(), InitLoadResources(), InitSwitchWndInfo(), InternalCreateDialog(), IsRectBogus(), NormalizeRect(), RawInputThread(), RepositionRect(), SetDesktopMetrics(), xxxCheckFullScreen(), xxxCreateWindowEx(), xxxExpandBitmap(), xxxInitSendValidateMinMaxInfo(), xxxInternalPaintDesktop(), xxxMoveSize(), xxxMS_TrackMove(), xxxSetTrayWindow(), xxxShowSwitchWindow(), and xxxSystemParametersInfo().

02716 {

BOOL HanjaKeyHandler PED  ped  ) 
 

Definition at line 1683 of file edecrare.c.

References BOOL, tagED::cbChar, tagED::cch, ECLock(), ECUnlock(), FALSE, tagED::fAnsi, tagED::fKorea, fpImmEscapeA, fpImmEscapeW, fpImmGetContext, tagED::fReadOnly, tagED::fReplaceCompChr, tagED::hwnd, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, NtUserMessageBeep, THREAD_HKL, and TRUE.

Referenced by MLKeyDown(), and SLKeyDown().

01684 { 01685 BOOL changeSelection = FALSE; 01686 01687 if (ped->fKorea && !ped->fReadOnly) { 01688 ICH oldCaret = ped->ichCaret; 01689 01690 if (ped->fReplaceCompChr) 01691 return FALSE; 01692 01693 if (ped->ichMinSel < ped->ichMaxSel) 01694 ped->ichCaret = ped->ichMinSel; 01695 01696 if (!ped->cch || ped->cch == ped->ichCaret) { 01697 ped->ichCaret = oldCaret; 01698 NtUserMessageBeep(MB_ICONEXCLAMATION); 01699 return FALSE; 01700 } 01701 01702 if (ped->fAnsi) { 01703 if (fpImmEscapeA(THREAD_HKL(), fpImmGetContext(ped->hwnd), 01704 IME_ESC_HANJA_MODE, (ECLock(ped) + ped->ichCaret * ped->cbChar))) { 01705 changeSelection = TRUE; 01706 } 01707 else 01708 ped->ichCaret = oldCaret; 01709 ECUnlock(ped); 01710 } 01711 else { 01712 if (fpImmEscapeW(THREAD_HKL(), fpImmGetContext(ped->hwnd), 01713 IME_ESC_HANJA_MODE, (ECLock(ped) + ped->ichCaret * ped->cbChar))) { 01714 changeSelection = TRUE; 01715 } 01716 else 01717 ped->ichCaret = oldCaret; 01718 ECUnlock(ped); 01719 } 01720 } 01721 return changeSelection; 01722 }

UINT HelpMenu HWND  hwnd,
PPOINT  ppt
 

Definition at line 348 of file client/help.c.

References GetSubMenu(), hmodUser, ID_HELPMENU, INT, NtUserDestroyMenu(), NULL, TrackPopupMenu(), and UINT.

Referenced by WinHelpA().

00351 { 00352 INT cmd; 00353 HMENU hmenu = LoadMenu( hmodUser, MAKEINTRESOURCE(ID_HELPMENU)); 00354 00355 if (hmenu != NULL) { 00356 cmd = TrackPopupMenu( GetSubMenu(hmenu, 0), 00357 TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON, 00358 ppt->x, ppt->y, 0, hwnd, NULL); 00359 NtUserDestroyMenu(hmenu); 00360 return cmd; 00361 } 00362 00363 return (UINT)-1; 00364 }

LPHLP HFill LPCSTR  lpszHelp,
DWORD  ulCommand,
ULONG_PTR  ulData
 

Definition at line 60 of file client/help.c.

References BYTE, DWORD, HIBYTE, NULL, and strlen().

Referenced by WinHelpA().

00064 { 00065 DWORD cb; // Size of the data block 00066 DWORD cbStr; // Length of the help file name 00067 DWORD cbData; // Size of the dwData parameter in bytes (0 if not used) 00068 LPHLP phlp; // Pointer to data block 00069 BYTE bType; // dwData parameter type 00070 00071 /* 00072 * Get the length of the help file name 00073 */ 00074 cbStr = (lpszHelp) ? strlen(lpszHelp) + 1 : 0; 00075 00076 /* 00077 * Get the length of any dwData parameters 00078 */ 00079 bType = HIBYTE(LOWORD(ulCommand)); 00080 if (ulData) { 00081 switch (bType) { 00082 case HIBYTE(HELP_HB_STRING): 00083 /* 00084 * ulData is an ANSI string, so compute its length 00085 */ 00086 cbData = strlen((LPSTR)ulData) + 1; 00087 break; 00088 00089 case HIBYTE(HELP_HB_STRUCT): 00090 /* 00091 * ulData points to a structure who's first member is 00092 * an int that contains the size of the structure in bytes. 00093 */ 00094 cbData = *((int *)ulData); 00095 break; 00096 00097 default: 00098 /* 00099 * dwData has no parameter 00100 */ 00101 cbData = 0; 00102 } 00103 } else { 00104 /* 00105 * No parameter is present 00106 */ 00107 cbData = 0; 00108 } 00109 00110 /* 00111 * Calculate size (NOTE: HLP is called WINHLP in Win95) 00112 */ 00113 cb = sizeof(HLP) + cbStr + cbData; 00114 00115 /* 00116 * Get data block 00117 */ 00118 if ((phlp = (LPHLP)LocalAlloc(LPTR, cb)) == NULL) 00119 return NULL; 00120 00121 /* 00122 * Fill in info 00123 */ 00124 phlp->cbData = (WORD)cb; 00125 phlp->usCommand = (WORD)ulCommand; 00126 phlp->ulReserved = 0; 00127 // phlp->ulTopic = 0; 00128 00129 /* 00130 * Fill in file name 00131 */ 00132 if (lpszHelp) { 00133 phlp->offszHelpFile = sizeof(HLP); // NOTE: HLP is called WINHLP in Win95 00134 strcpy((LPSTR)(phlp + 1), lpszHelp); 00135 } else { 00136 phlp->offszHelpFile = 0; 00137 } 00138 00139 /* 00140 * Fill in data 00141 */ 00142 switch (bType) { 00143 case HIBYTE(HELP_HB_STRING): 00144 if (cbData) { 00145 phlp->offabData = (WORD)(sizeof(HLP) + cbStr); // NOTE: HLP is called WINHLP in Win95 00146 strcpy((LPSTR)phlp + phlp->offabData, (LPSTR)ulData); 00147 } else { 00148 phlp->offabData = 0; 00149 } 00150 break; 00151 00152 case HIBYTE(HELP_HB_STRUCT): 00153 if (cbData) { 00154 phlp->offabData = (WORD)(sizeof(HLP) + cbStr); // NOTE: HLP is called WINHLP in Win95 00155 RtlCopyMemory((LPBYTE)phlp + phlp->offabData, (PVOID)ulData, 00156 *((int far *)ulData)); 00157 } else { 00158 phlp->offabData = 0; 00159 } 00160 break; 00161 00162 default: 00163 phlp->offabData = 0; 00164 // BradG - This item is named differently in the Win95 WINHLP structure 00165 // phlp->ctx = ulData; 00166 phlp->ulTopic = ulData; 00167 break; 00168 } 00169 00170 return(phlp); 00171 }

LRESULT APIENTRY ImeWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 240 of file imectl.c.

References ImeWndProcWorker(), L, NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

00245 { 00246 PWND pwnd; 00247 00248 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00249 return (0L); 00250 } 00251 00252 return ImeWndProcWorker(pwnd, message, wParam, lParam, TRUE); 00253 }

LRESULT APIENTRY ImeWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 256 of file imectl.c.

References FALSE, ImeWndProcWorker(), L, NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

00261 { 00262 PWND pwnd; 00263 00264 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00265 return (0L); 00266 } 00267 00268 return ImeWndProcWorker(pwnd, message, wParam, lParam, FALSE); 00269 }

LRESULT ImeWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 83 of file imectl.c.

References APIENTRY, BOOL, CheckLock, DefWindowProcWorker(), FNID_CLEANEDUP_BIT, FNID_IME, FreeLookasideEntry(), FWINDOWMSG, HWq, ImeControlHandler(), ImeCopyDataHandler(), ImeNotifyHandler(), ImeSelectHandler(), ImeSetContextHandler(), ImeSystemHandler(), ImeUILookaside, ImeWndCreateHandler(), ImeWndDestroyHandler(), INITCONTROLLOOKASIDE, L, tagIMEUI::nCntInIMEProc, NtUserSetWindowFNID(), NULL, SendMessageToUI(), tagIMEUI::spwnd, TestWF, TRUE, Unlock, VALIDATECLASSANDSIZE, WFDESTROYED, and WFINDESTROY.

Referenced by ClientThreadSetup(), DefWindowProcWorker(), ImeWndProcA(), and ImeWndProcW().

00089 { 00090 HWND hwnd = HWq(pwnd); 00091 PIMEUI pimeui; 00092 static BOOL fInit = TRUE; 00093 00094 CheckLock(pwnd); 00095 00096 VALIDATECLASSANDSIZE(pwnd, FNID_IME); 00097 INITCONTROLLOOKASIDE(&ImeUILookaside, IMEUI, spwnd, 8); 00098 00099 /* 00100 * If the control is not interested in this message, 00101 * pass it to DefWindowProc. 00102 */ 00103 if (!FWINDOWMSG(message, FNID_IME)) 00104 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00105 00106 /* 00107 * Get the pimeui for the given window now since we will use it a lot in 00108 * various handlers. This was stored using SetWindowLong(hwnd,0,pimeui) when 00109 * we initially created the IME control. 00110 */ 00111 pimeui = ((PIMEWND)pwnd)->pimeui; 00112 00113 if (pimeui == NULL) { 00114 /* 00115 * Further processing not needed 00116 */ 00117 RIPMSG0(RIP_WARNING, "ImeWndProcWorker: pimeui == NULL\n"); 00118 return 0L; 00119 } 00120 00121 /* 00122 * This is necessary to avoid recursion call from IME UI. 00123 */ 00124 UserAssert(pimeui->nCntInIMEProc >= 0); 00125 00126 if (pimeui->nCntInIMEProc > 0) { 00127 TAGMSG5(DBGTAG_IMM, "ImeWndProcWorker: Recursive for pwnd=%08p, msg=%08x, wp=%08x, lp=%08x, fAnsi=%d\n", 00128 pwnd, message, wParam, lParam, fAnsi); 00129 switch (message) { 00130 case WM_IME_SYSTEM: 00131 switch (wParam) { 00132 case IMS_ISACTIVATED: 00133 case IMS_SETOPENSTATUS: 00134 // case IMS_SETCONVERSIONSTATUS: 00135 case IMS_SETSOFTKBDONOFF: 00136 /* 00137 * Because these will not be pass to UI. 00138 * We can do it. 00139 */ 00140 break; 00141 00142 default: 00143 return 0L; 00144 } 00145 break; 00146 00147 case WM_IME_STARTCOMPOSITION: 00148 case WM_IME_ENDCOMPOSITION: 00149 case WM_IME_COMPOSITION: 00150 case WM_IME_SETCONTEXT: 00151 case WM_IME_NOTIFY: 00152 case WM_IME_CONTROL: 00153 case WM_IME_COMPOSITIONFULL: 00154 case WM_IME_SELECT: 00155 case WM_IME_CHAR: 00156 case WM_IME_REQUEST: 00157 return 0L; 00158 00159 default: 00160 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00161 } 00162 } 00163 00164 if (TestWF(pwnd, WFINDESTROY) || TestWF(pwnd, WFDESTROYED)) { 00165 switch (message) { 00166 case WM_DESTROY: 00167 case WM_NCDESTROY: 00168 case WM_FINALDESTROY: 00169 break; 00170 default: 00171 RIPMSG1(RIP_WARNING, "ImeWndProcWorker: message %x is sent to destroyed window.", message); 00172 return 0L; 00173 } 00174 } 00175 00176 switch (message) { 00177 case WM_ERASEBKGND: 00178 return (LONG)TRUE; 00179 00180 case WM_PAINT: 00181 break; 00182 00183 case WM_CREATE: 00184 00185 return ImeWndCreateHandler(pimeui, (LPCREATESTRUCT)lParam); 00186 00187 case WM_DESTROY: 00188 /* 00189 * We are destroying the IME window, destroy 00190 * any UI window that it owns. 00191 */ 00192 ImeWndDestroyHandler(pimeui); 00193 break; 00194 00195 case WM_NCDESTROY: 00196 case WM_FINALDESTROY: 00197 if (pimeui) { 00198 Unlock(&pimeui->spwnd); 00199 FreeLookasideEntry(&ImeUILookaside, pimeui); 00200 } 00201 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); 00202 goto CallDWP; 00203 00204 case WM_IME_SYSTEM: 00205 UserAssert(pimeui->spwnd == pwnd); 00206 return ImeSystemHandler(pimeui, message, wParam, lParam); 00207 00208 case WM_IME_SELECT: 00209 return ImeSelectHandler(pimeui, message, wParam, lParam); 00210 00211 case WM_IME_CONTROL: 00212 return ImeControlHandler(pimeui, message, wParam, lParam, fAnsi); 00213 00214 case WM_IME_SETCONTEXT: 00215 return ImeSetContextHandler(pimeui, message, wParam, lParam); 00216 00217 case WM_IME_NOTIFY: 00218 return ImeNotifyHandler(pimeui, message, wParam, lParam); 00219 00220 case WM_IME_REQUEST: 00221 return 0; 00222 00223 case WM_IME_COMPOSITION: 00224 case WM_IME_ENDCOMPOSITION: 00225 case WM_IME_STARTCOMPOSITION: 00226 return SendMessageToUI(pimeui, message, wParam, lParam, fAnsi); 00227 00228 case WM_COPYDATA: 00229 return ImeCopyDataHandler(wParam, lParam); 00230 00231 default: 00232 CallDWP: 00233 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00234 } 00235 00236 return 0L; 00237 }

BOOL InitClientDrawing  ) 
 

Referenced by ClientThreadSetup(), and CtxInitUser32().

VOID InitHStrings PLBIV   ) 
 

Definition at line 713 of file lboxrare.c.

References tagLBIV::cchStrings, tagLBIV::fHasStrings, tagLBIV::hStrings, tagLBIV::ichAlloc, L, and UserLocalAlloc.

Referenced by xxxLBCreate(), and xxxLBResetContent().

00715 { 00716 if (plb->fHasStrings) { 00717 plb->ichAlloc = 0; 00718 plb->cchStrings = 0; 00719 plb->hStrings = UserLocalAlloc(0, 0L); 00720 } 00721 }

VOID InitializeImmEntryTable VOID   ) 
 

Definition at line 338 of file fareast.c.

References _InitializeImmEntryTable(), bImmInitializing, TRUE, and VOID().

Referenced by UserClientDllInitialize().

00339 { 00340 bImmInitializing = TRUE; 00341 _InitializeImmEntryTable(); 00342 }

NTSTATUS InitLookaside PLOOKASIDE  pla,
DWORD  cbEntry,
DWORD  cEntries
 

Definition at line 221 of file rtlinit.c.

References _ZONE_HEADER::BlockSize, BlockSize, _LOOKASIDE::EntrySize, _ZONE_HEADER::FreeList, gcsLookaside, _LOOKASIDE::LookasideBase, _LOOKASIDE::LookasideBounds, _LOOKASIDE::LookasideZone, NULL, PLOOKASIDE, PZONE_HEADER, _ZONE_HEADER::SegmentList, _ZONE_HEADER::TotalSegmentSize, UserLocalAlloc, UserLocalFree, and ZONE_SEGMENT_HEADER.

Referenced by ValidateDialogPwnd().

00225 { 00226 ULONG i; 00227 PCH p; 00228 ULONG BlockSize; 00229 PZONE_HEADER Zone; 00230 PVOID InitialSegment; 00231 ULONG InitialSegmentSize; 00232 00233 InitialSegmentSize = (cEntries * cbEntry) + sizeof(ZONE_SEGMENT_HEADER); 00234 00235 p = (PCH)UserLocalAlloc(0, InitialSegmentSize); 00236 00237 if ( !p ) { 00238 return STATUS_NO_MEMORY; 00239 } 00240 00241 RtlEnterCriticalSection(&gcsLookaside); 00242 00243 // 00244 // If the lookaside list has already been initialized, we're done. 00245 // 00246 00247 if (pla->LookasideBase != NULL && pla->EntrySize == cbEntry) { 00248 RtlLeaveCriticalSection(&gcsLookaside); 00249 UserLocalFree(p); 00250 return STATUS_SUCCESS; 00251 } 00252 00253 pla->LookasideBase = (PVOID)p; 00254 pla->LookasideBounds = (PVOID)(p + InitialSegmentSize); 00255 pla->EntrySize = cbEntry; 00256 00257 // 00258 // Using the ExZone-like code, slice up the page into QMSG's 00259 // 00260 00261 Zone = &pla->LookasideZone; 00262 BlockSize = cbEntry; 00263 InitialSegment = pla->LookasideBase; 00264 00265 Zone->BlockSize = BlockSize; 00266 00267 Zone->SegmentList.Next = &((PZONE_SEGMENT_HEADER) InitialSegment)->SegmentList; 00268 ((PZONE_SEGMENT_HEADER) InitialSegment)->SegmentList.Next = NULL; 00269 ((PZONE_SEGMENT_HEADER) InitialSegment)->Reserved = NULL; 00270 00271 Zone->FreeList.Next = NULL; 00272 00273 p = (PCH)InitialSegment + sizeof(ZONE_SEGMENT_HEADER); 00274 00275 for (i = sizeof(ZONE_SEGMENT_HEADER); 00276 i <= InitialSegmentSize - BlockSize; 00277 i += BlockSize 00278 ) { 00279 ((PSINGLE_LIST_ENTRY)p)->Next = Zone->FreeList.Next; 00280 Zone->FreeList.Next = (PSINGLE_LIST_ENTRY)p; 00281 p += BlockSize; 00282 } 00283 Zone->TotalSegmentSize = i; 00284 00285 RtlLeaveCriticalSection(&gcsLookaside); 00286 00287 return STATUS_SUCCESS; 00288 00289 }

HANDLE InternalCopyImage HANDLE  hImage,
UINT  IMAGE_flag,
int  cxNew,
int  cyNew,
UINT  LR_flags
 

Definition at line 4719 of file clres.c.

References CopyBmp(), CopyIcoCur(), and NULL.

Referenced by CopyImage().

04725 { 04726 switch (IMAGE_flag) { 04727 04728 case IMAGE_BITMAP: 04729 if (GetObjectType(hImage) != OBJ_BITMAP) { 04730 RIPMSG0(RIP_ERROR, "CopyImage: invalid bitmap"); 04731 return NULL; 04732 } 04733 04734 return (HICON)CopyBmp(hImage, cxNew, cyNew, LR_flags); 04735 04736 case IMAGE_CURSOR: 04737 case IMAGE_ICON: 04738 04739 return CopyIcoCur(hImage, 04740 (IMAGE_flag == IMAGE_ICON), 04741 cxNew, 04742 cyNew, 04743 LR_flags); 04744 } 04745 04746 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "CopyImage: bad IMAGE_flag."); 04747 04748 return NULL; 04749 }

HWND InternalCreateDialog HANDLE  hmod,
LPDLGTEMPLATE  lpDlgTemplate,
DWORD  cb,
HWND  hwndOwner,
DLGPROC  pfnWndProc,
LPARAM  dwInitParam,
UINT  fFlags
 

Definition at line 553 of file dlgbegin.c.

References _AdjustWindowRectEx(), _GetNextDlgTabItem(), _MonitorFromPoint(), _MonitorFromRect(), tagSERVERINFO::atomSysClass, _LARGE_UNICODE_STRING::bAnsi, BOOL, _LARGE_UNICODE_STRING::Buffer, CD_GLOBALEDIT, CD_SETFOREGROUND, CD_USEDEFAULTCX, CD_USEDEFAULTX, CD_USERFONT, CD_VISIBLE, ClientToScreen(), CODEBIT, ConnectIfNecessary, CreateDlgFont(), CW2_USEDEFAULT, DefShortToInt(), DF3DLOOK, DFCONTROL, DFNOFAILCREATE, DIALOGCLASS, DLGF_ANSI, DLGRSC_VER_NT5COMPAT_RESERVE, DlgSetFocus(), dt(), DWORD, FALSE, GETAPPVER, GetDialogMonitor(), GetEditDS(), GETEXPWINVER, GetPrimaryMonitor(), ghFontSys, gpsi, HIBYTE, HW, ICLS_COMBOBOX, ICLS_EDIT, Is400Compat, IS_PTR, IsWindow(), L, _LARGE_UNICODE_STRING::Length, LPVOID, MakeAResizeDlg(), MaskWF, _LARGE_UNICODE_STRING::MaximumLength, NextDWordBoundary, NextWordBoundary, NtUserCallHwndLock(), NtUserCreateWindowEx(), NtUserDestroyMenu(), NtUserDestroyWindow(), NtUserGetSystemMenu(), NtUserSetForegroundWindow, NtUserSetWindowContextHelpId, NtUserShowWindow(), NULL, OffsetRect(), PBYTE, PDLG, PTR_TO_ID, tagMONITOR::rcMonitor, tagMONITOR::rcWork, RepositionRect(), RevalidateHwnd, RtlInitLargeUnicodeString(), SendMessage(), SendMessageWorker(), SHORT, SkipSz(), SYSMET, szEDITCLASS, TellWOWThehDlg(), TEST_KbdCuesPUSIF, TestWF, TestwndChild, TRUE, UINT, UpdateWindow(), UTCHAR, ValidateDialogPwnd(), ValidateHwnd, VER40, WFCHILD, WFMAXBOX, WFMINBOX, WFSIZEBOX, WFSYSMENU, WFTYPEMASK, WFVISIBLE, WFWIN40COMPAT, WordSkipSz(), WS_EX_ANSICREATOR, WS_EX_MDICHILD, XPixFromXDU, xxxCheckDefPushButton(), and YPixFromYDU.

Referenced by CreateDialogIndirectParamAorW(), and InternalDialogBox().

00561 { 00562 HWND hwnd; 00563 HWND hwnd2; 00564 PWND pwnd; 00565 HWND hwndNewFocus; 00566 HWND hwndEditFirst = NULL; 00567 RECT rc; 00568 WORD w; 00569 UTCHAR *lpszMenu, 00570 *lpszClass, 00571 *lpszText, 00572 *lpCreateParams, 00573 *lpStr; 00574 int cxChar, 00575 cyChar; 00576 BOOL f40Compat; 00577 HFONT hNewFont = NULL; 00578 HFONT hOldFont; 00579 LPDLGITEMTEMPLATE lpdit; 00580 HMENU hMenu; 00581 BOOL fSuccess; 00582 BOOL fWowWindow; 00583 HANDLE hmodCreate; 00584 LPBYTE lpCreateParamsData; 00585 DLGTEMPLATE2 dt; 00586 DLGITEMTEMPLATE2 dit; 00587 DWORD dwExpWinVer; 00588 DWORD dsStyleOld; 00589 DWORD bFlags = 0; 00590 HDC hdcDlg; 00591 LARGE_STRING strClassName; 00592 PLARGE_STRING pstrClassName; 00593 LARGE_STRING strWindowName; 00594 PMONITOR pMonitor; 00595 00596 UNREFERENCED_PARAMETER(cb); 00597 00598 ConnectIfNecessary(); 00599 00600 UserAssert(!(fSCDLGFlags & ~(SCDLG_CLIENT|SCDLG_ANSI|SCDLG_NOREVALIDATE|SCDLG_16BIT))); // These are the only valid flags 00601 00602 /* 00603 * Is this a Win4 extended dialog? 00604 */ 00605 if (((LPDLGTEMPLATE2)lpdt)->wSignature == 0xffff) { 00606 00607 UserAssert(((LPDLGTEMPLATE2)lpdt)->wDlgVer <= DLGRSC_VER_NT5COMPAT_RESERVE); 00608 RtlCopyMemory(&dt, lpdt, sizeof dt); 00609 } else { 00610 dt.wDlgVer = 0; 00611 dt.wSignature = 0; 00612 dt.dwHelpID = 0; 00613 dt.dwExStyle = lpdt->dwExtendedStyle; 00614 dt.style = lpdt->style; 00615 dt.cDlgItems = lpdt->cdit; 00616 dt.x = lpdt->x; 00617 dt.y = lpdt->y; 00618 dt.cx = lpdt->cx; 00619 dt.cy = lpdt->cy; 00620 } 00621 00622 /* 00623 * If this is called from wow code, then the loword of hmod != 0. 00624 * In this case, allow any DS_ style bits that were passed in win3.1 00625 * to be legal in win32. Case in point: 16 bit quark xpress passes the 00626 * same bit as the win32 style DS_SETFOREGROUND. Also, VC++ sample 00627 * "scribble" does the same thing. 00628 * 00629 * For win32 apps test the DS_SETFOREGROUND bit; wow apps are not set 00630 * foreground (this is the new NT semantics) 00631 * We have to let no "valid" bits through because apps depend on them 00632 * bug 5232. 00633 */ 00634 dsStyleOld = LOWORD(dt.style); 00635 00636 /* 00637 * If the app is Win4 or greater, require correct dialog style bits. 00638 * Prevents conflicts with new bits introduced in Chicago 00639 */ 00640 dwExpWinVer = GETEXPWINVER(hmod); 00641 00642 if ( f40Compat = Is400Compat(dwExpWinVer) ) { 00643 dt.style &= (DS_VALID40 | 0xffff0000); 00644 00645 // 00646 // For old applications: 00647 // If DS_COMMONDIALOG isn't set, don't touch DS_3DLOOK style 00648 // bit. If it's there, it stays there. If not, not. That way old 00649 // apps which pass in their own templates, not commdlg's, don't get 00650 // forced 3D. 00651 // If DS_COMMONDIALOG is there, remove DS_3DLOOK. 00652 // 00653 // For new applications: 00654 // Force 3D always. 00655 // 00656 if (GETAPPVER() < VER40) { 00657 if (dt.style & DS_COMMONDIALOG) { 00658 dt.style &= ~DS_3DLOOK; 00659 dsStyleOld &= ~DS_3DLOOK; 00660 } 00661 } else { 00662 dt.style |= DS_3DLOOK; 00663 dsStyleOld |= DS_3DLOOK; 00664 } 00665 } else { 00666 #if DBG 00667 if (dt.style != (dt.style & (DS_VALID31 | DS_3DLOOK | 0xffff0000))) { 00668 RIPMSG1(RIP_WARNING, "CreateDialog: stripping invalid bits %lX", dt.style); 00669 } 00670 #endif // DBG 00671 00672 00673 /* 00674 * Don't strip off bits for old apps, they depend on this. Especially 16 bit MFC apps! 00675 * 00676 * dt.dwStyle &= (DS_VALID31 | 0xffff0000); 00677 */ 00678 } 00679 00680 if (LOWORD((ULONG_PTR)hmod) == 0) { 00681 if (dt.style & DS_SETFOREGROUND) 00682 bFlags |= CD_SETFOREGROUND; 00683 } 00684 00685 if (dsStyleOld != LOWORD(dt.style)) 00686 { 00687 00688 RIPMSG1(f40Compat ? RIP_ERROR : RIP_WARNING, 00689 "Bad dialog style bits (%x) - please remove.", 00690 LOWORD(dt.style)); 00691 // Fail new apps that pass in bogus bits! 00692 00693 if (f40Compat) { 00694 return NULL; 00695 } 00696 } 00697 00698 if ( dt.style & DS_MODALFRAME) { 00699 dt.dwExStyle |= WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE; 00700 } 00701 00702 if (( dt.style & DS_CONTEXTHELP) && f40Compat) { 00703 dt.dwExStyle |= WS_EX_CONTEXTHELP; 00704 } 00705 00706 if (dt.style & DS_CONTROL) { 00707 // Captions and system menus aren't allowed on "control" dialogs. 00708 // And strip DS_SYSMODAL. 00709 dt.style &= ~(WS_CAPTION | WS_SYSMENU | DS_SYSMODAL); 00710 } else if (dt.style & WS_DLGFRAME) { 00711 // Add on window edge same way that CreateWindowEx() will 00712 dt.dwExStyle |= WS_EX_WINDOWEDGE; 00713 } 00714 00715 if (dt.style & DS_SYSMODAL) { 00716 dt.dwExStyle |= WS_EX_TOPMOST; 00717 } 00718 00719 if (!(dt.style & WS_CHILD) || (dt.style & DS_CONTROL)) { 00720 // only a control parent if it's not a child dialog or if it's 00721 // explicitly marked as a recursive dialog 00722 dt.dwExStyle |= WS_EX_CONTROLPARENT; 00723 } 00724 00725 if (dt.x == (short)CW2_USEDEFAULT) { 00726 bFlags |= CD_USEDEFAULTX; 00727 dt.x = 0; 00728 } 00729 00730 if (dt.cx == (short)CW2_USEDEFAULT) { 00731 bFlags |= CD_USEDEFAULTCX; 00732 dt.cx = 0; 00733 } else if (dt.cx < 0) { 00734 dt.cx = 0; 00735 } 00736 00737 if (dt.cy < 0) { 00738 dt.cy = 0; 00739 } 00740 00741 00742 // If there's a menu name string, load it. 00743 lpszMenu = (LPWSTR)(((PBYTE)(lpdt)) + (dt.wDlgVer ? sizeof(DLGTEMPLATE2):sizeof(DLGTEMPLATE))); 00744 00745 /* 00746 * If the menu id is expressed as an ordinal and not a string, 00747 * skip all 4 bytes to get to the class string. 00748 */ 00749 w = *(LPWORD)lpszMenu; 00750 00751 /* 00752 * If there's a menu name string, load it. 00753 */ 00754 if (w != 0) { 00755 if ((hMenu = LoadMenu(hmod, (w == 0xFFFF) ? 00756 MAKEINTRESOURCE(*(WORD *)((PBYTE)lpszMenu + 2)) : lpszMenu)) == NULL) { 00757 RIPMSG0(RIP_WARNING, "ServerCreateDialog() failed: couldn't load menu"); 00758 goto DeleteFontAndMenuAndFail; 00759 } 00760 } else { 00761 hMenu = NULL; 00762 } 00763 00764 if (w == 0xFFFF) { 00765 lpszClass = (LPWSTR)((LPBYTE)lpszMenu + 4); 00766 } else { 00767 lpszClass = (UTCHAR *)WordSkipSz(lpszMenu); 00768 } 00769 00770 lpszText = (UTCHAR *)WordSkipSz(lpszClass); 00771 00772 lpStr = (UTCHAR *)WordSkipSz(lpszText); 00773 00774 hdcDlg = CreateCompatibleDC(NULL); 00775 if (hdcDlg == NULL) 00776 goto DeleteFontAndMenuAndFail; 00777 00778 if (dt.style & DS_SETFONT) { 00779 hNewFont = CreateDlgFont(hdcDlg, &lpStr, &dt, dwExpWinVer, fSCDLGFlags); 00780 bFlags |= CD_USERFONT; 00781 lpdit = (LPDLGITEMTEMPLATE) NextDWordBoundary(lpStr); 00782 } else if (Is400Compat(dwExpWinVer) && (dt.style & DS_FIXEDSYS)) { 00783 00784 // 00785 // B#2078 -- WISH for fixed width system font in dialog. We need 00786 // to tell the dialog that it's using a font different from the 00787 // standard system font, so set CD_USERFONT bit. 00788 // 00789 // We need the 400 compat. check for CorelDraw, since they use 00790 // this style bit for their own purposes. 00791 // 00792 hNewFont = GetStockObject(SYSTEM_FIXED_FONT); 00793 bFlags |= CD_USERFONT; 00794 lpdit = (LPDLGITEMTEMPLATE)NextDWordBoundary(lpStr); 00795 } else { 00796 lpdit = (LPDLGITEMTEMPLATE)NextDWordBoundary(lpStr); 00797 } 00798 00799 /* 00800 * If the application requested a particular font and for some 00801 * reason we couldn't find it, we just use the system font. BUT we 00802 * need to make sure we tell him he gets the system font. Dialogs 00803 * which never request a particular font get the system font and we 00804 * don't bother telling them this (via the WM_SETFONT message). 00805 */ 00806 00807 // Is it anything other than the default system font? If we can't get 00808 // enough memory to select in the new font specified, just use the system 00809 // font. 00810 if (hNewFont && (hOldFont = SelectFont(hdcDlg, hNewFont))) { 00811 // Get the ave character width and height to be used 00812 cxChar = GdiGetCharDimensions(hdcDlg, NULL, &cyChar); 00813 00814 SelectFont(hdcDlg, hOldFont); 00815 if (cxChar == 0) { 00816 RIPMSG0(RIP_WARNING, "InternalCreateDialog: GdiGetCharDimensions failed"); 00817 goto UseSysFontMetrics; 00818 } 00819 } 00820 else 00821 { 00822 if (hNewFont || (bFlags & CD_USERFONT)) 00823 hNewFont = ghFontSys; 00824 00825 UseSysFontMetrics: 00826 cxChar = gpsi->cxSysFontChar; 00827 cyChar = gpsi->cySysFontChar; 00828 } 00829 DeleteDC(hdcDlg); 00830 00831 if (dt.style & WS_VISIBLE) { 00832 bFlags |= CD_VISIBLE; 00833 dt.style &= ~WS_VISIBLE; 00834 } 00835 00836 if (!(dt.style & DS_LOCALEDIT)) { 00837 bFlags |= CD_GLOBALEDIT; 00838 } 00839 00840 /* Figure out dimensions of real window 00841 */ 00842 rc.left = rc.top = 0; 00843 rc.right = XPixFromXDU(dt.cx, cxChar); 00844 rc.bottom = YPixFromYDU(dt.cy, cyChar); 00845 00846 _AdjustWindowRectEx(&rc, dt.style, w, dt.dwExStyle); 00847 00848 dt.cx = (SHORT)(rc.right - rc.left); 00849 dt.cy = (SHORT)(rc.bottom - rc.top); 00850 00851 if ((dt.style & DS_CENTERMOUSE) && SYSMET(MOUSEPRESENT) && f40Compat) { 00852 pMonitor = _MonitorFromPoint(gpsi->ptCursor, MONITOR_DEFAULTTONULL); 00853 UserAssert(pMonitor); 00854 *((LPPOINT)&rc.left) = gpsi->ptCursor; 00855 rc.left -= (dt.cx / 2); 00856 rc.top -= (dt.cy / 2); 00857 } else { 00858 BOOL fNoDialogMonitor; 00859 00860 pMonitor = GetDialogMonitor(hwndOwner, MONITOR_DEFAULTTONULL); 00861 fNoDialogMonitor = pMonitor ? FALSE : TRUE; 00862 if (!pMonitor) { 00863 pMonitor = GetPrimaryMonitor(); 00864 } 00865 00866 if ((dt.style & (DS_CENTER | DS_CENTERMOUSE)) && f40Compat) { 00867 /* 00868 * Center to the work area of the owner monitor. 00869 */ 00870 rc.left = (pMonitor->rcWork.left + pMonitor->rcWork.right - dt.cx) / 2; 00871 rc.top = (pMonitor->rcWork.top + pMonitor->rcWork.bottom - dt.cy) / 2; 00872 } else { 00873 rc.left = XPixFromXDU(dt.x, cxChar); 00874 rc.top = YPixFromYDU(dt.y, cyChar); 00875 00876 if (!(dt.style & DS_ABSALIGN) && hwndOwner) { 00877 /* 00878 * Offset relative coordinates to the owner window. If it is 00879 * a child window, there is nothing to do. 00880 */ 00881 if ((HIWORD(dt.style) & MaskWF(WFTYPEMASK)) != MaskWF(WFCHILD)) { 00882 //This is will considre rc.left form the right hand side of the owner window if it a mirrored one. 00883 ClientToScreen(hwndOwner, (LPPOINT)&rc.left); 00884 00885 #ifdef USE_MIRRORING 00886 //It is not chiled then do Visual ClientToScreen 00887 //i.e. rc.left it is form the left hand side of the owner window 00888 if (MIRRORED_HWND(hwndOwner)) { 00889 rc.left -= dt.cx; 00890 } 00891 #endif 00892 00893 } 00894 } else { 00895 /* 00896 * Position the dialog in screen coordinates. If the dialog's 00897 * owner is on a different monitor than specified in the 00898 * template, move the dialog to the owner window. If the owner 00899 * doesn't exist, then use the monitor from the dialog's 00900 * template. 00901 */ 00902 00903 PMONITOR pMonitorTemplate; 00904 RECT rcTemplate; 00905 00906 rcTemplate.left = rc.left; 00907 rcTemplate.top = rc.top; 00908 rcTemplate.right = rc.left + dt.cx; 00909 rcTemplate.bottom = rc.top + dt.cy; 00910 00911 pMonitorTemplate = _MonitorFromRect(&rcTemplate, MONITOR_DEFAULTTOPRIMARY); 00912 if (fNoDialogMonitor) { 00913 pMonitor = pMonitorTemplate; 00914 } else if (pMonitorTemplate != pMonitor) { 00915 rc.left += pMonitor->rcMonitor.left - pMonitorTemplate->rcMonitor.left; 00916 rc.top += pMonitor->rcMonitor.top - pMonitorTemplate->rcMonitor.top; 00917 } 00918 } 00919 } 00920 } 00921 00922 rc.right = rc.left + dt.cx; 00923 rc.bottom = rc.top + dt.cy; 00924 00925 // If the right or bottom coordinate has overflowed, then pin it back to 00926 // a valid rectangle. Likely to happen if a minimized window is the owner of 00927 // the dialog. 00928 if (rc.left > rc.right || rc.top > rc.bottom) { 00929 OffsetRect(&rc, -dt.cx, -dt.cy); 00930 } 00931 00932 // 00933 // Need to do this for ALL dialogs, not just top-level, since we used 00934 // to in 3.1. 00935 // 00936 00937 // Clip top level dialogs within working area 00938 // Start child dialogs at least at (0, 0) 00939 RepositionRect(pMonitor, &rc, dt.style, dt.dwExStyle); 00940 00941 dt.x = (SHORT)((bFlags & CD_USEDEFAULTX) ? CW2_USEDEFAULT : rc.left); 00942 dt.y = (SHORT)(rc.top); 00943 dt.cx = (SHORT)((bFlags & CD_USEDEFAULTCX) ? CW2_USEDEFAULT : rc.right - rc.left); 00944 dt.cy = (SHORT)(rc.bottom - rc.top); 00945 00946 if (*lpszClass != 0) { 00947 if (IS_PTR(lpszClass)) { 00948 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&strClassName, 00949 lpszClass, (UINT)-1); 00950 pstrClassName = &strClassName; 00951 } else { 00952 pstrClassName = (PLARGE_STRING)lpszClass; 00953 } 00954 } else { 00955 pstrClassName = (PLARGE_STRING)DIALOGCLASS; 00956 } 00957 00958 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&strWindowName, 00959 lpszText, (UINT)-1); 00960 00961 UserAssert((dt.dwExStyle & WS_EX_MDICHILD) == 0); 00962 hwnd = NtUserCreateWindowEx( 00963 dt.dwExStyle | ((fSCDLGFlags & SCDLG_ANSI) ? WS_EX_ANSICREATOR : 0), 00964 pstrClassName, 00965 &strWindowName, 00966 dt.style, 00967 DefShortToInt(dt.x), 00968 dt.y, 00969 DefShortToInt(dt.cx), 00970 dt.cy, 00971 hwndOwner, 00972 hMenu, 00973 hmod, 00974 (LPVOID)NULL, 00975 dwExpWinVer); 00976 00977 if (hwnd == NULL) { 00978 RIPMSG0(RIP_WARNING, "CreateDialog() failed: couldn't create window"); 00979 DeleteFontAndMenuAndFail: 00980 if (hMenu != NULL) 00981 NtUserDestroyMenu(hMenu); 00982 /* 00983 * Only delete the font if we didn't grab it 00984 * from the dialog font cache. 00985 */ 00986 if ((hNewFont != NULL)) { 00987 DeleteObject(hNewFont); 00988 } 00989 return NULL; 00990 } 00991 00992 pwnd = ValidateHwnd(hwnd); 00993 00994 // tell WOW the hDlg of the Window just created BEFORE they get any messages 00995 // at WOW32!w32win16wndprocex 00996 if(fSCDLGFlags & SCDLG_16BIT) { 00997 TellWOWThehDlg(hwnd); 00998 } 00999 01000 /* 01001 * Before anything happens with this window, we need to mark it as a 01002 * dialog window!!!! So do that. 01003 */ 01004 if (pwnd == NULL || !ValidateDialogPwnd(pwnd)) 01005 goto DeleteFontAndMenuAndFail; 01006 01007 if (dt.dwHelpID) { 01008 NtUserSetWindowContextHelpId(hwnd, dt.dwHelpID); 01009 } 01010 01011 /* 01012 * Set up the system menu on this dialog box if it has one. 01013 */ 01014 if (TestWF(pwnd, WFSYSMENU)) { 01015 01016 /* 01017 * For a modal dialog box with a frame and caption, we want to 01018 * delete the unselectable items from the system menu. 01019 */ 01020 UserAssert(HIBYTE(WFSIZEBOX) == HIBYTE(WFMINBOX)); 01021 UserAssert(HIBYTE(WFMINBOX) == HIBYTE(WFMAXBOX)); 01022 if (!TestWF(pwnd, WFSIZEBOX | WFMINBOX | WFMAXBOX)) { 01023 01024 NtUserCallHwndLock(hwnd, SFI_XXXSETDIALOGSYSTEMMENU); 01025 } else { 01026 01027 /* 01028 * We have to give this dialog its own copy of the system menu 01029 * in case it modifies the menu. 01030 */ 01031 NtUserGetSystemMenu(hwnd, FALSE); 01032 } 01033 } 01034 01035 /* 01036 * Set fDisabled to FALSE so EndDialog will Enable if dialog is ended 01037 * before returning to DialogBox (or if modeless). 01038 */ 01039 PDLG(pwnd)->fDisabled = FALSE; 01040 01041 PDLG(pwnd)->cxChar = cxChar; 01042 PDLG(pwnd)->cyChar = cyChar; 01043 PDLG(pwnd)->lpfnDlg = lpfnDialog; 01044 PDLG(pwnd)->fEnd = FALSE; 01045 PDLG(pwnd)->result = IDOK; 01046 01047 /* 01048 * Need to remember Unicode status. 01049 */ 01050 if (fSCDLGFlags & SCDLG_ANSI) { 01051 PDLG(pwnd)->flags |= DLGF_ANSI; 01052 } 01053 01054 /* 01055 * Have to do a callback here for WOW apps. WOW needs what's in lParam 01056 * before the dialog gets any messages. 01057 */ 01058 01059 /* 01060 * If the app is a Wow app then the Lo Word of the hInstance is the 01061 * 16-bit hInstance. Set the lParam, which no-one should look at 01062 * but the app, to the 16 bit value 01063 */ 01064 if (LOWORD((ULONG_PTR)hmod) != 0) { 01065 fWowWindow = TRUE; 01066 } else { 01067 fWowWindow = FALSE; 01068 } 01069 01070 /* 01071 * If a user defined font is used, save the handle so that we can delete 01072 * it when the dialog is destroyed. 01073 */ 01074 if (bFlags & CD_USERFONT) { 01075 01076 PDLG(pwnd)->hUserFont = hNewFont; 01077 01078 if (lpfnDialog != NULL) { 01079 /* 01080 * Tell the dialog that it will be using this font... 01081 */ 01082 SendMessageWorker(pwnd, WM_SETFONT, (WPARAM)hNewFont, 0L, FALSE); 01083 } 01084 } 01085 01086 if (!dt.wDlgVer) { 01087 dit.dwHelpID = 0; 01088 } 01089 01090 /* 01091 * Loop through the dialog controls, doing a CreateWindowEx() for each of 01092 * them. 01093 */ 01094 while (dt.cDlgItems-- != 0) { 01095 DWORD dwExpWinVer2; 01096 01097 if (dt.wDlgVer) { 01098 RtlCopyMemory(&dit, lpdit, sizeof dit); 01099 } else { 01100 dit.dwHelpID = 0; 01101 dit.dwExStyle = lpdit->dwExtendedStyle; 01102 dit.style = lpdit->style; 01103 dit.x = lpdit->x; 01104 dit.y = lpdit->y; 01105 dit.cx = lpdit->cx; 01106 dit.cy = lpdit->cy; 01107 dit.dwID = lpdit->id; 01108 } 01109 01110 dit.x = XPixFromXDU(dit.x, cxChar); 01111 dit.y = YPixFromYDU(dit.y, cyChar); 01112 dit.cx = XPixFromXDU(dit.cx, cxChar); 01113 dit.cy = YPixFromYDU(dit.cy, cyChar); 01114 01115 lpszClass = (LPWSTR)(((PBYTE)(lpdit)) + (dt.wDlgVer ? sizeof(DLGITEMTEMPLATE2):sizeof(DLGITEMTEMPLATE))); 01116 01117 /* 01118 * If the first WORD is 0xFFFF the second word is the encoded class name index. 01119 * Use it to look up the class name string. 01120 */ 01121 if (*(LPWORD)lpszClass == 0xFFFF) { 01122 lpszText = lpszClass + 2; 01123 lpszClass = (LPWSTR)(gpsi->atomSysClass[*(((LPWORD)lpszClass)+1) & ~CODEBIT]); 01124 } else { 01125 lpszText = (UTCHAR *)SkipSz(lpszClass); 01126 } 01127 lpszText = (UTCHAR *)NextWordBoundary(lpszText); // UINT align lpszText 01128 01129 dit.dwExStyle |= WS_EX_NOPARENTNOTIFY; 01130 01131 // 01132 // Replace flat borders with 3D ones for DS_3DLOOK dialogs 01133 // We test the WINDOW style, not the template style now. This is so 01134 // that 4.0 apps--who get 3D stuff automatically--can turn it off on 01135 // create if they want. 01136 // 01137 01138 // 01139 // HACK! 01140 // Treat DS_3DLOOK combos like they have a WS_EX_CLIENTEDGE. Why 01141 // should we have to draw the borders of a combobox ourselves? 01142 // We can't do the same thing for WS_BORDER though becaues of 01143 // PC Fools--they use the presence of WS_BORDER to distinguish 01144 // between lists and combos. 01145 // 01146 01147 if (TestWF(pwnd, DF3DLOOK)) { 01148 if ( (dit.style & WS_BORDER) || 01149 (lpszClass == MAKEINTRESOURCE(gpsi->atomSysClass[ICLS_COMBOBOX]))) { 01150 01151 dit.style &= ~WS_BORDER; 01152 dit.dwExStyle |= WS_EX_CLIENTEDGE; 01153 } 01154 } 01155 01156 /* 01157 * Get pointer to additional data. lpszText can point to an encoded 01158 * ordinal number for some controls (e.g. static icon control) so 01159 * we check for that here. 01160 */ 01161 if (*(LPWORD)lpszText == 0xFFFF) { 01162 lpCreateParams = (LPWSTR)((PBYTE)lpszText + 4); 01163 strWindowName.Buffer = lpszText; 01164 strWindowName.Length = 4; 01165 strWindowName.MaximumLength = 4; 01166 strWindowName.bAnsi = FALSE; 01167 } else { 01168 lpCreateParams = (LPWSTR)((PBYTE)WordSkipSz(lpszText)); 01169 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&strWindowName, 01170 lpszText, (UINT)-1); 01171 } 01172 01173 /* 01174 * If control is edit control and caller wants global storage 01175 * of edit text, allocate object in WOW and pass instance 01176 * handle to CreateWindowEx(). 01177 */ 01178 if (fWowWindow && (bFlags & CD_GLOBALEDIT) && 01179 ((!IS_PTR(lpszClass) && 01180 PTR_TO_ID(lpszClass) == (ATOM)(gpsi->atomSysClass[ICLS_EDIT])) || 01181 (IS_PTR(lpszClass) && 01182 (wcscmp(lpszClass, szEDITCLASS) == 0)))) { 01183 01184 /* 01185 * Allocate only one global object (first time we see editctl.) 01186 */ 01187 if (!(PDLG(pwnd)->hData)) { 01188 PDLG(pwnd)->hData = GetEditDS(); 01189 if (!(PDLG(pwnd)->hData)) 01190 goto NoCreate; 01191 } 01192 01193 hmodCreate = PDLG(pwnd)->hData; 01194 dwExpWinVer2 = GETEXPWINVER(hmodCreate); 01195 } else { 01196 hmodCreate = hmod; 01197 dwExpWinVer2 = dwExpWinVer; 01198 } 01199 01200 #if DBG 01201 if ((dit.dwExStyle & WS_EX_ANSICREATOR) != 0) { 01202 RIPMSG1(RIP_WARNING, "Bad WS_EX_ style 0x%x for a control in the dialog", 01203 dit.dwExStyle); 01204 } 01205 #endif // DBG 01206 01207 /* 01208 * Get pointer to additional data. 01209 * 01210 * For WOW, instead of pointing lpCreateParams at the CreateParams 01211 * data, set lpCreateParams to whatever DWORD is stored in the 32-bit 01212 * DLGTEMPLATE's CreateParams. WOW has already made sure that that 01213 * 32-bit value is indeed a 16:16 pointer to the CreateParams in the 01214 * 16-bit DLGTEMPLATE. 01215 */ 01216 01217 if (*lpCreateParams) { 01218 lpCreateParamsData = (LPBYTE)lpCreateParams; 01219 if (fWowWindow || fSCDLGFlags & SCDLG_16BIT) { 01220 lpCreateParamsData = 01221 (LPBYTE)ULongToPtr( *(UNALIGNED DWORD *) /* Sundown WOW: zero-extension */ 01222 (lpCreateParamsData + sizeof(WORD)) ); 01223 } 01224 } else { 01225 lpCreateParamsData = NULL; 01226 } 01227 01228 /* 01229 * If the dialog template specifies a menu ID then TestwndChild(pwnd) 01230 * must be TRUE or CreateWindowEx will think the ID is an hMenu rather 01231 * than an ID (in a dialog template you'll never have an hMenu). 01232 * However for compatibility reasons we let it go if the ID = 0. 01233 */ 01234 if (dit.dwID) { 01235 /* 01236 * This makes TestwndChild(pwnd) on this window return TRUE. 01237 */ 01238 dit.style |= WS_CHILD; 01239 dit.style &= ~WS_POPUP; 01240 } 01241 01242 if (IS_PTR(lpszClass)) { 01243 RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)&strClassName, 01244 lpszClass, (UINT)-1); 01245 pstrClassName = &strClassName; 01246 } else { 01247 pstrClassName = (PLARGE_STRING)lpszClass; 01248 } 01249 UserAssert((dit.dwExStyle & WS_EX_MDICHILD) == 0); 01250 01251 hwnd2 = NtUserCreateWindowEx( 01252 dit.dwExStyle | ((fSCDLGFlags & SCDLG_ANSI) ? WS_EX_ANSICREATOR : 0), 01253 pstrClassName, 01254 &strWindowName, 01255 dit.style, 01256 DefShortToInt(dit.x), 01257 dit.y, 01258 DefShortToInt(dit.cx), 01259 dit.cy, 01260 hwnd, 01261 (HMENU)LongToHandle( dit.dwID ), 01262 hmodCreate, 01263 lpCreateParamsData, 01264 dwExpWinVer2); 01265 01266 if (hwnd2 == NULL) { 01267 NoCreate: 01268 /* 01269 * Couldn't create the window -- return NULL. 01270 */ 01271 if (!TestWF(pwnd, DFNOFAILCREATE)) { 01272 RIPMSG0(RIP_WARNING, "CreateDialog() failed: couldn't create control"); 01273 NtUserDestroyWindow(hwnd); 01274 return NULL; 01275 } 01276 } else { 01277 01278 if (dit.dwHelpID) { 01279 NtUserSetWindowContextHelpId(hwnd2, dit.dwHelpID); 01280 } 01281 01282 /* 01283 * If it is a not a default system font, set the font for all the 01284 * child windows of the dialogbox. 01285 */ 01286 if (hNewFont != NULL) { 01287 SendMessage(hwnd2, WM_SETFONT, (WPARAM)hNewFont, 0L); 01288 } 01289 01290 /* 01291 * Result gets ID of last (hopefully only) defpushbutton. 01292 */ 01293 if (SendMessage(hwnd2, WM_GETDLGCODE, 0, 0L) & DLGC_DEFPUSHBUTTON) { 01294 PDLG(pwnd)->result = dit.dwID; 01295 } 01296 01297 } 01298 /* 01299 * Point at next item template 01300 */ 01301 lpdit = (LPDLGITEMTEMPLATE)NextDWordBoundary( 01302 (LPBYTE)(lpCreateParams + 1) + *lpCreateParams); 01303 } 01304 01305 if (!TestWF(pwnd, DFCONTROL)) { 01306 PWND pwndT = _GetNextDlgTabItem(pwnd, NULL, FALSE); 01307 hwndEditFirst = HW(pwndT); 01308 } 01309 01310 if (lpfnDialog != NULL) { 01311 fSuccess = (BOOL)SendMessageWorker(pwnd, WM_INITDIALOG, 01312 (WPARAM)hwndEditFirst, lParam, FALSE); 01313 01314 // 01315 // Make sure the window didn't get nuked during WM_INITDIALOG 01316 // 01317 if (!RevalidateHwnd(hwnd)) { 01318 goto CreateDialogReturn; 01319 } 01320 if (fSuccess && !PDLG(pwnd)->fEnd) { 01321 01322 // 01323 // To remove the two-default-push-buttons problem, we must make 01324 // sure CheckDefPushButton() will remove default from other push 01325 // buttons. This happens only if hwndEditFirst != hwndNewFocus; 01326 // So, we make it NULL here. This breaks Designer's install 01327 // program(which can't take a DM_GETDEFID. So, we do a version 01328 // check here. 01329 // 01330 if (!TestWF(pwnd, DFCONTROL)) { 01331 PWND pwndT; 01332 if (!IsWindow(hwndEditFirst) || TestWF(pwnd, WFWIN40COMPAT)) 01333 hwndEditFirst = NULL; 01334 01335 // 01336 // They could have disabled hwndEditFirst during WM_INITDIALOG. 01337 // So, let use obtain the First Tab again. 01338 // 01339 pwndT = _GetNextDlgTabItem(pwnd, NULL, FALSE); 01340 if (hwndNewFocus = HW(pwndT)) { 01341 DlgSetFocus(hwndNewFocus); 01342 } 01343 01344 xxxCheckDefPushButton(pwnd, hwndEditFirst, hwndNewFocus); 01345 } 01346 } 01347 } 01348 01349 if (!IsWindow(hwnd)) 01350 { 01351 // Omnis7 relies on a nonzero return even though they nuked this 01352 // dialog during processing of the WM_INITDIALOG message 01353 // -- jeffbog -- 2/24/95 -- Win95B B#12368 01354 if (GETAPPVER() < VER40) { 01355 return(hwnd); 01356 } 01357 01358 return(NULL); 01359 } 01360 01361 /* 01362 * UISTATE: if keyboard indicators are on and this is a topmost dialog 01363 * set the internal bit. 01364 */ 01365 if (TEST_KbdCuesPUSIF) { 01366 /* 01367 * If property page, UISTATE bits were copied from parent when I was created 01368 * Top level dialogs act as containers and initialize their state based on 01369 * the type of the last input event, after sending UIS_INITIALIZE 01370 */ 01371 if (!TestwndChild(pwnd)) { 01372 SendMessageWorker(pwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0, FALSE); 01373 } 01374 } 01375 01376 /* 01377 * Bring this dialog into the foreground 01378 * if DS_SETFOREGROUND is set. 01379 */ 01380 if (bFlags & CD_SETFOREGROUND) { 01381 NtUserSetForegroundWindow(hwnd); 01382 if (!IsWindow(hwnd)) { 01383 hwnd = NULL; 01384 goto CreateDialogReturn; 01385 } 01386 } 01387 01388 if ((bFlags & CD_VISIBLE) && !PDLG(pwnd)->fEnd && (!TestWF(pwnd, WFVISIBLE))) { 01389 NtUserShowWindow(hwnd, SHOW_OPENWINDOW); 01390 UpdateWindow(hwnd); 01391 } 01392 01393 CreateDialogReturn: 01394 01395 /* 01396 * 17609 Gupta's SQLWin deletes the window before CreateDialog returns 01397 * but still expects non-zero return value from CreateDialog so we will 01398 * do like win 3.1 and not revalidate for 16 bit apps 01399 */ 01400 if (!(fSCDLGFlags & SCDLG_NOREVALIDATE) && !RevalidateHwnd(hwnd)) { 01401 hwnd = NULL; 01402 } 01403 01404 return hwnd; 01405 }

INT_PTR InternalDialogBox HANDLE  hmod,
LPDLGTEMPLATE  lpDlgTemplate,
HWND  hwndOwner,
DLGPROC  pfnWndProc,
LPARAM  dwInitParam,
UINT  fFlags
 

Definition at line 1246 of file dlgmgr.c.

References BOOL, CheckLock, DialogBox2(), FALSE, GetActiveWindow(), GetDesktopWindow(), GetTopLevelWindow(), HWq, InternalCreateDialog(), L, NtUserEnableWindow, NtUserSetCursor(), NULL, PtoHq, SAMEWOWHANDLE, SYSMET, TestWF, TestwndChild, ThreadLock, ThreadUnlock, TRUE, ValidateHwnd, and WFDISABLED.

Referenced by DialogBoxIndirectParamAorW(), and SoftModalMessageBox().

01253 { 01254 INT_PTR i; 01255 BOOL fDisabled; 01256 HWND hwnd; 01257 PWND pwndOwner; 01258 BOOL fOwnerIsActiveWindow = FALSE; 01259 TL tlpwndOwner; 01260 BOOL fUnlockOwner; 01261 01262 UserAssert(!(fSCDLGFlags & ~(SCDLG_CLIENT|SCDLG_ANSI|SCDLG_16BIT))); // These are the only valid flags 01263 01264 /* 01265 * If hwndOwner == HWNDESKTOP, change it to NULL. This way the desktop 01266 * (and all its children) won't be disabled if the dialog is modal. 01267 */ 01268 if (hwndOwner && SAMEWOWHANDLE(hwndOwner, GetDesktopWindow())) 01269 hwndOwner = NULL; 01270 01271 /* 01272 * We return 0 if the ValidateHwnd fails in order to match Win 3.1 01273 * validation layer which always returns 0 for invalid hwnds even 01274 * if the function is spec'ed to return -1. Autocad setup bug #3615 01275 */ 01276 if (hwndOwner) { 01277 if ((pwndOwner = ValidateHwnd(hwndOwner)) == NULL) { 01278 return (0L); 01279 } 01280 } else { 01281 pwndOwner = NULL; 01282 } 01283 01284 CheckLock(pwndOwner); 01285 01286 fUnlockOwner = FALSE; 01287 if (pwndOwner != NULL) { 01288 01289 /* The following fixes an AV in Corel Photo-Paint 6.0. It passes a 01290 * 16-bit HWND in, and croaks at some point when it gets 16-bit hwnds 01291 * back in send messages. FritzS -- fixing bug 12531 01292 */ 01293 hwndOwner = PtoHq(pwndOwner); 01294 01295 /* 01296 * Make sure the owner is a top level window. 01297 */ 01298 if (TestwndChild(pwndOwner)) { 01299 pwndOwner = GetTopLevelWindow(pwndOwner); 01300 hwndOwner = HWq(pwndOwner); 01301 ThreadLock(pwndOwner, &tlpwndOwner); 01302 fUnlockOwner = TRUE; 01303 } 01304 01305 /* 01306 * Remember if window was originally disabled (so we can set 01307 * the correct state when the dialog goes away. 01308 */ 01309 fDisabled = TestWF(pwndOwner, WFDISABLED); 01310 fOwnerIsActiveWindow = (SAMEWOWHANDLE(hwndOwner, GetActiveWindow())); 01311 01312 /* 01313 * Disable the window. 01314 */ 01315 NtUserEnableWindow(hwndOwner, FALSE); 01316 } 01317 01318 /* 01319 * Don't show cursors on a mouseless system. Put up an hour glass while 01320 * the dialog comes up. 01321 */ 01322 if (SYSMET(MOUSEPRESENT)) { 01323 NtUserSetCursor(LoadCursor(NULL, IDC_WAIT)); 01324 } 01325 01326 /* 01327 * Creates the dialog. Frees the menu if this routine fails. 01328 */ 01329 hwnd = InternalCreateDialog(hModule, lpdt, 0, hwndOwner, 01330 pfnDialog, lParam, fSCDLGFlags); 01331 01332 if (hwnd == NULL) { 01333 01334 /* 01335 * The dialog creation failed. Re-enable the window, destroy the 01336 * menu, ie., fail gracefully. 01337 */ 01338 if (!fDisabled && hwndOwner != NULL) 01339 NtUserEnableWindow(hwndOwner, TRUE); 01340 01341 if (fUnlockOwner) 01342 ThreadUnlock(&tlpwndOwner); 01343 return -1; 01344 } 01345 01346 i = DialogBox2(hwnd, hwndOwner, fDisabled, fOwnerIsActiveWindow); 01347 01348 if (fUnlockOwner) 01349 ThreadUnlock(&tlpwndOwner); 01350 return i; 01351 }

HWND InternalFindWindowExA HWND  hwndParent,
HWND  hwndChild,
LPCSTR  pClassName,
LPCSTR  pWindowName,
DWORD  dwFlag
 

Referenced by WOWFindWindow().

HWND InternalFindWindowExW HWND  hwndParent,
HWND  hwndChild,
LPCTSTR  pClassName,
LPCTSTR  pWindowName,
DWORD  dwFlag
 

Referenced by FindWinHelpWindow().

BOOL InternalInsertMenuItem HMENU  hMenu,
UINT  uID,
BOOL  fByPosition,
LPCMENUITEMINFO  lpmii
 

Definition at line 439 of file clmenu.c.

References BOOL, FALSE, ThunkedMenuItemInfo(), and TRUE.

Referenced by AppendToWindowsMenu(), MDIAddSysMenu(), and SwitchWindowsMenus().

00440 { 00441 return ThunkedMenuItemInfo(hMenu, uID, fByPosition, TRUE, (LPMENUITEMINFOW)lpmii, FALSE); 00442 }

int InternalScrollWindowEx HWND  hwnd,
int  dx,
int  dy,
CONST RECT *  prcScroll,
CONST RECT *  prcClip,
HRGN  hrgnUpdate,
LPRECT  prcUpdate,
UINT  dwFlags,
DWORD  dwTime
 

BOOL ISelFromPt PLBIV  ,
POINT  ,
LPDWORD 
 

Definition at line 920 of file lboxctl2.c.

References _GetClientRect(), BOOL, tagLBIV::cMac, tagLBIV::cxColumn, tagLBIV::cyChar, tagLBIV::fMultiColumn, tagLBIV::fRightAlign, INT, tagLBIV::itemsPerColumn, tagLBIV::iTop, LBGetItemRect(), tagLBIV::OwnerDraw, OWNERDRAWVAR, PtInRect(), tagLBIV::spwnd, TRUE, and UINT.

Referenced by LBDropObjectHandler(), ListBoxWndProcWorker(), and xxxTrackMouse().

00924 { 00925 RECT rect; 00926 int y; 00927 UINT mouseHighWord = 0; 00928 INT sItem; 00929 INT sTmp; 00930 00931 _GetClientRect(plb->spwnd, &rect); 00932 00933 if (pt.y < 0) { 00934 00935 /* 00936 * Mouse is out of bounds above listbox 00937 */ 00938 *piItem = plb->iTop; 00939 return TRUE; 00940 } else if ((y = pt.y) > rect.bottom) { 00941 y = rect.bottom; 00942 mouseHighWord = 1; 00943 } 00944 00945 if (pt.x < 0 || pt.x > rect.right) 00946 mouseHighWord = 1; 00947 00948 /* 00949 * Now just need to check if y mouse coordinate intersects item's rectangle 00950 */ 00951 if (plb->OwnerDraw != OWNERDRAWVAR) { 00952 if (plb->fMultiColumn) { 00953 if (y < plb->itemsPerColumn * plb->cyChar) { 00954 if (plb->fRightAlign) 00955 sItem = plb->iTop + (INT)((y / plb->cyChar) + 00956 ((rect.right - pt.x) / plb->cxColumn) * plb->itemsPerColumn); 00957 else 00958 sItem = plb->iTop + (INT)((y / plb->cyChar) + 00959 (pt.x / plb->cxColumn) * plb->itemsPerColumn); 00960 00961 } else { 00962 00963 /* 00964 * User clicked in blank space at the bottom of a column. 00965 * Just select the last item in the column. 00966 */ 00967 mouseHighWord = 1; 00968 sItem = plb->iTop + (plb->itemsPerColumn - 1) + 00969 (INT)((pt.x / plb->cxColumn) * plb->itemsPerColumn); 00970 } 00971 } else { 00972 sItem = plb->iTop + (INT)(y / plb->cyChar); 00973 } 00974 } else { 00975 00976 /* 00977 * VarHeightOwnerdraw so we gotta do this the hardway... Set the x 00978 * coordinate of the mouse down point to be inside the listbox client 00979 * rectangle since we no longer care about it. This lets us use the 00980 * point in rect calls. 00981 */ 00982 pt.x = 8; 00983 pt.y = y; 00984 for (sTmp = plb->iTop; sTmp < plb->cMac; sTmp++) { 00985 (void)LBGetItemRect(plb, sTmp, &rect); 00986 if (PtInRect(&rect, pt)) { 00987 *piItem = sTmp; 00988 return mouseHighWord; 00989 } 00990 } 00991 00992 /* 00993 * Point was at the empty area at the bottom of a not full listbox 00994 */ 00995 *piItem = plb->cMac - 1; 00996 return mouseHighWord; 00997 } 00998 00999 /* 01000 * Check if user clicked on the blank area at the bottom of a not full list. 01001 * Assumes > 0 items in the listbox. 01002 */ 01003 if (sItem > plb->cMac - 1) { 01004 mouseHighWord = 1; 01005 sItem = plb->cMac - 1; 01006 } 01007 01008 *piItem = sItem; 01009 return mouseHighWord; 01010 }

BOOL IsMetaFile HDC  hdc  ) 
 

Definition at line 27 of file client/drawtext.c.

References BOOL, and DWORD.

Referenced by DrawCaption(), DrawCaptionTemp(), DrawIconEx(), and DrawMenuBarTemp().

00029 { 00030 DWORD dwType = GetObjectType(hdc); 00031 return (dwType == OBJ_METAFILE || 00032 dwType == OBJ_METADC || 00033 dwType == OBJ_ENHMETAFILE || 00034 dwType == OBJ_ENHMETADC); 00035 }

BOOL IsSelected PLBIV  ,
INT  ,
UINT 
 

Definition at line 480 of file lboxctl2.c.

References BOOL, tagLBIV::cMac, FALSE, tagLBIV::fHasData, tagLBIV::fHasStrings, HILITEONLY, tagLBIV::iSel, tagLBIV::rgpch, SINGLESEL, and tagLBIV::wMultiple.

Referenced by LBoxGetSelItems(), ListBoxWndProcWorker(), xxxAlterHilite(), xxxLBoxCtlKeyInput(), xxxLBPaint(), xxxLBSelRange(), xxxLBSetCaret(), xxxLBSetSel(), xxxResetWorld(), and xxxTrackMouse().

00484 { 00485 LPBYTE lp; 00486 00487 if ((sItem >= plb->cMac) || (sItem < 0)) { 00488 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00489 // return LB_ERR; 00490 return(FALSE); 00491 } 00492 00493 if (plb->wMultiple == SINGLESEL) { 00494 return (sItem == plb->iSel); 00495 } 00496 00497 lp = plb->rgpch + sItem + 00498 (plb->cMac * (plb->fHasStrings 00499 ? sizeof(LBItem) 00500 : (plb->fHasData 00501 ? sizeof(LBODItem) 00502 : 0))); 00503 sItem = *lp; 00504 00505 if (wOpFlags == HILITEONLY) { 00506 sItem >>= 4; 00507 } else { 00508 sItem &= 0x0F; /* SELONLY */ 00509 } 00510 00511 return sItem; 00512 }

INT LastFullVisible PLBIV   ) 
 

Definition at line 1090 of file lboxctl2.c.

References tagLBIV::cItemFullMax, CItemInWindow(), tagLBIV::cMac, FALSE, tagLBIV::fMultiColumn, INT, tagLBIV::iTop, max, min, tagLBIV::OwnerDraw, and OWNERDRAWVAR.

Referenced by xxxInsureVisible().

01092 { 01093 INT iLastItem; 01094 01095 if (plb->OwnerDraw == OWNERDRAWVAR || plb->fMultiColumn) { 01096 iLastItem = plb->iTop + CItemInWindow(plb, FALSE) - 1; 01097 iLastItem = max(iLastItem, plb->iTop); 01098 } else { 01099 iLastItem = min(plb->iTop + plb->cItemFullMax - 1, plb->cMac - 1); 01100 } 01101 return iLastItem; 01102 }

UINT LBCalcAllocNeeded PLBIV  ,
INT 
 

Definition at line 1220 of file lboxctl1.c.

References tagLBIV::fHasData, tagLBIV::fHasStrings, tagLBIV::OwnerDraw, OWNERDRAWVAR, SINGLESEL, UINT, and tagLBIV::wMultiple.

Referenced by xxxLBSetCount().

01223 { 01224 UINT cb; 01225 01226 /* 01227 * Allocate memory for pointers to the strings. 01228 */ 01229 cb = cItems * (plb->fHasStrings ? sizeof(LBItem) 01230 : (plb->fHasData ? sizeof(LBODItem) 01231 : 0)); 01232 01233 /* 01234 * If multiple selection list box (MULTIPLESEL or EXTENDEDSEL), then 01235 * allocate an extra byte per item to keep track of it's selection state. 01236 */ 01237 if (plb->wMultiple != SINGLESEL) { 01238 cb += cItems; 01239 } 01240 01241 /* 01242 * Extra bytes for each item so that we can store its height. 01243 */ 01244 if (plb->OwnerDraw == OWNERDRAWVAR) { 01245 cb += cItems; 01246 } 01247 01248 return cb; 01249 }

VOID LBCalcItemRowsAndColumns PLBIV   ) 
 

Definition at line 25 of file lboxmult.c.

References _GetClientRect(), tagLBIV::cItemFullMax, tagLBIV::cxColumn, tagLBIV::cyChar, INT, tagLBIV::itemsPerColumn, tagLBIV::iTop, max, tagLBIV::numberOfColumns, tagLBIV::spwnd, and xxxNewITop().

Referenced by LBGetSetItemHeightHandler(), ListBoxWndProcWorker(), xxxLBSetFont(), and xxxLBSize().

00027 { 00028 RECT rc; 00029 00030 _GetClientRect(plb->spwnd, &rc); 00031 00032 // 00033 // B#4155 00034 // We need to check if plb->cyChar has been initialized. This is because 00035 // we remove WS_BORDER from old listboxes and add on WS_EX_CLIENTEDGE. 00036 // Since listboxes are always inflated by CXBORDER and CYBORDER, a 00037 // listbox that was created empty always ends up 2 x 2. Since this isn't 00038 // big enough to fit the entire client border, we don't mark it as 00039 // present. Thus the client isn't empty in VER40, although it was in 00040 // VER31 and before. It is possible to get to this spot without 00041 // plb->cyChar having been initialized yet if the listbox is 00042 // multicolumn && ownerdraw variable. 00043 // 00044 00045 if (rc.bottom && rc.right && plb->cyChar) { 00046 00047 /* 00048 * Only make these calculations if the width & height are positive 00049 */ 00050 plb->itemsPerColumn = (INT)max(rc.bottom / plb->cyChar, 1); 00051 plb->numberOfColumns = (INT)max(rc.right / plb->cxColumn, 1); 00052 00053 plb->cItemFullMax = plb->itemsPerColumn * plb->numberOfColumns; 00054 00055 /* 00056 * Adjust iTop so it's at the top of a column 00057 */ 00058 xxxNewITop(plb, plb->iTop); 00059 } 00060 }

INT LBCalcVarITopScrollAmt PLBIV  ,
INT  ,
INT 
 

Definition at line 198 of file lboxvar.c.

References _GetClientRect(), INT, LBGetItemRect(), and tagLBIV::spwnd.

Referenced by xxxNewITopEx().

00202 { 00203 RECT rc; 00204 RECT rcClient; 00205 00206 _GetClientRect(plb->spwnd, (LPRECT)&rcClient); 00207 00208 /* 00209 * Just optimize redrawing when move +/- 1 item. We will redraw all items 00210 * if moving more than 1 item ahead or back. This is good enough for now. 00211 */ 00212 if (iTopOld + 1 == iTopNew) { 00213 00214 /* 00215 * We are scrolling the current iTop up off the top off the listbox so 00216 * return a negative number. 00217 */ 00218 LBGetItemRect(plb, iTopOld, (LPRECT)&rc); 00219 return (rcClient.top - rc.bottom); 00220 } 00221 00222 if (iTopOld - 1 == iTopNew) { 00223 00224 /* 00225 * We are scrolling the current iTop down and the previous item is 00226 * becoming the new iTop so return a positive number. 00227 */ 00228 LBGetItemRect(plb, iTopNew, (LPRECT)&rc); 00229 return -rc.top; 00230 } 00231 00232 return rcClient.bottom - rcClient.top; 00233 }

VOID LBDropObjectHandler PLBIV  ,
PDROPSTRUCT 
 

Definition at line 732 of file lboxrare.c.

References DWORD, ISelFromPt(), and L.

Referenced by ListBoxWndProcWorker().

00735 { 00736 LONG mouseSel; 00737 00738 if (ISelFromPt(plb, pds->ptDrop, &mouseSel)) { 00739 00740 /* 00741 * User dropped in empty space at bottom of listbox 00742 */ 00743 pds->dwControlData = (DWORD)-1L; 00744 } else { 00745 pds->dwControlData = mouseSel; 00746 } 00747 }

void LBEvent PLBIV  ,
UINT  ,
int 
 

Definition at line 820 of file lboxrare.c.

References FWINABLE, HW, MULTIPLESEL, NotifyWinEvent(), SINGLESEL, tagLBIV::spwnd, and tagLBIV::wMultiple.

Referenced by ListBoxWndProcWorker(), xxxLBButtonUp(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBSelRange(), xxxLBSetCurSel(), xxxLBSetSel(), xxxSetISelBase(), and xxxTrackMouse().

00821 { 00822 UserAssert(FWINABLE()); 00823 00824 switch (uEvent) { 00825 case EVENT_OBJECT_SELECTIONREMOVE: 00826 if (plb->wMultiple != SINGLESEL) { 00827 break; 00828 } 00829 iItem = -1; 00830 // 00831 // FALL THRU 00832 // 00833 00834 case EVENT_OBJECT_SELECTIONADD: 00835 if (plb->wMultiple == MULTIPLESEL) { 00836 uEvent = EVENT_OBJECT_SELECTION; 00837 } 00838 break; 00839 00840 case EVENT_OBJECT_SELECTIONWITHIN: 00841 iItem = -1; 00842 break; 00843 } 00844 00845 NotifyWinEvent(uEvent, HW(plb->spwnd), OBJID_CLIENT, iItem+1); 00846 }

LONG_PTR LBGetItemData PLBIV  ,
INT 
 

Definition at line 176 of file lboxctl1.c.

References tagLBIV::cMac, tagLBIV::fHasData, tagLBIV::fHasStrings, L, LBItem, LBODItem, lpLBODItem, and tagLBIV::rgpch.

Referenced by LBGetText(), ListBoxWndProcWorker(), xxxLBoxDeleteItem(), and xxxLBoxDrawItem().

00179 { 00180 LONG_PTR buffer; 00181 LPBYTE lpItem; 00182 00183 if (sItem < 0 || sItem >= plb->cMac) { 00184 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00185 return LB_ERR; 00186 } 00187 00188 // No-data listboxes always return 0L 00189 // 00190 if (!plb->fHasData) { 00191 return 0L; 00192 } 00193 00194 lpItem = (plb->rgpch + 00195 (sItem * (plb->fHasStrings ? sizeof(LBItem) : sizeof(LBODItem)))); 00196 buffer = (plb->fHasStrings ? ((lpLBItem)lpItem)->itemData : ((lpLBODItem)lpItem)->itemData); 00197 return buffer; 00198 }

BOOL LBGetItemRect PLBIV  ,
INT  ,
LPRECT 
 

Definition at line 179 of file lboxctl2.c.

References _GetClientRect(), BOOL, CItemInWindow(), tagLBIV::cMac, tagLBIV::cxColumn, tagLBIV::cyChar, FALSE, tagLBIV::fHorzBar, tagLBIV::fMultiColumn, tagLBIV::fRightAlign, INT, tagLBIV::itemsPerColumn, tagLBIV::iTop, LBGetVariableHeightItemHeight(), tagLBIV::OwnerDraw, OWNERDRAWVAR, SetRectEmpty, tagLBIV::spwnd, TRUE, UINT, tagLBIV::xOrigin, and tagLBIV::xRightOrigin.

Referenced by CItemInWindowVarOwnerDraw(), ISelFromPt(), LBCalcVarITopScrollAmt(), ListBoxWndProcWorker(), xxxInvertLBItem(), xxxLBoxCtlDelete(), xxxLBPaint(), xxxLBSelRange(), xxxLBSetCaret(), xxxLBSetSel(), and xxxLBSize().

00183 { 00184 INT sTmp; 00185 int clientbottom; 00186 00187 /* 00188 * Always allow an item number of 0 so that we can draw the caret which 00189 * indicates the listbox has the focus even though it is empty. 00190 00191 * FreeHand 3.1 passes in -1 as the itemNumber and expects 00192 * a non-null rectangle. So we check for -1 specifically. 00193 * BUGTAG: Fix for Bug #540 --Win95B-- SANKAR -- 2/20/95 -- 00194 */ 00195 00196 if (sItem && (sItem != -1) && ((UINT)sItem >= (UINT)plb->cMac)) 00197 { 00198 SetRectEmpty(lprc); 00199 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00200 return (LB_ERR); 00201 } 00202 00203 _GetClientRect(plb->spwnd, lprc); 00204 00205 if (plb->fMultiColumn) { 00206 00207 /* 00208 * itemHeight * sItem mod number ItemsPerColumn (itemsPerColumn) 00209 */ 00210 lprc->top = plb->cyChar * (sItem % plb->itemsPerColumn); 00211 lprc->bottom = lprc->top + plb->cyChar /*+(plb->OwnerDraw ? 0 : 1)*/; 00212 00213 UserAssert(plb->itemsPerColumn); 00214 00215 if (plb->fRightAlign) { 00216 lprc->right = lprc->right - plb->cxColumn * 00217 ((sItem / plb->itemsPerColumn) - (plb->iTop / plb->itemsPerColumn)); 00218 00219 lprc->left = lprc->right - plb->cxColumn; 00220 } else { 00221 /* 00222 * Remember, this is integer division here... 00223 */ 00224 lprc->left += plb->cxColumn * 00225 ((sItem / plb->itemsPerColumn) - (plb->iTop / plb->itemsPerColumn)); 00226 00227 lprc->right = lprc->left + plb->cxColumn; 00228 } 00229 } else if (plb->OwnerDraw == OWNERDRAWVAR) { 00230 00231 /* 00232 * Var height owner draw 00233 */ 00234 lprc->right += plb->xOrigin; 00235 clientbottom = lprc->bottom; 00236 00237 if (sItem >= plb->iTop) { 00238 for (sTmp = plb->iTop; sTmp < sItem; sTmp++) { 00239 lprc->top = lprc->top + LBGetVariableHeightItemHeight(plb, sTmp); 00240 } 00241 00242 /* 00243 * If item number is 0, it may be we are asking for the rect 00244 * associated with a nonexistant item so that we can draw a caret 00245 * indicating focus on an empty listbox. 00246 */ 00247 lprc->bottom = lprc->top + (sItem < plb->cMac ? LBGetVariableHeightItemHeight(plb, sItem) : plb->cyChar); 00248 return (lprc->top < clientbottom); 00249 } else { 00250 00251 /* 00252 * Item we want the rect of is before plb->iTop. Thus, negative 00253 * offsets for the rect and it is never visible. 00254 */ 00255 for (sTmp = sItem; sTmp < plb->iTop; sTmp++) { 00256 lprc->top = lprc->top - LBGetVariableHeightItemHeight(plb, sTmp); 00257 } 00258 lprc->bottom = lprc->top + LBGetVariableHeightItemHeight(plb, sItem); 00259 return FALSE; 00260 } 00261 } else { 00262 00263 /* 00264 * For fixed height listboxes 00265 */ 00266 if (plb->fRightAlign && !(plb->fMultiColumn || plb->OwnerDraw) && plb->fHorzBar) 00267 lprc->right += plb->xOrigin + (plb->xRightOrigin - plb->xOrigin); 00268 else 00269 lprc->right += plb->xOrigin; 00270 lprc->top = (sItem - plb->iTop) * plb->cyChar; 00271 lprc->bottom = lprc->top + plb->cyChar; 00272 } 00273 00274 return (sItem >= plb->iTop) && 00275 (sItem < (plb->iTop + CItemInWindow(plb, TRUE))); 00276 }

int LBGetSetItemHeightHandler PLBIV  plb,
UINT  message,
int  item,
UINT  height
 

Definition at line 759 of file lboxrare.c.

References tagLBIV::cMac, tagLBIV::cyChar, tagLBIV::fMultiColumn, INT, LBCalcItemRowsAndColumns(), LBGetVariableHeightItemHeight(), LBSetCItemFullMax(), LBSetVariableHeightItemHeight(), tagLBIV::OwnerDraw, and OWNERDRAWVAR.

Referenced by ListBoxWndProcWorker().

00764 { 00765 if (message == LB_GETITEMHEIGHT) { 00766 /* 00767 * All items are same height for non ownerdraw and for fixed height 00768 * ownerdraw. 00769 */ 00770 if (plb->OwnerDraw != OWNERDRAWVAR) 00771 return plb->cyChar; 00772 00773 if (plb->cMac && item >= plb->cMac) { 00774 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00775 return LB_ERR; 00776 } 00777 00778 return (int)LBGetVariableHeightItemHeight(plb, (INT)item); 00779 } 00780 00781 if (!height || height > 255) { 00782 RIPERR1(ERROR_INVALID_PARAMETER, 00783 RIP_WARNING, 00784 "Invalid parameter \"height\" (%ld) to LBGetSetItemHeightHandler", 00785 height); 00786 00787 return LB_ERR; 00788 } 00789 00790 if (plb->OwnerDraw != OWNERDRAWVAR) 00791 plb->cyChar = height; 00792 else { 00793 if (item < 0 || item >= plb->cMac) { 00794 RIPERR1(ERROR_INVALID_PARAMETER, 00795 RIP_WARNING, 00796 "Invalid parameter \"item\" (%ld) to LBGetSetItemHeightHandler", 00797 item); 00798 00799 return LB_ERR; 00800 } 00801 00802 LBSetVariableHeightItemHeight(plb, (INT)item, (INT)height); 00803 } 00804 00805 if (plb->fMultiColumn) 00806 LBCalcItemRowsAndColumns(plb); 00807 00808 LBSetCItemFullMax(plb); 00809 00810 return(0); 00811 }

INT LBGetText PLBIV  ,
BOOL  ,
BOOL  ,
INT  ,
LPWSTR 
 

Definition at line 214 of file lboxctl1.c.

References tagLBIV::cMac, FALSE, tagLBIV::fHasStrings, GetLpszItem(), INT, LBGetItemData(), tagLBIV::OwnerDraw, and RtlUnicodeToMultiByteSize().

Referenced by ListBoxWndProcWorker().

00220 { 00221 LPWSTR lpItemText; 00222 INT cchText; 00223 00224 if (index < 0 || index >= plb->cMac) { 00225 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00226 return LB_ERR; 00227 } 00228 00229 if (!plb->fHasStrings && plb->OwnerDraw) { 00230 00231 /* 00232 * Owner draw without strings so we must copy the app supplied DWORD 00233 * value. 00234 */ 00235 cchText = sizeof(ULONG_PTR); 00236 00237 if (!fLengthOnly) { 00238 LONG_PTR UNALIGNED *p = (LONG_PTR UNALIGNED *)lpbuffer; 00239 *p = LBGetItemData(plb, index); 00240 } 00241 } else { 00242 lpItemText = GetLpszItem(plb, index); 00243 if (!lpItemText) 00244 return LB_ERR; 00245 00246 /* 00247 * These are strings so we are copying the text and we must include 00248 * the terminating 0 when doing the RtlMoveMemory. 00249 */ 00250 cchText = wcslen(lpItemText); 00251 00252 if (fLengthOnly) { 00253 if (fAnsi) 00254 RtlUnicodeToMultiByteSize(&cchText, lpItemText, cchText*sizeof(WCHAR)); 00255 } else { 00256 if (fAnsi) { 00257 #ifdef FE_SB // LBGetText() 00258 cchText = WCSToMB(lpItemText, cchText+1, &((LPSTR)lpbuffer), (cchText+1)*sizeof(WORD), FALSE); 00259 /* 00260 * Here.. cchText contains null-terminate char, subtract it... Because, we pass cchText+1 to 00261 * above Unicode->Ansi convertsion to make sure the string is terminated with null. 00262 */ 00263 cchText--; 00264 #else 00265 WCSToMB(lpItemText, cchText+1, &((LPSTR)lpbuffer), cchText+1, FALSE); 00266 #endif // FE_SB 00267 } else { 00268 RtlCopyMemory(lpbuffer, lpItemText, (cchText+1)*sizeof(WCHAR)); 00269 } 00270 } 00271 00272 } 00273 00274 return cchText; 00275 }

INT LBGetVariableHeightItemHeight PLBIV  ,
INT 
 

Definition at line 25 of file lboxvar.c.

References BYTE, tagLBIV::cMac, tagLBIV::fHasStrings, gpsi, INT, tagLBIV::rgpch, UINT, and tagLBIV::wMultiple.

Referenced by LBGetItemRect(), LBGetSetItemHeightHandler(), LBPage(), and LBSetCItemFullMax().

00028 { 00029 BYTE itemHeight; 00030 int offsetHeight; 00031 00032 if (plb->cMac) { 00033 if (plb->fHasStrings) 00034 offsetHeight = plb->cMac * sizeof(LBItem); 00035 else 00036 offsetHeight = plb->cMac * sizeof(LBODItem); 00037 00038 if (plb->wMultiple) 00039 offsetHeight += plb->cMac; 00040 00041 offsetHeight += itemNumber; 00042 00043 itemHeight = *(plb->rgpch+(UINT)offsetHeight); 00044 00045 return (INT)itemHeight; 00046 00047 } 00048 00049 /* 00050 *Default, we return the height of the system font. This is so we can draw 00051 * the focus rect even though there are no items in the listbox. 00052 */ 00053 return gpsi->cySysFontChar; 00054 }

INT LBoxGetSelItems PLBIV  ,
BOOL  ,
INT  ,
LPINT 
 

Referenced by ListBoxWndProcWorker().

INT LBPage PLBIV  ,
INT  ,
BOOL 
 

Definition at line 157 of file lboxvar.c.

References _GetClientRect(), tagLBIV::cMac, INT, LBGetVariableHeightItemHeight(), max, min, and tagLBIV::spwnd.

Referenced by xxxInsureVisible(), xxxLBoxCtlKeyInput(), and xxxLBoxCtlScroll().

00161 { 00162 INT i; 00163 INT height; 00164 RECT rc; 00165 00166 if (plb->cMac == 1) 00167 return(0); 00168 00169 _GetClientRect(plb->spwnd, &rc); 00170 height = rc.bottom; 00171 i = startItem; 00172 00173 if (fPageForwardDirection) { 00174 while ((height >= 0) && (i < plb->cMac)) 00175 height -= LBGetVariableHeightItemHeight(plb, i++); 00176 00177 return((height >= 0) ? plb->cMac - 1 : max(i - 2, startItem + 1)); 00178 } else { 00179 while ((height >= 0) && (i >= 0)) 00180 height -= LBGetVariableHeightItemHeight(plb, i--); 00181 00182 return((height >= 0) ? 0 : min(i + 2, startItem - 1)); 00183 } 00184 00185 }

VOID LBSetCItemFullMax PLBIV  plb  ) 
 

Definition at line 25 of file lboxrare.c.

References _GetClientRect(), tagLBIV::cItemFullMax, CItemInWindow(), tagLBIV::cMac, FALSE, LBGetVariableHeightItemHeight(), tagLBIV::OwnerDraw, OWNERDRAWVAR, and tagLBIV::spwnd.

Referenced by LBGetSetItemHeightHandler(), xxxLBCreate(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBSetFont(), and xxxLBSize().

00027 { 00028 if (plb->OwnerDraw != OWNERDRAWVAR) { 00029 plb->cItemFullMax = CItemInWindow(plb, FALSE); 00030 } else if (plb->cMac < 2) { 00031 plb->cItemFullMax = 1; 00032 } else { 00033 int height; 00034 RECT rect; 00035 int i; 00036 int j = 0; 00037 00038 _GetClientRect(plb->spwnd, &rect); 00039 height = rect.bottom; 00040 00041 plb->cItemFullMax = 0; 00042 for (i = plb->cMac - 1; i >= 0; i--, j++) { 00043 height -= LBGetVariableHeightItemHeight(plb, i); 00044 00045 if (height < 0) { 00046 plb->cItemFullMax = j; 00047 break; 00048 } 00049 } 00050 if (!plb->cItemFullMax) 00051 plb->cItemFullMax = j; 00052 } 00053 }

int LBSetItemData PLBIV  ,
INT  ,
LONG_PTR 
 

Referenced by ListBoxWndProcWorker().

BOOL LBSetTabStops PLBIV  ,
INT  ,
LPINT 
 

Definition at line 652 of file lboxrare.c.

References BOOL, tagLBIV::cxChar, FALSE, tagLBIV::fUseTabStops, tagLBIV::iTabPixelPositions, MultDiv, NULL, PINT, TRUE, UserLocalAlloc, and UserLocalFree.

Referenced by ListBoxWndProcWorker(), and xxxLBCreate().

00656 { 00657 PINT ptabs; 00658 00659 if (!plb->fUseTabStops) { 00660 RIPERR0(ERROR_LB_WITHOUT_TABSTOPS, RIP_VERBOSE, ""); 00661 return FALSE; 00662 } 00663 00664 if (count) { 00665 /* 00666 * Allocate memory for the tab stops. The first byte in the 00667 * plb->iTabPixelPositions array will contain a count of the number 00668 * of tab stop positions we have. 00669 */ 00670 ptabs = (LPINT)UserLocalAlloc(HEAP_ZERO_MEMORY, (count + 1) * sizeof(int)); 00671 if (ptabs == NULL) 00672 return FALSE; 00673 00674 if (plb->iTabPixelPositions != NULL) 00675 UserLocalFree(plb->iTabPixelPositions); 00676 plb->iTabPixelPositions = ptabs; 00677 00678 /* 00679 * Set the count of tab stops 00680 */ 00681 *ptabs++ = count; 00682 00683 for (; count > 0; count--) { 00684 00685 /* 00686 * Convert the dialog unit tabstops into pixel position tab stops. 00687 */ 00688 *ptabs++ = MultDiv(*lptabstops, plb->cxChar, 4); 00689 lptabstops++; 00690 } 00691 } else { 00692 00693 /* 00694 * Set default 8 system font ave char width tabs. So free the memory 00695 * associated with the tab stop list. 00696 */ 00697 if (plb->iTabPixelPositions != NULL) { 00698 UserLocalFree((HANDLE)plb->iTabPixelPositions); 00699 plb->iTabPixelPositions = NULL; 00700 } 00701 } 00702 00703 return TRUE; 00704 }

VOID LBSetVariableHeightItemHeight PLBIV  ,
INT  ,
INT 
 

Definition at line 67 of file lboxvar.c.

References BYTE, tagLBIV::cMac, tagLBIV::fHasStrings, tagLBIV::rgpch, UINT, and tagLBIV::wMultiple.

Referenced by LBGetSetItemHeightHandler().

00071 { 00072 int offsetHeight; 00073 00074 if (plb->fHasStrings) 00075 offsetHeight = plb->cMac * sizeof(LBItem); 00076 else 00077 offsetHeight = plb->cMac * sizeof(LBODItem); 00078 00079 if (plb->wMultiple) 00080 offsetHeight += plb->cMac; 00081 00082 offsetHeight += itemNumber; 00083 00084 *(plb->rgpch + (UINT)offsetHeight) = (BYTE)itemHeight; 00085 00086 }

LRESULT APIENTRY ListBoxWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 744 of file lb1.c.

References DefWindowProcWorker(), FNID_LISTBOX, FWINDOWMSG, L, ListBoxWndProcWorker(), NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

00749 { 00750 PWND pwnd; 00751 00752 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00753 return (0L); 00754 } 00755 00756 /* 00757 * If the control is not interested in this message, 00758 * pass it to DefWindowProc. 00759 */ 00760 if (!FWINDOWMSG(message, FNID_LISTBOX)) 00761 return DefWindowProcWorker(pwnd, message, wParam, lParam, TRUE); 00762 00763 return ListBoxWndProcWorker(pwnd, message, wParam, lParam, TRUE); 00764 }

LRESULT APIENTRY ListBoxWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 766 of file lb1.c.

References DefWindowProcWorker(), FALSE, FNID_LISTBOX, FWINDOWMSG, L, ListBoxWndProcWorker(), NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

00771 { 00772 PWND pwnd; 00773 00774 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 00775 return (0L); 00776 } 00777 00778 /* 00779 * If the control is not interested in this message, 00780 * pass it to DefWindowProc. 00781 */ 00782 if (!FWINDOWMSG(message, FNID_LISTBOX)) 00783 return DefWindowProcWorker(pwnd, message, wParam, lParam, FALSE); 00784 00785 return ListBoxWndProcWorker(pwnd, message, wParam, lParam, FALSE); 00786 }

LRESULT ListBoxWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 32 of file lb1.c.

References _GetClientRect(), _IsWindowVisible(), _ScreenToClient(), APIENTRY, BOOL, CaretCreate, CheckLock, tagLBIV::cItemFullMax, tagLBIV::cMac, tagLBIV::cxChar, tagLBIV::cxColumn, DefWindowProcWorker(), tagLBIV::dwLocaleId, DWORD, EnterReaderModeHelper(), EQ, FALSE, tagLBIV::fCaptured, tagLBIV::fHasStrings, tagLBIV::fHorzBar, tagLBIV::fIgnoreSizeMsg, FillWindow, tagLBIV::fMultiColumn, FNID_LISTBOX, tagLBIV::fRightAlign, tagLBIV::fRtoLReading, FWINABLE, gcWheelDelta, GET_X_LPARAM, GET_Y_LPARAM, gpsi, tagLBIV::hFont, HW, HWq, IDSYS_LBSEARCH, tagLBIV::iLastMouseMove, tagLBIV::iLastSelection, tagLBIV::iMouseDown, INITCONTROLLOOKASIDE, INT, tagLBIV::iSel, tagLBIV::iSelBase, ISelFromPt(), IsLBoxVisible, IsSelected(), tagLBIV::itemsPerColumn, tagLBIV::iTop, tagLBIV::iTypeSearch, LBCalcItemRowsAndColumns(), LBDropObjectHandler(), LBEvent(), LBGetItemData(), LBGetItemRect(), LBGetSetItemHeightHandler(), LBGetText(), LBI_ADD, LBIV, LBoxGetSelItems(), LBSetItemData(), LBSetTabStops(), LBUP_NOTIFY, LBUP_RELEASECAPTURE, LBUP_RESETSELECTION, LBUP_SELCHANGE, ListboxLookaside, LOWERCASE, max, tagLBIV::maxWidth, min, NtUserAlterWindowStyle(), NtUserBeginPaint(), NtUserEndPaint(), NtUserInvalidateRect(), NtUserKillTimer(), NtUserSetCapture(), NULL, tagLBIV::numberOfColumns, tagLBIV::OwnerDraw, tagLBIV::pcbox, PREFIX, tagLBIV::pszTypeSearch, tagLBIV::ptPrev, SELONLY, SendMessage(), SINGLESEL, tagLBIV::spwnd, tagLBIV::spwndParent, TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, UPPERCASE, UserLocalFree, VALIDATECLASSANDSIZE, WEFRIGHT, WEFRTLREADING, WFWIN40COMPAT, tagLBIV::wMultiple, tagLBIV::xOrigin, xxxCaretDestroy(), xxxCheckRedraw(), xxxDestroyLBox(), xxxFindString(), xxxInsureVisible(), xxxInvertLBItem(), xxxLBButtonUp(), xxxLBCreate(), xxxLbDir(), xxxLBInitStorage(), xxxLbInsertFile(), xxxLBInsertItem(), xxxLBInvalidateRect(), xxxLBoxCtlCharInput(), xxxLBoxCtlDelete(), xxxLBoxCtlHScroll(), xxxLBoxCtlHScrollMultiColumn(), xxxLBoxCtlKeyInput(), xxxLBoxCtlScroll(), xxxLBPaint(), xxxLBResetContent(), xxxLBSelRange(), xxxLBSetCaret(), xxxLBSetCount(), xxxLBSetCurSel(), xxxLBSetFont(), xxxLBSetRedraw(), xxxLBSetSel(), xxxLBShowHideScrollBars(), xxxLBSize(), xxxNewITop(), xxxNotifyOwner(), xxxSetISelBase(), and xxxTrackMouse().

Referenced by ClientThreadSetup(), ComboListBoxWndProcA(), ComboListBoxWndProcW(), ListBoxWndProcA(), and ListBoxWndProcW().

00038 { 00039 HWND hwnd = HWq(pwnd); 00040 PAINTSTRUCT ps; 00041 HDC hdc; 00042 LPRECT lprc; 00043 PLBIV plb; /* List Box Instance Variable */ 00044 INT iSel; /* Index of selected item */ 00045 DWORD dw; 00046 TL tlpwndParent; 00047 UINT wFlags; 00048 LPWSTR lpwsz = NULL; 00049 LRESULT lReturn = 0; 00050 static BOOL fInit = TRUE; 00051 00052 CheckLock(pwnd); 00053 00054 VALIDATECLASSANDSIZE(pwnd, FNID_LISTBOX); 00055 INITCONTROLLOOKASIDE(&ListboxLookaside, LBIV, spwnd, 4); 00056 00057 /* 00058 * Get the plb for the given window now since we will use it a lot in 00059 * various handlers. This was stored using SetWindowLong(hwnd,0,plb) 00060 * when the listbox was first created (by INITCONTROLLOOKASIDE above) 00061 */ 00062 plb = ((PLBWND)pwnd)->pLBIV; 00063 00064 /* 00065 * Handle ANSI translations of input parameters 00066 */ 00067 if (fAnsi) { 00068 switch (message) { 00069 case LB_ADDSTRING: 00070 case LB_ADDSTRINGUPPER: 00071 case LB_ADDSTRINGLOWER: 00072 case LB_FINDSTRING: 00073 case LB_FINDSTRINGEXACT: 00074 case LB_INSERTSTRING: 00075 case LB_INSERTSTRINGUPPER: 00076 case LB_INSERTSTRINGLOWER: 00077 case LB_SELECTSTRING: 00078 if (!plb->fHasStrings) { 00079 break; 00080 } 00081 // Fall through... 00082 case LB_ADDFILE: 00083 case LB_DIR: 00084 if (lParam) { 00085 if (!MBToWCS((LPSTR)lParam, -1, &lpwsz, -1, TRUE)) 00086 return LB_ERR; 00087 } 00088 break; 00089 default: 00090 break; 00091 } 00092 if (lpwsz) { 00093 lParam = (LPARAM)lpwsz; 00094 } 00095 } 00096 00097 switch (message) { 00098 00099 case LB_GETTOPINDEX: // Return index of top item displayed. 00100 return plb->iTop; 00101 00102 case LB_SETTOPINDEX: 00103 if (wParam && ((INT)wParam < 0 || (INT)wParam >= plb->cMac)) { 00104 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00105 return LB_ERR; 00106 } 00107 if (plb->cMac) { 00108 xxxNewITop(plb, (INT)wParam); 00109 } 00110 break; 00111 00112 case WM_STYLECHANGED: 00113 plb->fRtoLReading = (TestWF(pwnd, WEFRTLREADING) != 0); 00114 plb->fRightAlign = (TestWF(pwnd, WEFRIGHT) != 0); 00115 xxxCheckRedraw(plb, FALSE, 0); 00116 break; 00117 00118 case WM_WINDOWPOSCHANGED: 00119 00120 /* 00121 * If we are in the middle of creation, ignore this 00122 * message because it will generate a WM_SIZE message. 00123 * See xxxLBCreate(). 00124 */ 00125 if (!plb->fIgnoreSizeMsg) 00126 goto CallDWP; 00127 break; 00128 00129 case WM_SIZE: 00130 00131 /* 00132 * If we are in the middle of creation, ignore size 00133 * messages. See xxxLBCreate(). 00134 */ 00135 if (!plb->fIgnoreSizeMsg) 00136 xxxLBSize(plb, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); 00137 break; 00138 00139 case WM_ERASEBKGND: 00140 ThreadLock(plb->spwndParent, &tlpwndParent); 00141 FillWindow(HW(plb->spwndParent), hwnd, (HDC)wParam, 00142 (HBRUSH)CTLCOLOR_LISTBOX); 00143 ThreadUnlock(&tlpwndParent); 00144 return TRUE; 00145 00146 case LB_RESETCONTENT: 00147 xxxLBResetContent(plb); 00148 break; 00149 00150 case WM_TIMER: 00151 if (wParam == IDSYS_LBSEARCH) { 00152 plb->iTypeSearch = 0; 00153 NtUserKillTimer(hwnd, IDSYS_LBSEARCH); 00154 xxxInvertLBItem(plb, plb->iSel, TRUE); 00155 break; 00156 } 00157 00158 message = WM_MOUSEMOVE; 00159 xxxTrackMouse(plb, message, plb->ptPrev); 00160 break; 00161 00162 /* 00163 * Fall through 00164 */ 00165 case WM_MOUSEMOVE: 00166 case WM_LBUTTONDOWN: 00167 case WM_LBUTTONUP: 00168 case WM_LBUTTONDBLCLK: 00169 { 00170 POINT pt; 00171 00172 POINTSTOPOINT(pt, lParam); 00173 xxxTrackMouse(plb, message, pt); 00174 } 00175 break; 00176 00177 case WM_MBUTTONDOWN: 00178 EnterReaderModeHelper(hwnd); 00179 break; 00180 00181 case WM_CAPTURECHANGED: 00182 // 00183 // Note that this message should be handled only on unexpected 00184 // capture changes currently. 00185 // 00186 UserAssert(TestWF(pwnd, WFWIN40COMPAT)); 00187 if (plb->fCaptured) 00188 xxxLBButtonUp(plb, LBUP_NOTIFY); 00189 break; 00190 00191 case LBCB_STARTTRACK: 00192 // 00193 // Start tracking mouse moves in the listbox, setting capture 00194 // 00195 if (!plb->pcbox) 00196 break; 00197 00198 plb->fCaptured = FALSE; 00199 if (wParam) { 00200 POINT pt; 00201 00202 POINTSTOPOINT(pt, lParam); 00203 00204 _ScreenToClient(pwnd, &pt); 00205 xxxTrackMouse(plb, WM_LBUTTONDOWN, pt); 00206 } else { 00207 NtUserSetCapture(hwnd); 00208 plb->fCaptured = TRUE; 00209 plb->iLastSelection = plb->iSel; 00210 } 00211 break; 00212 00213 case LBCB_ENDTRACK: 00214 // Kill capture, tracking, etc. 00215 if (plb->fCaptured) 00216 xxxLBButtonUp(plb, LBUP_RELEASECAPTURE | (wParam ? LBUP_SELCHANGE : 00217 LBUP_RESETSELECTION)); 00218 break; 00219 00220 case WM_PRINTCLIENT: 00221 xxxLBPaint(plb, (HDC) wParam, NULL); 00222 break; 00223 00224 case WM_PAINT: 00225 if (wParam) { 00226 hdc = (HDC) wParam; 00227 lprc = NULL; 00228 } else { 00229 hdc = NtUserBeginPaint(hwnd, &ps); 00230 lprc = &(ps.rcPaint); 00231 } 00232 00233 if (IsLBoxVisible(plb)) 00234 xxxLBPaint(plb, hdc, lprc); 00235 00236 if (!wParam) 00237 NtUserEndPaint(hwnd, &ps); 00238 break; 00239 00240 case WM_NCDESTROY: 00241 case WM_FINALDESTROY: 00242 xxxDestroyLBox(plb, pwnd); 00243 break; 00244 00245 case WM_SETFOCUS: 00246 // DISABLED in Win 3.1 xxxUpdateWindow(pwnd); 00247 CaretCreate(plb); 00248 xxxLBSetCaret(plb, TRUE); 00249 xxxNotifyOwner(plb, LBN_SETFOCUS); 00250 if (FWINABLE()) { 00251 if (_IsWindowVisible(pwnd)) { 00252 LBEvent(plb, EVENT_OBJECT_FOCUS, plb->iSelBase); 00253 } 00254 } 00255 break; 00256 00257 case WM_KILLFOCUS: 00258 /* 00259 * Reset the wheel delta count. 00260 */ 00261 gcWheelDelta = 0; 00262 00263 xxxLBSetCaret(plb, FALSE); 00264 xxxCaretDestroy(plb); 00265 xxxNotifyOwner(plb, LBN_KILLFOCUS); 00266 if (plb->iTypeSearch) { 00267 plb->iTypeSearch = 0; 00268 NtUserKillTimer(hwnd, IDSYS_LBSEARCH); 00269 } 00270 if (plb->pszTypeSearch) { 00271 UserLocalFree(plb->pszTypeSearch); 00272 plb->pszTypeSearch = NULL; 00273 } 00274 break; 00275 00276 case WM_MOUSEWHEEL: 00277 { 00278 int cDetants; 00279 int cPage; 00280 int cLines; 00281 RECT rc; 00282 int windowWidth; 00283 int cPos; 00284 00285 /* 00286 * Don't handle zoom and datazoom. 00287 */ 00288 if (wParam & (MK_SHIFT | MK_CONTROL)) { 00289 goto CallDWP; 00290 } 00291 00292 lReturn = 1; 00293 gcWheelDelta -= (short) HIWORD(wParam); 00294 cDetants = gcWheelDelta / WHEEL_DELTA; 00295 if ( cDetants != 0 && 00296 gpsi->ucWheelScrollLines > 0 && 00297 (pwnd->style & (WS_VSCROLL | WS_HSCROLL))) { 00298 00299 gcWheelDelta = gcWheelDelta % WHEEL_DELTA; 00300 00301 if (pwnd->style & WS_VSCROLL) { 00302 cPage = max(1, (plb->cItemFullMax - 1)); 00303 cLines = cDetants * 00304 (int) min((UINT) cPage, gpsi->ucWheelScrollLines); 00305 00306 cPos = max(0, min(plb->iTop + cLines, plb->cMac - 1)); 00307 if (cPos != plb->iTop) { 00308 xxxLBoxCtlScroll(plb, SB_THUMBPOSITION, cPos); 00309 xxxLBoxCtlScroll(plb, SB_ENDSCROLL, 0); 00310 } 00311 } else if (plb->fMultiColumn) { 00312 cPage = max(1, plb->numberOfColumns); 00313 cLines = cDetants * (int) min((UINT) cPage, gpsi->ucWheelScrollLines); 00314 cPos = max( 00315 0, 00316 min((plb->iTop / plb->itemsPerColumn) + cLines, 00317 plb->cMac - 1 - ((plb->cMac - 1) % plb->itemsPerColumn))); 00318 00319 if (cPos != plb->iTop) { 00320 xxxLBoxCtlHScrollMultiColumn(plb, SB_THUMBPOSITION, cPos); 00321 xxxLBoxCtlHScrollMultiColumn(plb, SB_ENDSCROLL, 0); 00322 } 00323 } else { 00324 _GetClientRect(plb->spwnd, &rc); 00325 windowWidth = rc.right; 00326 cPage = max(plb->cxChar, (windowWidth / 3) * 2) / 00327 plb->cxChar; 00328 00329 cLines = cDetants * 00330 (int) min((UINT) cPage, gpsi->ucWheelScrollLines); 00331 00332 cPos = max( 00333 0, 00334 min(plb->xOrigin + (cLines * plb->cxChar), 00335 plb->maxWidth)); 00336 00337 if (cPos != plb->xOrigin) { 00338 xxxLBoxCtlHScroll(plb, SB_THUMBPOSITION, cPos); 00339 xxxLBoxCtlHScroll(plb, SB_ENDSCROLL, 0); 00340 } 00341 } 00342 } 00343 } 00344 break; 00345 00346 case WM_VSCROLL: 00347 xxxLBoxCtlScroll(plb, LOWORD(wParam), HIWORD(wParam)); 00348 break; 00349 00350 case WM_HSCROLL: 00351 xxxLBoxCtlHScroll(plb, LOWORD(wParam), HIWORD(wParam)); 00352 break; 00353 00354 case WM_GETDLGCODE: 00355 return DLGC_WANTARROWS | DLGC_WANTCHARS; 00356 00357 case WM_CREATE: 00358 return xxxLBCreate(plb, pwnd, (LPCREATESTRUCT) lParam); 00359 00360 case WM_SETREDRAW: 00361 00362 /* 00363 * If wParam is nonzero, the redraw flag is set 00364 * If wParam is zero, the flag is cleared 00365 */ 00366 xxxLBSetRedraw(plb, (wParam != 0)); 00367 break; 00368 00369 case WM_ENABLE: 00370 xxxLBInvalidateRect(plb, NULL, !plb->OwnerDraw); 00371 break; 00372 00373 case WM_SETFONT: 00374 xxxLBSetFont(plb, (HANDLE)wParam, LOWORD(lParam)); 00375 break; 00376 00377 case WM_GETFONT: 00378 return (LRESULT)plb->hFont; 00379 00380 case WM_DRAGSELECT: 00381 case WM_DRAGLOOP: 00382 case WM_DRAGMOVE: 00383 case WM_DROPFILES: 00384 ThreadLock(plb->spwndParent, &tlpwndParent); 00385 lReturn = SendMessage(HW(plb->spwndParent), message, wParam, lParam); 00386 ThreadUnlock(&tlpwndParent); 00387 return lReturn; 00388 00389 00390 case WM_QUERYDROPOBJECT: 00391 case WM_DROPOBJECT: 00392 00393 /* 00394 * fix up control data, then pass message to parent 00395 */ 00396 LBDropObjectHandler(plb, (PDROPSTRUCT)lParam); 00397 ThreadLock(plb->spwndParent, &tlpwndParent); 00398 lReturn = SendMessage(HW(plb->spwndParent), message, wParam, lParam); 00399 ThreadUnlock(&tlpwndParent); 00400 return lReturn; 00401 00402 case LB_GETITEMRECT: 00403 return LBGetItemRect(plb, (INT)wParam, (LPRECT)lParam); 00404 00405 case LB_GETITEMDATA: 00406 return LBGetItemData(plb, (INT)wParam); // wParam = item index 00407 00408 case LB_SETITEMDATA: 00409 00410 /* 00411 * wParam is item index 00412 */ 00413 return LBSetItemData(plb, (INT)wParam, lParam); 00414 00415 case LB_ADDSTRINGUPPER: 00416 wFlags = UPPERCASE | LBI_ADD; 00417 goto CallInsertItem; 00418 00419 case LB_ADDSTRINGLOWER: 00420 wFlags = LOWERCASE | LBI_ADD; 00421 goto CallInsertItem; 00422 00423 case LB_ADDSTRING: 00424 wFlags = LBI_ADD; 00425 goto CallInsertItem; 00426 00427 case LB_INSERTSTRINGUPPER: 00428 wFlags = UPPERCASE; 00429 goto CallInsertItem; 00430 00431 case LB_INSERTSTRINGLOWER: 00432 wFlags = LOWERCASE; 00433 goto CallInsertItem; 00434 00435 case LB_INSERTSTRING: 00436 wFlags = 0; 00437 CallInsertItem: 00438 lReturn = ((LRESULT) xxxLBInsertItem(plb, (LPWSTR) lParam, (int) wParam, wFlags)); 00439 break; 00440 00441 case LB_INITSTORAGE: 00442 return xxxLBInitStorage(plb, fAnsi, (INT)wParam, (INT)lParam); 00443 00444 case LB_DELETESTRING: 00445 return xxxLBoxCtlDelete(plb, (INT)wParam); 00446 00447 case LB_DIR: 00448 /* 00449 * wParam - Dos attribute value. 00450 * lParam - Points to a file specification string 00451 */ 00452 lReturn = xxxLbDir(plb, (INT)wParam, (LPWSTR)lParam); 00453 break; 00454 00455 case LB_ADDFILE: 00456 lReturn = xxxLbInsertFile(plb, (LPWSTR)lParam); 00457 break; 00458 00459 case LB_SETSEL: 00460 return xxxLBSetSel(plb, (wParam != 0), (INT)lParam); 00461 00462 case LB_SETCURSEL: 00463 /* 00464 * If window obscured, update so invert will work correctly 00465 */ 00466 // DISABLED in Win 3.1 xxxUpdateWindow(pwnd); 00467 return xxxLBSetCurSel(plb, (INT)wParam); 00468 00469 case LB_GETSEL: 00470 if (wParam >= (UINT) plb->cMac) 00471 return((LRESULT) LB_ERR); 00472 00473 return IsSelected(plb, (INT)wParam, SELONLY); 00474 00475 case LB_GETCURSEL: 00476 if (plb->wMultiple == SINGLESEL) { 00477 return plb->iSel; 00478 } 00479 return plb->iSelBase; 00480 00481 case LB_SELITEMRANGE: 00482 if (plb->wMultiple == SINGLESEL) { 00483 /* 00484 * Can't select a range if only single selections are enabled 00485 */ 00486 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE,"Invalid index passed to LB_SELITEMRANGE"); 00487 return LB_ERR; 00488 } 00489 00490 xxxLBSelRange(plb, LOWORD(lParam), HIWORD(lParam), (wParam != 0)); 00491 break; 00492 00493 case LB_SELITEMRANGEEX: 00494 if (plb->wMultiple == SINGLESEL) { 00495 /* 00496 * Can't select a range if only single selections are enabled 00497 */ 00498 RIPERR0(ERROR_INVALID_LB_MESSAGE, RIP_VERBOSE,"LB_SELITEMRANGEEX:Can't select a range if only single selections are enabled"); 00499 return LB_ERR; 00500 } else { 00501 BOOL fHighlight = ((DWORD)lParam > (DWORD)wParam); 00502 if (fHighlight == FALSE) { 00503 ULONG_PTR temp = lParam; 00504 lParam = wParam; 00505 wParam = temp; 00506 } 00507 xxxLBSelRange(plb, (INT)wParam, (INT)lParam, fHighlight); 00508 } 00509 break; 00510 00511 case LB_GETTEXTLEN: 00512 if (lParam != 0) { 00513 RIPMSG1(RIP_WARNING, "LB_GETTEXTLEN with lParam = %lx\n", lParam); 00514 } 00515 lReturn = LBGetText(plb, TRUE, fAnsi, (INT)wParam, NULL); 00516 break; 00517 00518 case LB_GETTEXT: 00519 lReturn = LBGetText(plb, FALSE, fAnsi, (INT)wParam, (LPWSTR)lParam); 00520 break; 00521 00522 case LB_GETCOUNT: 00523 // Lotus Approach calls CallWndProc(ListWndProc, LB_GETCOUNT,...) 00524 // on a window that doesn't have a plb yet. So, we need to make 00525 // this check. Bug #6675 - 11/7/94 -- 00526 if(plb) 00527 return((LRESULT) plb->cMac); 00528 else 00529 return(0); 00530 00531 case LB_SETCOUNT: 00532 return xxxLBSetCount(plb, (INT)wParam); 00533 00534 case LB_SELECTSTRING: 00535 case LB_FINDSTRING: 00536 iSel = xxxFindString(plb, (LPWSTR)lParam, (INT)wParam, PREFIX, TRUE); 00537 if (message == LB_FINDSTRING || iSel == LB_ERR) { 00538 lReturn = iSel; 00539 } else { 00540 lReturn = xxxLBSetCurSel(plb, iSel); 00541 } 00542 break; 00543 00544 case LB_GETLOCALE: 00545 return plb->dwLocaleId; 00546 00547 case LB_SETLOCALE: 00548 00549 /* 00550 * Validate locale 00551 */ 00552 wParam = ConvertDefaultLocale((LCID)wParam); 00553 if (!IsValidLocale((LCID)wParam, LCID_INSTALLED)) 00554 return LB_ERR; 00555 00556 dw = plb->dwLocaleId; 00557 plb->dwLocaleId = (DWORD)wParam; 00558 return dw; 00559 00560 case WM_KEYDOWN: 00561 00562 /* 00563 * IanJa: Use LOWORD() to get low 16-bits of wParam - this should 00564 * work for Win16 & Win32. The value obtained is the virtual key 00565 */ 00566 xxxLBoxCtlKeyInput(plb, message, LOWORD(wParam)); 00567 break; 00568 00569 case WM_CHAR: 00570 xxxLBoxCtlCharInput(plb, LOWORD(wParam), fAnsi); 00571 break; 00572 00573 case LB_GETSELITEMS: 00574 case LB_GETSELCOUNT: 00575 00576 /* 00577 * IanJa/Win32 should this be LPWORD now? 00578 */ 00579 return LBoxGetSelItems(plb, (message == LB_GETSELCOUNT), (INT)wParam, 00580 (LPINT)lParam); 00581 00582 case LB_SETTABSTOPS: 00583 00584 /* 00585 * IanJa/Win32: Tabs given by array of INT for backwards compatability 00586 */ 00587 return LBSetTabStops(plb, (INT)wParam, (LPINT)lParam); 00588 00589 case LB_GETHORIZONTALEXTENT: 00590 00591 /* 00592 * Return the max width of the listbox used for horizontal scrolling 00593 */ 00594 return plb->maxWidth; 00595 00596 case LB_SETHORIZONTALEXTENT: 00597 00598 /* 00599 * Set the max width of the listbox used for horizontal scrolling 00600 */ 00601 if (plb->maxWidth != (INT)wParam) { 00602 plb->maxWidth = (INT)wParam; 00603 00604 /* 00605 * When horizontal extent is set, Show/hide the scroll bars. 00606 * NOTE: LBShowHideScrollBars() takes care if Redraw is OFF. 00607 * Fix for Bug #2477 -- 01/14/91 -- SANKAR -- 00608 */ 00609 xxxLBShowHideScrollBars(plb); //Try to show or hide scroll bars 00610 if (plb->fHorzBar && plb->fRightAlign && !(plb->fMultiColumn || plb->OwnerDraw)) { 00611 /* 00612 * origin to right 00613 */ 00614 xxxLBoxCtlHScroll(plb, SB_BOTTOM, 0); 00615 } 00616 } 00617 break; /* originally returned register ax (message) ! */ 00618 00619 case LB_SETCOLUMNWIDTH: 00620 00621 /* 00622 * Set the width of a column in a multicolumn listbox 00623 */ 00624 plb->cxColumn = (INT)wParam; 00625 LBCalcItemRowsAndColumns(plb); 00626 if (IsLBoxVisible(plb)) 00627 NtUserInvalidateRect(hwnd, NULL, TRUE); 00628 xxxLBShowHideScrollBars(plb); 00629 break; 00630 00631 case LB_SETANCHORINDEX: 00632 if ((INT)wParam >= plb->cMac) { 00633 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE,"Invalid index passed to LB_SETANCHORINDEX"); 00634 return LB_ERR; 00635 } 00636 plb->iMouseDown = (INT)wParam; 00637 plb->iLastMouseMove = (INT)wParam; 00638 xxxInsureVisible(plb, (int) wParam, (BOOL)(lParam != 0)); 00639 break; 00640 00641 case LB_GETANCHORINDEX: 00642 return plb->iMouseDown; 00643 00644 case LB_SETCARETINDEX: 00645 if ( (plb->iSel == -1) || ((plb->wMultiple != SINGLESEL) && 00646 (plb->cMac > (INT)wParam))) { 00647 00648 /* 00649 * Set's the iSelBase to the wParam 00650 * if lParam, then don't scroll if partially visible 00651 * else scroll into view if not fully visible 00652 */ 00653 xxxInsureVisible(plb, (INT)wParam, (BOOL)LOWORD(lParam)); 00654 xxxSetISelBase(plb, (INT)wParam); 00655 break; 00656 } else { 00657 if ((INT)wParam >= plb->cMac) { 00658 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE,"Invalid index passed to LB_SETCARETINDEX"); 00659 } 00660 return LB_ERR; 00661 } 00662 break; 00663 00664 case LB_GETCARETINDEX: 00665 return plb->iSelBase; 00666 00667 case LB_SETITEMHEIGHT: 00668 case LB_GETITEMHEIGHT: 00669 return LBGetSetItemHeightHandler(plb, message, (INT)wParam, LOWORD(lParam)); 00670 break; 00671 00672 case LB_FINDSTRINGEXACT: 00673 lReturn = xxxFindString(plb, (LPWSTR)lParam, (INT)wParam, EQ, TRUE); 00674 break; 00675 00676 case LB_ITEMFROMPOINT: { 00677 POINT pt; 00678 BOOL bOutside; 00679 DWORD dwItem; 00680 00681 POINTSTOPOINT(pt, lParam); 00682 bOutside = ISelFromPt(plb, pt, &dwItem); 00683 UserAssert(bOutside == 1 || bOutside == 0); 00684 return (LRESULT)MAKELONG(dwItem, bOutside); 00685 } 00686 00687 case LBCB_CARETON: 00688 00689 /* 00690 * Internal message for combo box support 00691 */ 00692 CaretCreate(plb); 00693 // Set up the caret in the proper location for drop downs. 00694 plb->iSelBase = plb->iSel; 00695 xxxLBSetCaret(plb, TRUE); 00696 if (FWINABLE()) { 00697 if (_IsWindowVisible(pwnd)) { 00698 LBEvent(plb, EVENT_OBJECT_FOCUS, plb->iSelBase); 00699 } 00700 } 00701 return(plb->iSel); 00702 00703 case LBCB_CARETOFF: 00704 00705 /* 00706 * Internal message for combo box support 00707 */ 00708 xxxLBSetCaret(plb, FALSE); 00709 xxxCaretDestroy(plb); 00710 break; 00711 00712 case WM_NCCREATE: 00713 if ((pwnd->style & LBS_MULTICOLUMN) && (pwnd->style & WS_VSCROLL)) 00714 { 00715 DWORD mask = WS_VSCROLL; 00716 DWORD flags = 0; 00717 if (!TestWF(pwnd, WFWIN40COMPAT)) { 00718 mask |= WS_HSCROLL; 00719 flags = WS_HSCROLL; 00720 } 00721 NtUserAlterWindowStyle(hwnd, mask, flags); 00722 } 00723 goto CallDWP; 00724 00725 default: 00726 CallDWP: 00727 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00728 } 00729 00730 /* 00731 * Handle translation of ANSI output data and free buffer 00732 */ 00733 if (lpwsz) { 00734 UserLocalFree(lpwsz); 00735 } 00736 00737 return lReturn; 00738 }

HANDLE LoadCursorIconFromFileMap IN PFILEINFO  pfi,
IN OUT LPWSTR *  prt,
IN DWORD  cxDesired,
IN DWORD  cyDesired,
IN DWORD  LR_flags,
OUT LPBOOL  pfAni
 

Definition at line 279 of file client/acons.c.

References BOOL, ConvertDIBIcon(), DWORD, FALSE, LoadAniIcon(), NULL, ReadChunk(), ReadFilePtr(), ReadIconGuts(), ReadTag(), SkipChunk(), and TRUE.

Referenced by LoadCursorIconFromResource(), and RtlLoadObjectFromDIBFile().

00286 { 00287 LPNEWHEADER pnh; 00288 int offResBase; 00289 00290 *pfAni = FALSE; 00291 offResBase = 0; 00292 00293 /* 00294 * Determine if this is an .ICO/.CUR file or an .ANI file. 00295 */ 00296 pnh = (LPNEWHEADER)pfi->pFileMap; 00297 if (*(LPDWORD)pnh == FOURCC_RIFF) { 00298 00299 RTAG tag; 00300 00301 /* 00302 * It's an ANICURSOR! 00303 * Seek back to beginning + 1 tag. 00304 */ 00305 pfi->pFilePtr = pfi->pFileMap + sizeof(tag); 00306 00307 /* check RIFF type for ACON */ 00308 if (*(LPDWORD)pfi->pFilePtr != FOURCC_ACON) { 00309 return NULL; 00310 } 00311 pfi->pFilePtr += sizeof(DWORD); 00312 if (pfi->pFilePtr > pfi->pFileEnd) { 00313 return NULL; 00314 } 00315 00316 /* 00317 * Ok, we have a ACON chunk. Find the first ICON chunk and set 00318 * things up so it looks we've just loaded the header of a normal 00319 * .CUR file, then fall into the .CUR bits handling code below. 00320 */ 00321 while (ReadTag(pfi, &tag)) { 00322 /* 00323 * Handle each chunk type. 00324 */ 00325 if (tag.ckID == FOURCC_anih) { 00326 00327 ANIHEADER anih; 00328 00329 if (!ReadChunk(pfi, &tag, &anih)) { 00330 return NULL; 00331 } 00332 00333 if (!(anih.fl & AF_ICON) || (anih.cFrames == 0)) { 00334 return NULL; 00335 } 00336 00337 // If this ACON has more than one frame then go ahead 00338 // and create an ACON, otherwise just use the first 00339 // frame to create a normal ICON/CURSOR. 00340 00341 if (anih.cFrames > 1) { 00342 00343 *pfAni = TRUE; 00344 *prt = RT_CURSOR; 00345 return(LoadAniIcon(pfi, 00346 RT_CURSOR, 00347 cxDesired, 00348 cyDesired, 00349 LR_flags)); 00350 } 00351 00352 } else if (tag.ckID == FOURCC_LIST) { 00353 LPDWORD pdwType = NULL; 00354 BOOL fOK = FALSE; 00355 /* 00356 * If this is the fram list, then get the first icon out of it 00357 */ 00358 00359 /* check LIST type for fram */ 00360 00361 if( tag.ckSize >= sizeof(DWORD) && 00362 (fOK = ReadFilePtr( pfi, 00363 &pdwType, 00364 sizeof(DWORD))) && 00365 *pdwType == FOURCC_fram) { 00366 00367 if (!ReadTag(pfi, &tag)) { 00368 return NULL; 00369 } 00370 00371 if (tag.ckID == FOURCC_icon) { 00372 /* 00373 * We've found what we're looking for. Get current position 00374 * in file to be used as the base from which the icon data 00375 * offsets are offset from. 00376 */ 00377 offResBase = (int)(pfi->pFilePtr - pfi->pFileMap); 00378 00379 /* 00380 * Grab the header first, since the following code assumes 00381 * it was read above. 00382 */ 00383 ReadFilePtr(pfi, &pnh, sizeof(NEWHEADER)); 00384 00385 /* 00386 * Break out and let the icon loading/cursor creating code 00387 * take it from here. 00388 */ 00389 break; 00390 } else { 00391 SkipChunk(pfi, &tag); 00392 } 00393 } else { 00394 /* 00395 * Something bad happened in the type read, if it was 00396 * a file error then close and exit, otherwise just 00397 * skip the rest of the chunk 00398 */ 00399 if(!fOK) { 00400 return NULL; 00401 } 00402 /* 00403 * take the type we just read out of the tag size and 00404 * skip the rest 00405 */ 00406 tag.ckSize -= sizeof(DWORD); 00407 SkipChunk(pfi, &tag); 00408 } 00409 } else { 00410 /* 00411 * We're not interested in this chunk, skip it. 00412 */ 00413 SkipChunk(pfi, &tag); 00414 } 00415 } 00416 } else { // not a RIFF file. 00417 if ((pnh->ResType != FT_ICON) && (pnh->ResType != FT_CURSOR)) { 00418 return NULL; 00419 } 00420 } 00421 { 00422 PCURSORRESOURCE pcres; 00423 00424 pcres = ReadIconGuts(pfi, 00425 pnh, 00426 offResBase, 00427 prt, 00428 cxDesired, 00429 cyDesired, 00430 LR_flags); 00431 00432 return ConvertDIBIcon((LPBITMAPINFOHEADER)pcres, 00433 NULL, 00434 pfi->pszName, 00435 *prt == RT_ICON, 00436 cxDesired, 00437 cyDesired, 00438 LR_flags); 00439 } 00440 }

HCURSOR LoadCursorOrIconFromFile LPCWSTR  pszFilename,
BOOL  fIcon
 

HICON LoadIcoCur HINSTANCE  hmod,
LPCWSTR  lpName,
LPWSTR  type,
DWORD  cxDesired,
DWORD  cyDesired,
UINT  LR_flags
 

Definition at line 2657 of file clres.c.

References tagMAPRES::bFlags, tagCURSORFIND::bpp, ConnectIfNecessary, CURSORFIND, tagCURSORFIND::cx, tagCURSORFIND::cy, FindExistingCursorIcon(), GETAPPVER, GetIcoCurBpp(), GetIcoCurHeight(), GetIcoCurWidth(), tagCURSORFIND::hcur, hmodUser, tagMAPRES::idDisp, tagMAPRES::idUser, IS_PTR, LPMAPRES, MAX_PATH, MR_FAILFOR40, NULL, ObjectFromDIBResource(), PTR_TO_ID, tagCURSORFIND::rt, szUSER32, type, VER40, and WowGetModuleFileName().

Referenced by CopyImageFromRes(), GetCursorFrameInfo(), LoadCursorsAndIcons(), LoadCursorW(), LoadIconW(), LoadImageW(), SetSystemCursor(), and WowServerLoadCreateCursorIcon().

02664 { 02665 HICON hico; 02666 LPWSTR pszModName; 02667 WCHAR achModName[MAX_PATH]; 02668 02669 ConnectIfNecessary(); 02670 02671 /* 02672 * Setup module name and handles for lookup. 02673 */ 02674 if (hmod == NULL) { 02675 02676 hmod = hmodUser; 02677 pszModName = szUSER32; 02678 02679 } else { 02680 02681 WowGetModuleFileName(hmod, 02682 achModName, 02683 sizeof(achModName) / sizeof(WCHAR)); 02684 02685 pszModName = achModName; 02686 } 02687 02688 if (LR_flags & LR_CREATEDIBSECTION) 02689 LR_flags = (LR_flags & ~LR_CREATEDIBSECTION) | LR_CREATEREALDIB; 02690 02691 /* 02692 * Setup defaults. 02693 */ 02694 if ((hmod == hmodUser) && !IS_PTR(pszResName)) { 02695 02696 int imapMax; 02697 LPMAPRES lpMapRes; 02698 02699 /* 02700 * Map some old OEM IDs for people. 02701 */ 02702 if (type == RT_ICON) { 02703 02704 static MAPRES MapOemOic[] = { 02705 {OCR_ICOCUR, OIC_WINLOGO, MR_FAILFOR40} 02706 }; 02707 02708 lpMapRes = MapOemOic; 02709 imapMax = 1; 02710 02711 } else { 02712 02713 static MAPRES MapOemOcr[] = { 02714 {OCR_ICON, OCR_ICON, MR_FAILFOR40}, 02715 {OCR_SIZE, OCR_SIZE, MR_FAILFOR40} 02716 }; 02717 02718 lpMapRes = MapOemOcr; 02719 imapMax = 2; 02720 } 02721 02722 while (--imapMax >= 0) { 02723 02724 if (lpMapRes->idDisp == PTR_TO_ID(pszResName)) { 02725 02726 if ((lpMapRes->bFlags & MR_FAILFOR40) && 02727 GETAPPVER() >= VER40) { 02728 02729 RIPMSG1(RIP_WARNING, 02730 "LoadIcoCur: Old ID 0x%x not allowed for 4.0 apps", 02731 PTR_TO_ID(pszResName)); 02732 02733 return NULL; 02734 } 02735 02736 pszResName = MAKEINTRESOURCE(lpMapRes->idUser); 02737 break; 02738 } 02739 02740 ++lpMapRes; 02741 } 02742 } 02743 02744 /* 02745 * Determine size of requested object. 02746 */ 02747 cxDesired = GetIcoCurWidth(cxDesired , (type == RT_ICON), LR_flags, 0); 02748 cyDesired = GetIcoCurHeight(cyDesired, (type == RT_ICON), LR_flags, 0); 02749 02750 /* 02751 * See if this is a cached icon/cursor, and grab it if we have one 02752 * already. 02753 */ 02754 if (LR_flags & LR_SHARED) { 02755 02756 CURSORFIND cfSearch; 02757 02758 /* 02759 * Note that win95 fails to load any USER resources unless 02760 * LR_SHARED is specified - so we do too. Also, win95 will 02761 * ignore your cx, cy and LR_flag parameters and just give 02762 * you whats in the cache so we do too. 02763 * A shame but thats life... 02764 * 02765 * Setup search criteria. Since this is a load, we will have 02766 * no source-cursor to lookup. Find something respectable. 02767 */ 02768 cfSearch.hcur = (HCURSOR)NULL; 02769 cfSearch.rt = PtrToUlong(type); 02770 02771 if (hmod == hmodUser) { 02772 02773 cfSearch.cx = 0; 02774 cfSearch.cy = 0; 02775 cfSearch.bpp = 0; 02776 02777 } else { 02778 02779 cfSearch.cx = cxDesired; 02780 cfSearch.cy = cyDesired; 02781 02782 /* 02783 * On NT we have a more strict cache-lookup. By passing in (zero), we 02784 * will tell the cache-lookup to ignore the bpp. This fixes a problem 02785 * in Crayola Art Studio where the coloring-book cursor was being created 02786 * as an invisible cursor. This lookup is compatible with Win95. 02787 */ 02788 #if 0 02789 cfSearch.bpp = GetIcoCurBpp(LR_flags); 02790 #else 02791 cfSearch.bpp = 0; 02792 #endif 02793 } 02794 02795 hico = FindExistingCursorIcon(pszModName, pszResName, &cfSearch); 02796 02797 if (hico != NULL) 02798 goto IcoCurFound; 02799 } 02800 02801 #ifdef LATER // SanfordS 02802 /* 02803 * We need to handle the case where a configurable icon has been 02804 * loaded from some arbitrary module or file and someone now wants 02805 * to load the same thing in a different size or color content. 02806 * 02807 * A cheezier alternative is to just call CopyImage on what we 02808 * found. 02809 */ 02810 if (hmod == hmodUser) { 02811 hico = FindExistingCursorIcon(NULL, 02812 szUSER, 02813 type, 02814 pszResName, 02815 0, 02816 0, 02817 0); 02818 if (hico != NULL) { 02819 /* 02820 * Find out where the original came from and load it. 02821 * This may require some redesign to remember the 02822 * filename that LR_LOADFROMFILE images came from. 02823 */ 02824 _GetIconInfo(....); 02825 return LoadIcoCur(....); 02826 } 02827 } 02828 #endif 02829 02830 hico = (HICON)ObjectFromDIBResource(hmod, 02831 pszResName, 02832 type, 02833 cxDesired, 02834 cyDesired, 02835 LR_flags); 02836 02837 IcoCurFound: 02838 02839 return hico; 02840 }

HKL LoadKeyboardLayoutWorker HKL  hkl,
LPCWSTR  lpszKLName,
UINT  uFlags,
BOOL  fFailSafe
 

Definition at line 4385 of file client.c.

References _LoadKeyboardLayoutEx(), CliImmInitializeHotKeys(), ISHK_ADD, L, NtClose(), NULL, OpenKeyboardLayoutFile(), and UINT.

Referenced by LoadKeyboardLayoutEx(), LoadKeyboardLayoutW(), and UpdatePerUserSystemParameters().

04390 { 04391 UINT offTable; 04392 UINT KbdInputLocale; 04393 HANDLE hFile; 04394 HKL hKbdLayout; 04395 WCHAR awchKL[KL_NAMELENGTH]; 04396 04397 TAGMSG1(DBGTAG_IMM, "LoadKeyboardLayoutWorker called with KLNAME=%S", lpszKLName); 04398 04399 /* 04400 * If there is a substitute keyboard layout OpenKeyboardLayoutFile returns 04401 * the substitute keyboard layout name to load. 04402 */ 04403 wcsncpy(awchKL, lpszKLName, KL_NAMELENGTH - 1); 04404 awchKL[KL_NAMELENGTH - 1] = L'\0'; 04405 04406 /* 04407 * Open the layout file 04408 */ 04409 hFile = OpenKeyboardLayoutFile(awchKL, &uFlags, &offTable, &KbdInputLocale); 04410 if (hFile == NULL) { 04411 if (!fFailSafe && (uFlags & KLF_FAILSAFE) == 0) { 04412 // If not fail safe mode, just bail to fail. 04413 return NULL; 04414 } 04415 uFlags &= ~KLF_SUBSTITUTE_OK; 04416 if (wcscmp(awchKL, L"00000409")) { 04417 wcscpy(awchKL, L"00000409"); 04418 hFile = OpenKeyboardLayoutFile(awchKL, &uFlags, &offTable, &KbdInputLocale); 04419 } 04420 if (hFile == NULL) { 04421 // It's OK to pass NULL hFile. This lets the win32k prepare and 04422 // allocate the fallback keyboard layout. 04423 // kbdnul, which is a fallback keyboard layout stored in in win32k, will be used: 04424 } 04425 } 04426 04427 /* 04428 * Call the server to read the keyboard tables. Note that 04429 * the server will close the file handle when it is done. 04430 */ 04431 hKbdLayout = _LoadKeyboardLayoutEx(hFile, offTable, hkl, awchKL, KbdInputLocale, uFlags); 04432 NtClose(hFile); 04433 04434 CliImmInitializeHotKeys(ISHK_ADD, (HKL)IntToPtr( KbdInputLocale )); 04435 04436 return hKbdLayout; 04437 }

VOID LoadPreloadKeyboardLayouts void   ) 
 

Definition at line 3976 of file client.c.

References ISREMOTESESSION, L, LoadKeyboardLayoutW(), NSIZEPRELOAD, UINT, and VOID().

Referenced by UpdatePerUserSystemParameters().

03977 { 03978 UINT i; 03979 WCHAR szPreLoadee[NSIZEPRELOAD]; 03980 WCHAR lpszName[KL_NAMELENGTH]; 03981 03982 if (!ISREMOTESESSION()) { 03983 /* 03984 * Console doesn't have a client layout, so start from 2. 03985 */ 03986 i = 2; 03987 } else { 03988 /* 03989 * Client might have specified a keyboard layout, if this 03990 * is so, then Preload\1 was not loaded, so start from 1. 03991 */ 03992 i = 1; 03993 } 03994 03995 for (; i < 1000; i++) { 03996 wsprintf(szPreLoadee, L"%d", i ); 03997 if ((GetPrivateProfileStringW( 03998 L"Preload", 03999 szPreLoadee, 04000 L"", // default = NULL 04001 lpszName, // output buffer 04002 KL_NAMELENGTH, 04003 L"keyboardlayout.ini") == -1 ) || (*lpszName == L'\0')) { 04004 break; 04005 } 04006 LoadKeyboardLayoutW(lpszName, KLF_REPLACELANG |KLF_SUBSTITUTE_OK |KLF_NOTELLSHELL); 04007 } 04008 }

int LoadStringOrError HANDLE  ,
UINT  ,
LPTSTR  ,
int  ,
WORD 
 

Referenced by LoadStringA(), LoadStringW(), and MessageBoxWorker().

HANDLE LocalReallocSafe HANDLE  hMem,
DWORD  dwBytes,
DWORD  dwFlags,
PPED  pped
 

int MakeMenuItem LPWSTR  lpOut,
PWND  pwnd
 

Definition at line 47 of file mdimenu.c.

References DWORD, FIRST, L, _LARGE_UNICODE_STRING::Length, PMDI, PMDIWND, REBASEALWAYS, REBASEPWND, tagWND::spmenu, tagWND::strName, and wsprintfW().

Referenced by AppendToWindowsMenu(), and ModifyMenuItem().

00050 { 00051 PMDI pmdi; 00052 DWORD rgParm; 00053 int cch = 0; 00054 WCHAR string[160]; 00055 LPWSTR lpstr; 00056 int i = 0; 00057 00058 /* 00059 * Get a pointer to the MDI structure 00060 */ 00061 pmdi = ((PMDIWND)(REBASEPWND(pwnd, spwndParent)))->pmdi; 00062 00063 *lpOut = 0; 00064 00065 rgParm = PtrToUlong(pwnd->spmenu) - (DWORD)FIRST(pmdi) + 1; 00066 00067 if (pwnd->strName.Length) { 00068 lpstr = REBASEALWAYS(pwnd, strName.Buffer); 00069 00070 /* 00071 * Search for an & in the title string and duplicate it so that we don't 00072 * get bogus accelerators. 00073 */ 00074 while (*lpstr && i < ((sizeof(string) / sizeof(WCHAR)) - 1)) { 00075 string[i] = *lpstr; 00076 i++; 00077 if (*lpstr == TEXT('&')) 00078 string[i++] = TEXT('&'); 00079 00080 lpstr++; 00081 } 00082 00083 string[i] = 0; 00084 cch = wsprintfW(lpOut, L"&%d %ws", rgParm, string); 00085 00086 } else { 00087 00088 /* 00089 * Handle the case of MDI children without any window title text. 00090 */ 00091 cch = wsprintfW(lpOut, L"&%d ", rgParm); 00092 } 00093 00094 return cch; 00095 }

INT_PTR APIENTRY MB_DlgProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1866 of file msgbox.c.

References MB_DlgProcWorker(), and TRUE.

Referenced by ClientThreadSetup(), and DefDlgProcWorker().

01871 { 01872 return MB_DlgProcWorker(hwnd, message, wParam, lParam, TRUE); 01873 }

INT_PTR APIENTRY MB_DlgProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1875 of file msgbox.c.

References FALSE, and MB_DlgProcWorker().

Referenced by ClientThreadSetup(), DefDlgProcWorker(), and SoftModalMessageBox().

01880 { 01881 return MB_DlgProcWorker(hwnd, message, wParam, lParam, FALSE); 01882 }

INT_PTR APIENTRY MDIActivateDlgProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 917 of file mdimenu.c.

References MDIActivateDlgProcWorker().

Referenced by ClientThreadSetup(), and DefFrameProcWorker().

00922 { 00923 return MDIActivateDlgProcWorker(hwnd, message, wParam, lParam); 00924 }

INT_PTR APIENTRY MDIActivateDlgProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 926 of file mdimenu.c.

References MDIActivateDlgProcWorker().

Referenced by ClientThreadSetup(), and DefFrameProcWorker().

00931 { 00932 return MDIActivateDlgProcWorker(hwnd, message, wParam, lParam); 00933 }

BOOL MDIAddSysMenu HMENU  hmenuFrame,
HWND  hwndChild
 

Definition at line 165 of file mdimenu.c.

References _GetSubMenu(), BOOL, ClearWindowState(), FALSE, InternalInsertMenuItem(), IsWindow(), MFMWFP_NOITEM, NtUserRedrawFrame, NtUserRemoveMenu(), NtUserSetSysMenu, PtoH, REBASEALWAYS, tagWND::spmenuSys, TestWF, TRUE, ValidateHwnd, WFMINBOX, WFOLDUI, WFSYSMENU, and xxxMNCanClose().

Referenced by MDICompleteChildCreation(), MDISetMenu(), and xxxChildResize().

00168 { 00169 PWND pwndChild; 00170 MENUITEMINFO mii; 00171 PMENU pMenuChild; 00172 00173 00174 // LATER -- look at passing pwndChild in -- FritzS 00175 00176 UserAssert(IsWindow(hwndChild)); 00177 pwndChild = ValidateHwnd(hwndChild); 00178 if (!hMenuFrame || !pwndChild || !pwndChild->spmenuSys) { 00179 return FALSE; 00180 } 00181 00182 /* 00183 * We don't need the pMenuChild pointer but the handle. However, if you 00184 * do PtoH(_GetSubMenu()), you end up calling the function twice 00185 */ 00186 pMenuChild = _GetSubMenu (REBASEALWAYS(pwndChild, spmenuSys), 0); 00187 if (!pMenuChild) { 00188 return FALSE; 00189 } 00190 00191 // Add MDI system button as first menu item 00192 mii.cbSize = sizeof(MENUITEMINFO); 00193 mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_BITMAP; // Add MIIM_DATA because of hack described below 00194 mii.hSubMenu = PtoH(pMenuChild); 00195 // Fritzs -- this won't work. 00196 // mii.dwTypeData = (LPSTR) MAKELONG(MENUHBM_SYSTEM, GetWindowSmIcon(hwndChild)); 00197 mii.hbmpItem = HBMMENU_SYSTEM; 00198 // FritzS -- so, we sneak the icon into ItemData 00199 mii.dwItemData = (ULONG_PTR)hwndChild; 00200 00201 if (!InternalInsertMenuItem(hMenuFrame, 0, TRUE, &mii)) 00202 return FALSE; 00203 00204 // TimeLine 6.1 gets confused by the extra Min/Close buttons, 00205 // don't add them if WFOLDUI 00206 00207 mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_BITMAP; 00208 mii.fType = MFT_RIGHTJUSTIFY; 00209 00210 pwndChild = ValidateHwnd(hwndChild); 00211 if (!pwndChild) { 00212 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00213 return FALSE; 00214 } 00215 00216 00217 if (!TestWF(pwndChild, WFOLDUI)) 00218 { 00219 // Add Minimize button as last menu item 00220 mii.hbmpItem = (TestWF(pwndChild, WFMINBOX) ? HBMMENU_MBAR_MINIMIZE : HBMMENU_MBAR_MINIMIZE_D); 00221 mii.wID = SC_MINIMIZE; 00222 00223 if (!InternalInsertMenuItem(hMenuFrame, MFMWFP_NOITEM, TRUE, &mii)) 00224 { 00225 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00226 return FALSE; 00227 } 00228 mii.fType &= ~MFT_RIGHTJUSTIFY; 00229 } 00230 00231 // Add Restore button as last menu item 00232 mii.hbmpItem = HBMMENU_MBAR_RESTORE; 00233 mii.wID = SC_RESTORE; 00234 00235 if (!InternalInsertMenuItem(hMenuFrame, MFMWFP_NOITEM, TRUE, &mii)) { 00236 // BOGUS -- we gotta remove the MINIMIZE button too 00237 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00238 return FALSE; 00239 } 00240 00241 pwndChild = ValidateHwnd(hwndChild); 00242 if (!pwndChild) { 00243 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00244 return FALSE; 00245 } 00246 00247 if (!TestWF(pwndChild, WFOLDUI)) 00248 { 00249 // Add Close button as last menu item 00250 mii.hbmpItem = (xxxMNCanClose(pwndChild) ? HBMMENU_MBAR_CLOSE : HBMMENU_MBAR_CLOSE_D); 00251 mii.wID = SC_CLOSE; 00252 00253 if (!InternalInsertMenuItem(hMenuFrame, MFMWFP_NOITEM, TRUE, &mii)) 00254 { 00255 // BOGUS -- we gotta remove the MINIMIZE and RESTORE buttons too 00256 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00257 return FALSE; 00258 } 00259 } 00260 00261 /* 00262 * Set the menu items to proper state since we just maximized it. Note 00263 * setsysmenu doesn't work if we've cleared the sysmenu bit so do it now... 00264 */ 00265 NtUserSetSysMenu(hwndChild); 00266 00267 /* 00268 * This is so that if the user brings up the child sysmenu, it's sure 00269 * to be that in the frame menu bar... 00270 */ 00271 ClearWindowState(pwndChild, WFSYSMENU); 00272 00273 /* 00274 * Make sure that the child's frame is redrawn to reflect the removed 00275 * system menu. 00276 */ 00277 NtUserRedrawFrame(hwndChild); 00278 00279 return TRUE; 00280 }

LRESULT APIENTRY MDIClientWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 2063 of file mdiwin.c.

References MDIClientWndProcWorker(), NULL, TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

02068 { 02069 PWND pwnd; 02070 02071 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 02072 return 0; 02073 } 02074 02075 return MDIClientWndProcWorker(pwnd, message, wParam, lParam, TRUE); 02076 }

LRESULT APIENTRY MDIClientWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 2078 of file mdiwin.c.

References FALSE, MDIClientWndProcWorker(), NULL, and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

02083 { 02084 PWND pwnd; 02085 02086 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 02087 return 0; 02088 } 02089 02090 return MDIClientWndProcWorker(pwnd, message, wParam, lParam, FALSE); 02091 }

LRESULT MDIClientWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 1657 of file mdiwin.c.

References _AdjustWindowRectEx(), _DefSetText(), ACTIVE, BOOL, CalcClientScrolling(), CALCSCROLL, CascadeWindows(), CheckLock, CKIDS, ClearWindowState(), DefWindowProcWorker(), DWORD, FALSE, FIRST, FNID_CLEANEDUP_BIT, FNID_MDICLIENT, GetMenuItemCount(), GWLP_MDIDATA, HAS_SBHORZ, HAS_SBVERT, HTITLE, HW, HWq, IsIconic(), IsMenu(), L, MAXED, MAXITEMS, MDI, MDIRemoveSysMenu(), MDISetMenu(), NtUserArrangeIconicWindows, NtUserChildWindowFromPointEx(), NtUserDeleteMenu(), NtUserGetSystemMenu(), NtUserMoveWindow(), NtUserSetFocus(), NtUserSetWindowFNID(), NtUserSetWindowLongPtr, NtUserSetWindowPos(), NtUserShowScrollBar(), NtUserShowWindow(), NtUserUpdateClientRect, NULL, PtoH, tagWND::rcClient, REBASE, REBASEPWND, RecalculateScrollRanges(), SAMEWOWHANDLE, SCROLL, SCROLLCOUNT, ScrollMDIChildren(), SCROLLSUPPRESS, SendMessage(), TestWF, TextAlloc(), ThreadLock, ThreadLockAlways, ThreadUnlock, TileWindows(), TRUE, UINT, Unlock, UserLocalAlloc, UserLocalFree, VALIDATECLASSANDSIZE, ValidateHwnd, WFHSCROLL, WFMAXBOX, WFMAXIMIZED, WFVSCROLL, WFWIN40COMPAT, WINDOW, WS_EX_MDICHILD, tagMDI::wScroll, xxxMDIDestroy(), xxxMDINext(), and xxxSetFrameTitle().

Referenced by ClientThreadSetup(), MDIClientWndProcA(), and MDIClientWndProcW().

01663 { 01664 HWND hwnd = HWq(pwnd); 01665 HWND hwndT; 01666 PWND pwndT; 01667 TL tlpwndT; 01668 PMDI pmdi; 01669 PWND pwndParent; 01670 01671 CheckLock(pwnd); 01672 01673 VALIDATECLASSANDSIZE(pwnd, FNID_MDICLIENT); 01674 01675 /* 01676 * Get the pmdi for the given window now since we will use it a lot in 01677 * various handlers. This was stored using SetWindowLong(hwnd,4,pmdi) when 01678 * we initially created the MDI client window. 01679 */ 01680 pmdi = ((PMDIWND)pwnd)->pmdi; 01681 01682 if (pmdi == NULL) { 01683 switch (message) { 01684 case WM_MDICREATE: 01685 case WM_MDIMAXIMIZE: 01686 case WM_PARENTNOTIFY: 01687 case WM_CREATE: 01688 /* 01689 * These messages are safe to call, even when pmdi has not already 01690 * been initialized. 01691 */ 01692 break; 01693 01694 default: 01695 /* 01696 * Any message that is not listed above is not safe to call when 01697 * pmdi has not been initialized. Instead, just directly call DWP. 01698 */ 01699 goto CallDWP; 01700 } 01701 } 01702 01703 switch (message) { 01704 case WM_NCACTIVATE: 01705 01706 /* 01707 * We are changing app activation. Fix the active child's caption. 01708 */ 01709 if (ACTIVE(pmdi) != NULL) { 01710 SendMessage(ACTIVE(pmdi), WM_NCACTIVATE, wParam, lParam); 01711 } 01712 goto CallDWP; 01713 01714 case WM_MDIGETACTIVE: 01715 if (lParam != 0) { 01716 *((LPBOOL)lParam) = (MAXED(pmdi) != NULL); 01717 } 01718 01719 return (LRESULT)ACTIVE(pmdi); 01720 01721 case WM_MDIACTIVATE: 01722 hwndT = (HWND)wParam; 01723 if ((pwndT = ValidateHwnd(hwndT)) == NULL) 01724 return 0; 01725 01726 if (SAMEWOWHANDLE(hwndT, ACTIVE(pmdi))) 01727 break; 01728 01729 NtUserSetWindowPos(hwndT, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); 01730 break; 01731 01732 case WM_MDICASCADE: 01733 pmdi->wScroll |= SCROLLSUPPRESS; 01734 NtUserShowScrollBar(hwnd, SB_BOTH, FALSE); 01735 01736 /* 01737 * Unmaximize any maximized window. 01738 */ 01739 #ifdef NEVER // Not in Chicago -- FritzS 01740 if (MAXED(pmdi) != NULL) { 01741 NtUserShowWindow(MAXED(pmdi), SW_SHOWNORMAL); 01742 } 01743 #endif 01744 /* 01745 * Save success/failure code to return to app 01746 */ 01747 message = (UINT)CascadeWindows(hwnd, (UINT)wParam, NULL, 0, NULL); 01748 pmdi->wScroll &= ~SCROLLCOUNT; 01749 return (LONG)message; 01750 break; 01751 01752 case WM_VSCROLL: 01753 case WM_HSCROLL: 01754 pmdi->wScroll |= SCROLLSUPPRESS; 01755 ScrollMDIChildren(hwnd, (message == WM_VSCROLL) ? SB_VERT : SB_HORZ, 01756 LOWORD(wParam), (short)(HIWORD(wParam))); 01757 pmdi->wScroll &= ~SCROLLCOUNT; 01758 break; 01759 01760 case WM_MDICREATE: 01761 { 01762 LPMDICREATESTRUCTA lpMCSA = (LPMDICREATESTRUCTA)lParam; 01763 LPMDICREATESTRUCTW lpMCSW = (LPMDICREATESTRUCTW)lParam; 01764 DWORD exStyle = WS_EX_MDICHILD; 01765 01766 /* 01767 * inherit the right.to.leftness of the parent. 01768 */ 01769 exStyle |= (pwnd->ExStyle & (WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR)); 01770 01771 if (fAnsi) { 01772 hwndT = CreateWindowExA(exStyle, lpMCSA->szClass, lpMCSA->szTitle, 01773 lpMCSA->style, lpMCSA->x, lpMCSA->y, lpMCSA->cx, lpMCSA->cy, 01774 hwnd, NULL, lpMCSA->hOwner, (LPSTR)lpMCSA->lParam); 01775 } else { 01776 hwndT = CreateWindowExW(exStyle, lpMCSW->szClass, lpMCSW->szTitle, 01777 lpMCSW->style, lpMCSW->x, lpMCSW->y, lpMCSW->cx, lpMCSW->cy, 01778 hwnd, NULL, lpMCSW->hOwner, (LPWSTR)lpMCSW->lParam); 01779 } 01780 01781 return((LRESULT)hwndT); 01782 01783 } 01784 01785 case WM_MDIDESTROY: 01786 xxxMDIDestroy(pwnd, (HWND)wParam); 01787 break; 01788 01789 case WM_MDIMAXIMIZE: 01790 hwndT = (HWND)wParam; 01791 if ((pwndT = ValidateHwnd(hwndT)) == NULL) 01792 return 0; 01793 01794 // Only maximize children with a MAXBOX. However, this introduces 01795 // backwards-compatibility issues with VB apps (see#12211) 01796 // So, we do this only for WIN40COMPAT apps and beyond. 01797 // 01798 if ((TestWF(pwndT, WFMAXBOX)) || !(TestWF(pwndT, WFWIN40COMPAT))) { 01799 NtUserShowWindow(hwndT, SW_SHOWMAXIMIZED); 01800 } 01801 break; 01802 01803 case WM_MDIRESTORE: 01804 hwndT = (HWND)wParam; 01805 if ((pwndT = ValidateHwnd(hwndT)) == NULL) 01806 return 0; 01807 01808 NtUserShowWindow(hwndT, SW_SHOWNORMAL); 01809 break; 01810 01811 case WM_MDITILE: 01812 pmdi->wScroll |= SCROLLSUPPRESS; 01813 NtUserShowScrollBar(hwnd, SB_BOTH, FALSE); 01814 01815 /* 01816 * Unmaximize any maximized window. 01817 */ 01818 #ifdef NEVER //Not in Chicago 01819 if (MAXED(pmdi) != NULL) { 01820 NtUserShowWindow(MAXED(pmdi), SW_SHOWNORMAL); 01821 } 01822 #endif 01823 /* 01824 * Save success/failure code to return to app 01825 */ 01826 message = (UINT)TileWindows(hwnd, (UINT)wParam, NULL, 0, NULL); 01827 pmdi->wScroll &= ~SCROLLCOUNT; 01828 return (LONG)message; 01829 break; 01830 01831 case WM_MDIICONARRANGE: 01832 pmdi->wScroll |= SCROLLSUPPRESS; 01833 NtUserArrangeIconicWindows(hwnd); 01834 pmdi->wScroll &= ~SCROLLCOUNT; 01835 RecalculateScrollRanges(pwnd, TRUE); 01836 break; 01837 01838 case WM_MDINEXT: 01839 if (wParam) { 01840 hwndT = (HWND)wParam; 01841 } else { 01842 hwndT = ACTIVE(pmdi); 01843 } 01844 01845 if ((pwndT = ValidateHwnd(hwndT)) == NULL) { 01846 return 0; 01847 } 01848 01849 /* 01850 * If lParam is 1, do a prev window instead of a next window 01851 */ 01852 ThreadLockAlways(pwndT, &tlpwndT); 01853 xxxMDINext(pwnd, pwndT, (lParam == 0 ? 0 : 1)); 01854 ThreadUnlock(&tlpwndT); 01855 break; 01856 01857 case WM_MDIREFRESHMENU: 01858 return (LRESULT)MDISetMenu(pwnd, TRUE, NULL, NULL); 01859 01860 case WM_MDISETMENU: 01861 return (LRESULT)MDISetMenu(pwnd, FALSE, (HMENU)wParam, (HMENU)lParam); 01862 01863 case WM_PARENTNOTIFY: 01864 if (wParam == WM_LBUTTONDOWN) { 01865 HWND hwndChild; 01866 POINT pt; 01867 01868 #ifdef USE_MIRRORING 01869 if ((pwndT = ValidateHwnd(hwnd)) == NULL) 01870 return 0; 01871 #endif 01872 01873 /* 01874 * Activate this child and bring it to the top. 01875 */ 01876 pt.x = (int)MAKEPOINTS(lParam).x; 01877 pt.y = (int)MAKEPOINTS(lParam).y; 01878 01879 #ifdef USE_MIRRORING 01880 /* 01881 * Since pt is relative to the client MDI window, 01882 * then the points should be mirrored if the MDI 01883 * client window is mirrored so that Scrren Coord 01884 * calculations are done properly in NtUserChildWindowFromPointEx. 01885 * [samera] 01886 */ 01887 if (TestWF(pwndT,WEFLAYOUTRTL)) { 01888 pt.x = (pwndT->rcClient.right-pwndT->rcClient.left)-pt.x; 01889 } 01890 #endif 01891 01892 hwndChild = NtUserChildWindowFromPointEx(hwnd, pt, 01893 CWP_SKIPDISABLED | CWP_SKIPINVISIBLE); 01894 01895 if ((hwndChild) && (hwndChild != hwnd)) { 01896 01897 if (hwndChild != ACTIVE(pmdi)) { 01898 NtUserSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 01899 SWP_NOMOVE | SWP_NOSIZE); 01900 } 01901 } 01902 } 01903 break; 01904 01905 case WM_SETFOCUS: 01906 if (ACTIVE(pmdi) != NULL && !IsIconic(ACTIVE(pmdi))) { 01907 NtUserSetFocus(ACTIVE(pmdi)); 01908 } 01909 break; 01910 01911 case WM_SIZE: 01912 if (ACTIVE(pmdi) && (pwndT = ValidateHwnd(ACTIVE(pmdi))) && 01913 TestWF(pwndT, WFMAXIMIZED)) { 01914 01915 RECT rc; 01916 01917 rc.top = rc.left = 0; 01918 rc.right = (int)MAKEPOINTS(lParam).x; 01919 rc.bottom = (int)MAKEPOINTS(lParam).y; 01920 _AdjustWindowRectEx(&rc, pwndT->style, FALSE, 01921 pwndT->ExStyle); 01922 NtUserMoveWindow(ACTIVE(pmdi), rc.left, rc.top, 01923 rc.right - rc.left, rc.bottom - rc.top, TRUE); 01924 } else { 01925 RecalculateScrollRanges(pwnd, FALSE); 01926 } 01927 goto CallDWP; 01928 01929 case MM_CALCSCROLL: { 01930 01931 if (SCROLL(pmdi) & SCROLLCOUNT) 01932 break; 01933 01934 { 01935 WORD sbj = pmdi->wScroll & (HAS_SBVERT | HAS_SBHORZ); 01936 01937 if (sbj) 01938 { 01939 CalcClientScrolling(hwnd, sbj, (BOOL) wParam); 01940 01941 SCROLL(pmdi) &= ~CALCSCROLL; 01942 } 01943 } 01944 break; 01945 } 01946 01947 case WM_CREATE: { 01948 LPCLIENTCREATESTRUCT pccs = ((LPCREATESTRUCT)lParam)->lpCreateParams; 01949 01950 /* 01951 * Try to allocate space for the pmdi 01952 */ 01953 if ((pmdi = (PMDI)UserLocalAlloc(HEAP_ZERO_MEMORY, sizeof(MDI)))) { 01954 NtUserSetWindowLongPtr(hwnd, GWLP_MDIDATA, (LONG_PTR)pmdi, FALSE); 01955 } else { 01956 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); 01957 break; 01958 } 01959 01960 pwndParent = REBASEPWND(pwnd, spwndParent); 01961 ACTIVE(pmdi) = NULL; 01962 MAXED(pmdi) = NULL; 01963 CKIDS(pmdi) = 0; 01964 WINDOW(pmdi) = pccs->hWindowMenu; 01965 01966 FIRST(pmdi) = pccs->idFirstChild; 01967 SCROLL(pmdi) = 0; 01968 HTITLE(pmdi) = TextAlloc(REBASE(pwndParent, strName.Buffer)); 01969 01970 _DefSetText(HW(pwndParent), NULL, FALSE); 01971 01972 ThreadLock(pwndParent, &tlpwndT); 01973 xxxSetFrameTitle(pwndParent, pwnd, (LPWSTR)2L); 01974 ThreadUnlock(&tlpwndT); 01975 01976 if (TestWF(pwnd, WFVSCROLL)) 01977 SCROLL(pmdi) |= HAS_SBVERT; 01978 if (TestWF(pwnd, WFHSCROLL)) 01979 SCROLL(pmdi) |= HAS_SBHORZ; 01980 if (SCROLL(pmdi)) { 01981 ClearWindowState(pwnd, WFVSCROLL | WFHSCROLL); 01982 } 01983 01984 /* 01985 * Set this dude's system menu. 01986 */ 01987 NtUserGetSystemMenu(HW(pwndParent), FALSE); 01988 01989 /* 01990 * make sure we have the correct window client area if scrolls are 01991 * removed... hack to take care of small progman bug 01992 */ 01993 if (SCROLL(pmdi)) { 01994 NtUserUpdateClientRect(hwnd); 01995 } 01996 break; 01997 } 01998 01999 case WM_DESTROY: 02000 case WM_FINALDESTROY: 02001 if (MAXED(pmdi)) { 02002 PWND pwndParent; 02003 PMENU pmenu; 02004 02005 pwndParent = REBASEPWND(pwnd, spwndParent); 02006 pmenu = REBASE(pwndParent, spmenu); 02007 MDIRemoveSysMenu(PtoH(pmenu), MAXED(pmdi)); 02008 } 02009 02010 /* 02011 * delete the title 02012 */ 02013 if (HTITLE(pmdi)) { 02014 UserLocalFree(HTITLE(pmdi)); 02015 HTITLE(pmdi) = NULL; 02016 } 02017 02018 /* 02019 * Delete the menu items of the child windows in the frame. 02020 * Chances are, this is called by destroying the frame, but 02021 * one never knows, does one? 02022 * 02023 * Increase CKIDS by 1 after checking to delete the separator 02024 */ 02025 if (IsMenu(WINDOW(pmdi)) && CKIDS(pmdi)++) { 02026 UINT iPosition; 02027 02028 if (CKIDS(pmdi) > MAXITEMS + 1) 02029 CKIDS(pmdi) = MAXITEMS + 1; 02030 02031 iPosition = GetMenuItemCount(WINDOW(pmdi)); 02032 while (CKIDS(pmdi)--) { 02033 NtUserDeleteMenu(WINDOW(pmdi), --iPosition, MF_BYPOSITION); 02034 } 02035 } 02036 02037 /* 02038 * Unlock those objects that are used by the MDI structure. 02039 */ 02040 Unlock(&MAXED(pmdi)); 02041 Unlock(&ACTIVE(pmdi)); 02042 Unlock(&WINDOW(pmdi)); 02043 02044 /* 02045 * Free the MDI structure 02046 */ 02047 UserLocalFree(pmdi); 02048 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); 02049 02050 break; 02051 02052 default: 02053 CallDWP: 02054 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 02055 } 02056 return 0L; 02057 }

BOOL MDICompleteChildCreation HWND  hwndChild,
HMENU  hSysMenu,
BOOL  fVisible,
BOOL  fDisabled
 

Definition at line 2735 of file mdiwin.c.

References ACTIVE, BOOL, CKIDS, FALSE, HW, HWq, ITILELEVEL, L, MAXITEMS, MDIAddSysMenu(), NtUserDestroyMenu(), NtUserRedrawFrame, NtUserSetSystemMenu(), NtUserSetWindowPos(), NtUserShowWindow(), PtoH, REBASE, REBASEPWND, SendMessage(), tagWND::spmenuSys, TestWF, TRUE, ValidateHwnd, WFMAXIMIZED, and WFMINIMIZED.

Referenced by _CreateWindowEx().

02735 { 02736 PWND pwndChild; 02737 PWND pwndClient; 02738 HWND hwndClient; 02739 BOOL fHasOwnSysMenu; 02740 PMDI pmdi; 02741 02742 pwndChild = ValidateHwnd(hwndChild); 02743 pwndClient = REBASEPWND(pwndChild,spwndParent); 02744 hwndClient = HWq(pwndClient); 02745 02746 fHasOwnSysMenu = (pwndChild->spmenuSys) ? TRUE : FALSE; 02747 02748 pmdi = ((PMDIWND)(pwndClient))->pmdi; 02749 02750 CKIDS(pmdi)++; 02751 ITILELEVEL(pmdi)++; 02752 if (ITILELEVEL(pmdi) > 0x7ffe) 02753 ITILELEVEL(pmdi) = 0; 02754 02755 // Update "Window" menu if this new window should be on it 02756 if (fVisible && !fDisabled && (CKIDS(pmdi) <= MAXITEMS)) 02757 SendMessage(hwndClient, WM_MDIREFRESHMENU, 0, 0L); 02758 02759 // 02760 // Add the MDI System Menu. Catch the case of not being able to add a 02761 // system menu (EG, guy doesn't have WS_SYSMENU style), and delete the 02762 // menu to avoid buildup in USER's heap. 02763 // 02764 if (hSysMenu && (fHasOwnSysMenu || !NtUserSetSystemMenu(hwndChild, hSysMenu))) 02765 NtUserDestroyMenu(hSysMenu); 02766 02767 if (fVisible) 02768 { 02769 if (!TestWF(pwndChild, WFMINIMIZED) || !ACTIVE(pmdi)) 02770 { 02771 NtUserSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 02772 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); 02773 02774 if (TestWF(pwndChild, WFMAXIMIZED) && !fHasOwnSysMenu) 02775 { 02776 PWND pwndParent = REBASEPWND(pwndClient, spwndParent); 02777 PMENU pmenu = REBASE(pwndParent, spmenu); 02778 MDIAddSysMenu(PtoH(pmenu), hwndChild); 02779 NtUserRedrawFrame(HW(pwndParent)); 02780 } 02781 } 02782 else 02783 { 02784 NtUserShowWindow(hwndChild, SW_SHOWMINNOACTIVE); 02785 } 02786 } 02787 02788 02789 return TRUE; 02790 }

BOOL MDIRemoveSysMenu HMENU  hMenuFrame,
HWND  hwndChild
 

Definition at line 289 of file mdimenu.c.

References BOOL, FALSE, GetMenuItemCount(), GetMenuItemID(), NtUserDeleteMenu(), NtUserRedrawFrame, NtUserRemoveMenu(), NULL, SetWindowState(), TestWF, TRUE, UINT, ValidateHwnd, WFOLDUI, and WFSYSMENU.

Referenced by MDIClientWndProcWorker(), MDISetMenu(), xxxChildResize(), and xxxMDIDestroy().

00292 { 00293 int iLastItem; 00294 UINT iLastCmd; 00295 PWND pwndChild; 00296 00297 // LATER -- look at passing pwndChild in -- FritzS 00298 00299 if (hMenuFrame == NULL) 00300 return FALSE; 00301 00302 pwndChild = ValidateHwnd(hwndChild); 00303 00304 if (pwndChild == NULL) 00305 return FALSE; 00306 00307 iLastItem = GetMenuItemCount(hMenuFrame) - 1; 00308 iLastCmd = TestWF(pwndChild, WFOLDUI) ? SC_RESTORE : SC_CLOSE; 00309 00310 if ((UINT) GetMenuItemID(hMenuFrame, iLastItem) != iLastCmd) 00311 return FALSE; 00312 00313 /* 00314 * Enable the sysmenu in the child window. 00315 */ 00316 SetWindowState(pwndChild, WFSYSMENU); 00317 00318 /* 00319 * Take the child sysmenu popup out of the frame menu. 00320 */ 00321 NtUserRemoveMenu(hMenuFrame, 0, MF_BYPOSITION); 00322 00323 /* 00324 * Delete the restore button from the menu bar. 00325 */ 00326 NtUserDeleteMenu(hMenuFrame, iLastItem - 1, MF_BYPOSITION); 00327 00328 pwndChild = ValidateHwnd(hwndChild); 00329 if (pwndChild == NULL) 00330 return FALSE; 00331 00332 if (!TestWF(pwndChild, WFOLDUI)) { 00333 NtUserDeleteMenu(hMenuFrame, iLastItem - 2, MF_BYPOSITION); 00334 NtUserDeleteMenu(hMenuFrame, iLastItem - 3, MF_BYPOSITION); 00335 } 00336 00337 /* 00338 * Make sure that the child's frame is redrawn to reflect the added 00339 * system menu. 00340 */ 00341 NtUserRedrawFrame(hwndChild); 00342 00343 return TRUE; 00344 }

HMENU MDISetMenu PWND  ,
BOOL  ,
HMENU  ,
HMENU 
 

Definition at line 499 of file mdimenu.c.

References ACTIVE, AppendToWindowsMenu(), CheckMenuItem(), CKIDS, FALSE, FindPwndChild(), FIRST, GetMenu(), GetMenuItemCount(), GetMenuItemID(), GetMenuState(), HW, Lock, MAXED, MAXITEMS, MDIAddSysMenu(), MDIRemoveSysMenu(), NtUserDeleteMenu(), NtUserSetMenu(), NULL, REBASEPWND, ShiftMenuIDs(), SwitchWindowsMenus(), TestWF, UINT, WFDISABLED, WFVISIBLE, and WINDOW.

Referenced by MDIClientWndProcWorker().

00504 { 00505 int i; 00506 int iFirst; 00507 int item; 00508 PMDI pmdi; 00509 PWND pwndParent; 00510 HMENU hOldSys; 00511 HMENU hOldWindow; 00512 PWND pwndChild; 00513 00514 /* 00515 * Get a pointer to the MDI structure 00516 */ 00517 pmdi = ((PMDIWND)pwndMDI)->pmdi; 00518 00519 /* 00520 * Save the old values 00521 */ 00522 pwndParent = REBASEPWND(pwndMDI, spwndParent); 00523 hOldSys = GetMenu(HW(pwndParent)); 00524 hOldWindow = WINDOW(pmdi); 00525 00526 if (fRefresh) { 00527 hNewSys = hOldSys; 00528 hNewWindow = hOldWindow; 00529 } 00530 00531 /* 00532 * Change the Frame Menu. 00533 */ 00534 if (hNewSys && (hNewSys != hOldSys)) { 00535 if (MAXED(pmdi)) 00536 MDIRemoveSysMenu(hOldSys, MAXED(pmdi)); 00537 00538 NtUserSetMenu(HW(pwndParent), hNewSys, FALSE); 00539 00540 if (MAXED(pmdi)) 00541 MDIAddSysMenu(hNewSys, MAXED(pmdi)); 00542 } else 00543 hNewSys = hOldSys; 00544 00545 /* 00546 * Now update the Window menu. 00547 */ 00548 if (fRefresh || (hOldWindow != hNewWindow)) { 00549 iFirst = FIRST(pmdi); 00550 00551 if (hOldWindow) { 00552 int cItems = GetMenuItemCount(hOldWindow); 00553 00554 for (i = cItems - 1; i >= 0; i--) { 00555 if (GetMenuState(hOldWindow, i, MF_BYPOSITION) & MF_SEPARATOR) 00556 break; 00557 } 00558 if ((i >= 0) && (GetMenuItemID(hOldWindow, i + 1) == (UINT)iFirst)) { 00559 int idTrim = i; 00560 00561 for (i = idTrim; i < cItems; i++) 00562 NtUserDeleteMenu(hOldWindow, idTrim, MF_BYPOSITION); 00563 } 00564 } 00565 00566 Lock(&WINDOW(pmdi), hNewWindow); 00567 00568 if (hNewWindow != NULL) { 00569 00570 /* 00571 * Add the list of child windows to the new window 00572 */ 00573 for (i = 0, item = 0; ((UINT)i < CKIDS(pmdi)) && (item < MAXITEMS); 00574 i++) { 00575 pwndChild = FindPwndChild(pwndMDI, iFirst + item); 00576 if (pwndChild != NULL) { 00577 if ((!TestWF(pwndChild, WFVISIBLE) && 00578 (LOWORD(pwndMDI->style) & 0x0001)) || 00579 TestWF(pwndChild, WFDISABLED)) { 00580 ShiftMenuIDs(pwndMDI, pwndChild); 00581 } else { 00582 AppendToWindowsMenu(pwndMDI, pwndChild); 00583 item++; 00584 } 00585 } 00586 } 00587 00588 /* 00589 * Add checkmark by the active child's menu item 00590 */ 00591 if (ACTIVE(pmdi)) 00592 CheckMenuItem(hNewWindow, (WORD)GetWindowID(ACTIVE(pmdi)), 00593 MF_BYCOMMAND | MF_CHECKED); 00594 } 00595 00596 /* 00597 * Out with the old, in with the new 00598 */ 00599 SwitchWindowsMenus(hNewSys, hOldWindow, hNewWindow); 00600 } 00601 return hOldSys; 00602 }

LRESULT APIENTRY MenuWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 165 of file clmsg.c.

References MenuWndProcWorker(), and TRUE.

Referenced by ClientThreadSetup().

00170 { 00171 return MenuWndProcWorker(hwnd, message, wParam, lParam, TRUE); 00172 }

LRESULT APIENTRY MenuWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 174 of file clmsg.c.

References FALSE, and MenuWndProcWorker().

Referenced by ClientThreadSetup().

00179 { 00180 return MenuWndProcWorker(hwnd, message, wParam, lParam, FALSE); 00181 }

MESSAGEPROTO CBGETEDITSEL   ) 
 

MESSAGEPROTO EMSETSEL   ) 
 

MESSAGEPROTO EMGETSEL   ) 
 

MESSAGEPROTO INWPARAMDBCSCHAR   ) 
 

MESSAGEPROTO IMEREQUEST   ) 
 

MESSAGEPROTO IMECONTROL   ) 
 

MESSAGEPROTO INSIZECLIPBRD   ) 
 

MESSAGEPROTO INPAINTCLIPBRD   ) 
 

MESSAGEPROTO INDEVICECHANGE   ) 
 

MESSAGEPROTO COPYGLOBALDATA   ) 
 

void MLBuildchLines PED  ,
ICH  ,
int  ,
BOOL  ,
PLONG  ,
PLONG 
 

Definition at line 1562 of file editml.c.

References AWCOMPARECHAR, BOOL, CALLWORDBREAKPROC, tagED::cbChar, tagED::cch, tagED::chLines, tagED::cLines, DWORD, ECAdjustIch(), ECAnsiPrev(), ECCchInWidth(), ECGetEditDC(), ECIsDBCSLeadByte(), ECLock(), ECNextIch(), ECReleaseEditDC(), ECUnlock(), ECWord(), tagLPKEDITCALLOUT::EditCchInWidth, tagLPKEDITCALLOUT::EditGetLineWidth, FALSE, tagED::fAnsi, tagED::fCalcLines, tagED::fDBCS, tagED::fWrap, ICH, tagED::ichScreenStart, ISDELIMETERA, ISDELIMETERW, tagED::lpfnNextWord, max, MAXLINELENGTH, tagED::maxPixelWidth, ML_REFRESH, MLGetLineWidth(), MLInsertchLine(), MLSanityCheck(), MLScroll(), MLShiftchLines(), NULL, tagED::pLpkEditCallout, tagED::rcFmt, TRUE, UINT, UserIsFullWidth(), and tagED::xOffset.

Referenced by ECResetTextInfo(), ECSetFont(), ECUpdateFormat(), MLDeleteText(), MLEditWndProc(), MLInsertText(), MLSetTabStops(), and MLSize().

01569 { 01570 PSTR ptext; /* Starting address of the text */ 01571 01572 /* 01573 * We keep these ICH's so that we can Unlock ped->hText when we have to grow 01574 * the chlines array. With large text handles, it becomes a problem if we 01575 * have a locked block in the way. 01576 */ 01577 ICH ichLineStart; 01578 ICH ichLineEnd; 01579 ICH ichLineEndBeforeCRLF; 01580 ICH ichCRLF; 01581 01582 ICH cch; 01583 HDC hdc; 01584 01585 BOOL fLineBroken = FALSE; /* Initially, no new line breaks are made */ 01586 ICH minCchBreak; 01587 ICH maxCchBreak; 01588 BOOL fOnDelimiter; 01589 01590 if (!ped->cch) { 01591 ped->maxPixelWidth = 0; 01592 ped->xOffset = 0; 01593 ped->ichScreenStart = 0; 01594 ped->cLines = 1; 01595 01596 if (pll) 01597 *pll = 0; 01598 if (phl) 01599 *phl = 0; 01600 01601 goto UpdateScroll; 01602 } 01603 01604 if (fUserTyping && cchDelta) 01605 MLShiftchLines(ped, iLine + 1, cchDelta); 01606 01607 hdc = ECGetEditDC(ped, TRUE); 01608 01609 if (!iLine && !cchDelta && !fUserTyping) { 01610 01611 /* 01612 * Reset maxpixelwidth only if we will be running through the whole 01613 * text. Better too long than too short. 01614 */ 01615 ped->maxPixelWidth = 0; 01616 01617 /* 01618 * Reset number of lines in text since we will be running through all 01619 * the text anyway... 01620 */ 01621 ped->cLines = 1; 01622 } 01623 01624 /* 01625 * Set min and max line built to be the starting line 01626 */ 01627 minCchBreak = maxCchBreak = (cchDelta ? ped->chLines[iLine] : 0); 01628 01629 ptext = ECLock(ped); 01630 01631 ichCRLF = ichLineStart = ped->chLines[iLine]; 01632 01633 while (ichLineStart < ped->cch) { 01634 if (ichLineStart >= ichCRLF) { 01635 ichCRLF = ichLineStart; 01636 01637 /* 01638 * Move ichCRLF ahead to either the first CR or to the end of text. 01639 */ 01640 if (ped->fAnsi) { 01641 while (ichCRLF < ped->cch) { 01642 if (*(ptext + ichCRLF) == 0x0D) { 01643 if (*(ptext + ichCRLF + 1) == 0x0A || 01644 *(WORD UNALIGNED *)(ptext + ichCRLF + 1) == 0x0A0D) 01645 break; 01646 } 01647 ichCRLF++; 01648 } 01649 } else { 01650 LPWSTR pwtext = (LPWSTR)ptext; 01651 01652 while (ichCRLF < ped->cch) { 01653 if (*(pwtext + ichCRLF) == 0x0D) { 01654 if (*(pwtext + ichCRLF + 1) == 0x0A || 01655 *(DWORD UNALIGNED *)(pwtext + ichCRLF + 1) == 0x000A000D) 01656 break; 01657 } 01658 ichCRLF++; 01659 } 01660 } 01661 } 01662 01663 01664 if (!ped->fWrap) { 01665 01666 UINT LineWidth; 01667 /* 01668 * If we are not word wrapping, line breaks are signified by CRLF. 01669 */ 01670 01671 // 01672 // If we cut off the line at MAXLINELENGTH, we should 01673 // adjust ichLineEnd. 01674 // 01675 if ((ichCRLF - ichLineStart) <= MAXLINELENGTH) { 01676 ichLineEnd = ichCRLF; 01677 } else { 01678 ichLineEnd = ichLineStart + MAXLINELENGTH; 01679 if (ped->fAnsi && ped->fDBCS) { 01680 ichLineEnd = ECAdjustIch( ped, (PSTR)ptext, ichLineEnd); 01681 } 01682 } 01683 01684 /* 01685 * We will keep track of what the longest line is for the horizontal 01686 * scroll bar thumb positioning. 01687 */ 01688 if (ped->pLpkEditCallout) { 01689 LineWidth = ped->pLpkEditCallout->EditGetLineWidth( 01690 ped, hdc, ptext + ichLineStart*ped->cbChar, 01691 ichLineEnd - ichLineStart); 01692 } else { 01693 LineWidth = MLGetLineWidth(hdc, ptext + ichLineStart * ped->cbChar, 01694 ichLineEnd - ichLineStart, 01695 ped); 01696 } 01697 ped->maxPixelWidth = max(ped->maxPixelWidth,(int)LineWidth); 01698 01699 } else { 01700 01701 /* 01702 * Check if the width of the edit control is non-zero; 01703 * a part of the fix for Bug #7402 -- SANKAR -- 01/21/91 -- 01704 */ 01705 if(ped->rcFmt.right > ped->rcFmt.left) { 01706 01707 /* 01708 * Find the end of the line based solely on text extents 01709 */ 01710 if (ped->pLpkEditCallout) { 01711 ichLineEnd = ichLineStart + 01712 ped->pLpkEditCallout->EditCchInWidth( 01713 ped, hdc, ptext + ped->cbChar*ichLineStart, 01714 ichCRLF - ichLineStart, 01715 ped->rcFmt.right - ped->rcFmt.left); 01716 } else { 01717 if (ped->fAnsi) { 01718 ichLineEnd = ichLineStart + 01719 ECCchInWidth(ped, hdc, 01720 ptext + ichLineStart, 01721 ichCRLF - ichLineStart, 01722 ped->rcFmt.right - ped->rcFmt.left, 01723 TRUE); 01724 } else { 01725 ichLineEnd = ichLineStart + 01726 ECCchInWidth(ped, hdc, 01727 (LPSTR)((LPWSTR)ptext + ichLineStart), 01728 ichCRLF - ichLineStart, 01729 ped->rcFmt.right - ped->rcFmt.left, 01730 TRUE); 01731 } 01732 } 01733 } else { 01734 ichLineEnd = ichLineStart; 01735 } 01736 01737 if (ichLineEnd == ichLineStart && ichCRLF - ichLineStart) { 01738 01739 /* 01740 * Maintain a minimum of one char per line 01741 */ 01742 // 01743 // Since it might be a double byte char, so calling ECNextIch. 01744 // 01745 ichLineEnd = ECNextIch(ped, NULL, ichLineEnd); 01746 } 01747 01748 /* 01749 * Now starting from ichLineEnd, if we are not at a hard line break, 01750 * then if we are not at a space AND the char before us is 01751 * not a space,(OR if we are at a CR) we will look word left for the 01752 * start of the word to break at. 01753 * This change was done for TWO reasons: 01754 * 1. If we are on a delimiter, no need to look word left to break at. 01755 * 2. If the previous char is a delimter, we can break at current char. 01756 * Change done by -- SANKAR --01/31/91-- 01757 */ 01758 if (ichLineEnd != ichCRLF) { 01759 if(ped->lpfnNextWord) { 01760 fOnDelimiter = (CALLWORDBREAKPROC(*ped->lpfnNextWord, ptext, 01761 ichLineEnd, ped->cch, WB_ISDELIMITER) || 01762 CALLWORDBREAKPROC(*ped->lpfnNextWord, ptext, ichLineEnd - 1, 01763 ped->cch, WB_ISDELIMITER)); 01764 // 01765 // This change was done for FOUR reasons: 01766 // 01767 // 1. If we are on a delimiter, no need to look word left to break at. 01768 // 2. If we are on a double byte character, we can break at current char. 01769 // 3. If the previous char is a delimter, we can break at current char. 01770 // 4. If the previous char is a double byte character, we can break at current char. 01771 // 01772 } else if (ped->fAnsi) { 01773 fOnDelimiter = (ISDELIMETERA(*(ptext + ichLineEnd)) || 01774 ECIsDBCSLeadByte(ped, *(ptext + ichLineEnd))); 01775 if (!fOnDelimiter) { 01776 PSTR pPrev = ECAnsiPrev(ped,ptext,ptext+ichLineEnd); 01777 01778 fOnDelimiter = ISDELIMETERA(*pPrev) || 01779 ECIsDBCSLeadByte(ped,*pPrev); 01780 } 01781 } else { // Unicode 01782 fOnDelimiter = (ISDELIMETERW(*((LPWSTR)ptext + ichLineEnd)) || 01783 UserIsFullWidth(CP_ACP,*((LPWSTR)ptext + ichLineEnd)) || 01784 ISDELIMETERW(*((LPWSTR)ptext + ichLineEnd - 1)) || 01785 UserIsFullWidth(CP_ACP,*((LPWSTR)ptext + ichLineEnd - 1))); 01786 } 01787 if (!fOnDelimiter || 01788 (ped->fAnsi && *(ptext + ichLineEnd) == 0x0D) || 01789 (!ped->fAnsi && *((LPWSTR)ptext + ichLineEnd) == 0x0D)) { 01790 01791 if (ped->lpfnNextWord != NULL) { 01792 cch = CALLWORDBREAKPROC(*ped->lpfnNextWord, (LPSTR)ptext, ichLineEnd, 01793 ped->cch, WB_LEFT); 01794 } else { 01795 ped->fCalcLines = TRUE; 01796 ECWord(ped, ichLineEnd, TRUE, &cch, NULL); 01797 ped->fCalcLines = FALSE; 01798 } 01799 if (cch > ichLineStart) { 01800 ichLineEnd = cch; 01801 } 01802 01803 /* 01804 * Now, if the above test fails, it means the word left goes 01805 * back before the start of the line ie. a word is longer 01806 * than a line on the screen. So, we just fit as much of 01807 * the word on the line as possible. Thus, we use the 01808 * pLineEnd we calculated solely on width at the beginning 01809 * of this else block... 01810 */ 01811 } 01812 } 01813 } 01814 #if 0 01815 if (!ISDELIMETERAW((*(ptext + (ichLineEnd - 1)*ped->cbChar))) && ISDELIMETERAW((*(ptext + ichLineEnd*ped->cbChar)))) #ERROR 01816 01817 if ((*(ptext + ichLineEnd - 1) != ' ' && 01818 *(ptext + ichLineEnd - 1) != VK_TAB) && 01819 (*(ptext + ichLineEnd) == ' ' || 01820 *(ptext + ichLineEnd) == VK_TAB)) 01821 #endif 01822 if (AWCOMPARECHAR(ped,ptext + ichLineEnd * ped->cbChar, ' ') || 01823 AWCOMPARECHAR(ped,ptext + ichLineEnd * ped->cbChar, VK_TAB)) { 01824 /* 01825 * Swallow the space at the end of a line. 01826 */ 01827 if (ichLineEnd < ped->cch) { 01828 ichLineEnd++; 01829 } 01830 } 01831 01832 /* 01833 * Skip over crlf or crcrlf if it exists. Thus, ichLineEnd is the first 01834 * character in the next line. 01835 */ 01836 ichLineEndBeforeCRLF = ichLineEnd; 01837 01838 if (ped->fAnsi) { 01839 if (ichLineEnd < ped->cch && *(ptext + ichLineEnd) == 0x0D) 01840 ichLineEnd += 2; 01841 01842 /* 01843 * Skip over CRCRLF 01844 */ 01845 if (ichLineEnd < ped->cch && *(ptext + ichLineEnd) == 0x0A) 01846 ichLineEnd++; 01847 UserAssert(ichLineEnd <= ped->cch); 01848 } else { 01849 if (ichLineEnd < ped->cch && *(((LPWSTR)ptext) + ichLineEnd) == 0x0D) 01850 ichLineEnd += 2; 01851 01852 /* 01853 * Skip over CRCRLF 01854 */ 01855 if (ichLineEnd < ped->cch && *(((LPWSTR)ptext) + ichLineEnd) == 0x0A) { 01856 ichLineEnd++; 01857 RIPMSG0(RIP_VERBOSE, "Skip over CRCRLF\n"); 01858 } 01859 UserAssert(ichLineEnd <= ped->cch); 01860 } 01861 01862 /* 01863 * Now, increment iLine, allocate space for the next line, and set its 01864 * starting point 01865 */ 01866 iLine++; 01867 01868 if (!fUserTyping || (iLine > ped->cLines - 1) || (ped->chLines[iLine] != ichLineEnd)) { 01869 01870 /* 01871 * The line break occured in a different place than before. 01872 */ 01873 if (!fLineBroken) { 01874 01875 /* 01876 * Since we haven't broken a line before, just set the min 01877 * break line. 01878 */ 01879 fLineBroken = TRUE; 01880 if (ichLineEndBeforeCRLF == ichLineEnd) 01881 minCchBreak = maxCchBreak = (ichLineEnd ? ichLineEnd - 1 : 0); 01882 else 01883 minCchBreak = maxCchBreak = ichLineEndBeforeCRLF; 01884 } 01885 maxCchBreak = max(maxCchBreak, ichLineEnd); 01886 01887 ECUnlock(ped); 01888 01889 /* 01890 * Now insert the new line into the array 01891 */ 01892 if (!MLInsertchLine(ped, iLine, ichLineEnd, (BOOL)(cchDelta != 0))) 01893 goto EndUp; 01894 01895 ptext = ECLock(ped); 01896 } else { 01897 maxCchBreak = ped->chLines[iLine]; 01898 01899 /* 01900 * Quick escape 01901 */ 01902 goto UnlockAndEndUp; 01903 } 01904 01905 ichLineStart = ichLineEnd; 01906 } /* end while (ichLineStart < ped->cch) */ 01907 01908 01909 if (iLine != ped->cLines) { 01910 RIPMSG1(RIP_VERBOSE, "chLines[%d] is being cleared.\n", iLine); 01911 ped->cLines = iLine; 01912 ped->chLines[ped->cLines] = 0; 01913 } 01914 01915 /* 01916 * Note that we incremented iLine towards the end of the while loop so, the 01917 * index, iLine, is actually equal to the line count 01918 */ 01919 if (ped->cch && AWCOMPARECHAR(ped, ptext + (ped->cch - 1)*ped->cbChar, 0x0A) && 01920 ped->chLines[ped->cLines - 1] < ped->cch) { 01921 01922 /* 01923 * Make sure last line has no crlf in it 01924 */ 01925 if (!fLineBroken) { 01926 01927 /* 01928 * Since we haven't broken a line before, just set the min break 01929 * line. 01930 */ 01931 fLineBroken = TRUE; 01932 minCchBreak = ped->cch - 1; 01933 } 01934 maxCchBreak = max(maxCchBreak, ichLineEnd); 01935 ECUnlock(ped); 01936 MLInsertchLine(ped, iLine, ped->cch, FALSE); 01937 MLSanityCheck(ped); 01938 } else 01939 UnlockAndEndUp: 01940 ECUnlock(ped); 01941 01942 EndUp: 01943 ECReleaseEditDC(ped, hdc, TRUE); 01944 if (pll) 01945 *pll = minCchBreak; 01946 if (phl) 01947 *phl = maxCchBreak; 01948 01949 UpdateScroll: 01950 MLScroll(ped, FALSE, ML_REFRESH, 0, TRUE); 01951 MLScroll(ped, TRUE, ML_REFRESH, 0, TRUE); 01952 01953 MLSanityCheck(ped); 01954 01955 return; 01956 }

int MLCalcXOffset PED  ,
HDC  ,
int 
 

Definition at line 85 of file editml.c.

References tagED::cbChar, tagED::chLines, ECGetEditDC(), ECLock(), ECReleaseEditDC(), ECUnlock(), tagED::format, ICH, max, MLGetLineWidth(), MLLine(), tagED::rcFmt, and TRUE.

Referenced by MLDrawText(), MLIchToXYPos(), and MLMouseToIch().

00089 { 00090 PSTR pText; 00091 ICH lineLength; 00092 ICH lineWidth; 00093 00094 if (ped->format == ES_LEFT) 00095 return (0); 00096 00097 lineLength = MLLine(ped, lineNumber); 00098 00099 if (lineLength) { 00100 00101 pText = ECLock(ped) + ped->chLines[lineNumber] * ped->cbChar; 00102 hdc = ECGetEditDC(ped, TRUE); 00103 lineWidth = MLGetLineWidth(hdc, pText, lineLength, ped); 00104 ECReleaseEditDC(ped, hdc, TRUE); 00105 ECUnlock(ped); 00106 } else { 00107 lineWidth = 0; 00108 } 00109 00110 /* 00111 * If a SPACE or a TAB was eaten at the end of a line by MLBuildchLines 00112 * to prevent a delimiter appearing at the begining of a line, the 00113 * the following calculation will become negative causing this bug. 00114 * So, now, we take zero in such cases. 00115 * Fix for Bug #3566 --01/31/91-- SANKAR -- 00116 */ 00117 lineWidth = max(0, (int)(ped->rcFmt.right-ped->rcFmt.left-lineWidth)); 00118 00119 if (ped->format == ES_CENTER) 00120 return (lineWidth / 2); 00121 00122 if (ped->format == ES_RIGHT) { 00123 00124 /* 00125 * Subtract 1 so that the 1 pixel wide cursor will be in the visible 00126 * region on the very right side of the screen. 00127 */ 00128 return max(0, (int)(lineWidth-1)); 00129 } 00130 00131 return 0; 00132 }

void MLChangeSelection PED  ,
HDC  ,
ICH  ,
ICH 
 

Definition at line 919 of file editml.c.

References _IsWindowVisible(), tagED::cch, ECCalcChangeSelection(), tagBLOCK::EndPos, tagED::fFocus, tagED::fNoHideSel, tagED::hwnd, ICH, tagED::ichMaxSel, tagED::ichMinSel, min, MLDrawText(), MLSetCaretPosition(), NtUserHideCaret(), NtUserShowCaret(), tagED::pwnd, tagBLOCK::StPos, and TRUE.

Referenced by MLKeyDown(), MLMouseMotion(), and MLSetSelection().

00924 { 00925 00926 ICH temp; 00927 ICH ichOldMinSel, ichOldMaxSel; 00928 00929 if (ichNewMinSel > ichNewMaxSel) { 00930 temp = ichNewMinSel; 00931 ichNewMinSel = ichNewMaxSel; 00932 ichNewMaxSel = temp; 00933 } 00934 ichNewMinSel = min(ichNewMinSel, ped->cch); 00935 ichNewMaxSel = min(ichNewMaxSel, ped->cch); 00936 00937 /* 00938 * Save the current selection 00939 */ 00940 ichOldMinSel = ped->ichMinSel; 00941 ichOldMaxSel = ped->ichMaxSel; 00942 00943 /* 00944 * Set new selection 00945 */ 00946 ped->ichMinSel = ichNewMinSel; 00947 ped->ichMaxSel = ichNewMaxSel; 00948 00949 /* 00950 * This finds the XOR of the old and new selection regions and redraws it. 00951 * There is nothing to repaint if we aren't visible or our selection 00952 * is hidden. 00953 */ 00954 if (_IsWindowVisible(ped->pwnd) && (ped->fFocus || ped->fNoHideSel)) { 00955 00956 BLOCK Blk[2]; 00957 int i; 00958 00959 if (ped->fFocus) { 00960 NtUserHideCaret(ped->hwnd); 00961 } 00962 00963 Blk[0].StPos = ichOldMinSel; 00964 Blk[0].EndPos = ichOldMaxSel; 00965 Blk[1].StPos = ped->ichMinSel; 00966 Blk[1].EndPos = ped->ichMaxSel; 00967 00968 if (ECCalcChangeSelection(ped, ichOldMinSel, ichOldMaxSel, (LPBLOCK)&Blk[0], (LPBLOCK)&Blk[1])) { 00969 00970 /* 00971 * Paint both Blk[0] and Blk[1], if they exist 00972 */ 00973 for (i = 0; i < 2; i++) { 00974 if (Blk[i].StPos != 0xFFFFFFFF) 00975 MLDrawText(ped, hdc, Blk[i].StPos, Blk[i].EndPos, TRUE); 00976 } 00977 } 00978 00979 /* 00980 * Update caret. 00981 */ 00982 MLSetCaretPosition(ped, hdc); 00983 00984 if (ped->fFocus) { 00985 NtUserShowCaret(ped->hwnd); 00986 } 00987 00988 } 00989 }

void MLChar PED  ,
DWORD  ,
int 
 

Definition at line 2531 of file editml.c.

References BOOL, BYTE, CTRLDOWN, DbcsCombine(), ECGetModKeys(), ECInOutReconversionMode(), ECIsCharNumeric(), ECIsDBCSLeadByte(), EFNUMBER, EFWANTRETURN, tagED::f40Compat, FALSE, tagED::fAnsi, tagED::fInDialogBox, tagED::fMouseDown, tagED::fReadOnly, HIBYTE, tagED::hwnd, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, L, LOBYTE, MLDeleteText(), MLInsertText(), MLMoveSelection(), msg, NtUserCallNoParam(), NtUserMessageBeep, tagED::pwnd, SendMessage(), TestWF, TRUE, and UINT.

Referenced by MLEditWndProc(), and MLKeyDown().

02535 { 02536 WCHAR keyPress; 02537 BOOL updateText = FALSE; 02538 02539 /* 02540 * keyValue is either: 02541 * a Virtual Key (eg: VK_TAB, VK_ESCAPE, VK_BACK) 02542 * a character (Unicode or "ANSI") 02543 */ 02544 if (ped->fAnsi) 02545 keyPress = LOBYTE(keyValue); 02546 else 02547 keyPress = LOWORD(keyValue); 02548 02549 if (ped->fMouseDown || keyPress == VK_ESCAPE) { 02550 02551 /* 02552 * If we are in the middle of a mousedown command, don't do anything. 02553 * Also, just ignore it if we get a translated escape key which happens 02554 * with multiline edit controls in a dialog box. 02555 */ 02556 return ; 02557 } 02558 02559 ECInOutReconversionMode(ped, FALSE); 02560 02561 { 02562 int scState; 02563 scState = ECGetModKeys(keyMods); 02564 02565 if (ped->fInDialogBox && scState != CTRLDOWN) { 02566 02567 /* 02568 * If this multiline edit control is in a dialog box, then we want the 02569 * TAB key to take you to the next control, shift TAB to take you to the 02570 * previous control, and CTRL-TAB to insert a tab into the edit control. 02571 * We moved the focus when we received the keydown message so we will 02572 * ignore the TAB key now unless the ctrl key is down. Also, we want 02573 * CTRL-RETURN to insert a return into the text and RETURN to be sent to 02574 * the default button. 02575 */ 02576 if (keyPress == VK_TAB || 02577 (keyPress == VK_RETURN && !TestWF(ped->pwnd, EFWANTRETURN))) 02578 return ; 02579 } 02580 02581 /* 02582 * Allow CTRL+C to copy from a read only edit control 02583 * Ignore all other keys in read only controls 02584 */ 02585 if ((ped->fReadOnly) && !((keyPress == 3) && (scState == CTRLDOWN))) { 02586 return ; 02587 } 02588 } 02589 02590 switch (keyPress) { 02591 case 0x0A: // linefeed 02592 keyPress = VK_RETURN; 02593 /* 02594 * FALL THRU 02595 */ 02596 02597 case VK_RETURN: 02598 case VK_TAB: 02599 case VK_BACK: 02600 DeleteSelection: 02601 if (MLDeleteText(ped)) 02602 updateText = TRUE; 02603 break; 02604 02605 default: 02606 if (keyPress >= TEXT(' ')) { 02607 /* 02608 * If this is in [a-z],[A-Z] and we are an ES_NUMBER 02609 * edit field, bail. 02610 */ 02611 if (ped->f40Compat && TestWF(ped->pwnd, EFNUMBER)) { 02612 if (!ECIsCharNumeric(ped, keyPress)) { 02613 goto IllegalChar; 02614 } 02615 } 02616 02617 goto DeleteSelection; 02618 } 02619 break; 02620 } 02621 02622 /* 02623 * Handle key codes 02624 */ 02625 switch(keyPress) { 02626 UINT msg; 02627 02628 // Ctrl+Z == Undo 02629 case 26: 02630 msg = WM_UNDO; 02631 goto SendEditingMessage; 02632 break; 02633 02634 // Ctrl+X == Cut 02635 case 24: 02636 if (ped->ichMinSel == ped->ichMaxSel) 02637 goto IllegalChar; 02638 else 02639 { 02640 msg = WM_CUT; 02641 goto SendEditingMessage; 02642 } 02643 break; 02644 02645 // Ctrl+C == Copy 02646 case 3: 02647 msg = WM_COPY; 02648 goto SendEditingMessage; 02649 break; 02650 02651 // Ctrl+V == Paste 02652 case 22: 02653 msg = WM_PASTE; 02654 SendEditingMessage: 02655 SendMessage(ped->hwnd, msg, 0, 0L); 02656 break; 02657 02658 case VK_BACK: 02659 // 02660 // Delete any selected text or delete character left if no sel 02661 // 02662 if (!updateText && ped->ichMinSel) 02663 { 02664 // 02665 // There was no selection to delete so we just delete 02666 // character left if available 02667 // 02668 ped->ichMinSel = MLMoveSelection(ped, ped->ichCaret, TRUE); 02669 MLDeleteText(ped); 02670 } 02671 break; 02672 02673 default: 02674 if (keyPress == VK_RETURN) 02675 if (ped->fAnsi) 02676 keyValue = 0x0A0D; 02677 else 02678 keyValue = 0x000A000D; 02679 02680 if ( keyPress >= TEXT(' ') 02681 || keyPress == VK_RETURN 02682 || keyPress == VK_TAB 02683 || keyPress == 0x1E // RS - Unicode block separator 02684 || keyPress == 0x1F // US - Unicode segment separator 02685 ) { 02686 02687 NtUserCallNoParam(SFI_ZZZHIDECURSORNOCAPTURE); 02688 if (ped->fAnsi) { 02689 // 02690 // check if it's a leading byte of double byte character 02691 // 02692 if (ECIsDBCSLeadByte(ped,(BYTE)keyPress)) { 02693 int DBCSkey; 02694 02695 if ((DBCSkey = DbcsCombine(ped->hwnd, keyPress)) != 0) 02696 keyValue = DBCSkey; 02697 } 02698 MLInsertText(ped, (LPSTR)&keyValue, HIBYTE(keyValue) ? 2 : 1, TRUE); 02699 } else 02700 MLInsertText(ped, (LPSTR)&keyValue, HIWORD(keyValue) ? 2 : 1, TRUE); 02701 } else { 02702 IllegalChar: 02703 NtUserMessageBeep(0); 02704 } 02705 break; 02706 } 02707 }

LONG MLCreate PED  ,
LPCREATESTRUCT 
 

Definition at line 23 of file edmlonce.c.

References tagED::cchTextMax, tagED::chLines, ClearWindowState(), tagED::cLines, ECCreate(), ECSetFont(), ECSetText(), FALSE, tagED::fAutoHScroll, tagED::fAutoVScroll, tagED::format, tagED::fWrap, gHighestUserAddress, LPICH, MAXTEXT, NULL, tagED::pwnd, REBASEPTR, TRUE, and WFHSCROLL.

Referenced by MLEditWndProc().

00026 { 00027 LONG windowStyle; 00028 LPWSTR lpszName; 00029 00030 /* 00031 * Get values from the window instance data structure and put them in the 00032 * ped so that we can access them easier 00033 */ 00034 windowStyle = ped->pwnd->style; 00035 00036 /* 00037 * Do the standard creation stuff 00038 */ 00039 if (!ECCreate(ped, windowStyle)) { 00040 return (-1); 00041 } 00042 00043 /* 00044 * Allocate line start array in local heap and lock it down 00045 */ 00046 ped->chLines = (LPICH)LocalAlloc(LPTR, 2 * sizeof(int)); 00047 if (ped->chLines == NULL) { 00048 return (-1); 00049 } 00050 00051 /* 00052 * Call it one line of text... 00053 */ 00054 ped->cLines = 1; 00055 00056 /* 00057 * If app wants WS_VSCROLL or WS_HSCROLL, it automatically gets AutoVScroll 00058 * or AutoHScroll. 00059 */ 00060 if ((windowStyle & ES_AUTOVSCROLL) || (windowStyle & WS_VSCROLL)) { 00061 ped->fAutoVScroll = 1; 00062 } 00063 00064 if (ped->format != ES_LEFT) 00065 { 00066 /* 00067 * If user wants right or center justified text, then we turn off 00068 * AUTOHSCROLL and WS_HSCROLL since non-left styles don't make sense 00069 * otherwise. 00070 */ 00071 windowStyle &= ~WS_HSCROLL; 00072 ClearWindowState(ped->pwnd, WFHSCROLL); 00073 ped->fAutoHScroll = FALSE; 00074 } 00075 else if (windowStyle & WS_HSCROLL) { 00076 ped->fAutoHScroll = TRUE; 00077 } 00078 00079 ped->fWrap = (!ped->fAutoHScroll && !(windowStyle & WS_HSCROLL)); 00080 00081 /* 00082 * Max # chars we will allow user to enter 00083 */ 00084 ped->cchTextMax = MAXTEXT; 00085 00086 /* 00087 * Set the default font to be the system font. 00088 */ 00089 ECSetFont(ped, NULL, FALSE) ; 00090 00091 /* 00092 * Set the window text if needed and notify parent if not enough memory to 00093 * set the initial text. 00094 */ 00095 if ((ULONG_PTR)lpCreateStruct->lpszName > gHighestUserAddress) 00096 lpszName = REBASEPTR(ped->pwnd, (PVOID)lpCreateStruct->lpszName); 00097 else 00098 lpszName = (LPWSTR)lpCreateStruct->lpszName; 00099 if (!ECSetText(ped, (LPSTR)lpszName)) 00100 return (-1); 00101 00102 return (TRUE); 00103 }

ICH MLDeleteText PED   ) 
 

Definition at line 1367 of file editml.c.

References _IsWindowVisible(), BOOL, tagED::cch, tagED::chLines, CopyRect, ECDeleteText(), ECGetEditDC(), ECNextIch(), ECNotifyParent(), ECReleaseEditDC(), FALSE, tagED::fAnsi, tagED::fAutoVScroll, tagED::fDBCS, tagED::fDirty, FWINABLE, tagED::hwnd, ICH, tagED::ichMaxSel, tagED::ichMinSel, INT, tagED::lineHeight, max, MLBuildchLines(), MLDrawText(), MLEnsureCaretVisible(), MLIchToLine(), MLIchToXYPos(), MLIchToYPos(), MLShiftchLines(), MLUpdateiCaretLine(), NotifyWinEvent(), NtUserInvalidateRect(), NULL, tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, TRUE, tagED::wLeftMargin, and tagED::wRightMargin.

Referenced by ECImeComposition(), EditWndProc(), MLChar(), MLPasteText(), and MLReplaceSel().

01369 { 01370 ICH minSel = ped->ichMinSel; 01371 ICH maxSel = ped->ichMaxSel; 01372 ICH cchDelete; 01373 HDC hdc; 01374 int minSelLine; 01375 int maxSelLine; 01376 POINT xyPos; 01377 RECT rc; 01378 BOOL fFastDelete = FALSE; 01379 LONG hl; 01380 INT cchcount = 0; 01381 01382 /* 01383 * Get what line the min selection is on so that we can start rebuilding the 01384 * text from there if we delete anything. 01385 */ 01386 minSelLine = MLIchToLine(ped, minSel); 01387 maxSelLine = MLIchToLine(ped, maxSel); 01388 // 01389 // Calculate fFastDelete and cchcount 01390 // 01391 if (ped->fAnsi && ped->fDBCS) { 01392 if ((ped->fAutoVScroll) && 01393 (minSelLine == maxSelLine) && 01394 (ped->chLines[minSelLine] != minSel) && 01395 (ECNextIch(ped,NULL,minSel) == maxSel)) { 01396 01397 fFastDelete = TRUE; 01398 cchcount = ((maxSel - minSel) == 1) ? 0 : -1; 01399 } 01400 } else if (((maxSel - minSel) == 1) && (minSelLine == maxSelLine) && (ped->chLines[minSelLine] != minSel)) { 01401 if (!ped->fAutoVScroll) 01402 fFastDelete = FALSE; 01403 else 01404 fFastDelete = TRUE; 01405 } 01406 if (!(cchDelete = ECDeleteText(ped))) 01407 return (0); 01408 01409 /* 01410 * Start building lines at minsel line since caretline may be at the max sel 01411 * point. 01412 */ 01413 if (fFastDelete) { 01414 // 01415 // cchcount is (-1) if it's a double byte character 01416 // 01417 MLShiftchLines(ped, minSelLine + 1, -2 + cchcount); 01418 MLBuildchLines(ped, minSelLine, 1, TRUE, NULL, &hl); 01419 } else { 01420 MLBuildchLines(ped, max(minSelLine-1,0), -(int)cchDelete, FALSE, NULL, NULL); 01421 } 01422 01423 MLUpdateiCaretLine(ped); 01424 01425 ECNotifyParent(ped, EN_UPDATE); 01426 01427 if (_IsWindowVisible(ped->pwnd)) { 01428 01429 /* 01430 * Now update the screen to reflect the deletion 01431 */ 01432 hdc = ECGetEditDC(ped, FALSE); 01433 01434 /* 01435 * Otherwise just redraw starting at the line we just entered 01436 */ 01437 minSelLine = max(minSelLine-1,0); 01438 MLDrawText(ped, hdc, ped->chLines[minSelLine], 01439 fFastDelete ? hl : ped->cch, FALSE); 01440 01441 CopyRect(&rc, &ped->rcFmt); 01442 rc.left -= ped->wLeftMargin; 01443 rc.right += ped->wRightMargin; 01444 01445 if (ped->cch) { 01446 01447 /* 01448 * Clear from end of text to end of window. 01449 * 01450 * We only need the y position. Since with an LPK loaded 01451 * calculating the x position is an intensive job, just 01452 * call MLIchToYPos. 01453 */ 01454 if (ped->pLpkEditCallout) 01455 xyPos.y = MLIchToYPos(ped, ped->cch, FALSE); 01456 else 01457 MLIchToXYPos(ped, hdc, ped->cch, FALSE, &xyPos); 01458 rc.top = xyPos.y + ped->lineHeight; 01459 } 01460 01461 NtUserInvalidateRect(ped->hwnd, &rc, TRUE); 01462 ECReleaseEditDC(ped, hdc, FALSE); 01463 01464 MLEnsureCaretVisible(ped); 01465 } 01466 01467 ped->fDirty = TRUE; 01468 01469 ECNotifyParent(ped, EN_CHANGE); 01470 01471 if (cchDelete && FWINABLE()) 01472 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01473 01474 return cchDelete; 01475 }

void MLDrawLine PED  ,
HDC  ,
int  ,
ICH  ,
int  ,
BOOL 
 

void MLDrawText PED  ,
HDC  ,
ICH  ,
ICH  ,
BOOL 
 

Definition at line 3991 of file editml.c.

References BOOL, tagED::cbChar, tagED::cch, tagED::chLines, tagED::cLines, CopyRect, DWORD, ECAdjustIch(), ECAdjustIchNext(), ECGetBrush(), ECLock(), ECT_NORMAL, ECT_SELECTED, ECTabTheTextOut(), ECUnlock(), tagLPKEDITCALLOUT::EditDrawText, FALSE, tagED::fAnsi, tagED::fDBCS, tagED::fDisabled, tagED::fFocus, tagED::fNoHideSel, tagED::format, GetSysColor(), tagED::hwnd, ICH, tagED::ichLinesOnScreen, tagED::ichMaxSel, tagED::ichMinSel, tagED::ichScreenStart, INT, tagED::lineHeight, max, MAXCLIPENDPOS, min, MLCalcXOffset(), MLIchToLine(), MLIchToXYPos(), MLIchToYPos(), MLLine(), MLSetCaretPosition(), STRIPINFO::nCount, NtUserHideCaret(), NtUserInvalidateRect(), NtUserShowCaret(), tagED::pLpkEditCallout, tagED::rcFmt, TRUE, UINT, tagED::wLeftMargin, tagED::wMaxNegAcharPos, tagED::wMaxNegC, tagED::wMaxNegCcharPos, tagED::wRightMargin, tagED::xOffset, and STRIPINFO::XStartPos.

Referenced by MLChangeSelection(), MLDeleteText(), MLInsertText(), MLKillFocus(), MLPaint(), and MLSetFocus().

03997 { 03998 DWORD textColorSave; 03999 DWORD bkColorSave; 04000 PSTR pText; 04001 UINT wCurLine; 04002 UINT wEndLine; 04003 int xOffset; 04004 ICH LengthToDraw; 04005 ICH CurStripLength; 04006 ICH ichAttrib, ichNewStart; 04007 ICH ExtraLengthForNegA; 04008 ICH ichT; 04009 int iRemainingLengthInLine; 04010 int xStPos, xClipStPos, xClipEndPos, yPos; 04011 BOOL fFirstLineOfBlock = TRUE; 04012 BOOL fDrawEndOfLineStrip = FALSE; 04013 BOOL fDrawOnSameLine = FALSE; 04014 BOOL fSelected = FALSE; 04015 BOOL fLineBegins = FALSE; 04016 STRIPINFO NegCInfo; 04017 POINT pt; 04018 04019 // 04020 // Just return if nothing to draw 04021 if (!ped->ichLinesOnScreen) 04022 return; 04023 04024 ECGetBrush(ped, hdc); 04025 04026 // 04027 // Adjust the value of ichStart such that we need to draw only those lines 04028 // visible on the screen. 04029 // 04030 if ((UINT)ichStart < (UINT)ped->chLines[ped->ichScreenStart]) { 04031 ichStart = ped->chLines[ped->ichScreenStart]; 04032 if (ichStart > ichEnd) 04033 return; 04034 } 04035 04036 // Adjust the value of ichEnd such that we need to draw only those lines 04037 // visible on the screen. 04038 wCurLine = min(ped->ichScreenStart+ped->ichLinesOnScreen,ped->cLines-1); 04039 ichT = ped->chLines[wCurLine] + MLLine(ped, wCurLine); 04040 ichEnd = min(ichEnd, ichT); 04041 04042 wCurLine = MLIchToLine(ped, ichStart); // Starting line. 04043 wEndLine = MLIchToLine(ped, ichEnd); // Ending line. 04044 04045 UserAssert(ped->chLines[wCurLine] <= ped->cch + 1); 04046 UserAssert(ped->chLines[wEndLine] <= ped->cch + 1); 04047 04048 if (fSelChange && (GetBkMode(hdc) != OPAQUE)) 04049 { 04050 /* 04051 * if changing selection on a transparent edit control, just 04052 * draw those lines from scratch 04053 */ 04054 RECT rcStrip; 04055 CopyRect(&rcStrip, &ped->rcFmt); 04056 rcStrip.left -= ped->wLeftMargin; 04057 if (ped->pLpkEditCallout) { 04058 rcStrip.right += ped->wRightMargin; 04059 } 04060 rcStrip.top += (wCurLine - ped->ichScreenStart) * ped->lineHeight; 04061 rcStrip.bottom = rcStrip.top + ((wEndLine - wCurLine) + 1) * ped->lineHeight; 04062 NtUserInvalidateRect(ped->hwnd, &rcStrip, TRUE); 04063 return; 04064 } 04065 04066 // If it is either centered or right-justified, then draw the whole lines. 04067 // Also draw whole lines if the language pack is handling line layout. 04068 if ((ped->format != ES_LEFT) || (ped->pLpkEditCallout)) { 04069 ichStart = ped->chLines[wCurLine]; 04070 ichEnd = ped->chLines[wEndLine] + MLLine(ped, wEndLine); 04071 } 04072 04073 pText = ECLock(ped); 04074 04075 NtUserHideCaret(ped->hwnd); 04076 04077 // 04078 // If ichStart stays on Second byte of DBCS, we have to 04079 // adjust it. LiZ -- 5/5/93 04080 // 04081 if (ped->fAnsi && ped->fDBCS) { 04082 ichStart = ECAdjustIch( ped, pText, ichStart ); 04083 } 04084 UserAssert(ichStart <= ped->cch); 04085 UserAssert(ichEnd <= ped->cch); 04086 04087 while (ichStart <= ichEnd) { 04088 // Pass whole lines to the language pack to display with selection 04089 // marking and tab expansion. 04090 if (ped->pLpkEditCallout) { 04091 ped->pLpkEditCallout->EditDrawText( 04092 ped, hdc, pText + ped->cbChar*ichStart, 04093 MLLine(ped, wCurLine), 04094 (INT)ped->ichMinSel - (INT)ichStart, (INT)ped->ichMaxSel - (INT)ichStart, 04095 MLIchToYPos(ped, ichStart, FALSE)); 04096 } else { 04097 // xStPos: The starting Position where the string must be drawn. 04098 // xClipStPos: The starting position for the clipping rect for the block. 04099 // xClipEndPos: The ending position for the clipping rect for the block. 04100 04101 // Calculate the xyPos of starting point of the block. 04102 MLIchToXYPos(ped, hdc, ichStart, FALSE, &pt); 04103 xClipStPos = xStPos = pt.x; 04104 yPos = pt.y; 04105 04106 // The attributes of the block is the same as that of ichStart. 04107 ichAttrib = ichStart; 04108 04109 // If the current font has some negative C widths and if this is the 04110 // begining of a block, we must start drawing some characters before the 04111 // block to account for the negative C widths of the strip before the 04112 // current strip; In this case, reset ichStart and xStPos. 04113 04114 if (fFirstLineOfBlock && ped->wMaxNegC) { 04115 fFirstLineOfBlock = FALSE; 04116 ichNewStart = max(((int)(ichStart - ped->wMaxNegCcharPos)), ((int)ped->chLines[wCurLine])); 04117 04118 // If ichStart needs to be changed, then change xStPos also accordingly. 04119 if (ichNewStart != ichStart) { 04120 if (ped->fAnsi && ped->fDBCS) { 04121 // 04122 // Adjust DBCS alignment... 04123 // 04124 ichNewStart = ECAdjustIchNext( ped, pText, ichNewStart ); 04125 } 04126 MLIchToXYPos(ped, hdc, ichStart = ichNewStart, FALSE, &pt); 04127 xStPos = pt.x; 04128 } 04129 } 04130 04131 // Calc the number of characters remaining to be drawn in the current line. 04132 iRemainingLengthInLine = MLLine(ped, wCurLine) - 04133 (ichStart - ped->chLines[wCurLine]); 04134 04135 // If this is the last line of a block, we may not have to draw all the 04136 // remaining lines; We must draw only upto ichEnd. 04137 if (wCurLine == wEndLine) 04138 LengthToDraw = ichEnd - ichStart; 04139 else 04140 LengthToDraw = iRemainingLengthInLine; 04141 04142 // Find out how many pixels we indent the line for non-left-justified 04143 // formats 04144 if (ped->format != ES_LEFT) 04145 xOffset = MLCalcXOffset(ped, hdc, wCurLine); 04146 else 04147 xOffset = -((int)(ped->xOffset)); 04148 04149 // Check if this is the begining of a line. 04150 if (ichAttrib == ped->chLines[wCurLine]) { 04151 fLineBegins = TRUE; 04152 xClipStPos = ped->rcFmt.left - ped->wLeftMargin; 04153 } 04154 04155 // 04156 // The following loop divides this 'wCurLine' into strips based on the 04157 // selection attributes and draw them strip by strip. 04158 do { 04159 // 04160 // If ichStart is pointing at CRLF or CRCRLF, then iRemainingLength 04161 // could have become negative because MLLine does not include 04162 // CR and LF at the end of a line. 04163 // 04164 if (iRemainingLengthInLine < 0) // If Current line is completed, 04165 break; // go on to the next line. 04166 04167 // 04168 // Check if a part of the block is selected and if we need to 04169 // show it with a different attribute. 04170 // 04171 if (!(ped->ichMinSel == ped->ichMaxSel || 04172 ichAttrib >= ped->ichMaxSel || 04173 ichEnd < ped->ichMinSel || 04174 (!ped->fNoHideSel && !ped->fFocus))) { 04175 // 04176 // OK! There is a selection somewhere in this block! 04177 // Check if this strip has selection attribute. 04178 // 04179 if (ichAttrib < ped->ichMinSel) { 04180 fSelected = FALSE; // This strip is not selected 04181 04182 // Calculate the length of this strip with normal attribute. 04183 CurStripLength = min(ichStart+LengthToDraw, ped->ichMinSel)-ichStart; 04184 fLineBegins = FALSE; 04185 } else { 04186 // The current strip has the selection attribute. 04187 if (fLineBegins) { // Is it the first part of a line? 04188 // Then, draw the left margin area with normal attribute. 04189 fSelected = FALSE; 04190 CurStripLength = 0; 04191 xClipStPos = ped->rcFmt.left - ped->wLeftMargin; 04192 fLineBegins = FALSE; 04193 } else { 04194 // Else, draw the strip with selection attribute. 04195 fSelected = TRUE; 04196 CurStripLength = min(ichStart+LengthToDraw, ped->ichMaxSel)-ichStart; 04197 04198 // Select in the highlight colors. 04199 bkColorSave = SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); 04200 if (!ped->fDisabled) 04201 textColorSave = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); 04202 } 04203 } 04204 } else { 04205 // The whole strip has no selection attributes. 04206 CurStripLength = LengthToDraw; 04207 } 04208 04209 // 04210 // Other than the current strip, do we still have anything 04211 // left to be drawn in the current line? 04212 // 04213 fDrawOnSameLine = (LengthToDraw != CurStripLength); 04214 04215 // 04216 // When we draw this strip, we need to draw some more characters 04217 // beyond the end of this strip to account for the negative A 04218 // widths of the characters that follow this strip. 04219 // 04220 ExtraLengthForNegA = min(iRemainingLengthInLine-CurStripLength, ped->wMaxNegAcharPos); 04221 04222 // 04223 // The blank strip at the end of the line needs to be drawn with 04224 // normal attribute irrespective of whether the line has selection 04225 // attribute or not. Hence, if the last strip of the line has selection 04226 // attribute, then this blank strip needs to be drawn separately. 04227 // Else, we can draw the blank strip along with the last strip. 04228 // 04229 04230 // Is this the last strip of the current line? 04231 if (iRemainingLengthInLine == (int)CurStripLength) { 04232 if (fSelected) { // Does this strip have selection attribute? 04233 // Then we need to draw the end of line strip separately. 04234 fDrawEndOfLineStrip = TRUE; // Draw the end of line strip. 04235 MLIchToXYPos(ped, hdc, ichStart+CurStripLength, TRUE, &pt); 04236 xClipEndPos = pt.x; 04237 } else { 04238 // 04239 // Set the xClipEndPos to a big value sothat the blank 04240 // strip will be drawn automatically when the last strip 04241 // is drawn. 04242 // 04243 xClipEndPos = MAXCLIPENDPOS; 04244 } 04245 } else { 04246 // 04247 // This is not the last strip of this line; So, set the ending 04248 // clip position accurately. 04249 // 04250 MLIchToXYPos(ped, hdc, ichStart+CurStripLength, FALSE, &pt); 04251 xClipEndPos = pt.x; 04252 } 04253 04254 // 04255 // Draw the current strip starting from xStPos, clipped to the area 04256 // between xClipStPos and xClipEndPos. Obtain "NegCInfo" and use it 04257 // in drawing the next strip. 04258 // 04259 ECTabTheTextOut(hdc, xClipStPos, xClipEndPos, 04260 xStPos, yPos, (LPSTR)(pText+ichStart*ped->cbChar), 04261 CurStripLength+ExtraLengthForNegA, ichStart, ped, 04262 ped->rcFmt.left+xOffset, fSelected ? ECT_SELECTED : ECT_NORMAL, &NegCInfo); 04263 04264 if (fSelected) { 04265 // 04266 // If this strip was selected, then the next strip won't have 04267 // selection attribute 04268 // 04269 fSelected = FALSE; 04270 SetBkColor(hdc, bkColorSave); 04271 if (!ped->fDisabled) 04272 SetTextColor(hdc, textColorSave); 04273 } 04274 04275 // Do we have one more strip to draw on the current line? 04276 if (fDrawOnSameLine || fDrawEndOfLineStrip) { 04277 int iLastDrawnLength; 04278 04279 // 04280 // Next strip's attribute is decided based on the char at ichAttrib 04281 // 04282 ichAttrib = ichStart + CurStripLength; 04283 04284 // 04285 // When drawing the next strip, start at a few chars before 04286 // the actual start to account for the Neg 'C' of the strip 04287 // just drawn. 04288 // 04289 iLastDrawnLength = CurStripLength +ExtraLengthForNegA - NegCInfo.nCount; 04290 // 04291 // Adjust DBCS alignment... 04292 // 04293 if (ped->fAnsi && ped->fDBCS) { 04294 ichNewStart = ECAdjustIch(ped,pText,ichStart+iLastDrawnLength); 04295 iLastDrawnLength = ichNewStart - ichStart; 04296 ichStart = ichNewStart; 04297 } else { 04298 ichStart += iLastDrawnLength; 04299 } 04300 LengthToDraw -= iLastDrawnLength; 04301 iRemainingLengthInLine -= iLastDrawnLength; 04302 04303 // 04304 // The start of clip rect for the next strip. 04305 // 04306 xStPos = NegCInfo.XStartPos; 04307 xClipStPos = xClipEndPos; 04308 } 04309 04310 // Draw the blank strip at the end of line seperately, if required. 04311 if (fDrawEndOfLineStrip) { 04312 ECTabTheTextOut(hdc, xClipStPos, MAXCLIPENDPOS, xStPos, yPos, 04313 (LPSTR)(pText+ichStart*ped->cbChar), LengthToDraw, ichStart, 04314 ped, ped->rcFmt.left+xOffset, ECT_NORMAL, &NegCInfo); 04315 04316 fDrawEndOfLineStrip = FALSE; 04317 } 04318 } 04319 while(fDrawOnSameLine); // do while loop ends here. 04320 } 04321 04322 // Let us move on to the next line of this block to be drawn. 04323 wCurLine++; 04324 if (ped->cLines > wCurLine) 04325 ichStart = ped->chLines[wCurLine]; 04326 else 04327 ichStart = ichEnd+1; // We have reached the end of the text. 04328 } // while loop ends here 04329 04330 ECUnlock(ped); 04331 04332 NtUserShowCaret(ped->hwnd); 04333 MLSetCaretPosition(ped, hdc); 04334 }

LRESULT MLEditWndProc HWND  ,
PED  ,
UINT  ,
WPARAM  ,
LPARAM 
 

Definition at line 3457 of file editml.c.

References _IsWindowVisible(), abs, tagED::aveCharWidth, BOOL, tagED::cch, DefWindowProcWorker(), DWORD, ECEmptyUndo(), ECGetCaretWidth, ECGetEditDC(), ECInOutReconversionMode(), ECLock(), ECReleaseEditDC(), ECSize(), ECUnlock(), ECUpdateFormat(), tagLPKEDITCALLOUT::EditCreateCaret, EnterReaderModeHelper(), tagED::f40Compat, FALSE, tagED::fAnsi, tagED::fDisabled, tagED::fFocus, FillWindow, tagED::fInDialogBox, tagED::fMouseDown, tagED::fReadOnly, gcWheelDelta, gpsi, tagED::hText, tagED::hwnd, tagED::hwndParent, ICH, tagED::ichLinesOnScreen, tagED::ichScreenStart, IDSYS_SCROLL, INT, L, tagED::lineHeight, max, min, MLBuildchLines(), MLChar(), MLCreate(), MLEnsureCaretVisible(), MLGetLine(), MLIchToLine(), MLIchToXYPos(), MLInsertCrCrLf(), MLKeyDown(), MLKillFocus(), MLLineIndex(), MLLineLength(), MLMouseMotion(), MLMouseToIch(), MLPaint(), MLPasteText(), MLReplaceSel(), MLScroll(), MLSetCaretPosition(), MLSetFocus(), MLSetHandle(), MLSetSelection(), MLSetTabStops(), MLStripCrCrLf(), MLUndo(), NtUserBeginPaint(), NtUserDestroyCaret, NtUserEndPaint(), NtUserHideCaret(), NtUserKillSystemTimer, NtUserShowCaret(), NULL, tagED::pLpkEditCallout, tagED::prevKeys, tagED::ptPrevMouse, Pundo, tagED::pwnd, tagED::rcFmt, RedrawWindow, SendMessage(), SYS_ALTERNATE, TRUE, UINT, and WM_SYSTIMER.

Referenced by ECClearText(), and EditWndProc().

03463 { 03464 HDC hdc; 03465 PAINTSTRUCT ps; 03466 LPRECT lprc; 03467 POINT pt; 03468 DWORD windowstyle; 03469 03470 switch (message) { 03471 03472 case WM_INPUTLANGCHANGE: 03473 if (ped && ped->fFocus && ped->pLpkEditCallout) { 03474 NtUserHideCaret(hwnd); 03475 hdc = ECGetEditDC(ped, TRUE); 03476 NtUserDestroyCaret(); 03477 ped->pLpkEditCallout->EditCreateCaret (ped, hdc, ECGetCaretWidth(), ped->lineHeight, (UINT)lParam); 03478 MLSetCaretPosition(ped, hdc); 03479 ECReleaseEditDC(ped, hdc, TRUE); 03480 NtUserShowCaret(hwnd); 03481 } 03482 goto PassToDefaultWindowProc; 03483 03484 03485 case WM_STYLECHANGED: 03486 if (ped && ped->pLpkEditCallout) { 03487 switch (wParam) { 03488 03489 case GWL_STYLE: 03490 ECUpdateFormat(ped, 03491 ((LPSTYLESTRUCT)lParam)->styleNew, 03492 GetWindowLong(ped->hwnd, GWL_EXSTYLE)); 03493 return 1L; 03494 03495 case GWL_EXSTYLE: 03496 ECUpdateFormat(ped, 03497 GetWindowLong(ped->hwnd, GWL_STYLE), 03498 ((LPSTYLESTRUCT)lParam)->styleNew); 03499 return 1L; 03500 } 03501 } 03502 03503 goto PassToDefaultWindowProc; 03504 03505 case WM_CHAR: 03506 03507 /* 03508 * wParam - the value of the key 03509 * lParam - modifiers, repeat count etc (not used) 03510 */ 03511 MLChar(ped, (UINT)wParam, 0); 03512 break; 03513 03514 case WM_ERASEBKGND: { 03515 HBRUSH hbr; 03516 03517 // USE SAME RULES AS IN ECGetBrush() 03518 if (ped->f40Compat && 03519 (ped->fReadOnly || ped->fDisabled)) 03520 hbr = (HBRUSH) CTLCOLOR_STATIC; 03521 else 03522 hbr = (HBRUSH) CTLCOLOR_EDIT; 03523 03524 FillWindow(ped->hwndParent, hwnd, (HDC)wParam, hbr); 03525 } 03526 return ((LONG)TRUE); 03527 03528 case WM_GETDLGCODE: { 03529 LONG code = DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS | DLGC_WANTALLKEYS; 03530 03531 /* 03532 ** !!! JEFFBOG HACK !!! 03533 ** Only set Dialog Box Flag if GETDLGCODE message is generated by 03534 ** IsDialogMessage -- if so, the lParam will be a pointer to the 03535 ** message structure passed to IsDialogMessage; otherwise, lParam 03536 ** will be NULL. Reason for the HACK alert: the wParam & lParam 03537 ** for GETDLGCODE is still not clearly defined and may end up 03538 ** changing in a way that would throw this off 03539 ** 03540 */ 03541 if (lParam) 03542 ped->fInDialogBox = TRUE; // Mark ML edit ctrl as in a dialog box 03543 03544 /* 03545 ** If this is a WM_SYSCHAR message generated by the UNDO keystroke 03546 ** we want this message so we can EAT IT in "case WM_SYSCHAR:" 03547 */ 03548 if (lParam && (((LPMSG)lParam)->message == WM_SYSCHAR) && 03549 ((DWORD)((LPMSG)lParam)->lParam & SYS_ALTERNATE) && 03550 ((WORD)wParam == VK_BACK)) 03551 code |= DLGC_WANTMESSAGE; 03552 return code; 03553 } 03554 03555 case EM_SCROLL: 03556 message = WM_VSCROLL; 03557 03558 /* 03559 * FALL THROUGH 03560 */ 03561 case WM_HSCROLL: 03562 case WM_VSCROLL: 03563 return MLScroll(ped, (message==WM_VSCROLL), LOWORD(wParam), HIWORD(wParam), TRUE); 03564 03565 case WM_MOUSEWHEEL: 03566 /* 03567 * Don't handle zoom and datazoom. 03568 */ 03569 if (wParam & (MK_SHIFT | MK_CONTROL)) { 03570 goto PassToDefaultWindowProc; 03571 } 03572 03573 gcWheelDelta -= (short) HIWORD(wParam); 03574 windowstyle = ped->pwnd->style; 03575 if ( abs(gcWheelDelta) >= WHEEL_DELTA && 03576 gpsi->ucWheelScrollLines > 0 && 03577 (windowstyle & (WS_VSCROLL | WS_HSCROLL))) { 03578 03579 int cLineScroll; 03580 BOOL fVert; 03581 int cPage; 03582 03583 if (windowstyle & WS_VSCROLL) { 03584 fVert = TRUE; 03585 cPage = ped->ichLinesOnScreen; 03586 } else { 03587 fVert = FALSE; 03588 cPage = (ped->rcFmt.right - ped->rcFmt.left) / ped->aveCharWidth; 03589 } 03590 03591 /* 03592 * Limit a roll of one (1) WHEEL_DELTA to scroll one (1) page. 03593 */ 03594 cLineScroll = (int) min( 03595 (UINT) (max(1, (cPage - 1))), 03596 gpsi->ucWheelScrollLines); 03597 03598 cLineScroll *= (gcWheelDelta / WHEEL_DELTA); 03599 UserAssert(cLineScroll != 0); 03600 gcWheelDelta = gcWheelDelta % WHEEL_DELTA; 03601 MLScroll(ped, fVert, EM_LINESCROLL, cLineScroll, TRUE); 03602 } 03603 03604 break; 03605 03606 case WM_KEYDOWN: 03607 03608 /* 03609 * wParam - virt keycode of the given key 03610 * lParam - modifiers such as repeat count etc. (not used) 03611 */ 03612 MLKeyDown(ped, (UINT)wParam, 0); 03613 break; 03614 03615 case WM_KILLFOCUS: 03616 03617 /* 03618 * wParam - handle of the window that receives the input focus 03619 * lParam - not used 03620 */ 03621 MLKillFocus(ped); 03622 break; 03623 03624 case WM_CAPTURECHANGED: 03625 // 03626 // wParam -- unused 03627 // lParam -- hwnd of window gaining capture. 03628 // 03629 if (ped->fMouseDown) { 03630 // 03631 // We don't change the caret pos here. If this is happening 03632 // due to button up, then we'll change the pos in the 03633 // handler after ReleaseCapture(). Otherwise, just end 03634 // gracefully because someone else has stolen capture out 03635 // from under us. 03636 // 03637 03638 ped->fMouseDown = FALSE; 03639 NtUserKillSystemTimer(ped->hwnd, IDSYS_SCROLL); 03640 } 03641 break; 03642 03643 case WM_SYSTIMER: 03644 03645 /* 03646 * This allows us to automatically scroll if the user holds the mouse 03647 * outside the edit control window. We simulate mouse moves at timer 03648 * intervals set in MouseMotionHandler. 03649 */ 03650 if (ped->fMouseDown) 03651 MLMouseMotion(ped, WM_MOUSEMOVE, ped->prevKeys, &ped->ptPrevMouse); 03652 break; 03653 03654 case WM_MBUTTONDOWN: 03655 EnterReaderModeHelper(ped->hwnd); 03656 break; 03657 03658 case WM_MOUSEMOVE: 03659 UserAssert(ped->fMouseDown); 03660 03661 /* 03662 * FALL THROUGH 03663 */ 03664 case WM_LBUTTONDBLCLK: 03665 case WM_LBUTTONDOWN: 03666 case WM_LBUTTONUP: 03667 /* 03668 * wParam - contains a value that indicates which virtual keys are down 03669 lParam - contains x and y coords of the mouse cursor 03670 */ 03671 POINTSTOPOINT(pt, lParam); 03672 MLMouseMotion(ped, message, (UINT)wParam, &pt); 03673 break; 03674 03675 case WM_CREATE: 03676 03677 /* 03678 * wParam - handle to window being created 03679 * lParam - points to a CREATESTRUCT that contains copies of parameters 03680 * passed to the CreateWindow function. 03681 */ 03682 return (MLCreate(ped, (LPCREATESTRUCT)lParam)); 03683 03684 case WM_PRINTCLIENT: 03685 MLPaint(ped, (HDC) wParam, NULL); 03686 break; 03687 03688 case WM_PAINT: 03689 /* 03690 * wParam - can be hdc from subclassed paint 03691 lParam - not used 03692 */ 03693 if (wParam) { 03694 hdc = (HDC) wParam; 03695 lprc = NULL; 03696 } else { 03697 hdc = NtUserBeginPaint(ped->hwnd, &ps); 03698 lprc = &ps.rcPaint; 03699 } 03700 03701 if (_IsWindowVisible(ped->pwnd)) 03702 MLPaint(ped, hdc, lprc); 03703 03704 if (!wParam) 03705 NtUserEndPaint(ped->hwnd, &ps); 03706 break; 03707 03708 case WM_PASTE: 03709 03710 /* 03711 * wParam - not used 03712 lParam - not used 03713 */ 03714 if (!ped->fReadOnly) 03715 MLPasteText(ped); 03716 break; 03717 03718 case WM_SETFOCUS: 03719 03720 /* 03721 * wParam - handle of window that loses the input focus (may be NULL) 03722 lParam - not used 03723 */ 03724 MLSetFocus(ped); 03725 break; 03726 03727 case WM_SIZE: 03728 03729 /* 03730 * wParam - defines the type of resizing fullscreen, sizeiconic, 03731 sizenormal etc. 03732 lParam - new width in LOWORD, new height in HIGHWORD of client area 03733 */ 03734 ECSize(ped, NULL, TRUE); 03735 break; 03736 03737 case EM_FMTLINES: 03738 03739 /* 03740 * wParam - indicates disposition of end-of-line chars. If non 03741 * zero, the chars CR CR LF are placed at the end of a word 03742 * wrapped line. If wParam is zero, the end of line chars are 03743 * removed. This is only done when the user gets a handle (via 03744 * EM_GETHANDLE) to the text. lParam - not used. 03745 */ 03746 if (wParam) 03747 MLInsertCrCrLf(ped); 03748 else 03749 MLStripCrCrLf(ped); 03750 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 03751 return (LONG)(wParam != 0); 03752 03753 case EM_GETHANDLE: 03754 03755 /* 03756 * wParam - not used 03757 lParam - not used 03758 */ 03759 03760 /* 03761 * Returns a handle to the edit control's text. 03762 */ 03763 03764 /* 03765 * Null terminate the string. Note that we are guaranteed to have the 03766 * memory for the NULL since ECInsertText allocates an extra 03767 * WCHAR for the NULL terminator. 03768 */ 03769 03770 if (ped->fAnsi) 03771 *(ECLock(ped) + ped->cch) = 0; 03772 else 03773 *((LPWSTR)ECLock(ped) + ped->cch) = 0; 03774 ECUnlock(ped); 03775 return ((LRESULT)ped->hText); 03776 03777 case EM_GETLINE: 03778 03779 /* 03780 * wParam - line number to copy (0 is first line) 03781 * lParam - buffer to copy text to. First WORD is max # of bytes to 03782 * copy 03783 */ 03784 return MLGetLine(ped, (ICH)wParam, (ICH)*(WORD UNALIGNED *)lParam, (LPSTR)lParam); 03785 03786 case EM_LINEFROMCHAR: 03787 03788 /* 03789 * wParam - Contains the index value for the desired char in the text 03790 * of the edit control. These are 0 based. 03791 * lParam - not used 03792 */ 03793 return (LRESULT)MLIchToLine(ped, (ICH)wParam); 03794 03795 case EM_LINEINDEX: 03796 03797 /* 03798 * wParam - specifies the desired line number where the number of the 03799 * first line is 0. If linenumber = 0, the line with the caret is used. 03800 * lParam - not used. 03801 * This function return s the number of character positions that occur 03802 * preceeding the first char in a given line. 03803 */ 03804 return (LRESULT)MLLineIndex(ped, (ICH)wParam); 03805 03806 case EM_LINELENGTH: 03807 03808 /* 03809 * wParam - specifies the character index of a character in the 03810 specified line, where the first line is 0. If -1, the length 03811 of the current line (with the caret) is return ed not including the 03812 length of any selected text. 03813 lParam - not used 03814 */ 03815 return (LRESULT)MLLineLength(ped, (ICH)wParam); 03816 03817 case EM_LINESCROLL: 03818 03819 /* 03820 * wParam - not used 03821 lParam - Contains the number of lines and char positions to scroll 03822 */ 03823 MLScroll(ped, TRUE, EM_LINESCROLL, (INT)lParam, TRUE); 03824 MLScroll(ped, FALSE, EM_LINESCROLL, (INT)wParam, TRUE); 03825 break; 03826 03827 case EM_REPLACESEL: 03828 03829 /* 03830 * wParam - flag for 4.0+ apps saying whether to clear undo 03831 lParam - Points to a null terminated replacement text. 03832 */ 03833 MLReplaceSel(ped, (LPSTR)lParam); 03834 if (!ped->f40Compat || !wParam) 03835 ECEmptyUndo(Pundo(ped)); 03836 break; 03837 03838 case EM_SETHANDLE: 03839 03840 /* 03841 * wParam - contains a handle to the text buffer 03842 lParam - not used 03843 */ 03844 MLSetHandle(ped, (HANDLE)wParam); 03845 break; 03846 03847 case EM_SETRECT: 03848 case EM_SETRECTNP: 03849 03850 // 03851 // wParamLo -- not used 03852 // lParam -- LPRECT with new formatting area 03853 // 03854 ECSize(ped, (LPRECT) lParam, (message != EM_SETRECTNP)); 03855 break; 03856 03857 case EM_SETSEL: 03858 03859 /* 03860 * wParam - Under 3.1, specifies if we should scroll caret into 03861 * view or not. 0 == scroll into view. 1 == don't scroll 03862 * lParam - starting pos in lowword ending pos in high word 03863 * 03864 * Under Win32, wParam is the starting pos, lParam is the 03865 * ending pos, and the caret is not scrolled into view. 03866 * The message EM_SCROLLCARET forces the caret to be scrolled 03867 * into view. 03868 */ 03869 MLSetSelection(ped, TRUE, (ICH)wParam, (ICH)lParam); 03870 break; 03871 03872 case EM_SCROLLCARET: 03873 03874 /* 03875 * Scroll caret into view 03876 */ 03877 MLEnsureCaretVisible(ped); 03878 break; 03879 03880 case EM_GETFIRSTVISIBLELINE: 03881 03882 /* 03883 * Returns the first visible line for multiline edit controls. 03884 */ 03885 return (LONG)ped->ichScreenStart; 03886 03887 case WM_SYSKEYDOWN: 03888 if (((WORD)wParam == VK_BACK) && ((DWORD)lParam & SYS_ALTERNATE)) { 03889 SendMessage(ped->hwnd, EM_UNDO, 0, 0L); 03890 break; 03891 } 03892 goto PassToDefaultWindowProc; 03893 03894 case WM_UNDO: 03895 case EM_UNDO: 03896 return MLUndo(ped); 03897 03898 case EM_SETTABSTOPS: 03899 03900 /* 03901 * This sets the tab stop positions for multiline edit controls. 03902 * wParam - Number of tab stops 03903 * lParam - Far ptr to a UINT array containing the Tab stop positions 03904 */ 03905 return MLSetTabStops(ped, (int)wParam, (LPINT)lParam); 03906 03907 case EM_POSFROMCHAR: 03908 // 03909 // wParam -- char index in text 03910 // lParam -- not used 03911 // This function returns the (x,y) position of the character 03912 // 03913 case EM_CHARFROMPOS: 03914 // 03915 // wParam -- unused 03916 // lParam -- pt in client coordinates 03917 // This function returns 03918 // LOWORD: the position of the closest character 03919 // to the passed in point. Beware of 03920 // points not actually in the edit client... 03921 // HIWORD: the index of the line the char is on 03922 // 03923 { 03924 LONG xyPos; 03925 LONG line; 03926 03927 hdc = ECGetEditDC(ped, TRUE); 03928 03929 if (message == EM_POSFROMCHAR) { 03930 MLIchToXYPos(ped, hdc, (ICH)wParam, FALSE, &pt); 03931 xyPos = MAKELONG(pt.x, pt.y); 03932 } else { 03933 POINTSTOPOINT(pt, lParam); 03934 xyPos = MLMouseToIch(ped, hdc, &pt, &line); 03935 xyPos = MAKELONG(xyPos, line); 03936 } 03937 03938 ECReleaseEditDC(ped, hdc, TRUE); 03939 return((LRESULT)xyPos); 03940 break; 03941 } 03942 03943 case WM_SETREDRAW: 03944 DefWindowProcWorker(ped->pwnd, message, wParam, lParam, FALSE); 03945 if (wParam) { 03946 03947 /* 03948 * Backwards compatability hack needed so that winraid's edit 03949 * controls work fine. 03950 */ 03951 RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME); 03952 } 03953 break; 03954 03955 #if LATER 03956 case WM_IME_ENDCOMPOSITION: 03957 ECInOutReconversionMode(ped, FALSE); 03958 break; 03959 #endif 03960 03961 default: 03962 PassToDefaultWindowProc: 03963 return DefWindowProcWorker(ped->pwnd, message, wParam, lParam, ped->fAnsi); 03964 } 03965 03966 return 1L; 03967 } /* MLEditWndProc */

BOOL MLEnsureCaretVisible PED   ) 
 

Definition at line 3379 of file editml.c.

References _IsWindowVisible(), tagED::aveCharWidth, BOOL, tagED::chLines, tagED::cLines, ECGetEditDC(), ECReleaseEditDC(), FALSE, tagED::fAutoHScroll, tagED::fAutoVScroll, tagED::iCaretLine, tagED::ichCaret, tagED::ichLinesOnScreen, tagED::ichScreenStart, tagED::maxPixelWidth, MLIchToXYPos(), MLScroll(), tagED::pwnd, tagED::rcFmt, TRUE, and UINT.

Referenced by MLDeleteText(), MLEditWndProc(), MLInsertText(), MLKeyDown(), MLMouseMotion(), MLSetFocus(), MLSetSelection(), and MLSetTabStops().

03381 { 03382 UINT iLineMax; 03383 int xposition; 03384 BOOL fPrevLine; 03385 HDC hdc; 03386 BOOL fVScroll = FALSE; 03387 BOOL fHScroll = FALSE; 03388 03389 if (_IsWindowVisible(ped->pwnd)) { 03390 int iAmt; 03391 int iFmtWidth = ped->rcFmt.right - ped->rcFmt.left; 03392 03393 if (ped->fAutoVScroll) { 03394 iLineMax = ped->ichScreenStart + ped->ichLinesOnScreen - 1; 03395 03396 if (fVScroll = (ped->iCaretLine > iLineMax)) 03397 iAmt = iLineMax; 03398 else if (fVScroll = (ped->iCaretLine < ped->ichScreenStart)) 03399 iAmt = ped->ichScreenStart; 03400 03401 if (fVScroll) 03402 MLScroll(ped, TRUE, EM_LINESCROLL, ped->iCaretLine - iAmt, TRUE); 03403 } 03404 03405 if (ped->fAutoHScroll && ((int) ped->maxPixelWidth > iFmtWidth)) { 03406 POINT pt; 03407 /* Get the current position of the caret in pixels */ 03408 if ((UINT) (ped->cLines - 1) != ped->iCaretLine && 03409 ped->ichCaret == ped->chLines[ped->iCaretLine + 1]) 03410 fPrevLine = TRUE; 03411 else 03412 fPrevLine = FALSE; 03413 03414 hdc = ECGetEditDC(ped,TRUE); 03415 MLIchToXYPos(ped, hdc, ped->ichCaret, fPrevLine, &pt); 03416 ECReleaseEditDC(ped, hdc, TRUE); 03417 xposition = pt.x; 03418 03419 // Remember, MLIchToXYPos returns coordinates with respect to the 03420 // top left pixel displayed on the screen. Thus, if xPosition < 0, 03421 // it means xPosition is less than current ped->xOffset. 03422 03423 iFmtWidth /= 3; 03424 if (fHScroll = (xposition < ped->rcFmt.left)) 03425 // scroll to the left 03426 iAmt = ped->rcFmt.left + iFmtWidth; 03427 else if (fHScroll = (xposition > ped->rcFmt.right)) 03428 // scroll to the right 03429 iAmt = ped->rcFmt.right - iFmtWidth; 03430 03431 if (fHScroll) 03432 MLScroll(ped, FALSE, EM_LINESCROLL, (xposition - iAmt) / ped->aveCharWidth, TRUE); 03433 } 03434 } 03435 return(fVScroll); 03436 }

BOOL MLExpandTabs PED   ) 
 

LONG MLGetLine PED  ,
ICH  ,
ICH  ,
LPSTR 
 

Definition at line 266 of file edmlrare.c.

References tagED::cbChar, tagED::chLines, tagED::cLines, ECLock(), ECUnlock(), ICH, L, min, and MLLine().

Referenced by MLEditWndProc().

00271 { 00272 PSTR pText; 00273 ICH cchLen; 00274 00275 if (lineNumber > ped->cLines - 1) { 00276 RIPERR1(ERROR_INVALID_PARAMETER, 00277 RIP_WARNING, 00278 "Invalid parameter \"lineNumber\" (%ld) to MLGetLine", 00279 lineNumber); 00280 00281 return 0L; 00282 } 00283 00284 cchLen = MLLine(ped, lineNumber); 00285 maxCchToCopy = min(cchLen, maxCchToCopy); 00286 00287 if (maxCchToCopy) { 00288 pText = ECLock(ped) + 00289 ped->chLines[lineNumber] * ped->cbChar; 00290 memmove(lpBuffer, pText, maxCchToCopy*ped->cbChar); 00291 ECUnlock(ped); 00292 } 00293 00294 return maxCchToCopy; 00295 }

int MLIchToLine PED  ,
ICH 
 

Definition at line 443 of file editml.c.

References tagED::chLines, tagED::cLines, ICH, tagED::ichMinSel, and max.

Referenced by MLDeleteText(), MLDrawText(), MLEditWndProc(), MLIchToXYPos(), MLIchToYPos(), MLInsertText(), MLKeyDown(), MLLineLength(), MLSetSelection(), and MLUpdateiCaretLine().

00446 { 00447 int iLo, iHi, iLine; 00448 00449 iLo = 0; 00450 iHi = ped->cLines; 00451 00452 if (ich == (ICH)-1) 00453 ich = ped->ichMinSel; 00454 00455 while (iLo < iHi - 1) { 00456 iLine = max((iHi - iLo)/2, 1) + iLo; 00457 00458 if (ped->chLines[iLine] > ich) { 00459 iHi = iLine; 00460 } else { 00461 iLo = iLine; 00462 } 00463 } 00464 00465 return iLo; 00466 }

void MLIchToXYPos PED  ,
HDC  ,
ICH  ,
BOOL  ,
LPPOINT 
 

Definition at line 553 of file editml.c.

References AWCOMPARECHAR, tagED::cbChar, tagED::cch, tagED::chLines, DWORD, ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditIchToXY, tagED::fAnsi, tagED::format, ICH, tagED::ichScreenStart, tagED::lineHeight, MLCalcXOffset(), MLGetLineWidth(), MLIchToLine(), MLLine(), tagED::pLpkEditCallout, tagED::rcFmt, and tagED::xOffset.

Referenced by MLDeleteText(), MLDrawText(), MLEditWndProc(), MLEnsureCaretVisible(), MLInsertText(), MLKeyDown(), and MLSetCaretPosition().

00559 { 00560 int iline; 00561 ICH cch; 00562 int xPosition, yPosition; 00563 int xOffset; 00564 00565 /* 00566 * For horizontal scroll displacement on left justified text and 00567 * for indent on centered or right justified text 00568 */ 00569 PSTR pText, pTextStart, pLineStart; 00570 00571 /* 00572 * Determine what line the character is on 00573 */ 00574 iline = MLIchToLine(ped, ich); 00575 00576 /* 00577 * Calc. the yPosition now. Note that this may change by the height of one 00578 * char if the prevLine flag is set and the ICH is at the beginning of a 00579 * line. 00580 */ 00581 yPosition = (iline - ped->ichScreenStart) * ped->lineHeight + ped->rcFmt.top; 00582 00583 /* 00584 * Now determine the xPosition of the character 00585 */ 00586 pTextStart = ECLock(ped); 00587 00588 if (prevLine && iline && (ich == ped->chLines[iline]) && 00589 (!AWCOMPARECHAR(ped, pTextStart + (ich - 2) * ped->cbChar, 0x0D) || 00590 !AWCOMPARECHAR(ped, pTextStart + (ich - 1) * ped->cbChar, 0x0A))) { 00591 00592 /* 00593 * First char in the line. We want text extent upto end of the previous 00594 * line if we aren't at the 0th line. 00595 */ 00596 iline--; 00597 00598 yPosition = yPosition - ped->lineHeight; 00599 pLineStart = pTextStart + ped->chLines[iline] * ped->cbChar; 00600 00601 /* 00602 * Note that we are taking the position in front of any CRLFs in the 00603 * text. 00604 */ 00605 cch = MLLine(ped, iline); 00606 00607 } else { 00608 00609 pLineStart = pTextStart + ped->chLines[iline] * ped->cbChar; 00610 pText = pTextStart + ich * ped->cbChar; 00611 00612 /* 00613 * Strip off CRLF or CRCRLF. Note that we may be pointing to a CR but in 00614 * which case we just want to strip off a single CR or 2 CRs. 00615 */ 00616 00617 /* 00618 * We want pText to point to the first CR at the end of the line if 00619 * there is one. Thus, we will get an xPosition to the right of the last 00620 * visible char on the line otherwise we will be to the left of 00621 * character ich. 00622 */ 00623 00624 /* 00625 * Check if we at the end of text 00626 */ 00627 if (ich < ped->cch) { 00628 if (ped->fAnsi) { 00629 if (ich && *(WORD UNALIGNED *)(pText - 1) == 0x0A0D) { 00630 pText--; 00631 if (ich > 2 && *(pText - 1) == 0x0D) 00632 pText--; 00633 } 00634 } else { 00635 LPWSTR pwText = (LPWSTR)pText; 00636 00637 if (ich && *(DWORD UNALIGNED *)(pwText - 1) == 0x000A000D) { 00638 pwText--; 00639 if (ich > 2 && *(pwText - 1) == 0x0D) 00640 pwText--; 00641 } 00642 pText = (LPSTR)pwText; 00643 } 00644 } 00645 00646 if (pText < pLineStart) 00647 pText = pLineStart; 00648 00649 cch = (ICH)(pText - pLineStart)/ped->cbChar; 00650 } 00651 00652 /* 00653 * Find out how many pixels we indent the line for funny formats 00654 */ 00655 if (ped->pLpkEditCallout) { 00656 /* 00657 * Must find position at start of character offset cch from start of line. 00658 * This depends on the layout and the reading order 00659 */ 00660 xPosition = ped->pLpkEditCallout->EditIchToXY( 00661 ped, hdc, pLineStart, MLLine(ped, iline), cch); 00662 } else { 00663 if (ped->format != ES_LEFT) { 00664 xOffset = MLCalcXOffset(ped, hdc, iline); 00665 } else { 00666 xOffset = -(int)ped->xOffset; 00667 } 00668 00669 xPosition = ped->rcFmt.left + xOffset + 00670 MLGetLineWidth(hdc, pLineStart, cch, ped); 00671 } 00672 00673 ECUnlock(ped); 00674 ppt->x = xPosition; 00675 ppt->y = yPosition; 00676 return ; 00677 }

BOOL MLInsertchLine PED  ,
ICH  ,
ICH  ,
BOOL 
 

Definition at line 1487 of file editml.c.

References BOOL, tagED::chLines, tagED::cLines, DWORD, ECNotifyParent(), FALSE, LINEBUMP, LPICH, TRUE, UserLocalReAlloc, and UserLocalSize.

Referenced by MLBuildchLines().

01492 { 01493 DWORD dwSize; 01494 01495 if (fUserTyping && iLine < ped->cLines) { 01496 ped->chLines[iLine] = ich; 01497 return (TRUE); 01498 } 01499 01500 dwSize = (ped->cLines + 2) * sizeof(int); 01501 01502 if (dwSize > UserLocalSize(ped->chLines)) { 01503 LPICH hResult; 01504 /* 01505 * Grow the line index buffer 01506 */ 01507 dwSize += LINEBUMP * sizeof(int); 01508 hResult = (LPICH)UserLocalReAlloc(ped->chLines, dwSize, 0); 01509 01510 if (!hResult) { 01511 ECNotifyParent(ped, EN_ERRSPACE); 01512 return FALSE; 01513 } 01514 ped->chLines = hResult; 01515 } 01516 01517 /* 01518 * Move indices starting at iLine up 01519 */ 01520 if (ped->cLines != iLine) 01521 RtlMoveMemory(&ped->chLines[iLine + 1], &ped->chLines[iLine], 01522 (ped->cLines - iLine) * sizeof(int)); 01523 ped->cLines++; 01524 01525 ped->chLines[iLine] = ich; 01526 return TRUE; 01527 }

BOOL MLInsertCrCrLf PED  ped  ) 
 

fAnsi

Definition at line 27 of file edmlrare.c.

References BOOL, tagED::cbChar, tagED::cch, tagED::cchAlloc, tagED::chLines, tagED::cLines, dch(), ECLock(), ECNotifyParent(), ECUnlock(), FALSE, tagED::fAnsi, tagED::fStripCRCRLF, tagED::fWrap, tagED::hInstance, tagED::hText, ICH, LOCALREALLOC, NULL, and TRUE.

Referenced by MLEditWndProc().

00029 { 00030 ICH dch; 00031 ICH li; 00032 ICH lineSize; 00033 unsigned char *pchText; 00034 unsigned char *pchTextNew; 00035 00036 if (!ped->fWrap || !ped->cch) { 00037 00038 /* 00039 * There are no soft line breaks if word-wrapping is off or if no chars 00040 */ 00041 return TRUE; 00042 } 00043 00044 /* 00045 * Calc an upper bound on the number of additional characters we will be 00046 * adding to the text when we insert CR CR LFs. 00047 */ 00048 dch = 3 * ped->cLines; 00049 00050 if (!LOCALREALLOC(ped->hText, (ped->cch + dch) * ped->cbChar, 0, ped->hInstance, NULL)) { 00051 ECNotifyParent(ped, EN_ERRSPACE); 00052 return FALSE; 00053 } 00054 00055 ped->cchAlloc = ped->cch + dch; 00056 00057 /* 00058 * Move the text up dch bytes and then copy it back down, inserting the CR 00059 * CR LF's as necessary. 00060 */ 00061 pchTextNew = pchText = ECLock(ped); 00062 pchText += dch * ped->cbChar; 00063 00064 /* 00065 * We will use dch to keep track of how many chars we add to the text 00066 */ 00067 dch = 0; 00068 00069 /* 00070 * Copy the text up dch bytes to pchText. This will shift all indices in 00071 * ped->chLines up by dch bytes. 00072 */ 00073 memmove(pchText, pchTextNew, ped->cch * ped->cbChar); 00074 00075 /* 00076 * Now copy chars from pchText down to pchTextNew and insert CRCRLF at soft 00077 * line breaks. 00078 */ 00079 if (ped->fAnsi) { 00080 for (li = 0; li < ped->cLines - 1; li++) { 00081 lineSize = ped->chLines[li + 1] - ped->chLines[li]; 00082 memmove(pchTextNew, pchText, lineSize); 00083 pchTextNew += lineSize; 00084 pchText += lineSize; 00085 00086 /* 00087 * If last character in newly copied line is not a line feed, then we 00088 * need to add the CR CR LF triple to the end 00089 */ 00090 if (*(pchTextNew - 1) != 0x0A) { 00091 *pchTextNew++ = 0x0D; 00092 *pchTextNew++ = 0x0D; 00093 *pchTextNew++ = 0x0A; 00094 dch += 3; 00095 } 00096 } 00097 00098 /* 00099 * Now move the last line up. It won't have any line breaks in it... 00100 */ 00101 memmove(pchTextNew, pchText, ped->cch - ped->chLines[ped->cLines - 1]); 00102 } else { 00103 LPWSTR pwchTextNew = (LPWSTR)pchTextNew; 00104 00105 for (li = 0; li < ped->cLines - 1; li++) { 00106 lineSize = ped->chLines[li + 1] - ped->chLines[li]; 00107 memmove(pwchTextNew, pchText, lineSize * sizeof(WCHAR)); 00108 pwchTextNew += lineSize; 00109 pchText += lineSize * sizeof(WCHAR); 00110 00111 /* 00112 * If last character in newly copied line is not a line feed, then we 00113 * need to add the CR CR LF triple to the end 00114 */ 00115 if (*(pwchTextNew - 1) != 0x0A) { 00116 *pwchTextNew++ = 0x0D; 00117 *pwchTextNew++ = 0x0D; 00118 *pwchTextNew++ = 0x0A; 00119 dch += 3; 00120 } 00121 } 00122 00123 /* 00124 * Now move the last line up. It won't have any line breaks in it... 00125 */ 00126 memmove(pwchTextNew, pchText, 00127 (ped->cch - ped->chLines[ped->cLines - 1]) * sizeof(WCHAR)); 00128 } 00129 00130 ECUnlock(ped); 00131 00132 if (dch) { 00133 /* 00134 * Update number of characters in text handle 00135 */ 00136 ped->cch += dch; 00137 00138 /* 00139 * So that the next time we do anything with the text, we can strip the 00140 * CRCRLFs 00141 */ 00142 ped->fStripCRCRLF = TRUE; 00143 return TRUE; 00144 } 00145 00146 return FALSE; 00147 }

ICH MLInsertText PED  ,
LPSTR  ,
ICH  ,
BOOL 
 

Definition at line 1040 of file editml.c.

References _IsWindowVisible(), BOOL, tagED::cbChar, tagED::cch, tagED::cchTextMax, tagED::chLines, tagED::cLines, CopyRect, DWORD, ECAdjustIch(), ECEmptyUndo(), ECGetEditDC(), ECInsertText(), ECLock(), ECNotifyParent(), ECReleaseEditDC(), ECSaveUndo(), FALSE, tagED::fAnsi, tagED::fAutoVScroll, tagED::fDBCS, tagED::fDirty, tagED::format, tagED::fRtoLReading, FWINABLE, tagED::fWrap, tagED::hwnd, tagED::iCaretLine, ICH, tagED::ichCaret, tagED::ichLinesOnScreen, tagED::ichScreenStart, IsWindow(), tagED::lineHeight, max, tagED::maxPixelWidth, min, MLBuildchLines(), MLDrawText(), MLEnsureCaretVisible(), MLIchToLine(), MLIchToXYPos(), MLIchToYPos(), MLUndo(), MLUpdateiCaretLine(), NotifyWinEvent(), NtUserInvalidateRect(), NtUserMessageBeep, tagED::pLpkEditCallout, Pundo, tagED::pwnd, tagED::rcFmt, TRUE, tagED::wLeftMargin, tagED::wMaxNegAcharPos, tagED::wRightMargin, and tagED::xOffset.

Referenced by ECImeComposition(), MLChar(), MLPasteText(), MLReplaceSel(), and MLUndo().

01045 { 01046 HDC hdc; 01047 ICH validCch = cchInsert; 01048 ICH oldCaret = ped->ichCaret; 01049 int oldCaretLine = ped->iCaretLine; 01050 BOOL fCRLF = FALSE; 01051 LONG ll, hl; 01052 POINT xyPosInitial; 01053 POINT xyPosFinal; 01054 HWND hwndSave = ped->hwnd; 01055 UNDO undo; 01056 ICH validCchTemp; 01057 01058 xyPosInitial.x=0; 01059 xyPosInitial.y=0; 01060 xyPosFinal.x=0; 01061 xyPosFinal.y=0; 01062 01063 if (validCch == 0) 01064 return 0; 01065 01066 if (ped->cchTextMax <= ped->cch) { 01067 01068 /* 01069 * When the max chars is reached already, notify parent 01070 * Fix for Bug #4183 -- 02/06/91 -- SANKAR -- 01071 */ 01072 ECNotifyParent(ped,EN_MAXTEXT); 01073 return 0; 01074 } 01075 01076 /* 01077 * Limit the amount of text we add 01078 */ 01079 validCch = min(validCch, ped->cchTextMax - ped->cch); 01080 01081 /* 01082 * Make sure we don't split a CRLF in half 01083 */ 01084 if (validCch) { 01085 if (ped->fAnsi) { 01086 if (*(WORD UNALIGNED *)(lpText + validCch - 1) == 0x0A0D) 01087 validCch--; 01088 } else { 01089 if (*(DWORD UNALIGNED *)(lpText + (validCch - 1) * ped->cbChar) == 0x000A000D) 01090 validCch--; 01091 } 01092 } 01093 if (!validCch) { 01094 /* 01095 * When the max chars is reached already, notify parent 01096 * Fix for Bug #4183 -- 02/06/91 -- SANKAR -- 01097 */ 01098 ECNotifyParent(ped,EN_MAXTEXT); 01099 return 0; 01100 } 01101 01102 if (validCch == 2) { 01103 if (ped->fAnsi) { 01104 if (*(WORD UNALIGNED *)lpText == 0x0A0D) 01105 fCRLF = TRUE; 01106 } else { 01107 if (*(DWORD UNALIGNED *)lpText == 0x000A000D) 01108 fCRLF = TRUE; 01109 } 01110 } 01111 01112 // 01113 // Save current undo state always, but clear it out only if !AutoVScroll 01114 // 01115 ECSaveUndo(Pundo(ped), (PUNDO)&undo, !ped->fAutoVScroll); 01116 01117 hdc = ECGetEditDC(ped, FALSE); 01118 /* 01119 * We only need the y position. Since with an LPK loaded 01120 * calculating the x position is an intensive job, just 01121 * call MLIchToYPos. 01122 */ 01123 if (ped->cch) 01124 if (ped->pLpkEditCallout) 01125 xyPosInitial.y = MLIchToYPos(ped, ped->cch-1, FALSE); 01126 else 01127 MLIchToXYPos(ped, hdc, ped->cch - 1, FALSE, &xyPosInitial); 01128 01129 /* 01130 * Insert the text 01131 */ 01132 validCchTemp = validCch; // may not be needed, but just for precautions.. 01133 if (!ECInsertText(ped, lpText, &validCchTemp)) { 01134 01135 // Restore previous undo buffer if it was cleared 01136 if (!ped->fAutoVScroll) 01137 ECSaveUndo((PUNDO)&undo, Pundo(ped), FALSE); 01138 01139 ECReleaseEditDC(ped, hdc, FALSE); 01140 ECNotifyParent(ped, EN_ERRSPACE); 01141 return (0); 01142 } 01143 01144 #if DBG 01145 if (validCch != validCchTemp) { 01146 /* 01147 * All characters in lpText has not been inserted to ped. 01148 * This could happen when cch is close to cchMax. 01149 * Better revisit this after NT5 ships. 01150 */ 01151 RIPMSG2(RIP_WARNING, "MLInsertText: validCch is changed (%x -> %x) in ECInsertText.", 01152 validCch, validCchTemp); 01153 } 01154 #endif 01155 01156 /* 01157 * Note that ped->ichCaret is updated by ECInsertText 01158 */ 01159 MLBuildchLines(ped, (ICH)oldCaretLine, (int)validCch, fCRLF?(BOOL)FALSE:fUserTyping, &ll, &hl); 01160 01161 if (ped->cch) 01162 /* 01163 * We only need the y position. Since with an LPK loaded 01164 * calculating the x position is an intensive job, just 01165 * call MLIchToYPos. 01166 */ 01167 if (ped->pLpkEditCallout) 01168 xyPosFinal.y = MLIchToYPos(ped, ped->cch-1, FALSE); 01169 else 01170 MLIchToXYPos(ped, hdc, ped->cch - 1, FALSE,&xyPosFinal); 01171 01172 if (xyPosFinal.y < xyPosInitial.y && ((ICH)ped->ichScreenStart) + ped->ichLinesOnScreen >= ped->cLines - 1) { 01173 RECT rc; 01174 01175 CopyRect((LPRECT)&rc, (LPRECT)&ped->rcFmt); 01176 rc.top = xyPosFinal.y + ped->lineHeight; 01177 if (ped->pLpkEditCallout) { 01178 int xFarOffset = ped->xOffset + ped->rcFmt.right - ped->rcFmt.left; 01179 // Include left or right margins in display unless clipped 01180 // by horizontal scrolling. 01181 if (ped->wLeftMargin) { 01182 if (!( ped->format == ES_LEFT // Only ES_LEFT (Nearside alignment) can get clipped 01183 && ( (!ped->fRtoLReading && ped->xOffset > 0) // LTR and first char not fully in view 01184 || ( ped->fRtoLReading && xFarOffset < ped->maxPixelWidth)))) { //RTL and last char not fully in view 01185 rc.left -= ped->wLeftMargin; 01186 } 01187 } 01188 01189 // Process right margin 01190 if (ped->wRightMargin) { 01191 if (!( ped->format == ES_LEFT // Only ES_LEFT (Nearside alignment) can get clipped 01192 && ( ( ped->fRtoLReading && ped->xOffset > 0) // RTL and first char not fully in view 01193 || (!ped->fRtoLReading && xFarOffset < ped->maxPixelWidth)))) { // LTR and last char not fully in view 01194 rc.right += ped->wRightMargin; 01195 } 01196 } 01197 } 01198 NtUserInvalidateRect(ped->hwnd, (LPRECT)&rc, TRUE); 01199 } 01200 01201 if (!ped->fAutoVScroll) { 01202 if (ped->ichLinesOnScreen < ped->cLines) { 01203 MLUndo(ped); 01204 ECEmptyUndo(Pundo(ped)); 01205 01206 ECSaveUndo(&undo, Pundo(ped), FALSE); 01207 01208 NtUserMessageBeep(0); 01209 ECReleaseEditDC(ped, hdc, FALSE); 01210 01211 /* 01212 * When the max lines is reached already, notify parent 01213 * Fix for Bug #7586 -- 10/14/91 -- SANKAR -- 01214 */ 01215 ECNotifyParent(ped,EN_MAXTEXT); 01216 return (0); 01217 } else { 01218 ECEmptyUndo(&undo); 01219 } 01220 } 01221 01222 if (fUserTyping && ped->fWrap) { 01223 // 01224 // To avoid oldCaret points intermediate of DBCS character, 01225 // adjust oldCaret position if necessary. 01226 // 01227 // !!!CR If MLBuildchLines() returns reasonable value ( and I think 01228 // it does), we don't probably need this. Check this out later. 01229 // 01230 if (ped->fDBCS && ped->fAnsi) { 01231 oldCaret = ECAdjustIch(ped, 01232 ECLock(ped), 01233 min((ICH)LOWORD(ll),oldCaret)); 01234 /* ECUnlock(ped); */ 01235 } else { // same as original code 01236 oldCaret = min((ICH)LOWORD(ll), oldCaret); 01237 } 01238 } 01239 01240 // Update ped->iCaretLine properly. 01241 MLUpdateiCaretLine(ped); 01242 01243 ECNotifyParent(ped, EN_UPDATE); 01244 01245 /* 01246 * Make sure window still exists. 01247 */ 01248 if (!IsWindow(hwndSave)) 01249 return 0; 01250 01251 if (_IsWindowVisible(ped->pwnd)) { 01252 01253 // 01254 // If the current font has negative A widths, we may have to start 01255 // drawing a few characters before the oldCaret position. 01256 // 01257 if (ped->wMaxNegAcharPos) { 01258 int iLine = MLIchToLine(ped, oldCaret); 01259 oldCaret = max( ((int)(oldCaret - ped->wMaxNegAcharPos)), 01260 ((int)(ped->chLines[iLine]))); 01261 } 01262 01263 // Redraw to end of screen/text if CRLF or large insert 01264 if (fCRLF || !fUserTyping) { 01265 01266 /* 01267 * Redraw to end of screen/text if crlf or large insert. 01268 */ 01269 MLDrawText(ped, hdc, (fUserTyping ? oldCaret : 0), ped->cch, FALSE); 01270 } else 01271 MLDrawText(ped, hdc, oldCaret, max(ped->ichCaret, (ICH)hl), FALSE); 01272 } 01273 01274 ECReleaseEditDC(ped, hdc, FALSE); 01275 01276 /* 01277 * Make sure we can see the cursor 01278 */ 01279 MLEnsureCaretVisible(ped); 01280 01281 ped->fDirty = TRUE; 01282 01283 ECNotifyParent(ped, EN_CHANGE); 01284 01285 if (validCch < cchInsert) 01286 ECNotifyParent(ped, EN_MAXTEXT); 01287 01288 if (validCch && FWINABLE()) { 01289 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01290 } 01291 01292 /* 01293 * Make sure the window still exists. 01294 */ 01295 if (!IsWindow(hwndSave)) 01296 return 0; 01297 else 01298 return validCch; 01299 }

void MLKeyDown PED  ,
UINT  ,
int 
 

Definition at line 2028 of file editml.c.

References tagED::aveCharWidth, BOOL, tagED::cbChar, tagED::cch, tagED::chLines, tagED::cLines, CTRLDOWN, DWORD, ECGetEditDC(), ECGetModKeys(), ECLock(), ECReleaseEditDC(), ECUnlock(), ECWord(), EFWANTRETURN, FALSE, tagED::fAnsi, tagED::fFocus, tagED::fInDialogBox, tagED::fMouseDown, tagED::fReadOnly, tagED::fWrap, GETAPPVER, GetDlgItem(), HanjaKeyHandler(), tagED::hwnd, tagED::hwndParent, tagED::iCaretLine, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, L, tagED::lineHeight, MLChangeSelection(), MLChar(), MLEnsureCaretVisible(), MLIchToLine(), MLIchToXYPos(), MLLine(), MLMouseMotion(), MLMoveSelection(), MLMoveSelectionRestricted(), MLSetCaretPosition(), NONEDOWN, NULL, tagED::pLpkEditCallout, PostMessage(), tagED::pwnd, tagED::rcFmt, SendMessage(), SendMessageWorker(), SHFTDOWN, TestWF, TRUE, UINT, and VER40.

Referenced by MLEditWndProc().

02032 { 02033 HDC hdc; 02034 BOOL prevLine; 02035 POINT mousePt; 02036 int defaultDlgId; 02037 int iScrollAmt; 02038 02039 /* 02040 * Variables we will use for redrawing the updated text 02041 */ 02042 02043 /* 02044 * new selection is specified by newMinSel, newMaxSel 02045 */ 02046 ICH newMaxSel = ped->ichMaxSel; 02047 ICH newMinSel = ped->ichMinSel; 02048 02049 /* 02050 * Flags for drawing the updated text 02051 */ 02052 BOOL changeSelection = FALSE; 02053 02054 /* 02055 * Comparisons we do often 02056 */ 02057 BOOL MinEqMax = (newMaxSel == newMinSel); 02058 BOOL MinEqCar = (ped->ichCaret == newMinSel); 02059 BOOL MaxEqCar = (ped->ichCaret == newMaxSel); 02060 02061 /* 02062 * State of shift and control keys. 02063 */ 02064 int scState; 02065 02066 if (ped->fMouseDown) { 02067 02068 /* 02069 * If we are in the middle of a mousedown command, don't do anything. 02070 */ 02071 return ; 02072 } 02073 02074 scState = ECGetModKeys(keyMods); 02075 02076 switch (virtKeyCode) { 02077 case VK_ESCAPE: 02078 if (ped->fInDialogBox) { 02079 02080 /* 02081 * This condition is removed because, if the dialogbox does not 02082 * have a CANCEL button and if ESC is hit when focus is on a 02083 * ML edit control the dialogbox must close whether it has cancel 02084 * button or not to be consistent with SL edit control; 02085 * DefDlgProc takes care of the disabled CANCEL button case. 02086 * Fix for Bug #4123 -- 02/07/91 -- SANKAR -- 02087 */ 02088 #if 0 02089 if (GetDlgItem(ped->hwndParent, IDCANCEL)) 02090 #endif 02091 02092 /* 02093 * User hit ESC...Send a close message (which in turn sends a 02094 * cancelID to the app in DefDialogProc... 02095 */ 02096 PostMessage(ped->hwndParent, WM_CLOSE, 0, 0L); 02097 } 02098 return ; 02099 02100 case VK_RETURN: 02101 if (ped->fInDialogBox) { 02102 02103 /* 02104 * If this multiline edit control is in a dialog box, then we want 02105 * the RETURN key to be sent to the default dialog button (if there 02106 * is one). CTRL-RETURN will insert a RETURN into the text. Note 02107 * that CTRL-RETURN automatically translates into a linefeed (0x0A) 02108 * and in the MLCharHandler, we handle this as if a return was 02109 * entered. 02110 */ 02111 if (scState != CTRLDOWN) { 02112 02113 if (TestWF(ped->pwnd, EFWANTRETURN)) { 02114 02115 /* 02116 * This edit control wants cr to be inserted so break out of 02117 * case. 02118 */ 02119 return ; 02120 } 02121 02122 defaultDlgId = (int)(DWORD)LOWORD(SendMessage(ped->hwndParent, 02123 DM_GETDEFID, 0, 0L)); 02124 if (defaultDlgId) { 02125 HWND hwnd = GetDlgItem(ped->hwndParent, defaultDlgId); 02126 if (hwnd) { 02127 SendMessage(ped->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwnd, 1L); 02128 if (!ped->fFocus) 02129 PostMessage(hwnd, WM_KEYDOWN, VK_RETURN, 0L); 02130 } 02131 } 02132 } 02133 02134 return ; 02135 } 02136 break; 02137 02138 case VK_TAB: 02139 02140 /* 02141 * If this multiline edit control is in a dialog box, then we want the 02142 * TAB key to take you to the next control, shift TAB to take you to the 02143 * previous control. We always want CTRL-TAB to insert a tab into the 02144 * edit control regardless of weather or not we're in a dialog box. 02145 */ 02146 if (scState == CTRLDOWN) 02147 MLChar(ped, virtKeyCode, keyMods); 02148 else if (ped->fInDialogBox) 02149 SendMessage(ped->hwndParent, WM_NEXTDLGCTL, scState == SHFTDOWN, 0L); 02150 02151 return ; 02152 02153 case VK_LEFT: 02154 // 02155 // If the caret isn't at the beginning, we can move left 02156 // 02157 if (ped->ichCaret) { 02158 // Get new caret pos. 02159 if (scState & CTRLDOWN) { 02160 // Move caret word left 02161 ECWord(ped, ped->ichCaret, TRUE, &ped->ichCaret, NULL); 02162 } else { 02163 if (ped->pLpkEditCallout) { 02164 ped->ichCaret = MLMoveSelectionRestricted(ped, ped->ichCaret, TRUE); 02165 } else { 02166 // Move caret char left 02167 ped->ichCaret = MLMoveSelection(ped, ped->ichCaret, TRUE); 02168 } 02169 } 02170 02171 // Get new selection 02172 if (scState & SHFTDOWN) { 02173 if (MaxEqCar && !MinEqMax) { 02174 // Reduce selection 02175 newMaxSel = ped->ichCaret; 02176 02177 UserAssert(newMinSel == ped->ichMinSel); 02178 } else { 02179 // Extend selection 02180 newMinSel = ped->ichCaret; 02181 } 02182 } else { 02183 // Clear selection 02184 newMaxSel = newMinSel = ped->ichCaret; 02185 } 02186 02187 changeSelection = TRUE; 02188 } else { 02189 // 02190 // If the user tries to move left and we are at the 0th 02191 // character and there is a selection, then cancel the 02192 // selection. 02193 // 02194 if ( (ped->ichMaxSel != ped->ichMinSel) && 02195 !(scState & SHFTDOWN) ) { 02196 changeSelection = TRUE; 02197 newMaxSel = newMinSel = ped->ichCaret; 02198 } 02199 } 02200 break; 02201 02202 case VK_RIGHT: 02203 // 02204 // If the caret isn't at the end, we can move right. 02205 // 02206 if (ped->ichCaret < ped->cch) { 02207 // 02208 // Get new caret pos. 02209 // 02210 if (scState & CTRLDOWN) { 02211 // Move caret word right 02212 ECWord(ped, ped->ichCaret, FALSE, NULL, &ped->ichCaret); 02213 } else { 02214 // Move caret char right 02215 if (ped->pLpkEditCallout) { 02216 ped->ichCaret = MLMoveSelectionRestricted(ped, ped->ichCaret, FALSE); 02217 } else { 02218 ped->ichCaret = MLMoveSelection(ped, ped->ichCaret, FALSE); 02219 } 02220 } 02221 02222 // 02223 // Get new selection. 02224 // 02225 if (scState & SHFTDOWN) { 02226 if (MinEqCar && !MinEqMax) { 02227 // Reduce selection 02228 newMinSel = ped->ichCaret; 02229 02230 UserAssert(newMaxSel == ped->ichMaxSel); 02231 } else { 02232 // Extend selection 02233 newMaxSel = ped->ichCaret; 02234 } 02235 } else { 02236 // Clear selection 02237 newMaxSel = newMinSel = ped->ichCaret; 02238 } 02239 02240 changeSelection = TRUE; 02241 } else { 02242 // 02243 // If the user tries to move right and we are at the last 02244 // character and there is a selection, then cancel the 02245 // selection. 02246 // 02247 if ( (ped->ichMaxSel != ped->ichMinSel) && 02248 !(scState & SHFTDOWN) ) { 02249 newMaxSel = newMinSel = ped->ichCaret; 02250 changeSelection = TRUE; 02251 } 02252 } 02253 break; 02254 02255 case VK_UP: 02256 case VK_DOWN: 02257 if (ped->cLines - 1 != ped->iCaretLine && 02258 ped->ichCaret == ped->chLines[ped->iCaretLine + 1]) 02259 prevLine = TRUE; 02260 else 02261 prevLine = FALSE; 02262 02263 hdc = ECGetEditDC(ped, TRUE); 02264 MLIchToXYPos(ped, hdc, ped->ichCaret, prevLine, &mousePt); 02265 ECReleaseEditDC(ped, hdc, TRUE); 02266 mousePt.y += 1 + (virtKeyCode == VK_UP ? -ped->lineHeight : ped->lineHeight); 02267 02268 if (!(scState & CTRLDOWN)) { 02269 // 02270 // Send fake mouse messages to handle this 02271 // If VK_SHIFT is down, extend selection & move caret up/down 02272 // 1 line. Otherwise, clear selection & move caret. 02273 // 02274 MLMouseMotion(ped, WM_LBUTTONDOWN, 02275 !(scState & SHFTDOWN) ? 0 : MK_SHIFT, &mousePt); 02276 MLMouseMotion(ped, WM_LBUTTONUP, 02277 !(scState & SHFTDOWN) ? 0 : MK_SHIFT, &mousePt); 02278 } 02279 break; 02280 02281 case VK_HOME: 02282 // 02283 // Update caret. 02284 // 02285 if (scState & CTRLDOWN) { 02286 // Move caret to beginning of text. 02287 ped->ichCaret = 0; 02288 } else { 02289 // Move caret to beginning of line. 02290 ped->ichCaret = ped->chLines[ped->iCaretLine]; 02291 } 02292 02293 // 02294 // Update selection. 02295 // 02296 newMinSel = ped->ichCaret; 02297 02298 if (scState & SHFTDOWN) { 02299 if (MaxEqCar && !MinEqMax) { 02300 if (scState & CTRLDOWN) 02301 newMaxSel = ped->ichMinSel; 02302 else { 02303 newMinSel = ped->ichMinSel; 02304 newMaxSel = ped->ichCaret; 02305 } 02306 } 02307 } else { 02308 // Clear selection 02309 newMaxSel = ped->ichCaret; 02310 } 02311 02312 changeSelection = TRUE; 02313 break; 02314 02315 case VK_END: 02316 // 02317 // Update caret. 02318 // 02319 if (scState & CTRLDOWN) { 02320 // Move caret to end of text. 02321 ped->ichCaret = ped->cch; 02322 } else { 02323 // Move caret to end of line. 02324 ped->ichCaret = ped->chLines[ped->iCaretLine] + 02325 MLLine(ped, ped->iCaretLine); 02326 } 02327 02328 // Update selection. 02329 newMaxSel = ped->ichCaret; 02330 02331 if (scState & SHFTDOWN) { 02332 if (MinEqCar && !MinEqMax) { 02333 // Reduce selection 02334 if (scState & CTRLDOWN) { 02335 newMinSel = ped->ichMaxSel; 02336 } else { 02337 newMinSel = ped->ichCaret; 02338 newMaxSel = ped->ichMaxSel; 02339 } 02340 } 02341 } else { 02342 // Clear selection 02343 newMinSel = ped->ichCaret; 02344 } 02345 02346 changeSelection = TRUE; 02347 break; 02348 02349 // FE_IME // EC_INSERT_COMPOSITION_CHAR : MLKeyDown() : VK_HANJA support 02350 case VK_HANJA: 02351 if ( HanjaKeyHandler( ped ) ) { 02352 changeSelection = TRUE; 02353 newMinSel = ped->ichCaret; 02354 newMaxSel = ped->ichCaret + (ped->fAnsi ? 2 : 1); 02355 } 02356 break; 02357 02358 case VK_PRIOR: 02359 case VK_NEXT: 02360 if (!(scState & CTRLDOWN)) { 02361 /* 02362 * Vertical scroll by one visual screen 02363 */ 02364 hdc = ECGetEditDC(ped, TRUE); 02365 MLIchToXYPos(ped, hdc, ped->ichCaret, FALSE, &mousePt); 02366 ECReleaseEditDC(ped, hdc, TRUE); 02367 mousePt.y += 1; 02368 02369 SendMessage(ped->hwnd, WM_VSCROLL, virtKeyCode == VK_PRIOR ? SB_PAGEUP : SB_PAGEDOWN, 0L); 02370 02371 /* 02372 * Move the cursor there 02373 */ 02374 MLMouseMotion(ped, WM_LBUTTONDOWN, !(scState & SHFTDOWN) ? 0 : MK_SHIFT, &mousePt); 02375 MLMouseMotion(ped, WM_LBUTTONUP, !(scState & SHFTDOWN) ? 0 : MK_SHIFT, &mousePt); 02376 02377 } else { 02378 /* 02379 * Horizontal scroll by one screenful minus one char 02380 */ 02381 iScrollAmt = ((ped->rcFmt.right - ped->rcFmt.left) / ped->aveCharWidth) - 1; 02382 if (virtKeyCode == VK_PRIOR) 02383 iScrollAmt *= -1; /* For previous page */ 02384 02385 SendMessage(ped->hwnd, WM_HSCROLL, MAKELONG(EM_LINESCROLL, iScrollAmt), 0); 02386 break; 02387 } 02388 break; 02389 02390 case VK_DELETE: 02391 if (ped->fReadOnly) 02392 break; 02393 02394 switch (scState) { 02395 case NONEDOWN: 02396 02397 /* 02398 * Clear selection. If no selection, delete (clear) character 02399 * right 02400 */ 02401 if ((ped->ichMaxSel < ped->cch) && (ped->ichMinSel == ped->ichMaxSel)) { 02402 02403 /* 02404 * Move cursor forwards and send a backspace message... 02405 */ 02406 if (ped->pLpkEditCallout) { 02407 ped->ichMinSel = ped->ichCaret; 02408 ped->ichMaxSel = MLMoveSelectionRestricted(ped, ped->ichCaret, FALSE); 02409 } else { 02410 ped->ichCaret = MLMoveSelection(ped, ped->ichCaret, FALSE); 02411 ped->ichMaxSel = ped->ichMinSel = ped->ichCaret; 02412 } 02413 02414 goto DeleteAnotherChar; 02415 } 02416 break; 02417 02418 case SHFTDOWN: 02419 02420 /* 02421 * CUT selection ie. remove and copy to clipboard, or if no 02422 * selection, delete (clear) character left. 02423 */ 02424 if (ped->ichMinSel == ped->ichMaxSel) { 02425 goto DeleteAnotherChar; 02426 } else { 02427 SendMessage(ped->hwnd, WM_CUT, (UINT)0, 0L); 02428 } 02429 02430 break; 02431 02432 case CTRLDOWN: 02433 02434 /* 02435 * Clear selection, or delete to end of line if no selection 02436 */ 02437 if ((ped->ichMaxSel < ped->cch) && (ped->ichMinSel == ped->ichMaxSel)) { 02438 ped->ichMaxSel = ped->ichCaret = ped->chLines[ped->iCaretLine] + 02439 MLLine(ped, ped->iCaretLine); 02440 } 02441 break; 02442 } 02443 02444 if (!(scState & SHFTDOWN) && (ped->ichMinSel != ped->ichMaxSel)) { 02445 02446 DeleteAnotherChar: 02447 if (GETAPPVER() >= VER40) { 02448 MLChar(ped, VK_BACK, 0); 02449 } else { 02450 SendMessageWorker(ped->pwnd, WM_CHAR, VK_BACK, 0, ped->fAnsi); 02451 } 02452 } 02453 02454 /* 02455 * No need to update text or selection since BACKSPACE message does it 02456 * for us. 02457 */ 02458 break; 02459 02460 case VK_INSERT: 02461 if (scState == CTRLDOWN || scState == SHFTDOWN) { 02462 02463 /* 02464 * if CTRLDOWN Copy current selection to clipboard 02465 */ 02466 02467 /* 02468 * if SHFTDOWN Paste clipboard 02469 */ 02470 SendMessage(ped->hwnd, (UINT)(scState == CTRLDOWN ? WM_COPY : WM_PASTE), 0, 0); 02471 } 02472 break; 02473 } 02474 02475 if (changeSelection) { 02476 hdc = ECGetEditDC(ped, FALSE); 02477 MLChangeSelection(ped, hdc, newMinSel, newMaxSel); 02478 02479 /* 02480 * Set the caret's line 02481 */ 02482 ped->iCaretLine = MLIchToLine(ped, ped->ichCaret); 02483 02484 if (virtKeyCode == VK_END && 02485 // Next line: Win95 Bug#11822, EditControl repaint (Sankar) 02486 (ped->ichCaret == ped->chLines[ped->iCaretLine]) && 02487 ped->ichCaret < ped->cch && 02488 ped->fWrap && ped->iCaretLine > 0) { 02489 LPSTR pText = ECLock(ped); 02490 02491 /* 02492 * Handle moving to the end of a word wrapped line. This keeps the 02493 * cursor from falling to the start of the next line if we have word 02494 * wrapped and there is no CRLF. 02495 */ 02496 if ( ped->fAnsi ) { 02497 if (*(WORD UNALIGNED *)(pText + 02498 ped->chLines[ped->iCaretLine] - 2) != 0x0A0D) { 02499 ped->iCaretLine--; 02500 } 02501 } else { 02502 if (*(DWORD UNALIGNED *)(pText + 02503 (ped->chLines[ped->iCaretLine] - 2)*ped->cbChar) != 0x000A000D) { 02504 ped->iCaretLine--; 02505 } 02506 } 02507 ECUnlock(ped); 02508 } 02509 02510 /* 02511 * Since drawtext sets the caret position 02512 */ 02513 MLSetCaretPosition(ped, hdc); 02514 ECReleaseEditDC(ped, hdc, FALSE); 02515 02516 /* 02517 * Make sure we can see the cursor 02518 */ 02519 MLEnsureCaretVisible(ped); 02520 } 02521 }

ICH MLLine PED  ,
ICH 
 

Definition at line 374 of file editml.c.

References tagED::cch, tagED::chLines, tagED::cLines, DWORD, ECLock(), ECUnlock(), tagED::fAnsi, and ICH.

Referenced by MLCalcXOffset(), MLDrawText(), MLGetLine(), MLIchToXYPos(), MLKeyDown(), MLLineLength(), and MLMouseToIch().

00377 { 00378 ICH result; 00379 00380 UserAssert(lineNumber < ped->cLines); 00381 00382 if (lineNumber >= ped->cLines) 00383 return (0); 00384 00385 if (lineNumber == ped->cLines - 1) { 00386 00387 /* 00388 * Since we can't have a CRLF on the last line 00389 */ 00390 return (ped->cch - ped->chLines[ped->cLines - 1]); 00391 } else { 00392 result = ped->chLines[lineNumber + 1] - ped->chLines[lineNumber]; 00393 RIPMSG1(RIP_VERBOSE, "MLLine result=%d\n", result); 00394 00395 /* 00396 * Now check for CRLF or CRCRLF at end of line 00397 */ 00398 if (result > 1) { 00399 if (ped->fAnsi) { 00400 LPSTR pText; 00401 00402 pText = ECLock(ped) + ped->chLines[lineNumber + 1] - 2; 00403 if (*(WORD UNALIGNED *)pText == 0x0A0D) { 00404 result -= 2; 00405 if (result && *(--pText) == 0x0D) 00406 /* 00407 * In case there was a CRCRLF 00408 */ 00409 result--; 00410 } 00411 } else { // !fAnsi 00412 LPWSTR pwText; 00413 00414 pwText = (LPWSTR)ECLock(ped) + 00415 (ped->chLines[lineNumber + 1] - 2); 00416 if (*(DWORD UNALIGNED *)pwText == 0x000A000D) { 00417 result = result - 2; 00418 if (result && *(--pwText) == 0x0D) 00419 /* 00420 * In case there was a CRCRLF 00421 */ 00422 result--; 00423 } 00424 00425 } 00426 ECUnlock(ped); 00427 } 00428 } 00429 return (result); 00430 }

ICH MLLineIndex PED  ,
ICH 
 

Definition at line 306 of file edmlrare.c.

References tagED::chLines, tagED::cLines, tagED::iCaretLine, and ICH.

Referenced by MLEditWndProc().

00309 { 00310 if (iLine == -1) 00311 iLine = ped->iCaretLine; 00312 if (iLine < ped->cLines) { 00313 return ped->chLines[iLine]; 00314 } else { 00315 RIPERR1(ERROR_INVALID_PARAMETER, 00316 RIP_WARNING, 00317 "Invalid parameter \"iLine\" (%ld) to MLLineIndex", 00318 iLine); 00319 00320 return (ICH)-1; 00321 } 00322 }

ICH MLLineLength PED  ,
ICH 
 

Definition at line 334 of file edmlrare.c.

References tagED::chLines, ICH, tagED::ichMaxSel, tagED::ichMinSel, MLIchToLine(), and MLLine().

Referenced by MLEditWndProc().

00337 { 00338 ICH il1, il2; 00339 ICH temp; 00340 00341 if (ich != 0xFFFFFFFF) 00342 return (MLLine(ped, MLIchToLine(ped, ich))); 00343 00344 /* 00345 * Find length of lines corresponding to current selection 00346 */ 00347 il1 = MLIchToLine(ped, ped->ichMinSel); 00348 il2 = MLIchToLine(ped, ped->ichMaxSel); 00349 if (il1 == il2) 00350 return (MLLine(ped, il1) - (ped->ichMaxSel - ped->ichMinSel)); 00351 00352 temp = ped->ichMinSel - ped->chLines[il1]; 00353 temp += MLLine(ped, il2); 00354 temp -= (ped->ichMaxSel - ped->chLines[il2]); 00355 00356 return temp; 00357 }

void MLMouseMotion PED  ,
UINT  ,
UINT  ,
LPPOINT 
 

Definition at line 2792 of file editml.c.

References BOOL, tagED::chLines, ECGetEditDC(), ECIsDBCSLeadByte(), ECLock(), ECReleaseEditDC(), ECUnlock(), ECWord(), FALSE, tagED::fAnsi, tagED::fDBCS, tagED::fFocus, tagED::fMouseDown, gpsi, tagED::hwnd, tagED::iCaretLine, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, tagED::ichStartMaxSel, tagED::ichStartMinSel, IDSYS_SCROLL, MLChangeSelection(), MLEnsureCaretVisible(), MLMouseToIch(), MLSetCaretPosition(), NtUserKillSystemTimer, NtUserReleaseCapture, NtUserSetCapture(), NtUserSetFocus(), NtUserSetSystemTimer(), NULL, tagED::prevKeys, tagED::ptPrevMouse, tagED::rcFmt, TRUE, and UINT.

Referenced by MLEditWndProc(), and MLKeyDown().

02797 { 02798 BOOL fChangedSel = FALSE; 02799 02800 HDC hdc = ECGetEditDC(ped, TRUE); 02801 02802 ICH ichMaxSel = ped->ichMaxSel; 02803 ICH ichMinSel = ped->ichMinSel; 02804 02805 ICH mouseCch; 02806 ICH mouseLine; 02807 int i, j; 02808 LONG ll, lh; 02809 02810 mouseCch = MLMouseToIch(ped, hdc, mousePt, &mouseLine); 02811 02812 /* 02813 * Save for timer 02814 */ 02815 ped->ptPrevMouse = *mousePt; 02816 ped->prevKeys = virtKeyDown; 02817 02818 switch (message) { 02819 case WM_LBUTTONDBLCLK: 02820 /* 02821 * if shift key is down, extend selection to word we double clicked on 02822 * else clear current selection and select word. 02823 */ 02824 // LiZ -- 5/5/93 02825 if (ped->fAnsi && ped->fDBCS) { 02826 LPSTR pText = ECLock(ped); 02827 ECWord(ped,ped->ichCaret, 02828 ECIsDBCSLeadByte(ped, *(pText+(ped->ichCaret))) 02829 ? FALSE : 02830 (ped->ichCaret == ped->chLines[ped->iCaretLine] 02831 ? FALSE : TRUE), &ll, &lh); 02832 ECUnlock(ped); 02833 } else { 02834 ECWord(ped, mouseCch, !(mouseCch == ped->chLines[mouseLine]), &ll, &lh); 02835 } 02836 if (!(virtKeyDown & MK_SHIFT)) { 02837 // If shift key isn't down, move caret to mouse point and clear 02838 // old selection 02839 ichMinSel = ll; 02840 ichMaxSel = ped->ichCaret = lh; 02841 } else { 02842 // Shiftkey is down so we want to maintain the current selection 02843 // (if any) and just extend or reduce it 02844 if (ped->ichMinSel == ped->ichCaret) { 02845 ichMinSel = ped->ichCaret = ll; 02846 ECWord(ped, ichMaxSel, TRUE, &ll, &lh); 02847 } else { 02848 ichMaxSel = ped->ichCaret = lh; 02849 ECWord(ped, ichMinSel, FALSE, &ll, &lh); 02850 } 02851 } 02852 02853 ped->ichStartMinSel = ll; 02854 ped->ichStartMaxSel = lh; 02855 02856 goto InitDragSelect; 02857 02858 case WM_MOUSEMOVE: 02859 if (ped->fMouseDown) { 02860 02861 /* 02862 * Set the system timer to automatically scroll when mouse is 02863 * outside of the client rectangle. Speed of scroll depends on 02864 * distance from window. 02865 */ 02866 i = mousePt->y < 0 ? -mousePt->y : mousePt->y - ped->rcFmt.bottom; 02867 j = gpsi->dtScroll - ((UINT)i << 4); 02868 if (j < 1) 02869 j = 1; 02870 NtUserSetSystemTimer(ped->hwnd, IDSYS_SCROLL, (UINT)j, NULL); 02871 02872 fChangedSel = TRUE; 02873 02874 // Extend selection, move caret right 02875 if (ped->ichStartMinSel || ped->ichStartMaxSel) { 02876 // We're in WORD SELECT mode 02877 BOOL fReverse = (mouseCch <= ped->ichStartMinSel); 02878 ECWord(ped, mouseCch, !fReverse, &ll, &lh); 02879 if (fReverse) { 02880 ichMinSel = ped->ichCaret = ll; 02881 ichMaxSel = ped->ichStartMaxSel; 02882 } else { 02883 ichMinSel = ped->ichStartMinSel; 02884 ichMaxSel = ped->ichCaret = lh; 02885 } 02886 } else if ((ped->ichMinSel == ped->ichCaret) && 02887 (ped->ichMinSel != ped->ichMaxSel)) 02888 // Reduce selection extent 02889 ichMinSel = ped->ichCaret = mouseCch; 02890 else 02891 // Extend selection extent 02892 ichMaxSel = ped->ichCaret = mouseCch; 02893 02894 ped->iCaretLine = mouseLine; 02895 } 02896 break; 02897 02898 case WM_LBUTTONDOWN: 02899 ll = lh = mouseCch; 02900 02901 if (!(virtKeyDown & MK_SHIFT)) { 02902 // If shift key isn't down, move caret to mouse point and clear 02903 // old selection 02904 ichMinSel = ichMaxSel = ped->ichCaret = mouseCch; 02905 } else { 02906 // Shiftkey is down so we want to maintain the current selection 02907 // (if any) and just extend or reduce it 02908 if (ped->ichMinSel == ped->ichCaret) 02909 ichMinSel = ped->ichCaret = mouseCch; 02910 else 02911 ichMaxSel = ped->ichCaret = mouseCch; 02912 } 02913 02914 ped->ichStartMinSel = ped->ichStartMaxSel = 0; 02915 02916 InitDragSelect: 02917 ped->iCaretLine = mouseLine; 02918 02919 ped->fMouseDown = FALSE; 02920 NtUserSetCapture(ped->hwnd); 02921 ped->fMouseDown = TRUE; 02922 fChangedSel = TRUE; 02923 02924 // Set the timer so that we can scroll automatically when the mouse 02925 // is moved outside the window rectangle. 02926 NtUserSetSystemTimer(ped->hwnd, IDSYS_SCROLL, gpsi->dtScroll, NULL); 02927 break; 02928 02929 case WM_LBUTTONUP: 02930 if (ped->fMouseDown) { 02931 02932 /* 02933 * Kill the timer so that we don't do auto mouse moves anymore 02934 */ 02935 NtUserKillSystemTimer(ped->hwnd, IDSYS_SCROLL); 02936 NtUserReleaseCapture(); 02937 MLSetCaretPosition(ped, hdc); 02938 ped->fMouseDown = FALSE; 02939 } 02940 break; 02941 } 02942 02943 02944 if (fChangedSel) { 02945 MLChangeSelection(ped, hdc, ichMinSel, ichMaxSel); 02946 MLEnsureCaretVisible(ped); 02947 } 02948 02949 ECReleaseEditDC(ped, hdc, TRUE); 02950 02951 if (!ped->fFocus && (message == WM_LBUTTONDOWN)) { 02952 02953 /* 02954 * If we don't have the focus yet, get it 02955 */ 02956 NtUserSetFocus(ped->hwnd); 02957 } 02958 }

void MLPaintABlock PED  ,
HDC  ,
int  ,
int 
 

ICH MLPasteText PED   ) 
 

Definition at line 2720 of file editml.c.

References ECEmptyUndo(), FALSE, tagED::fAnsi, tagED::fAutoVScroll, GetClipboardData(), tagED::hwnd, ICH, MLDeleteText(), MLInsertText(), NtUserCloseClipboard(), NtUserSetCursor(), NULL, OpenClipboard(), strlen(), USERGLOBALLOCK, and USERGLOBALUNLOCK.

Referenced by MLEditWndProc().

02722 { 02723 HANDLE hData; 02724 LPSTR lpchClip; 02725 ICH cchAdded = 0; 02726 HCURSOR hCursorOld; 02727 02728 #ifdef UNDO_CLEANUP // #ifdef Added in Chicago - johnl 02729 if (!ped->fAutoVScroll) { 02730 02731 /* 02732 * Empty the undo buffer if this edit control limits the amount of text 02733 * the user can add to the window rect. This is so that we can undo this 02734 * operation if doing in causes us to exceed the window boundaries. 02735 */ 02736 ECEmptyUndo(ped); 02737 } 02738 #endif 02739 02740 hCursorOld = NtUserSetCursor(LoadCursor(NULL, IDC_WAIT)); 02741 02742 if (!OpenClipboard(ped->hwnd)) 02743 goto PasteExitNoCloseClip; 02744 02745 if (!(hData = GetClipboardData(ped->fAnsi ? CF_TEXT : CF_UNICODETEXT)) || 02746 (GlobalFlags(hData) == GMEM_INVALID_HANDLE)) { 02747 RIPMSG1(RIP_WARNING, "MLPasteText(): couldn't get a valid handle(%x)", hData); 02748 goto PasteExit; 02749 } 02750 02751 /* 02752 * See if any text should be deleted 02753 */ 02754 MLDeleteText(ped); 02755 02756 USERGLOBALLOCK(hData, lpchClip); 02757 if (lpchClip == NULL) { 02758 RIPMSG1(RIP_WARNING, "MLPasteText: USERGLOBALLOCK(%x) failed.", hData); 02759 goto PasteExit; 02760 } 02761 02762 /* 02763 * Get the length of the addition. 02764 */ 02765 if (ped->fAnsi) 02766 cchAdded = strlen(lpchClip); 02767 else 02768 cchAdded = wcslen((LPWSTR)lpchClip); 02769 02770 /* 02771 * Insert the text (MLInsertText checks line length) 02772 */ 02773 cchAdded = MLInsertText(ped, lpchClip, cchAdded, FALSE); 02774 02775 USERGLOBALUNLOCK(hData); 02776 02777 PasteExit: 02778 NtUserCloseClipboard(); 02779 02780 PasteExitNoCloseClip: 02781 NtUserSetCursor(hCursorOld); 02782 02783 return (cchAdded); 02784 }

void MLRepaintChangedSelection PED  ,
HDC  ,
ICH  ,
ICH 
 

void MLReplaceSel PED  ,
LPSTR 
 

Definition at line 1309 of file editml.c.

References BOOL, ECEmptyUndo(), ECSaveUndo(), FALSE, tagED::fAnsi, tagED::hwnd, ICH, IsWindow(), MLDeleteText(), MLInsertText(), MLUndo(), Pundo, and strlen().

Referenced by ECResultStrHandler(), and MLEditWndProc().

01310 { 01311 ICH cchText; 01312 01313 // 01314 // Delete text, which will put it into the clean undo buffer. 01315 // 01316 ECEmptyUndo(Pundo(ped)); 01317 MLDeleteText(ped); 01318 01319 // 01320 // B#3356 01321 // Some apps do "clear" by selecting all of the text, then replacing 01322 // it with "", in which case MLInsertText() will return 0. But that 01323 // doesn't mean failure... 01324 // 01325 if ( ped->fAnsi ) 01326 cchText = strlen(lpText); 01327 else 01328 cchText = wcslen((LPWSTR)lpText); 01329 01330 if (cchText ) { 01331 BOOL fFailed; 01332 UNDO undo; 01333 HWND hwndSave; 01334 01335 // 01336 // B#1385,1427 01337 // Save undo buffer, but DO NOT CLEAR IT. We want to restore it 01338 // if insertion fails due to OOM. 01339 // 01340 ECSaveUndo(Pundo(ped), (PUNDO)&undo, FALSE); 01341 01342 hwndSave = ped->hwnd; 01343 fFailed = (BOOL) !MLInsertText(ped, lpText, cchText, FALSE); 01344 if (!IsWindow(hwndSave)) 01345 return; 01346 01347 if (fFailed) { 01348 // 01349 // UNDO the previous edit 01350 // 01351 ECSaveUndo((PUNDO)&undo, Pundo(ped), FALSE); 01352 MLUndo(ped); 01353 } 01354 } 01355 }

LONG MLScroll PED  ,
BOOL  ,
int  ,
int  ,
BOOL 
 

Definition at line 2966 of file editml.c.

References _GetClientRect(), _IsWindowVisible(), tagED::aveCharWidth, BOOL, tagED::cLines, CopyRect, DWORD, ECGetBrush(), ECGetEditDC(), ECNotifyParent(), ECReleaseEditDC(), ECSetEditClip(), FALSE, tagED::format, tagED::fRtoLReading, GetScrollInfo(), tagED::hFont, tagED::hwnd, tagED::hwndParent, tagED::ichLinesOnScreen, tagED::ichScreenStart, IntersectRect(), L, tagED::lineHeight, max, tagED::maxPixelWidth, min, ML_REFRESH, MLSetCaretPosition(), NtUserInvalidateRect(), NtUserScrollDC(), NtUserSetScrollInfo(), NULL, tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, ScrollWindowEx(), TestWF, TRUE, UINT, UnionRect(), UpdateWindow(), ValidateHwnd, WFHSCROLL, WFVSCROLL, WFWIN40COMPAT, tagED::wLeftMargin, tagED::wRightMargin, and tagED::xOffset.

Referenced by ECUpdateFormat(), MLBuildchLines(), MLEditWndProc(), MLEnsureCaretVisible(), and MLSize().

02972 { 02973 SCROLLINFO si; 02974 int dx = 0; 02975 int dy = 0; 02976 BOOL fIncludeLeftMargin; 02977 int newPos; 02978 int oldPos; 02979 BOOL fUp = FALSE; 02980 UINT wFlag; 02981 DWORD dwTime = 0; 02982 02983 if (fRedraw && (cmd != ML_REFRESH)) { 02984 UpdateWindow(ped->hwnd); 02985 } 02986 02987 if (ped->pLpkEditCallout && ped->fRtoLReading && !fVertical 02988 && ped->maxPixelWidth > ped->rcFmt.right - ped->rcFmt.left) { 02989 /* 02990 * Horizontal scoll of a right oriented window with a scrollbar. 02991 * Map the logical xOffset to visual coordinates. 02992 */ 02993 oldPos = ped->maxPixelWidth 02994 - ((int)ped->xOffset + ped->rcFmt.right - ped->rcFmt.left); 02995 } else 02996 oldPos = (int) (fVertical ? ped->ichScreenStart : ped->xOffset); 02997 02998 fIncludeLeftMargin = (ped->xOffset == 0); 02999 03000 switch (cmd) { 03001 case ML_REFRESH: 03002 newPos = oldPos; 03003 break; 03004 03005 case EM_GETTHUMB: 03006 return(oldPos); 03007 03008 case SB_THUMBTRACK: 03009 case SB_THUMBPOSITION: 03010 03011 /* 03012 * If the edit contains more than 0xFFFF lines 03013 * it means that the scrolbar can return a position 03014 * that cannot fit in a WORD (16 bits), so use 03015 * GetScrollInfo (which is slower) in this case. 03016 */ 03017 if (ped->cLines < 0xFFFF) { 03018 newPos = iAmt; 03019 } else { 03020 SCROLLINFO si; 03021 03022 si.cbSize = sizeof(SCROLLINFO); 03023 si.fMask = SIF_TRACKPOS; 03024 03025 GetScrollInfo( ped->hwnd, SB_VERT, &si); 03026 03027 newPos = si.nTrackPos; 03028 } 03029 break; 03030 03031 case SB_TOP: // == SB_LEFT 03032 newPos = 0; 03033 break; 03034 03035 case SB_BOTTOM: // == SB_RIGHT 03036 if (fVertical) 03037 newPos = ped->cLines; 03038 else 03039 newPos = ped->maxPixelWidth; 03040 break; 03041 03042 case SB_PAGEUP: // == SB_PAGELEFT 03043 fUp = TRUE; 03044 case SB_PAGEDOWN: // == SB_PAGERIGHT 03045 03046 if (fVertical) 03047 iAmt = ped->ichLinesOnScreen - 1; 03048 else 03049 iAmt = (ped->rcFmt.right - ped->rcFmt.left) - 1; 03050 03051 if (iAmt == 0) 03052 iAmt++; 03053 03054 if (fUp) 03055 iAmt = -iAmt; 03056 goto AddDelta; 03057 03058 case SB_LINEUP: // == SB_LINELEFT 03059 fUp = TRUE; 03060 case SB_LINEDOWN: // == SB_LINERIGHT 03061 03062 dwTime = iAmt; 03063 03064 iAmt = 1; 03065 03066 if (fUp) 03067 iAmt = -iAmt; 03068 03069 // | | 03070 // | FALL THRU | 03071 // V V 03072 03073 case EM_LINESCROLL: 03074 if (!fVertical) 03075 iAmt *= ped->aveCharWidth; 03076 03077 AddDelta: 03078 newPos = oldPos + iAmt; 03079 break; 03080 03081 default: 03082 return(0L); 03083 } 03084 03085 if (fVertical) { 03086 if (si.nMax = ped->cLines) 03087 si.nMax--; 03088 03089 if (!ped->hwndParent || 03090 TestWF(ValidateHwnd(ped->hwndParent), WFWIN40COMPAT)) 03091 si.nPage = ped->ichLinesOnScreen; 03092 else 03093 si.nPage = 0; 03094 03095 wFlag = WFVSCROLL; 03096 } else { 03097 si.nMax = ped->maxPixelWidth; 03098 si.nPage = ped->rcFmt.right - ped->rcFmt.left; 03099 wFlag = WFHSCROLL; 03100 } 03101 03102 if (TestWF(ValidateHwnd(ped->hwnd), wFlag)) { 03103 si.cbSize = sizeof(SCROLLINFO); 03104 si.fMask = SIF_ALL | SIF_DISABLENOSCROLL; 03105 si.nMin = 0; 03106 si.nPos = newPos; 03107 newPos = NtUserSetScrollInfo(ped->hwnd, fVertical ? SB_VERT : SB_HORZ, 03108 &si, fRedraw); 03109 } else { 03110 // BOGUS -- this is duped code from ScrollBar code 03111 // but it's for the case when we want to limit the position without 03112 // actually having the scroll bar 03113 int iMaxPos; 03114 03115 // Clip page to 0, range + 1 03116 si.nPage = max(min((int)si.nPage, si.nMax + 1), 0); 03117 03118 03119 iMaxPos = si.nMax - (si.nPage ? si.nPage - 1 : 0); 03120 newPos = min(max(newPos, 0), iMaxPos); 03121 } 03122 03123 oldPos -= newPos; 03124 03125 if (!oldPos) 03126 return(0L); 03127 03128 if (ped->pLpkEditCallout && ped->fRtoLReading && !fVertical 03129 && ped->maxPixelWidth > ped->rcFmt.right - ped->rcFmt.left) { 03130 // Map visual oldPos and newPos back to logical coordinates 03131 newPos = ped->maxPixelWidth 03132 - (newPos + ped->rcFmt.right - ped->rcFmt.left); 03133 oldPos = -oldPos; 03134 if (newPos<0) { 03135 // Compensate for scroll bar returning pos > max-page 03136 oldPos += newPos; 03137 newPos=0; 03138 } 03139 } 03140 03141 if (fVertical) { 03142 ped->ichScreenStart = newPos; 03143 dy = oldPos * ped->lineHeight; 03144 } else { 03145 ped->xOffset = newPos; 03146 dx = oldPos; 03147 } 03148 03149 if (cmd != SB_THUMBTRACK) 03150 // We don't want to notify the parent of thumbtracking since they might 03151 // try to set the thumb position to something bogus. 03152 // NOTEPAD used to be guilty of this -- but I rewrote it so it's not. 03153 // The question is WHO ELSE does this? (jeffbog) 03154 ECNotifyParent(ped, fVertical ? EN_VSCROLL : EN_HSCROLL); 03155 03156 if (fRedraw && _IsWindowVisible(ped->pwnd)) { 03157 RECT rc; 03158 RECT rcUpdate; 03159 RECT rcClipRect; 03160 HDC hdc; 03161 03162 _GetClientRect(ped->pwnd, &rc); 03163 CopyRect(&rcClipRect, &ped->rcFmt); 03164 03165 if (fVertical) { // Is this a vertical scroll? 03166 rcClipRect.left -= ped->wLeftMargin; 03167 rcClipRect.right += ped->wRightMargin; 03168 } 03169 03170 IntersectRect(&rc, &rc, &rcClipRect); 03171 rc.bottom++; 03172 03173 /* 03174 * Chicago has this HideCaret but there doesn't appear to be a 03175 * corresponding ShowCaret, so we lose the Caret under NT when the 03176 * EC scrolls - Johnl 03177 * 03178 * HideCaret(ped->hwnd); 03179 */ 03180 03181 hdc = ECGetEditDC(ped, FALSE); 03182 ECSetEditClip(ped, hdc, fIncludeLeftMargin); 03183 if (ped->hFont) 03184 SelectObject(hdc, ped->hFont); 03185 ECGetBrush(ped, hdc); 03186 03187 if (ped->pLpkEditCallout && !fVertical) { 03188 // Horizontal scroll with complex script support 03189 int xFarOffset = ped->xOffset + ped->rcFmt.right - ped->rcFmt.left; 03190 03191 rc = ped->rcFmt; 03192 if (dwTime != 0) 03193 ScrollWindowEx(ped->hwnd, ped->fRtoLReading ? -dx : dx, dy, NULL, NULL, NULL, 03194 &rcUpdate, MAKELONG(SW_SMOOTHSCROLL | SW_SCROLLCHILDREN, dwTime)); 03195 else 03196 NtUserScrollDC(hdc, ped->fRtoLReading ? -dx : dx, dy, 03197 &rc, &rc, NULL, &rcUpdate); 03198 03199 // Handle margins: Blank if clipped by horizontal scrolling, 03200 // display otherwise. 03201 if (ped->wLeftMargin) { 03202 rc.left = ped->rcFmt.left - ped->wLeftMargin; 03203 rc.right = ped->rcFmt.left; 03204 if ( (ped->format != ES_LEFT) // Always display margin for centred or far-aligned text 03205 || // Display LTR left margin if first character fully visible 03206 (!ped->fRtoLReading && ped->xOffset == 0) 03207 || // Display RTL left margin if last character fully visible 03208 (ped->fRtoLReading && xFarOffset >= ped->maxPixelWidth)) { 03209 UnionRect(&rcUpdate, &rcUpdate, &rc); 03210 } else { 03211 ExtTextOutW(hdc, rc.left, rc.top, 03212 ETO_CLIPPED | ETO_OPAQUE | ETO_GLYPH_INDEX, 03213 &rc, L"", 0, 0L); 03214 } 03215 } 03216 if (ped->wRightMargin) { 03217 rc.left = ped->rcFmt.right; 03218 rc.right = ped->rcFmt.right + ped->wRightMargin; 03219 if ( (ped->format != ES_LEFT) // Always display margin for centred or far-aligned text 03220 || // Display RTL right margin if first character fully visible 03221 (ped->fRtoLReading && ped->xOffset == 0) 03222 || // Display LTR right margin if last character fully visible 03223 (!ped->fRtoLReading && xFarOffset >= ped->maxPixelWidth)) { 03224 UnionRect(&rcUpdate, &rcUpdate, &rc); 03225 } else { 03226 ExtTextOutW(hdc, rc.left, rc.top, 03227 ETO_CLIPPED | ETO_OPAQUE | ETO_GLYPH_INDEX, 03228 &rc, L"", 0, 0L); 03229 } 03230 } 03231 } else { 03232 if (dwTime != 0) 03233 ScrollWindowEx(ped->hwnd, dx, dy, NULL, NULL, NULL, 03234 &rcUpdate, MAKELONG(SW_SMOOTHSCROLL | SW_SCROLLCHILDREN, dwTime)); 03235 else 03236 NtUserScrollDC(hdc, dx, dy, &rc, &rc, NULL, &rcUpdate); 03237 03238 // If we need to wipe out the left margin area 03239 if (ped->wLeftMargin && !fVertical) { 03240 // Calculate the rectangle to be wiped out 03241 rc.right = rc.left; 03242 rc.left = max(0, ped->rcFmt.left - ped->wLeftMargin); 03243 if (rc.left < rc.right) { 03244 if (fIncludeLeftMargin && (ped->xOffset != 0)) { 03245 03246 ExtTextOutW(hdc, rc.left, rc.top, ETO_CLIPPED | ETO_OPAQUE, 03247 &rc, L"", 0, 0L); 03248 } else 03249 if((!fIncludeLeftMargin) && (ped->xOffset == 0)) 03250 UnionRect(&rcUpdate, &rcUpdate, &rc); 03251 } 03252 } 03253 } 03254 MLSetCaretPosition(ped,hdc); 03255 03256 ECReleaseEditDC(ped, hdc, FALSE); 03257 NtUserInvalidateRect(ped->hwnd, &rcUpdate, 03258 ((ped->ichLinesOnScreen + ped->ichScreenStart) >= ped->cLines)); 03259 UpdateWindow(ped->hwnd); 03260 } 03261 03262 return(MAKELONG(-oldPos, 1)); 03263 }

void MLSetCaretPosition PED  ,
HDC 
 

Definition at line 292 of file editml.c.

References _IsWindowVisible(), BOOL, tagED::chLines, tagED::cLines, CopyRect, ECGetCaretWidth, ECImmSetCompositionWindow(), tagED::f40Compat, FALSE, tagED::fCaretHidden, tagED::fFocus, fpImmIsIME, tagED::fWrap, GetClientRect(), tagED::hwnd, tagED::iCaretLine, tagED::iCaretOffset, ICH, tagED::ichCaret, tagED::ichLinesOnScreen, tagED::ichScreenStart, IntersectRect(), tagED::lineHeight, max, min, MLIchToXYPos(), NtUserSetCaretPos, tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, THREAD_HKL, and TRUE.

Referenced by ECSetCaretHandler(), MLChangeSelection(), MLDrawText(), MLEditWndProc(), MLKeyDown(), MLMouseMotion(), MLScroll(), MLSetFocus(), and MLSetSelection().

00295 { 00296 POINT position; 00297 BOOL prevLine; 00298 int x = -20000; 00299 int y = -20000; 00300 00301 /* 00302 * We will only position the caret if we have the focus since we don't want 00303 * to move the caret while another window could own it. 00304 */ 00305 if (!ped->fFocus || !_IsWindowVisible(ped->pwnd)) 00306 return; 00307 00308 /* 00309 * Find the position of the caret 00310 */ 00311 if (!ped->fCaretHidden && 00312 ((ICH) ped->iCaretLine >= ped->ichScreenStart) && 00313 ((ICH) ped->iCaretLine < (ped->ichScreenStart + ped->ichLinesOnScreen))) { 00314 00315 RECT rcRealFmt; 00316 00317 if (ped->f40Compat) 00318 { 00319 GetClientRect(ped->hwnd, &rcRealFmt); 00320 IntersectRect(&rcRealFmt, &rcRealFmt, &ped->rcFmt); 00321 } else { 00322 CopyRect(&rcRealFmt, &ped->rcFmt); 00323 } 00324 00325 if (ped->cLines - 1 != ped->iCaretLine && ped->ichCaret == ped->chLines[ped->iCaretLine + 1]) { 00326 prevLine = TRUE; 00327 } else { 00328 prevLine = FALSE; 00329 } 00330 00331 MLIchToXYPos(ped, hdc, ped->ichCaret, prevLine, &position); 00332 00333 if ( (position.y >= rcRealFmt.top) && 00334 (position.y <= rcRealFmt.bottom - ped->lineHeight)) { 00335 int xPos = position.x; 00336 int cxCaret = ECGetCaretWidth(); 00337 00338 if (ped->fWrap || 00339 ((xPos > (rcRealFmt.left - cxCaret)) && 00340 (xPos <= rcRealFmt.right))) { 00341 // Make sure the caret is in the visible region if word 00342 // wrapping. This is so that the caret will be visible if the 00343 // line ends with a space. 00344 x = max(xPos, rcRealFmt.left); 00345 x = min(x, rcRealFmt.right - cxCaret); 00346 y = position.y; 00347 } 00348 } 00349 } 00350 00351 if (ped->pLpkEditCallout) { 00352 NtUserSetCaretPos(x + ped->iCaretOffset, y); 00353 } else { 00354 NtUserSetCaretPos(x, y); 00355 } 00356 00357 // FE_IME : MLSetCaretPosition -- ImmSetCompositionWindow(CFS_RECT) 00358 if (fpImmIsIME(THREAD_HKL())) { 00359 if (x != -20000 && y != -20000) { 00360 ECImmSetCompositionWindow(ped, x, y); 00361 } 00362 } 00363 }

void MLSetHandle PED  ,
HANDLE 
 

Definition at line 222 of file edmlrare.c.

References tagED::cbChar, tagED::cch, tagED::cchAlloc, CCHALLOCEXTRA, ECLock(), ECResetTextInfo(), ECUnlock(), FALSE, tagED::fAnsi, tagED::fEncoded, tagED::hInstance, tagED::hText, ICH, LOCALREALLOC, LOCALSIZE, NULL, and strlen().

Referenced by MLEditWndProc().

00225 { 00226 ICH newCch; 00227 00228 ped->cch = ped->cchAlloc = 00229 LOCALSIZE(ped->hText = hNewText, ped->hInstance) / ped->cbChar; 00230 ped->fEncoded = FALSE; 00231 00232 if (ped->cch) { 00233 00234 /* 00235 * We have to do it this way in case the app gives us a zero size handle 00236 */ 00237 if (ped->fAnsi) 00238 ped->cch = strlen(ECLock(ped)); 00239 else 00240 ped->cch = wcslen((LPWSTR)ECLock(ped)); 00241 ECUnlock(ped); 00242 } 00243 00244 newCch = (ICH)(ped->cch + CCHALLOCEXTRA); 00245 00246 /* 00247 * We do this LocalReAlloc in case the app changed the size of the handle 00248 */ 00249 if (LOCALREALLOC(ped->hText, newCch*ped->cbChar, 0, ped->hInstance, NULL)) 00250 ped->cchAlloc = newCch; 00251 00252 ECResetTextInfo(ped); 00253 }

void MLSetRectHandler PED  ,
LPRECT 
 

void MLSetSelection PED  ,
BOOL  ,
ICH  ,
ICH 
 

Definition at line 368 of file edmlrare.c.

References tagED::cch, ECAdjustIch(), ECGetEditDC(), ECLock(), ECReleaseEditDC(), ECUnlock(), FALSE, tagED::fAnsi, tagED::fDBCS, tagED::iCaretLine, tagED::ichCaret, min, MLChangeSelection(), MLEnsureCaretVisible(), MLIchToLine(), MLSetCaretPosition(), and NULL.

Referenced by MLEditWndProc(), and MLUndo().

00373 { 00374 HDC hdc; 00375 00376 if (ichMinSel == 0xFFFFFFFF) { 00377 00378 /* 00379 * Set no selection if we specify -1 00380 */ 00381 ichMinSel = ichMaxSel = ped->ichCaret; 00382 } 00383 00384 /* 00385 * Since these are unsigned, we don't check if they are greater than 0. 00386 */ 00387 ichMinSel = min(ped->cch, ichMinSel); 00388 ichMaxSel = min(ped->cch, ichMaxSel); 00389 00390 #ifdef FE_SB // MLSetSelectionHander() 00391 // 00392 // To avoid position to half of DBCS, check and ajust position if necessary 00393 // 00394 // We check ped->fDBCS and ped->fAnsi though ECAdjustIch checks these bits 00395 // at first. We're worrying about the overhead of ECLock and ECUnlock. 00396 // 00397 if ( ped->fDBCS && ped->fAnsi ) { 00398 00399 PSTR pText; 00400 00401 pText = ECLock(ped); 00402 ichMinSel = ECAdjustIch( ped, pText, ichMinSel ); 00403 ichMaxSel = ECAdjustIch( ped, pText, ichMaxSel ); 00404 ECUnlock(ped); 00405 } 00406 #endif // FE_SB 00407 00408 /* 00409 * Set the caret's position to be at ichMaxSel. 00410 */ 00411 ped->ichCaret = ichMaxSel; 00412 ped->iCaretLine = MLIchToLine(ped, ped->ichCaret); 00413 00414 hdc = ECGetEditDC(ped, FALSE); 00415 MLChangeSelection(ped, hdc, ichMinSel, ichMaxSel); 00416 00417 MLSetCaretPosition(ped, hdc); 00418 ECReleaseEditDC(ped, hdc, FALSE); 00419 00420 #ifdef FE_SB // MLSetSelectionHander() 00421 if (!fDoNotScrollCaret) 00422 MLEnsureCaretVisible(ped); 00423 /* 00424 * #ifdef KOREA is history, with FE_SB (FarEast Single Binary). 00425 */ 00426 #else 00427 #ifdef KOREA 00428 /* 00429 * Extra parameter specified interim character mode 00430 */ 00431 MLEnsureCaretVisible(ped,NULL); 00432 #else 00433 if (!fDoNotScrollCaret) 00434 MLEnsureCaretVisible(ped); 00435 #endif 00436 #endif // FE_SB 00437 }

BOOL MLSetTabStops PED  ,
int  ,
LPINT 
 

Definition at line 458 of file edmlrare.c.

References tagED::aveCharWidth, BOOL, FALSE, tagED::hwnd, MLBuildchLines(), MLEnsureCaretVisible(), MLUpdateiCaretLine(), MultDiv, NtUserInvalidateRect(), NULL, tagED::pTabStops, TRUE, UserLocalAlloc, UserLocalFree, and UserLocalReAlloc.

Referenced by MLEditWndProc().

00462 { 00463 int *pTabStops; 00464 00465 /* 00466 * Check if tab positions already exist 00467 */ 00468 if (!ped->pTabStops) { 00469 00470 /* 00471 * Check if the caller wants the new tab positions 00472 */ 00473 if (nTabPos) { 00474 00475 /* 00476 * Allocate the array of tab stops 00477 */ 00478 if (!(pTabStops = (LPINT)UserLocalAlloc(HEAP_ZERO_MEMORY, (nTabPos + 1) * sizeof(int)))) { 00479 return FALSE; 00480 } 00481 } else { 00482 return TRUE; /* No stops then and no stops now! */ 00483 } 00484 } else { 00485 00486 /* 00487 * Check if the caller wants the new tab positions 00488 */ 00489 if (nTabPos) { 00490 00491 /* 00492 * Check if the number of tab positions is different 00493 */ 00494 if (ped->pTabStops[0] != nTabPos) { 00495 00496 /* 00497 * Yes! So ReAlloc to new size 00498 */ 00499 if (!(pTabStops = (LPINT)UserLocalReAlloc(ped->pTabStops, 00500 (nTabPos + 1) * sizeof(int), 0))) 00501 return FALSE; 00502 } else { 00503 pTabStops = ped->pTabStops; 00504 } 00505 } else { 00506 00507 /* 00508 * Caller wants to remove all the tab stops; So, release 00509 */ 00510 if (!UserLocalFree(ped->pTabStops)) 00511 return FALSE; /* Failure */ 00512 ped->pTabStops = NULL; 00513 goto RedrawAndReturn; 00514 } 00515 } 00516 00517 /* 00518 * Copy the new tab stops onto the tab stop array after converting the 00519 * dialog co-ordinates into the pixel co-ordinates 00520 */ 00521 ped->pTabStops = pTabStops; 00522 *pTabStops++ = nTabPos; /* First element contains the count */ 00523 while (nTabPos--) { 00524 00525 /* 00526 * aveCharWidth must be used instead of cxSysCharWidth. 00527 * Fix for Bug #3871 --SANKAR-- 03/14/91 00528 */ 00529 *pTabStops++ = MultDiv(*lpTabStops++, ped->aveCharWidth, 4); 00530 } 00531 00532 RedrawAndReturn: 00533 // Because the tabstops have changed, we need to recompute the 00534 // maxPixelWidth. Otherwise, horizontal scrolls will have problems. 00535 // Fix for Bug #6042 - 3/15/94 00536 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 00537 00538 // Caret may have changed line by the line recalc above. 00539 MLUpdateiCaretLine(ped); 00540 00541 MLEnsureCaretVisible(ped); 00542 00543 // Also, we need to redraw the whole window. 00544 NtUserInvalidateRect(ped->hwnd, NULL, TRUE); 00545 return TRUE; 00546 }

void MLShiftchLines PED  ,
ICH  ,
int 
 

Definition at line 1538 of file editml.c.

References tagED::chLines, and tagED::cLines.

Referenced by MLBuildchLines(), and MLDeleteText().

01542 { 01543 if (iLine >= ped->cLines) 01544 return; 01545 01546 /* 01547 * Just add delta to the starting point of each line after iLine 01548 */ 01549 for (; iLine < ped->cLines; iLine++) 01550 ped->chLines[iLine] += delta; 01551 }

void MLSize PED  ,
BOOL 
 

Definition at line 56 of file editml.c.

References FALSE, tagED::fWrap, tagED::ichLinesOnScreen, tagED::lineHeight, ML_REFRESH, MLBuildchLines(), MLScroll(), MLUpdateiCaretLine(), NULL, tagED::rcFmt, and TRUE.

Referenced by ECSize().

00057 { 00058 // Calculate the # of lines we can fit in our rectangle. 00059 ped->ichLinesOnScreen = (ped->rcFmt.bottom - ped->rcFmt.top) / ped->lineHeight; 00060 00061 // Make the format rectangle height an integral number of lines 00062 ped->rcFmt.bottom = ped->rcFmt.top + ped->ichLinesOnScreen * ped->lineHeight; 00063 00064 // Rebuild the line array 00065 if (ped->fWrap) { 00066 MLBuildchLines(ped, 0, 0, FALSE, NULL, NULL); 00067 MLUpdateiCaretLine(ped); 00068 } else { 00069 MLScroll(ped, TRUE, ML_REFRESH, 0, fRedraw); 00070 MLScroll(ped, FALSE, ML_REFRESH, 0, fRedraw); 00071 } 00072 }

void MLStripCrCrLf PED   ) 
 

Definition at line 159 of file edmlrare.c.

References tagED::cch, ECLock(), ECUnlock(), tagED::fAnsi, tagED::ichCaret, tagED::ichMaxSel, and tagED::ichMinSel.

Referenced by ECResetTextInfo(), and MLEditWndProc().

00161 { 00162 if (ped->cch) { 00163 if (ped->fAnsi) { 00164 unsigned char *pchSrc; 00165 unsigned char *pchDst; 00166 unsigned char *pchLast; 00167 00168 pchSrc = pchDst = ECLock(ped); 00169 pchLast = pchSrc + ped->cch; 00170 while (pchSrc < pchLast) { 00171 if ( (pchSrc[0] == 0x0D) 00172 && (pchSrc[1] == 0x0D) 00173 && (pchSrc[2] == 0x0A) 00174 ) { 00175 pchSrc += 3; 00176 ped->cch -= 3; 00177 } else { 00178 *pchDst++ = *pchSrc++; 00179 } 00180 } 00181 } else { // !fAnsi 00182 LPWSTR pwchSrc; 00183 LPWSTR pwchDst; 00184 LPWSTR pwchLast; 00185 00186 pwchSrc = pwchDst = (LPWSTR)ECLock(ped); 00187 pwchLast = pwchSrc + ped->cch; 00188 while (pwchSrc < pwchLast) { 00189 if ( (pwchSrc[0] == 0x0D) 00190 && (pwchSrc[1] == 0x0D) 00191 && (pwchSrc[2] == 0x0A) 00192 ) { 00193 pwchSrc += 3; 00194 ped->cch -= 3; 00195 } else { 00196 *pwchDst++ = *pwchSrc++; 00197 } 00198 } 00199 } 00200 ECUnlock(ped); 00201 00202 /* 00203 * Make sure we don't have any values past the last character 00204 */ 00205 if (ped->ichCaret > ped->cch) 00206 ped->ichCaret = ped->cch; 00207 if (ped->ichMinSel > ped->cch) 00208 ped->ichMinSel = ped->cch; 00209 if (ped->ichMaxSel > ped->cch) 00210 ped->ichMaxSel = ped->cch; 00211 } 00212 }

int MLThumbPosFromPed PED  ,
BOOL 
 

BOOL MLUndo PED   ) 
 

Definition at line 556 of file edmlrare.c.

References BOOL, FALSE, tagED::hwnd, ICH, L, MLInsertText(), MLSetSelection(), NULL, SendMessage(), TRUE, UNDO_DELETE, UNDO_INSERT, UNDO_NONE, and UserGlobalFree.

Referenced by MLEditWndProc(), MLInsertText(), and MLReplaceSel().

00558 { 00559 HANDLE hDeletedText = ped->hDeletedText; 00560 BOOL fDelete = (BOOL)(ped->undoType & UNDO_DELETE); 00561 ICH cchDeleted = ped->cchDeleted; 00562 ICH ichDeleted = ped->ichDeleted; 00563 00564 if (ped->undoType == UNDO_NONE) { 00565 00566 /* 00567 * No undo... 00568 */ 00569 return FALSE; 00570 } 00571 00572 ped->hDeletedText = NULL; 00573 ped->cchDeleted = 0; 00574 ped->ichDeleted = (ICH)-1; 00575 ped->undoType &= ~UNDO_DELETE; 00576 00577 if (ped->undoType == UNDO_INSERT) { 00578 ped->undoType = UNDO_NONE; 00579 00580 /* 00581 * Set the selection to the inserted text 00582 */ 00583 MLSetSelection(ped, FALSE, ped->ichInsStart, ped->ichInsEnd); 00584 ped->ichInsStart = ped->ichInsEnd = (ICH)-1; 00585 00586 /* 00587 * Now send a backspace to delete and save it in the undo buffer... 00588 */ 00589 SendMessage(ped->hwnd, WM_CHAR, (WPARAM)VK_BACK, 0L); 00590 } 00591 00592 if (fDelete) { 00593 00594 /* 00595 * Insert deleted chars 00596 */ 00597 00598 /* 00599 * Set the selection to the inserted text 00600 */ 00601 MLSetSelection(ped, FALSE, ichDeleted, ichDeleted); 00602 MLInsertText(ped, hDeletedText, cchDeleted, FALSE); 00603 00604 UserGlobalFree(hDeletedText); 00605 MLSetSelection(ped, FALSE, ichDeleted, ichDeleted + cchDeleted); 00606 } 00607 00608 return TRUE; 00609 }

void MLUpdateiCaretLine PED  ped  ) 
 

Definition at line 1003 of file editml.c.

References AWCOMPARECHAR, tagED::cbChar, tagED::chLines, ECLock(), ECUnlock(), tagED::iCaretLine, tagED::ichCaret, and MLIchToLine().

Referenced by ECUpdateFormat(), MLDeleteText(), MLInsertText(), MLSetTabStops(), and MLSize().

01004 { 01005 PSTR pText; 01006 01007 ped->iCaretLine = MLIchToLine(ped, ped->ichCaret); 01008 01009 /* 01010 * If caret gets to beginning of next line, pop it up to end of current line 01011 * when inserting text. 01012 */ 01013 pText = ECLock(ped) + 01014 (ped->ichCaret - 1) * ped->cbChar; 01015 if (ped->iCaretLine && ped->chLines[ped->iCaretLine] == ped->ichCaret && 01016 (!AWCOMPARECHAR(ped, pText - ped->cbChar, 0x0D) || 01017 !AWCOMPARECHAR(ped, pText, 0x0A))) 01018 ped->iCaretLine--; 01019 ECUnlock(ped); 01020 }

VOID ModifyMenuItem PWND  pwnd  ) 
 

Definition at line 104 of file mdimenu.c.

References ACTIVE, FALSE, FIRST, HWq, MakeMenuItem(), PtoH, REBASEALWAYS, REBASEPWND, tagWND::spmenu, ThunkedMenuItemInfo(), and UINT.

Referenced by DefMDIChildProcWorker(), and xxxMDIActivate().

00106 { 00107 PMDI pmdi; 00108 WCHAR sz[200]; 00109 MENUITEMINFO mii; 00110 PWND pwndParent; 00111 PMENU pmenu; 00112 00113 /* 00114 * Get a pointer to the MDI structure 00115 */ 00116 pwndParent = REBASEPWND(pwnd, spwndParent); 00117 pmdi = ((PMDIWND)pwndParent)->pmdi; 00118 00119 if (PtrToUlong(pwnd->spmenu) > FIRST(pmdi) + (UINT)8) 00120 return; 00121 00122 mii.cbSize = sizeof(MENUITEMINFO); 00123 mii.fMask = MIIM_STRING; 00124 mii.dwTypeData = sz; 00125 00126 /* 00127 * Parent is MDI Client. 00128 */ 00129 MakeMenuItem(sz, pwnd); 00130 00131 /* 00132 * Changing the active child? Check it. 00133 */ 00134 if (HWq(pwnd) == ACTIVE(pmdi)) { 00135 mii.fMask |= MIIM_STATE; 00136 mii.fState = MFS_CHECKED; 00137 } 00138 00139 pwndParent = REBASEPWND(pwndParent, spwndParent); 00140 00141 if (pwndParent->spmenu) { 00142 00143 /* 00144 * Bug# 21566. If spmenu is NULL we used to fail 00145 * because REBASEALWAYS is trying to get the kernel 00146 * address of NULL based on pwndParent 00147 */ 00148 pmenu = REBASEALWAYS(pwndParent, spmenu); 00149 /* 00150 * Internal call to SetMenuItemInfo 00151 */ 00152 ThunkedMenuItemInfo(PtoH(pmenu), PtrToUlong(pwnd->spmenu), FALSE, FALSE, &mii, FALSE); 00153 } 00154 }

HANDLE ObjectFromDIBResource HINSTANCE  hmod,
LPCWSTR  lpName,
LPWSTR  type,
DWORD  cxDesired,
DWORD  cyDesired,
UINT  LR_flags
 

Definition at line 2847 of file clres.c.

References ConvertDIBBitmap(), ConvertDIBIcon(), ISRIFFFORMAT, LoadCursorIconFromResource(), LoadDIB(), LOCKRESOURCE, NULL, PBYTE, PTR_TO_ID, RtlLoadObjectFromDIBFile(), SplFreeResource(), type, and UNLOCKRESOURCE.

Referenced by LoadBmp(), and LoadIcoCur().

02854 { 02855 HANDLE hObj = NULL; 02856 02857 if (LR_flags & LR_LOADFROMFILE) { 02858 02859 hObj = RtlLoadObjectFromDIBFile(lpName, 02860 type, 02861 cxDesired, 02862 cyDesired, 02863 LR_flags); 02864 } else { 02865 02866 HANDLE hdib; 02867 02868 hdib = LoadDIB(hmod, lpName, type, cxDesired, cyDesired, LR_flags); 02869 02870 if (hdib != NULL) { 02871 02872 LPBITMAPINFOHEADER lpbih; 02873 02874 /* 02875 * We cast the resource-bits to a BITMAPINFOHEADER. If the 02876 * resource is a CURSOR type, then there are actually two 02877 * WORDs preceeding the BITMAPINFOHDEADER indicating the 02878 * hot-spot. Be careful in assuming you have a real 02879 * dib in this case. 02880 */ 02881 if(lpbih = (LPBITMAPINFOHEADER)LOCKRESOURCE(hdib, hmod)) { 02882 02883 switch (PTR_TO_ID(type)) { 02884 case PTR_TO_ID(RT_BITMAP): 02885 /* 02886 * Create a physical bitmap from the DIB. 02887 */ 02888 hObj = ConvertDIBBitmap(lpbih, 02889 cxDesired, 02890 cyDesired, 02891 LR_flags, 02892 NULL, 02893 NULL); 02894 break; 02895 02896 case PTR_TO_ID(RT_ICON): 02897 case PTR_TO_ID(RT_CURSOR): 02898 case PTR_TO_ID(RT_ANICURSOR): 02899 case PTR_TO_ID(RT_ANIICON): 02900 /* 02901 * Animated icon\cursors resources use the RIFF format 02902 */ 02903 if (ISRIFFFORMAT(lpbih)) { 02904 hObj = LoadCursorIconFromResource ((PBYTE)lpbih, lpName, cxDesired, cyDesired, LR_flags); 02905 } else { 02906 /* 02907 * Create the object from the DIB. 02908 */ 02909 hObj = ConvertDIBIcon(lpbih, 02910 hmod, 02911 lpName, 02912 (type == RT_ICON), 02913 cxDesired, 02914 cyDesired, 02915 LR_flags); 02916 } 02917 break; 02918 } 02919 02920 UNLOCKRESOURCE(hdib, hmod); 02921 } 02922 02923 /* 02924 * DO THIS TWICE! The resource compiler always makes icon images 02925 * (RT_ICON) in a group icon discardable, whether the group dude 02926 * is or not! So the first free won't really free the thing; 02927 * it'll just set the ref count to 0 and let the discard logic 02928 * go on its merry way. 02929 * 02930 * We take care of shared guys, so we don't need this dib no more. 02931 * Don't need this DIB no more no more, no more no more no more 02932 * don't need this DIB no more. 02933 */ 02934 SplFreeResource(hdib, hmod, LR_flags); 02935 } 02936 } 02937 02938 return hObj; 02939 }

HANDLE OpenKeyboardLayoutFile LPWSTR  lpszKLName,
PUINT  puFlags,
PUINT  poffTable,
PUINT  pKbdInputLocale
 

Definition at line 4019 of file client.c.

References BOOL(), CCH_KL_ID, CCH_KL_LIBNAME, DbgPrint, DWORD, FALSE, GetClientKeyboardType(), IS_IME_KBDLAYOUT, ISREMOTESESSION, KeyAttributes, L, LPVOID, MAX_PATH, NSZKLKEY, NT_SUCCESS, NtClose(), NtOpenKey(), NtQueryValueKey(), NTSTATUS(), NULL, OPEN_EXISTING, PBYTE, PUINT, pwszKLLibSafety, pwszKLLibSafetyJPN, pwszKLLibSafetyKOR, RtlInitUnicodeString(), RtlUnicodeStringToInteger(), Status, szKLAttributes, szKLFile, szKLId, szKLKey, TRUE, UINT, wKbdLocaleSafety, wKbdLocaleSafetyJPN, and wKbdLocaleSafetyKOR.

Referenced by CommonCreateWindowStation(), and LoadKeyboardLayoutWorker().

04024 { 04025 PKBDNLSTABLES (*pfnNls)(); 04026 BOOL (*pfnDriverNT4)(LPWSTR); 04027 BOOL (*pfnDriver)(HKL, LPWSTR, PCLIENTKEYBOARDTYPE, LPVOID); 04028 WCHAR awchRealLayoutFile[MAX_PATH]; 04029 BOOL bMightBeKbdNlsDriver = FALSE; 04030 WCHAR awchKL[KL_NAMELENGTH]; 04031 WCHAR awchKLRegKey[NSZKLKEY]; 04032 LPWSTR lpszKLRegKey = &awchKLRegKey[0]; 04033 PKBDTABLES (*pfn)(); 04034 LPWSTR pwszLib; 04035 LPWSTR pwszId; 04036 HANDLE hLibModule; 04037 WCHAR awchModName[MAX_PATH]; 04038 UNICODE_STRING UnicodeString; 04039 UINT wLayoutId; 04040 UINT wLanguageId; 04041 NTSTATUS Status; 04042 OBJECT_ATTRIBUTES OA; 04043 HANDLE hKey; 04044 DWORD cbSize; 04045 struct { 04046 KEY_VALUE_PARTIAL_INFORMATION KeyInfo; 04047 WCHAR awchLibName[CCH_KL_LIBNAME]; 04048 } KeyFile; 04049 struct { 04050 KEY_VALUE_PARTIAL_INFORMATION KeyInfo; 04051 WCHAR awchId[CCH_KL_ID]; 04052 } KeyId; 04053 struct { 04054 KEY_VALUE_PARTIAL_INFORMATION KeyInfo; 04055 DWORD Attributes; 04056 } KeyAttributes; 04057 04058 wLanguageId = (UINT)wcstoul(lpszKLName, NULL, 16); 04059 /* 04060 * Substitute Layout if required. 04061 */ 04062 if (*puFlags & KLF_SUBSTITUTE_OK) { 04063 GetPrivateProfileStringW( 04064 L"Substitutes", 04065 lpszKLName, 04066 lpszKLName, // default == no change (no substitute found) 04067 awchKL, 04068 sizeof(awchKL)/sizeof(WCHAR), 04069 L"keyboardlayout.ini"); 04070 04071 /* 04072 * #273562 : Flush the registry cache, because the cpanel applet 04073 * destroys and recreates the Substitutes section a lot, which 04074 * would otherwise leave us with STATUS_KEY_DELETED. 04075 */ 04076 WritePrivateProfileStringW(NULL, NULL, NULL, NULL); 04077 04078 awchKL[KL_NAMELENGTH - 1] = L'\0'; 04079 wcscpy(lpszKLName, awchKL); 04080 } 04081 04082 wLayoutId = (UINT)wcstoul(lpszKLName, NULL, 16); 04083 04084 /* 04085 * Get DLL name from the registry, load it, and get the entry point. 04086 */ 04087 pwszLib = NULL; 04088 wcscpy(lpszKLRegKey, szKLKey); 04089 wcscat(lpszKLRegKey, lpszKLName); 04090 RtlInitUnicodeString(&UnicodeString, lpszKLRegKey); 04091 InitializeObjectAttributes(&OA, &UnicodeString, OBJ_CASE_INSENSITIVE, NULL, NULL); 04092 04093 if (NT_SUCCESS(NtOpenKey(&hKey, KEY_READ, &OA))) { 04094 /* 04095 * Read the "Layout File" value. 04096 */ 04097 RtlInitUnicodeString(&UnicodeString, szKLFile); 04098 04099 Status = NtQueryValueKey(hKey, 04100 &UnicodeString, 04101 KeyValuePartialInformation, 04102 &KeyFile, 04103 sizeof(KeyFile), 04104 &cbSize); 04105 04106 if (Status == STATUS_BUFFER_OVERFLOW) { 04107 RIPMSG0(RIP_WARNING, "OpenKeyboardLayoutFile (Layout File) - Buffer overflow."); 04108 Status = STATUS_SUCCESS; 04109 } 04110 if (NT_SUCCESS(Status)) { 04111 pwszLib = (LPWSTR)KeyFile.KeyInfo.Data; 04112 pwszLib[CCH_KL_LIBNAME - 1] = L'\0'; 04113 04114 } 04115 04116 RtlInitUnicodeString(&UnicodeString, szKLAttributes); 04117 Status = NtQueryValueKey(hKey, 04118 &UnicodeString, 04119 KeyValuePartialInformation, 04120 &KeyAttributes, 04121 sizeof(KeyAttributes), 04122 &cbSize); 04123 04124 if (NT_SUCCESS(Status)) { 04125 #if DBG 04126 if ((*((PDWORD)KeyAttributes.KeyInfo.Data) & ~KLF_ATTRMASK) != 0) { 04127 RIPMSG1(RIP_WARNING, 04128 "OpenKeyboardLayoutFile - Unexpected attributes %lx", 04129 *((PDWORD)KeyAttributes.KeyInfo.Data)); 04130 } 04131 #endif 04132 *puFlags |= (*(PDWORD)KeyAttributes.KeyInfo.Data & KLF_ATTRMASK); 04133 } 04134 04135 /* 04136 * If the high word of wLayoutId is 0xE??? then this is an IME based 04137 * keyboard layout. 04138 */ 04139 if (IS_IME_KBDLAYOUT(wLayoutId)) { 04140 wLayoutId = (UINT)HIWORD(wLayoutId); 04141 } else if (HIWORD(wLayoutId)) { 04142 /* 04143 * If the high word of wLayoutId is non-null then read the "Layout ID" value. 04144 * Layout IDs start at 1, increase sequentially and are unique. 04145 */ 04146 RtlInitUnicodeString(&UnicodeString, szKLId); 04147 04148 Status = NtQueryValueKey(hKey, 04149 &UnicodeString, 04150 KeyValuePartialInformation, 04151 &KeyId, 04152 sizeof(KeyId), 04153 &cbSize); 04154 04155 if (Status == STATUS_BUFFER_OVERFLOW) { 04156 RIPMSG0(RIP_WARNING, "OpenKeyboardLayoutFile - Buffer overflow."); 04157 Status = STATUS_SUCCESS; 04158 } 04159 if (NT_SUCCESS(Status)) { 04160 pwszId = (LPWSTR)KeyId.KeyInfo.Data; 04161 pwszId[CCH_KL_ID - 1] = L'\0'; 04162 wLayoutId = (wcstol(pwszId, NULL, 16) & 0x0fff) | 0xf000; 04163 } else { 04164 wLayoutId = (UINT)0xfffe ; // error in layout ID, load separately 04165 } 04166 } 04167 NtClose(hKey); 04168 } else { 04169 /* 04170 * This is a temporary case to allow booting the new multilingual user on top of a 04171 * Daytona registry. 04172 */ 04173 /* 04174 * Get DLL name from the registry, load it, and get the entry point. 04175 */ 04176 pwszLib = NULL; 04177 RtlInitUnicodeString(&UnicodeString, 04178 L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Keyboard Layout"); 04179 InitializeObjectAttributes(&OA, &UnicodeString, OBJ_CASE_INSENSITIVE, NULL, NULL); 04180 04181 if (NT_SUCCESS(NtOpenKey(&hKey, KEY_READ, &OA))) { 04182 RtlInitUnicodeString(&UnicodeString, lpszKLName); 04183 04184 Status = NtQueryValueKey(hKey, 04185 &UnicodeString, 04186 KeyValuePartialInformation, 04187 &KeyFile, 04188 sizeof(KeyFile), 04189 &cbSize); 04190 04191 if (Status == STATUS_BUFFER_OVERFLOW) { 04192 RIPMSG0(RIP_WARNING, "OpenKeyboardLayoutFile - Buffer overflow."); 04193 Status = STATUS_SUCCESS; 04194 } 04195 if (NT_SUCCESS(Status)) { 04196 pwszLib = (LPWSTR)KeyFile.KeyInfo.Data; 04197 pwszLib[CCH_KL_LIBNAME - 1] = L'\0'; 04198 } 04199 04200 NtClose(hKey); 04201 } 04202 } 04203 04204 *pKbdInputLocale = (UINT)MAKELONG(LOWORD(wLanguageId),LOWORD(wLayoutId)); 04205 04206 if (pwszLib == NULL) { 04207 if (ISREMOTESESSION() && IS_IME_KBDLAYOUT(wLayoutId)) { 04208 /* 04209 * -- port from HYDRA -- 04210 * Could not find the keyboard KL for FE, so give them some reasonable one. 04211 * If the high word of wLayoutId is 0xE??? then this is an IME based 04212 * keyboard layout. 04213 * And, the safe KL name is KBDJPN.DLL for Japanese. 04214 * or KBDKOR.DLL for Korean 04215 * or KBDUS.DLL for other Far East 04216 */ 04217 if (PRIMARYLANGID(wLanguageId) == LANG_JAPANESE) { 04218 pwszLib = pwszKLLibSafetyJPN; 04219 *pKbdInputLocale = wKbdLocaleSafetyJPN; 04220 } 04221 else if (PRIMARYLANGID(wLanguageId) == LANG_KOREAN) { 04222 pwszLib = pwszKLLibSafetyKOR; 04223 *pKbdInputLocale = wKbdLocaleSafetyKOR; 04224 } 04225 else { 04226 pwszLib = pwszKLLibSafety; 04227 *pKbdInputLocale = MAKELONG(LOWORD(wLanguageId), LOWORD(wLanguageId)); 04228 } 04229 } 04230 else if (*puFlags & KLF_INITTIME) { 04231 pwszLib = pwszKLLibSafety; 04232 *pKbdInputLocale = wKbdLocaleSafety; 04233 } else { 04234 RIPMSG1(RIP_WARNING, "no DLL name for %ws", lpszKLName); 04235 /* 04236 * We're going to use the fallback layout... 04237 * This could happen when IMM32 is trying to unload the IME, 04238 * by making any non IME keyboard layout tentatively active. 04239 */ 04240 pwszLib = pwszKLLibSafety; 04241 *pKbdInputLocale = wKbdLocaleSafety; 04242 // return NULL; 04243 } 04244 } 04245 04246 RetryLoad: 04247 hLibModule = LoadLibraryW(pwszLib); 04248 04249 if (hLibModule == NULL) { 04250 RIPMSG1(RIP_WARNING, "Keyboard Layout: cannot load %ws\n", pwszLib); 04251 /* 04252 * It is OK to fail to load DLL here: 04253 * if this ever happens, the fallback keyboard layout built in 04254 * win32k.sys shall be used. 04255 */ 04256 return NULL; 04257 } 04258 04259 /* 04260 * if the layout driver is not "REAL" layout driver, the driver has 04261 * "3" or "5" entry point, then we call this to get real layout driver.. 04262 * This is neccesary for Japanese and Korean systems. because their 04263 * keyboard layout driver is "KBDJPN.DLL" or "KBDKOR.DLL", but its 04264 * "REAL" driver becomes different depending their keyboard hardware. 04265 */ 04266 04267 /* 04268 * Get the entrypoints. 04269 */ 04270 pfnDriver = (BOOL(*)(HKL, LPWSTR, PCLIENTKEYBOARDTYPE, LPVOID))GetProcAddress(hLibModule, (LPCSTR)5); 04271 pfnDriverNT4 = (BOOL(*)(LPWSTR))GetProcAddress(hLibModule, (LPCSTR)3); 04272 04273 if (pfnDriver || pfnDriverNT4) { 04274 HKL hkl; 04275 CLIENTKEYBOARDTYPE clientKbdType; 04276 PCLIENTKEYBOARDTYPE pClientKbdType = NULL; 04277 04278 RtlInitUnicodeString(&UnicodeString, lpszKLName); 04279 RtlUnicodeStringToInteger(&UnicodeString, 0x10, (PULONG)&hkl); 04280 /* 04281 * When we reach here, the layout DLL may have KBDNLSTABLE 04282 * even if we fail from now on. Our temporary layout 04283 * dll should have the fallback tables for just in case. 04284 */ 04285 bMightBeKbdNlsDriver = TRUE; 04286 04287 if (ISREMOTESESSION() && GetClientKeyboardType(&clientKbdType)) { 04288 pClientKbdType = &clientKbdType; 04289 } 04290 04291 /* 04292 * Call the entry. 04293 * a. NT5 / Hydra (oridinal=5) 04294 * b. NT4 compatible (3) 04295 */ 04296 if ((pfnDriver && pfnDriver(hkl, awchRealLayoutFile, pClientKbdType, NULL)) || 04297 (pfnDriverNT4 && pfnDriverNT4(awchRealLayoutFile))) { 04298 04299 HANDLE hLibModuleNew; 04300 /* 04301 * Try to load "REAL" keyboard layout file. 04302 */ 04303 RIPMSG1(RIP_VERBOSE, "awchRealLayoutFile='%S'\n", awchRealLayoutFile); 04304 if (hLibModuleNew = LoadLibraryW(awchRealLayoutFile)) { 04305 /* 04306 * Set "REAL" layout file name. 04307 */ 04308 pwszLib = awchRealLayoutFile; 04309 /* 04310 * Unload temporary layout driver. 04311 */ 04312 FreeLibrary(hLibModule); 04313 /* 04314 * Updates it. 04315 */ 04316 hLibModule = hLibModuleNew; 04317 } 04318 } 04319 } 04320 04321 /* 04322 * HACK Part 1! Get the pointer to the layout table and 04323 * change it to a virtual offset. The server will then 04324 * use this offset when poking through the file header to 04325 * locate the table within the file. 04326 */ 04327 pfn = (PKBDTABLES(*)())GetProcAddress(hLibModule, (LPCSTR)1); 04328 if (pfn == NULL) { 04329 RIPMSG0(RIP_ERROR, "Keyboard Layout: cannot get proc addr"); 04330 if ((*puFlags & KLF_INITTIME) && (pwszLib != pwszKLLibSafety)) { 04331 pwszLib = pwszKLLibSafety; 04332 goto RetryLoad; 04333 } 04334 return NULL; 04335 } 04336 *poffTable = (UINT)((PBYTE)pfn() - (PBYTE)hLibModule); 04337 04338 if (bMightBeKbdNlsDriver) { 04339 pfnNls = (PKBDNLSTABLES(*)())GetProcAddress(hLibModule, (LPCSTR)2); 04340 if (pfnNls != NULL) { 04341 UINT offNlsTable; 04342 04343 offNlsTable = (UINT)((PBYTE)pfnNls() - (PBYTE)hLibModule); 04344 04345 #if DBG_FE 04346 DbgPrint("USER32:Offset to KBDTABLES = %d (%x)\n",*poffTable,*poffTable); 04347 DbgPrint("USER32:Offset to KBDNLSTABLES = %d (%x)\n",offNlsTable,offNlsTable); 04348 #endif // DBG_FE 04349 04350 /* 04351 * Combine these offsets... 04352 * 04353 * LOWORD(*poffTable) = Offset to KBDTABLES. 04354 * HIWORD(*poffTable) = Offset to KBDNLSTABLES. 04355 */ 04356 *poffTable |= (offNlsTable << 16); 04357 } 04358 } 04359 04360 /* 04361 * Open the dll for read access. 04362 */ 04363 GetModuleFileName(hLibModule, awchModName, sizeof(awchModName)); 04364 FreeLibrary(hLibModule); 04365 return CreateFileW( 04366 awchModName, 04367 GENERIC_READ, 04368 FILE_SHARE_READ, 04369 NULL, 04370 OPEN_EXISTING, 04371 0, 04372 NULL); 04373 }

BOOL PaintRect HWND  hwndBrush,
HWND  hwndPaint,
HDC  hdc,
HBRUSH  hbr,
LPRECT  lprc
 

Definition at line 25 of file client/draw.c.

References BOOL, FALSE, FillRect(), GetControlColor, GetDesktopWindow(), NULL, tagWND::rcClient, TRUE, and ValidateHwnd.

Referenced by ButtonWndProcWorker(), ConsoleWindowProc(), xxxBNPaint(), xxxButtonDrawCheck(), and xxxStaticPaint().

00031 { 00032 POINT ptOrg; 00033 PWND pwndBrush; 00034 PWND pwndPaint; 00035 HWND hwndDesktop; 00036 00037 hwndDesktop = GetDesktopWindow(); 00038 if (hwndBrush == NULL) { 00039 hwndBrush = hwndDesktop; 00040 } 00041 00042 if (hwndBrush != hwndPaint) { 00043 pwndBrush = ValidateHwnd(hwndBrush); 00044 if (pwndBrush == NULL) { 00045 RIPMSG1(RIP_WARNING, "PaintRect: invalid Brush window %lX", hwndBrush); 00046 return FALSE; 00047 } 00048 00049 pwndPaint = ValidateHwnd(hwndPaint); 00050 if (pwndPaint == NULL) { 00051 RIPMSG1(RIP_WARNING, "PaintRect: invalid Paint window %lX", hwndBrush); 00052 return FALSE; 00053 } 00054 00055 00056 if (hwndBrush != hwndDesktop) { 00057 SetBrushOrgEx( 00058 hdc, 00059 pwndBrush->rcClient.left - pwndPaint->rcClient.left, 00060 pwndBrush->rcClient.top - pwndPaint->rcClient.top, 00061 &ptOrg); 00062 } else { 00063 SetBrushOrgEx(hdc, 0, 0, &ptOrg); 00064 } 00065 } 00066 00067 /* 00068 * If hbr < CTLCOLOR_MAX, it isn't really a brush but is one of our 00069 * special color values. Translate it to the appropriate WM_CTLCOLOR 00070 * message and send it off to get back a real brush. The translation 00071 * process assumes the CTLCOLOR*** and WM_CTLCOLOR*** values map directly. 00072 */ 00073 if (hbr < (HBRUSH)CTLCOLOR_MAX) { 00074 hbr = GetControlColor(hwndBrush, hwndPaint, hdc, 00075 HandleToUlong(hbr) + WM_CTLCOLORMSGBOX); 00076 } 00077 00078 FillRect(hdc, lprc, hbr); 00079 00080 if (hwndBrush != hwndPaint) { 00081 SetBrushOrgEx(hdc, ptOrg.x, ptOrg.y, NULL); 00082 } 00083 00084 return TRUE; 00085 }

void PSMTextOut HDC  hdc,
int  xLeft,
int  yTop,
LPWSTR  lpsz,
int  cch,
DWORD  dwFlags
 

Definition at line 555 of file client/drawtext.c.

References dwFlags.

Referenced by DrawStateW(), DT_InitDrawTextInfo(), and xxxStaticPaint().

00562 { 00563 /* 00564 * By default this is just a call to UserLpkPSMTextOut. If an 00565 * LPK is installed, this calls out to the LPK. The LPK calls 00566 * UserLpkPSMTextOut, if necessary. 00567 */ 00568 (*fpLpkPSMTextOut)(hdc, xLeft, yTop, lpsz, cch, dwFlags); 00569 return; 00570 }

__inline PVOID REBASESHAREDPTR KERNEL_PVOID  p  ) 
 

Definition at line 2588 of file usercli.h.

References BOOL, and DWORD.

02595 {

__inline PVOID REBASESHAREDPTRALWAYS KERNEL_PVOID  p  ) 
 

Definition at line 2582 of file usercli.h.

02595 {

ATOM RegisterClassExWOWA PWNDCLASSEXA  lpWndClass,
LPDWORD  pdwWOWstuff,
WORD  fnid
 

Referenced by RegisterClassWOWA(), and RW_RegisterDDEML().

ATOM RegisterClassExWOWW PWNDCLASSEXW  lpWndClass,
LPDWORD  pdwWOWstuff,
WORD  fnid
 

Referenced by EnterReaderMode(), RW_RegisterControls(), and RW_RegisterDDEML().

VOID ReleaseEditDS HANDLE  h  ) 
 

Definition at line 2783 of file client.c.

References NULL, pfn16GlobalFree, and VOID().

Referenced by DefDlgProcWorker().

02785 { 02786 UserAssert(pfn16GlobalFree != NULL); 02787 02788 (*pfn16GlobalFree)(LOWORD(HandleToUlong(h))); 02789 }

void RepositionRect PMONITOR  pMonitor,
LPRECT  lprc,
DWORD  dwStyle,
DWORD  dwExStyle
 

Definition at line 1363 of file dlgmgr.c.

References GetPrimaryMonitor(), OffsetRect(), tagMONITOR::rcMonitor, tagMONITOR::rcWork, and SYSMET.

Referenced by DefDlgProcWorker(), and InternalCreateDialog().

01368 { 01369 LPRECT lprcClip; 01370 int y; 01371 01372 UserAssert(lprc); 01373 UserAssert(pMonitor); 01374 01375 if (dwStyle & WS_CHILD) { 01376 if (dwExStyle & WS_EX_CONTROLPARENT) 01377 return; 01378 01379 /* 01380 * Old style 3.1 child dialogs--do this nonsense anyway. Keeps 01381 * FedEx happy. 01382 */ 01383 pMonitor = GetPrimaryMonitor(); 01384 lprcClip = &pMonitor->rcMonitor; 01385 } else if (dwExStyle & WS_EX_TOOLWINDOW) { 01386 lprcClip = &pMonitor->rcMonitor; 01387 } else { 01388 lprcClip = &pMonitor->rcWork; 01389 } 01390 01391 UserAssert(lprc); 01392 01393 y = lprcClip->bottom - (SYSMET(CYEDGE) * 2 + SYSMET(CYKANJIWINDOW)); 01394 01395 if (lprc->bottom > y) { 01396 OffsetRect(lprc, 0, y - lprc->bottom); 01397 } 01398 01399 if (lprc->top < lprcClip->top) { 01400 OffsetRect(lprc, 0, lprcClip->top - lprc->top); 01401 } 01402 01403 if (lprc->right > lprcClip->right) { 01404 OffsetRect(lprc, lprcClip->right - lprc->right, 0); 01405 } 01406 01407 if (lprc->left < lprcClip->left) { 01408 OffsetRect(lprc, lprcClip->left - lprc->left, 0); 01409 } 01410 }

BOOL RtlCaptureAnsiString PIN_STRING  ,
LPCSTR  ,
BOOL 
 

Definition at line 30 of file rtlinit.c.

References BOOL, _IN_STRING::fAllocated, FALSE, NULL, _IN_STRING::pstr, pUserHeap, RtlAllocateHeap, RtlFreeHeap, RtlMultiByteToUnicodeN(), _IN_STRING::strCapture, strlen(), TRUE, and USHORT.

00034 { 00035 int cbSrc; 00036 int cbDst; 00037 00038 pstr->fAllocated = FALSE; 00039 if (psz) { 00040 cbSrc = strlen(psz) + 1; 00041 if (cbSrc > MAXUSHORT) { 00042 RIPMSG0(RIP_WARNING, "String too long for standard string"); 00043 return FALSE; 00044 } 00045 00046 /* 00047 * If the allocation is forced or if the string is 00048 * too long to fit in the TEB, allocate a buffer. 00049 * Otherwise, store the result in the TEB. 00050 */ 00051 if (fForceAlloc || 00052 cbSrc > (STATIC_UNICODE_BUFFER_LENGTH / sizeof(WCHAR))) { 00053 pstr->strCapture.Buffer = RtlAllocateHeap(pUserHeap, 00054 0, cbSrc * sizeof(WCHAR)); 00055 if (pstr->strCapture.Buffer == NULL) 00056 return FALSE; 00057 pstr->fAllocated = TRUE; 00058 pstr->pstr = &pstr->strCapture; 00059 pstr->strCapture.MaximumLength = (USHORT)(cbSrc * sizeof(WCHAR)); 00060 } else { 00061 pstr->pstr = &NtCurrentTeb()->StaticUnicodeString; 00062 } 00063 00064 /* 00065 * Convert the string to Unicode 00066 */ 00067 if (RtlMultiByteToUnicodeN(pstr->pstr->Buffer, 00068 (ULONG)pstr->pstr->MaximumLength, &cbDst, 00069 (LPSTR)psz, cbSrc)) { 00070 RIPMSG0(RIP_WARNING, "Unicode conversion failed"); 00071 if (pstr->fAllocated) { 00072 RtlFreeHeap(pUserHeap, 0, pstr->strCapture.Buffer); 00073 pstr->fAllocated = FALSE; 00074 } 00075 return FALSE; 00076 } 00077 pstr->pstr->Length = (USHORT)cbDst - sizeof(WCHAR); 00078 } else { 00079 pstr->pstr = &pstr->strCapture; 00080 pstr->strCapture.Length = pstr->strCapture.MaximumLength = 0; 00081 pstr->strCapture.Buffer = NULL; 00082 } 00083 return TRUE; 00084 }

BOOL RtlCaptureLargeAnsiString PLARGE_IN_STRING  ,
LPCSTR  ,
BOOL 
 

Definition at line 95 of file rtlinit.c.

References BOOL, _LARGE_UNICODE_STRING::Buffer, _LARGE_IN_STRING::fAllocated, FALSE, _LARGE_UNICODE_STRING::Length, _LARGE_UNICODE_STRING::MaximumLength, NULL, PLARGE_IN_STRING, _LARGE_IN_STRING::pstr, pUserHeap, RtlAllocateHeap, RtlFreeHeap, RtlMultiByteToUnicodeN(), _LARGE_IN_STRING::strCapture, strlen(), TRUE, and UINT.

Referenced by _CreateWindowEx().

00099 { 00100 int cchSrc; 00101 UINT uLength; 00102 00103 plstr->fAllocated = FALSE; 00104 plstr->pstr = &plstr->strCapture; 00105 00106 if (psz) { 00107 cchSrc = strlen(psz) + 1; 00108 00109 /* 00110 * If the allocation is forced or if the string is 00111 * too long to fit in the TEB, allocate a buffer. 00112 * Otherwise, store the result in the TEB. 00113 */ 00114 if (fForceAlloc || cchSrc > STATIC_UNICODE_BUFFER_LENGTH) { 00115 plstr->strCapture.Buffer = RtlAllocateHeap(pUserHeap, 00116 0, cchSrc * sizeof(WCHAR)); 00117 if (plstr->strCapture.Buffer == NULL) 00118 return FALSE; 00119 plstr->fAllocated = TRUE; 00120 plstr->strCapture.MaximumLength = cchSrc * sizeof(WCHAR); 00121 } else { 00122 plstr->strCapture.Buffer = NtCurrentTeb()->StaticUnicodeBuffer; 00123 plstr->strCapture.MaximumLength = 00124 (UINT)(STATIC_UNICODE_BUFFER_LENGTH * sizeof(WCHAR)); 00125 } 00126 00127 /* 00128 * Convert the string to Unicode 00129 */ 00130 if (RtlMultiByteToUnicodeN(plstr->pstr->Buffer, 00131 plstr->pstr->MaximumLength, &uLength, 00132 (LPSTR)psz, cchSrc)) { 00133 RIPMSG0(RIP_WARNING, "Unicode conversion failed"); 00134 if (plstr->fAllocated) { 00135 RtlFreeHeap(pUserHeap, 0, plstr->strCapture.Buffer); 00136 plstr->fAllocated = FALSE; 00137 } 00138 return FALSE; 00139 } 00140 plstr->pstr->Length = uLength - sizeof(WCHAR); 00141 } else { 00142 plstr->strCapture.Length = plstr->strCapture.MaximumLength = 0; 00143 plstr->strCapture.Buffer = NULL; 00144 } 00145 return TRUE; 00146 }

int RtlGetIdFromDirectory PBYTE  ,
BOOL  ,
int  ,
int  ,
DWORD  ,
PDWORD 
 

Definition at line 4759 of file clres.c.

References GetBestImage(), GetIcoCurBpp(), GetIcoCurHeight(), GetIcoCurWidth(), NULL, and UINT.

Referenced by LookupIconIdFromDirectoryEx(), and ReadIconGuts().

04766 { 04767 LPNEWHEADER lpnh; 04768 LPRESDIR lprsd; 04769 UINT iImage; 04770 UINT cImage; 04771 UINT bpp; 04772 04773 /* 04774 * Make sure this is pointing to valid resource bits. 04775 */ 04776 if (presbits == NULL) 04777 return 0; 04778 04779 lpnh = (LPNEWHEADER)presbits; 04780 04781 /* 04782 * Fill in defaults. 04783 */ 04784 cxDesired = GetIcoCurWidth(cxDesired, fIcon, LR_flags, 0); 04785 cyDesired = GetIcoCurHeight(cyDesired, fIcon, LR_flags, 0); 04786 04787 bpp = GetIcoCurBpp(LR_flags); 04788 04789 /* 04790 * We'll use the first image in the directory if we can't find one 04791 * that's appropriate. 04792 */ 04793 cImage = lpnh->ResCount; 04794 lprsd = (LPRESDIR)(lpnh + 1); 04795 04796 iImage = GetBestImage(lprsd, cImage, cxDesired, cyDesired, bpp, fIcon); 04797 04798 if (iImage == cImage) 04799 iImage = 0; 04800 04801 if (pdwResSize != NULL) 04802 *pdwResSize = (lprsd + iImage)->BytesInRes; 04803 04804 return ((LPRESDIR)(lprsd + iImage))->idIcon; 04805 }

HANDLE RtlLoadObjectFromDIBFile LPCWSTR  lpszName,
LPWSTR  type,
DWORD  cxDesired,
DWORD  cyDesired,
UINT  LR_flags
 

Definition at line 142 of file rtlres.c.

References BFT_BITMAP, BITMAPFILEHEADER_SIZE, BitmapSize, BOOL, ConvertDIBBitmap(), cy, DWORD, FALSE, FILEINFO, IconFromBestImage(), INVALID_HANDLE_VALUE, LoadCursorIconFromFileMap(), MAX_PATH, MINHEADERS_SIZE, NULL, OPEN_EXISTING, _FILEINFO::pFileEnd, _FILEINFO::pFileMap, _FILEINFO::pFilePtr, _FILEINFO::pszName, PTR_TO_ID, szFile, type, UPBITMAPCOREHEADER, and UPBITMAPINFOHEADER.

Referenced by ObjectFromDIBResource().

00148 { 00149 FILEINFO fi = { NULL, NULL, NULL }; 00150 HANDLE hFile; 00151 HANDLE hFileMap = NULL; 00152 HANDLE hObj = NULL; 00153 TCHAR szFile[MAX_PATH]; 00154 TCHAR szFile2[MAX_PATH]; 00155 LPWSTR pszFileDummy; 00156 00157 if (LR_flags & LR_ENVSUBST) { 00158 00159 /* 00160 * Do any %% string substitutions. We need this feature to handle 00161 * loading custom cursors and icons from the registry which uses 00162 * %SystemRoot% in the paths. It also makes the shell's job 00163 * easier. 00164 */ 00165 ExpandEnvironmentStrings(lpszName, szFile2, MAX_PATH); 00166 00167 } else { 00168 00169 lstrcpy(szFile2, lpszName); 00170 } 00171 00172 if (SearchPath(NULL, // use default search locations 00173 szFile2, // file name to search for 00174 NULL, // already have file name extension 00175 MAX_PATH, // how big is that buffer, anyway? 00176 szFile, // stick fully qualified path name here 00177 &pszFileDummy) == 0) { 00178 RIPERR0(ERROR_FILE_NOT_FOUND, RIP_VERBOSE, ""); 00179 return NULL; 00180 } 00181 00182 /* 00183 * Open File for reading. 00184 */ 00185 hFile = CreateFileW(szFile, 00186 GENERIC_READ, 00187 FILE_SHARE_READ, 00188 NULL, 00189 OPEN_EXISTING, 00190 0, 00191 NULL); 00192 00193 if (hFile == INVALID_HANDLE_VALUE) 00194 goto Done; 00195 00196 /* 00197 * Create file-mapping for the file in question. 00198 */ 00199 hFileMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); 00200 00201 if (hFileMap == NULL) 00202 goto CloseDone; 00203 00204 /* 00205 * Map the file into view. 00206 */ 00207 fi.pFileMap = MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, 0); 00208 00209 if (fi.pFileMap == NULL) 00210 goto CloseDone; 00211 00212 fi.pFileEnd = fi.pFileMap + GetFileSize(hFile, NULL); 00213 fi.pFilePtr = fi.pFileMap; 00214 fi.pszName = szFile; 00215 00216 try { 00217 switch(PTR_TO_ID(type)) { 00218 case PTR_TO_ID(RT_BITMAP): { 00219 00220 LPBITMAPFILEHEADER pBFH; 00221 UPBITMAPINFOHEADER upBIH; 00222 LPBYTE lpBits; 00223 DWORD cx; 00224 DWORD cy; 00225 WORD planes; 00226 WORD bpp; 00227 DWORD cbSizeImage = 0; 00228 DWORD cbSizeFile; 00229 DWORD cbSizeBits; 00230 00231 /* 00232 * Set the BitmapFileHeader and BitmapInfoHeader pointers. 00233 */ 00234 pBFH = (LPBITMAPFILEHEADER)fi.pFileMap; 00235 upBIH = (UPBITMAPINFOHEADER)(fi.pFileMap + BITMAPFILEHEADER_SIZE); 00236 00237 /* 00238 * Are we dealing with a bitmap file. 00239 */ 00240 if (pBFH->bfType != BFT_BITMAP) 00241 break; 00242 00243 /* 00244 * We need to check the filesize against the potential size of 00245 * the image. Bad-Bitmaps would otherwise be able to slam us 00246 * if they lied about the size (and/or) the file is truncated. 00247 */ 00248 if (upBIH->biSize == sizeof(BITMAPCOREHEADER)) { 00249 00250 cx = ((UPBITMAPCOREHEADER)upBIH)->bcWidth; 00251 cy = ((UPBITMAPCOREHEADER)upBIH)->bcHeight; 00252 bpp = ((UPBITMAPCOREHEADER)upBIH)->bcBitCount; 00253 planes = ((UPBITMAPCOREHEADER)upBIH)->bcPlanes; 00254 00255 } else { 00256 00257 cx = upBIH->biWidth; 00258 cy = upBIH->biHeight; 00259 bpp = upBIH->biBitCount; 00260 planes = upBIH->biPlanes; 00261 00262 if(upBIH->biSizeImage >= sizeof(BITMAPINFOHEADER)) 00263 cbSizeImage = upBIH->biSizeImage; 00264 } 00265 00266 cbSizeFile = (DWORD)(fi.pFileEnd - fi.pFileMap); 00267 cbSizeBits = BitmapSize(cx, cy, planes, bpp); 00268 00269 if ((!cbSizeImage && ((cbSizeFile - MINHEADERS_SIZE) < cbSizeBits)) || 00270 (cbSizeImage && ((cbSizeFile - MINHEADERS_SIZE) < cbSizeImage))) { 00271 00272 break; 00273 } 00274 00275 /* 00276 * Get the bits-offset in the file. 00277 */ 00278 if ((pBFH->bfOffBits >= (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPCOREHEADER))) && 00279 (pBFH->bfOffBits <= (cbSizeFile - cbSizeImage))) { 00280 00281 lpBits = ((LPBYTE)upBIH) + pBFH->bfOffBits - sizeof(BITMAPFILEHEADER); 00282 00283 } else { 00284 00285 lpBits = NULL; 00286 } 00287 00288 /* 00289 * Convert the dib-on-file to a bitmap-handle. This can 00290 * convert both CORE and INFO formats. 00291 */ 00292 hObj = ConvertDIBBitmap(upBIH, 00293 cxDesired, 00294 cyDesired, 00295 LR_flags, 00296 NULL, 00297 &lpBits); // use these bits! 00298 } 00299 break; 00300 00301 case PTR_TO_ID(RT_CURSOR): 00302 case PTR_TO_ID(RT_ICON): 00303 { 00304 RTAG *prtag; 00305 ICONFILEHEADER *pifh; 00306 00307 /* 00308 * Is this a RIFF file? 00309 */ 00310 prtag = (RTAG *)fi.pFileMap; 00311 00312 if (prtag->ckID != FOURCC_RIFF) { 00313 00314 NEWHEADER nh; 00315 00316 pifh = (ICONFILEHEADER *)fi.pFileMap; 00317 00318 /* 00319 * BUG?: looks like we can load icons as cursors and cursors 00320 * as icons. Does this work? Is this desired? (SAS) 00321 */ 00322 if ((pifh->iReserved != 0) || 00323 ((pifh->iResourceType != IMAGE_ICON) && 00324 (pifh->iResourceType != IMAGE_CURSOR)) || 00325 (pifh->cresIcons < 1)) 00326 00327 break; 00328 00329 nh.ResType = ((type == RT_ICON) ? IMAGE_ICON : IMAGE_CURSOR); 00330 nh.ResCount = pifh->cresIcons; 00331 nh.Reserved = 0; 00332 00333 /* 00334 * Get the size of the sucker and meanwhile seek the file pointer 00335 * to point at the DIB we want. Files that have more than one 00336 * icon/cursor are treated like a group. In other words, 00337 * each image is treated like an individual element in the res 00338 * dir. So we need to pick the best fit one... 00339 */ 00340 hObj = IconFromBestImage(pifh, 00341 &nh, 00342 cxDesired, 00343 cyDesired, 00344 LR_flags); 00345 } else { 00346 00347 BOOL fAni; 00348 00349 hObj = LoadCursorIconFromFileMap(&fi, 00350 &type, 00351 cxDesired, 00352 cyDesired, 00353 LR_flags, 00354 &fAni); 00355 } 00356 } 00357 break; 00358 00359 default: 00360 UserAssert(FALSE); 00361 break; 00362 } // switch 00363 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00364 hObj = NULL; 00365 } 00366 CloseDone: 00367 00368 if (fi.pFileMap != NULL) 00369 UnmapViewOfFile(fi.pFileMap); 00370 00371 if (hFileMap) 00372 CloseHandle(hFileMap); 00373 00374 if (hFile && (hFile != INVALID_HANDLE_VALUE)) 00375 CloseHandle(hFile); 00376 00377 Done: 00378 #if DBG 00379 if (hObj == NULL) { 00380 RIPMSG1(RIP_WARNING, 00381 "RtlLoadObjectFromDIBFile: Couldn't read resource from %ws", 00382 lpszName); 00383 } 00384 #endif 00385 00386 return hObj; 00387 }

LRESULT APIENTRY ScrollBarWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 242 of file clmsg.c.

References ScrollBarWndProcWorker(), and TRUE.

Referenced by ClientThreadSetup().

00247 { 00248 return ScrollBarWndProcWorker(hwnd, message, wParam, lParam, TRUE); 00249 }

LRESULT APIENTRY ScrollBarWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 251 of file clmsg.c.

References FALSE, and ScrollBarWndProcWorker().

Referenced by ClientThreadSetup().

00256 { 00257 return ScrollBarWndProcWorker(hwnd, message, wParam, lParam, FALSE); 00258 }

LRESULT SendMessageTimeoutWorker HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
UINT  fuFlags,
UINT  uTimeout,
PULONG_PTR  lpdwResult,
BOOL  fAnsi
 

Definition at line 498 of file clmsg.c.

References CsSendMessage, FNID_SENDMESSAGEEX, FNID_SENDMESSAGEFF, tagSNDMSGTIMEOUT::fuFlags, GetDesktopWindow(), L, tagSNDMSGTIMEOUT::lSMTOResult, tagSNDMSGTIMEOUT::lSMTOReturn, NULL, RESERVED_MSG_BITS, SNDMSGTIMEOUT, and tagSNDMSGTIMEOUT::uTimeout.

Referenced by SendMessageTimeout().

00507 { 00508 SNDMSGTIMEOUT smto; 00509 00510 /* 00511 * Prevent apps from setting hi 16 bits so we can use them internally. 00512 */ 00513 if (message & RESERVED_MSG_BITS) { 00514 RIPERR1(ERROR_INVALID_PARAMETER, 00515 RIP_WARNING, 00516 "Invalid parameter \"message\" (%ld) to SendMessageTimeoutWorker", 00517 message); 00518 00519 return(0); 00520 } 00521 00522 if (fuFlags & ~SMTO_VALID) { 00523 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "invalid dwFlags (%x) for SendMessageTimeout\n", fuFlags); 00524 return(0); 00525 } 00526 00527 if (lpdwResult != NULL) 00528 *lpdwResult = 0L; 00529 00530 /* 00531 * Always send broadcast requests straight to the server. 00532 * Note: the xParam is used to id if it's from timeout or 00533 * from an normal sendmessage. 00534 */ 00535 smto.fuFlags = fuFlags; 00536 smto.uTimeout = uTimeout; 00537 smto.lSMTOReturn = 0; 00538 smto.lSMTOResult = 0; 00539 00540 /* 00541 * Thunk through a special sendmessage for -1 hwnd's so that the general 00542 * purpose thunks don't allow -1 hwnd's. 00543 */ 00544 if (hwnd == (HWND)-1 || hwnd == (HWND)0x0000FFFF) { 00545 /* 00546 * Get a real hwnd so the thunks will validation ok. Note that since 00547 * -1 hwnd is really rare, calling GetDesktopWindow() here is not a 00548 * big deal. 00549 */ 00550 hwnd = GetDesktopWindow(); 00551 00552 CsSendMessage(hwnd, message, wParam, lParam, 00553 (ULONG_PTR)&smto, FNID_SENDMESSAGEFF, fAnsi); 00554 } else { 00555 CsSendMessage(hwnd, message, wParam, lParam, 00556 (ULONG_PTR)&smto, FNID_SENDMESSAGEEX, fAnsi); 00557 } 00558 00559 if (lpdwResult != NULL) 00560 *lpdwResult = smto.lSMTOResult; 00561 00562 return smto.lSMTOReturn; 00563 }

LRESULT SendMessageWorker PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
BOOL  fAnsi
 

Definition at line 270 of file clmsg.c.

References _WNDMSG::abMsgs, tagSHAREDINFO::awmControl, tagMSG_TABLE_ENTRY::bThunkMessage, BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_CLIENTW, BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_CLIENTA, CALLPROC_WOWCHECKPWW, CsSendMessage, DefWindowProcWorker(), DISPATCH_DBCS_MESSAGE_IF_EXIST, FALSE, tagCLS::fnid, FNID_CONTROLEND, FNID_CONTROLSTART, FNID_DIALOG, FNID_SENDMESSAGE, FNID_START, FNID_TO_CLIENT_PFNA_KERNEL, FNID_TO_CLIENT_PFNW_KERNEL, FNID_TO_CLIENT_PFNWORKER, GetClientInfo, GETPTI, gSharedInfo, HWq, IS_DBCS_ENABLED, IsHooked, L, tagWND::lpfnWndProc, MapKernelClientFnToClientFn, _WNDMSG::maxMsgs, MessageTable, NULL, PDLG, PtiCurrent, PWNDMSG, REBASEALWAYS, RtlMBMessageWParamCharToWCS(), RtlWCSMessageWParamCharToMB(), TestWF, TRUE, WFANSIPROC, WFSERVERSIDEPROC, WHF_CALLWNDPROC, and WHF_CALLWNDPROCRET.

Referenced by ButtonWndProcWorker(), ComboBoxDBCharHandler(), ComboBoxWndProcWorker(), DefWindowProcWorker(), ECGetControlBrush(), GetScrollInfo(), GetScrollPos(), GetScrollRange(), GetWindowText(), GetWindowTextLength(), InternalCreateDialog(), IsDialogMessageW(), MLKeyDown(), SendMessage(), SendMessageToUI(), SetWindowText(), StaticWndProcWorker(), xxxBNReleaseCapture(), xxxCBCompleteEditWindow(), xxxCBGetFocusHelper(), xxxCBGetTextHelper(), xxxCBGetTextLengthHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBKillFocusHelper(), xxxCBNotifyParent(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxCBUpdateListBoxWindow(), xxxLBoxCtlCharInput(), xxxLBoxCtlDelete(), xxxLBSetCount(), and xxxTrackMouse().

00276 { 00277 HWND hwnd = HWq(pwnd); 00278 PCLIENTINFO pci; 00279 PCLS pcls; 00280 BOOLEAN fAnsiRecv; 00281 BOOLEAN fNeedTranslation = FALSE; 00282 BOOLEAN bDoDbcsMessaging = FALSE; 00283 LRESULT lRet; 00284 00285 UserAssert(pwnd); 00286 00287 /* 00288 * Pass DDE messages to the server. 00289 */ 00290 if (message >= WM_DDE_FIRST && message <= WM_DDE_LAST) 00291 goto lbServerSendMessage; 00292 00293 /* 00294 * Server must handle inter-thread SendMessages and SendMessages 00295 * to server-side procs. 00296 */ 00297 if ((PtiCurrent() != GETPTI(pwnd)) || TestWF(pwnd, WFSERVERSIDEPROC)) 00298 goto lbServerSendMessage; 00299 00300 /* 00301 * Server must handle hooks (at least for now). 00302 */ 00303 pci = GetClientInfo(); 00304 if (IsHooked(pci, (WHF_CALLWNDPROC | WHF_CALLWNDPROCRET))) { 00305 lbServerSendMessage: 00306 return CsSendMessage(hwnd, message, wParam, lParam, 0L, 00307 FNID_SENDMESSAGE, fAnsi); 00308 } 00309 00310 /* 00311 * If the sender and the receiver are both ANSI or both UNICODE 00312 * then no message translation is necessary. 00313 * 00314 * EditWndProc may need to go to the server for translation if we 00315 * are calling vanilla EditWndProc from SendMessageA and the edit 00316 * control is currently subclassed Ansi but the edit control is 00317 * stored Unicode. 00318 */ 00319 fAnsiRecv = !!(TestWF(pwnd, WFANSIPROC)); 00320 if (!fAnsi != !fAnsiRecv) { 00321 00322 /* 00323 * Translation might be necessary between sender and receiver, 00324 * check to see if this is one of the messages we translate. 00325 */ 00326 switch (message) { 00327 case WM_CHARTOITEM: 00328 case EM_SETPASSWORDCHAR: 00329 case WM_CHAR: 00330 case WM_DEADCHAR: 00331 case WM_SYSCHAR: 00332 case WM_SYSDEADCHAR: 00333 case WM_MENUCHAR: 00334 case WM_IME_CHAR: 00335 case WM_IME_COMPOSITION: 00336 if (fAnsi) { 00337 /* 00338 * Setup DBCS Messaging for WM_CHAR... 00339 */ 00340 BUILD_DBCS_MESSAGE_TO_CLIENTW_FROM_CLIENTA(message,wParam,TRUE); 00341 00342 /* 00343 * Convert wParam to Unicode... 00344 */ 00345 RtlMBMessageWParamCharToWCS(message, &wParam); 00346 00347 /* 00348 * The message has been converted to Unicode. 00349 */ 00350 fAnsi = FALSE; 00351 } else { 00352 POINT ptZero = {0,0}; 00353 /* 00354 * Convert wParam to ANSI... 00355 */ 00356 RtlWCSMessageWParamCharToMB(message, &wParam); 00357 00358 /* 00359 * Let's DBCS messaging for WM_CHAR.... 00360 */ 00361 BUILD_DBCS_MESSAGE_TO_CLIENTA_FROM_CLIENTW( 00362 hwnd,message,wParam,lParam,0,ptZero,bDoDbcsMessaging); 00363 00364 /* 00365 * The message has been converted to ANSI. 00366 */ 00367 fAnsi = TRUE; 00368 } 00369 break; 00370 00371 case EM_SETSEL: 00372 case EM_GETSEL: 00373 case CB_GETEDITSEL: 00374 if (IS_DBCS_ENABLED()) { 00375 RIPERR1(ERROR_INVALID_PARAMETER, 00376 RIP_WARNING, 00377 "Invalid DBCS message (%x) to SendMessageWorker",message); 00378 } 00379 // 00380 // Fall down... 00381 00382 default: 00383 if ((message < WM_USER) && MessageTable[message].bThunkMessage) { 00384 fNeedTranslation = TRUE; 00385 } 00386 } 00387 } 00388 00389 #ifndef LATER 00390 /* 00391 * If the window has a client side worker proc and has 00392 * not been subclassed, dispatch the message directly 00393 * to the worker proc. Otherwise, dispatch it normally. 00394 */ 00395 pcls = REBASEALWAYS(pwnd, pcls); 00396 00397 if ((pcls->fnid >= FNID_CONTROLSTART && pcls->fnid <= FNID_CONTROLEND) && 00398 ((KERNEL_ULONG_PTR)pwnd->lpfnWndProc == FNID_TO_CLIENT_PFNW_KERNEL(pcls->fnid) || 00399 (KERNEL_ULONG_PTR)pwnd->lpfnWndProc == FNID_TO_CLIENT_PFNA_KERNEL(pcls->fnid))) { 00400 PWNDMSG pwm = &gSharedInfo.awmControl[pcls->fnid - FNID_START]; 00401 00402 /* 00403 * If this message is not processed by the control, call 00404 * xxxDefWindowProc 00405 */ 00406 if (pwm->abMsgs && ((message > pwm->maxMsgs) || 00407 !((pwm->abMsgs)[message / 8] & (1 << (message & 7))))) { 00408 00409 /* 00410 * Special case dialogs so that we can ignore unimportant 00411 * messages during dialog creation. 00412 */ 00413 if (pcls->fnid == FNID_DIALOG && 00414 PDLG(pwnd) && PDLG(pwnd)->lpfnDlg != NULL) { 00415 /* 00416 * If A/W translation are needed for Dialog, 00417 * it should go to kernel side to perform proper message. 00418 * DefDlgProcWorker will call aplication's DlgProc directly 00419 * without A/W conversion. 00420 */ 00421 if (fNeedTranslation) { 00422 goto lbServerSendMessage; 00423 } 00424 /* 00425 * Call woker procudure. 00426 */ 00427 SendMessageToWorker1Again: 00428 lRet = ((PROC)(FNID_TO_CLIENT_PFNWORKER(pcls->fnid)))(pwnd, message, wParam, lParam, fAnsi); 00429 /* 00430 * if we have DBCS TrailingByte that should be sent, send it here.. 00431 */ 00432 DISPATCH_DBCS_MESSAGE_IF_EXIST(message,wParam,bDoDbcsMessaging,SendMessageToWorker1); 00433 00434 return lRet; 00435 } else { 00436 /* 00437 * Call worker procedure. 00438 */ 00439 SendMessageToDefWindowAgain: 00440 lRet = DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00441 /* 00442 * if we have DBCS TrailingByte that should be sent, send it here.. 00443 */ 00444 DISPATCH_DBCS_MESSAGE_IF_EXIST(message,wParam,bDoDbcsMessaging,SendMessageToDefWindow); 00445 00446 return lRet; 00447 } 00448 } else { 00449 /* 00450 * Call woker procudure. 00451 */ 00452 SendMessageToWorker2Again: 00453 lRet = ((PROC)(FNID_TO_CLIENT_PFNWORKER(pcls->fnid)))(pwnd, message, wParam, lParam, fAnsi); 00454 00455 /* 00456 * if we have DBCS TrailingByte that should be sent, send it here.. 00457 */ 00458 DISPATCH_DBCS_MESSAGE_IF_EXIST(message,wParam,bDoDbcsMessaging,SendMessageToWorker2); 00459 00460 return lRet; 00461 } 00462 } 00463 #endif 00464 00465 /* 00466 * If this message needs to be translated, go through the kernel. 00467 */ 00468 if (fNeedTranslation) { 00469 goto lbServerSendMessage; 00470 } 00471 00472 /* 00473 * Call Client Windows procudure. 00474 */ 00475 SendMessageToWndProcAgain: 00476 00477 lRet = CALLPROC_WOWCHECKPWW(MapKernelClientFnToClientFn(pwnd->lpfnWndProc), hwnd, message, wParam, lParam, &(pwnd->state)); 00478 00479 /* 00480 * if we have DBCS TrailingByte that should be sent, send it here.. 00481 */ 00482 DISPATCH_DBCS_MESSAGE_IF_EXIST(message,wParam,bDoDbcsMessaging,SendMessageToWndProc); 00483 00484 return lRet; 00485 }

void SetMenuItemInfoStruct HMENU  hMenu,
UINT  wFlags,
UINT_PTR  wIDNew,
LPWSTR  pwszNew,
LPMENUITEMINFOW  pmii
 

Referenced by AppendMenu(), InsertMenu(), and ModifyMenu().

VOID SetSelected PLBIV  ,
INT  ,
BOOL  ,
UINT 
 

Definition at line 1028 of file lboxctl2.c.

References BYTE, tagLBIV::cMac, tagLBIV::fHasData, tagLBIV::fHasStrings, HILITEANDSEL, HILITEONLY, tagLBIV::iSel, tagLBIV::rgpch, SELONLY, SINGLESEL, and tagLBIV::wMultiple.

Referenced by xxxAlterHilite(), xxxLBoxCtlKeyInput(), xxxLBSelRange(), xxxLBSetSel(), xxxResetWorld(), and xxxTrackMouse().

01033 { 01034 LPSTR lp; 01035 BYTE cMask; 01036 BYTE cSelStatus; 01037 01038 if (iSel < 0 || iSel >= plb->cMac) 01039 return; 01040 01041 if (plb->wMultiple == SINGLESEL) { 01042 if (fSelected) 01043 plb->iSel = iSel; 01044 } else { 01045 cSelStatus = (BYTE)fSelected; 01046 switch (wOpFlags) { 01047 case HILITEONLY: 01048 01049 /* 01050 * Mask out lo-nibble 01051 */ 01052 cSelStatus = (BYTE)(cSelStatus << 4); 01053 cMask = 0x0F; 01054 break; 01055 case SELONLY: 01056 01057 /* 01058 * Mask out hi-nibble 01059 */ 01060 cMask = 0xF0; 01061 break; 01062 case HILITEANDSEL: 01063 01064 /* 01065 * Mask the byte fully 01066 */ 01067 cSelStatus |= (cSelStatus << 4); 01068 cMask = 0; 01069 break; 01070 } 01071 lp = (LPSTR)(plb->rgpch) + iSel + 01072 (plb->cMac * (plb->fHasStrings 01073 ? sizeof(LBItem) 01074 : (plb->fHasData ? sizeof(LBODItem) : 0))); 01075 01076 *lp = (*lp & cMask) | cSelStatus; 01077 } 01078 }

BOOL SetVideoTimeout DWORD  dwVideoTimeout  ) 
 

Definition at line 918 of file cltxt.h.

References BOOL, FALSE, NULL, PFNGETACTIVEPWRSCHEME, PFNREADPWRSCHEME, PFNSETACTIVEPWRSCHEME, and UINT.

Referenced by SystemParametersInfo().

00920 { 00921 POWER_POLICY pp; 00922 UINT uiID; 00923 HINSTANCE hInstDLL; 00924 PFNGETACTIVEPWRSCHEME pfnGetActivePwrScheme; 00925 PFNSETACTIVEPWRSCHEME pfnSetActivePwrScheme; 00926 PFNREADPWRSCHEME pfnReadPwrScheme; 00927 BOOL fRet = FALSE; 00928 00929 if ((hInstDLL = LoadLibrary(TEXT("powrprof.dll"))) == NULL) { 00930 return FALSE; 00931 } 00932 00933 pfnGetActivePwrScheme = (PFNGETACTIVEPWRSCHEME)GetProcAddress(hInstDLL, "GetActivePwrScheme"); 00934 pfnSetActivePwrScheme = (PFNSETACTIVEPWRSCHEME)GetProcAddress(hInstDLL, "SetActivePwrScheme"); 00935 pfnReadPwrScheme = (PFNREADPWRSCHEME)GetProcAddress(hInstDLL, "ReadPwrScheme"); 00936 00937 if (pfnGetActivePwrScheme(&uiID)) { 00938 00939 if (pfnReadPwrScheme(uiID, &pp)) { 00940 00941 pp.user.VideoTimeoutDc = dwVideoTimeout; 00942 pp.user.VideoTimeoutAc = dwVideoTimeout; 00943 00944 fRet = pfnSetActivePwrScheme(uiID, NULL, &pp); 00945 } 00946 } 00947 FreeLibrary (hInstDLL); 00948 00949 return fRet; 00950 }

void SetWindowState PWND  pwnd,
UINT  flags
 

Definition at line 3365 of file client.c.

References HWq, LOBYTE, NtUserCallHwndParam(), and TestWF.

03368 { 03369 if (TestWF(pwnd, flags) != LOBYTE(flags)) 03370 NtUserCallHwndParam(HWq(pwnd), flags, SFI_SETWINDOWSTATE); 03371 }

VOID ShiftMenuIDs PWND  pwnd,
PWND  pwndVictim
 

Definition at line 467 of file mdimenu.c.

References CKIDS, FIRST, HWq, REBASEPWND, SetWindowLongPtr(), tagWND::spmenu, and tagWND::spwndOwner.

Referenced by MDISetMenu(), and xxxMDIDestroy().

00470 { 00471 PMDI pmdi; 00472 PWND pwndChild; 00473 PWND pwndParent; 00474 /* 00475 * Get a pointer to the MDI structure 00476 */ 00477 pmdi = ((PMDIWND)pwnd)->pmdi; 00478 00479 pwndParent = REBASEPWND(pwndVictim, spwndParent); 00480 pwndChild = REBASEPWND(pwndParent, spwndChild); 00481 00482 while (pwndChild) { 00483 if (!pwndChild->spwndOwner && (pwndChild->spmenu > pwndVictim->spmenu)) { 00484 SetWindowLongPtr(HWq(pwndChild), GWLP_ID, PtrToUlong(pwndChild->spmenu) - 1); 00485 } 00486 pwndChild = REBASEPWND(pwndChild, spwndNext); 00487 } 00488 00489 SetWindowLongPtr(HWq(pwndVictim), GWLP_ID, FIRST(pmdi) + CKIDS(pmdi) - 1); 00490 }

void SLChangeSelection PED  ,
HDC  ,
ICH  ,
ICH 
 

Definition at line 395 of file editsl.c.

References _IsWindowVisible(), tagED::cch, ECAdjustIch(), ECCalcChangeSelection(), ECGetBrush(), ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditDrawText, tagBLOCK::EndPos, tagED::fAnsi, tagED::fDBCS, tagED::fFocus, tagED::fNoHideSel, tagED::hwnd, ICH, tagED::ichMaxSel, tagED::ichMinSel, min, NtUserHideCaret(), NtUserShowCaret(), tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, SLDrawLine(), SLGetClipRect(), SLSetCaretPosition(), and tagBLOCK::StPos.

Referenced by SLKeyDown(), SLMouseMotion(), and SLSetSelection().

00400 { 00401 ICH temp; 00402 ICH ichOldMinSel; 00403 ICH ichOldMaxSel; 00404 00405 if (ichNewMinSel > ichNewMaxSel) { 00406 temp = ichNewMinSel; 00407 ichNewMinSel = ichNewMaxSel; 00408 ichNewMaxSel = temp; 00409 } 00410 ichNewMinSel = min(ichNewMinSel, ped->cch); 00411 ichNewMaxSel = min(ichNewMaxSel, ped->cch); 00412 00413 // 00414 // To avoid position to half of DBCS, check and ajust position if necessary 00415 // 00416 // We check ped->fDBCS and ped->fAnsi though ECAdjustIch checks these bits. 00417 // We're worrying about the overhead of EcLock and EcUnlock. 00418 // 00419 if (ped->fDBCS && ped->fAnsi) { 00420 PSTR pText; 00421 00422 pText = ECLock(ped); 00423 ichNewMinSel = ECAdjustIch( ped, pText, ichNewMinSel ); 00424 ichNewMaxSel = ECAdjustIch( ped, pText, ichNewMaxSel ); 00425 ECUnlock(ped); 00426 } 00427 00428 /* 00429 * Preserve the Old selection 00430 */ 00431 ichOldMinSel = ped->ichMinSel; 00432 ichOldMaxSel = ped->ichMaxSel; 00433 00434 /* 00435 * Set new selection 00436 */ 00437 ped->ichMinSel = ichNewMinSel; 00438 ped->ichMaxSel = ichNewMaxSel; 00439 00440 /* 00441 * We will find the intersection of current selection rectangle with the new 00442 * selection rectangle. We will then invert the parts of the two rectangles 00443 * not in the intersection. 00444 */ 00445 if (_IsWindowVisible(ped->pwnd) && (ped->fFocus || ped->fNoHideSel)) { 00446 BLOCK Blk[2]; 00447 int i; 00448 RECT rc; 00449 00450 if (ped->fFocus) 00451 NtUserHideCaret(ped->hwnd); 00452 00453 if (ped->pLpkEditCallout) { 00454 /* 00455 * The language pack handles display while complex script support present 00456 */ 00457 PSTR pText; 00458 00459 ECGetBrush(ped, hdc); // Give user a chance to manipulate the DC 00460 pText = ECLock(ped); 00461 ped->pLpkEditCallout->EditDrawText(ped, hdc, pText, ped->cch, ped->ichMinSel, ped->ichMaxSel, ped->rcFmt.top); 00462 ECUnlock(ped); 00463 } else { 00464 Blk[0].StPos = ichOldMinSel; 00465 Blk[0].EndPos = ichOldMaxSel; 00466 Blk[1].StPos = ped->ichMinSel; 00467 Blk[1].EndPos = ped->ichMaxSel; 00468 00469 if (ECCalcChangeSelection(ped, ichOldMinSel, ichOldMaxSel, 00470 (LPBLOCK)&Blk[0], (LPBLOCK)&Blk[1])) { 00471 00472 // 00473 // Paint the rectangles where selection has changed. 00474 // Paint both Blk[0] and Blk[1], if they exist. 00475 // 00476 for (i = 0; i < 2; i++) { 00477 if (Blk[i].StPos != 0xFFFFFFFF) { 00478 SLGetClipRect(ped, hdc, Blk[i].StPos, 00479 Blk[i].EndPos - Blk[i].StPos, (LPRECT)&rc); 00480 SLDrawLine(ped, hdc, rc.left, rc.right, Blk[i].StPos, 00481 Blk[i].EndPos - Blk[i].StPos, 00482 ((Blk[i].StPos >= ped->ichMinSel) && 00483 (Blk[i].StPos < ped->ichMaxSel))); 00484 } 00485 } 00486 } 00487 } 00488 00489 // 00490 // Update caret. 00491 // 00492 SLSetCaretPosition(ped, hdc); 00493 00494 if (ped->fFocus) 00495 NtUserShowCaret(ped->hwnd); 00496 } 00497 }

void SLChar PED  ,
DWORD 
 

Definition at line 1304 of file editsl.c.

References BOOL, BYTE, DbcsCombine(), ECDeleteText(), ECGetEditDC(), ECInOutReconversionMode(), ECIsCharNumeric(), ECIsDBCSLeadByte(), ECNotifyParent(), ECPrevIch(), ECReleaseEditDC(), EFNUMBER, tagED::f40Compat, FALSE, tagED::fAnsi, tagED::fMouseDown, tagED::format, tagED::fReadOnly, FWINABLE, tagED::hwnd, tagED::hwndParent, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, IS_DBCS_ENABLED, IS_IME_ENABLED, IsWindow(), L, tagED::listboxHwnd, LOBYTE, max, NotifyWinEvent(), NtUserCallNoParam(), NtUserMessageBeep, NULL, tagED::pwnd, SendMessage(), SLDrawText(), SLInsertText(), SLScrollText(), TestWF, TRUE, and tagED::wMaxNegCcharPos.

Referenced by SLEditWndProc(), and SLKeyDown().

01307 { 01308 HDC hdc; 01309 WCHAR keyPress; 01310 BOOL updateText = FALSE; 01311 HWND hwndSave = ped->hwnd; 01312 int InsertTextLen = 1; 01313 int DBCSkey; 01314 01315 if (ped->fAnsi) 01316 keyPress = LOBYTE(keyValue); 01317 else 01318 keyPress = LOWORD(keyValue); 01319 01320 if (ped->fMouseDown || (ped->fReadOnly && keyPress != 3)) { 01321 01322 /* 01323 * Don't do anything if we are in the middle of a mousedown deal or if 01324 * this is a read only edit control, with exception of allowing 01325 * ctrl-C in order to copy to the clipboard. 01326 */ 01327 return ; 01328 } 01329 01330 if (IS_IME_ENABLED()) { 01331 ECInOutReconversionMode(ped, FALSE); 01332 } 01333 01334 switch (keyPress) { 01335 case VK_BACK: 01336 DeleteSelection: 01337 if (ECDeleteText(ped)) 01338 updateText = TRUE; 01339 break; 01340 01341 default: 01342 if (keyPress >= TEXT(' ')) 01343 { 01344 /* 01345 * If this is in [a-z],[A-Z] and we are an ES_NUMBER 01346 * edit field, bail. 01347 */ 01348 if (ped->f40Compat && TestWF(ped->pwnd, EFNUMBER)) { 01349 if (!ECIsCharNumeric(ped, keyPress)) { 01350 goto IllegalChar; 01351 } 01352 } 01353 goto DeleteSelection; 01354 } 01355 break; 01356 } 01357 01358 switch (keyPress) { 01359 case 3: 01360 01361 /* 01362 * CTRL-C Copy 01363 */ 01364 SendMessage(ped->hwnd, WM_COPY, 0, 0L); 01365 return; 01366 01367 case VK_BACK: 01368 01369 /* 01370 * Delete any selected text or delete character left if no sel 01371 */ 01372 if (!updateText && ped->ichMinSel) { 01373 01374 /* 01375 * There was no selection to delete so we just delete character 01376 left if available 01377 */ 01378 // 01379 // Calling PrevIch rather than just doing a decrement for VK_BACK 01380 // 01381 ped->ichMinSel = ECPrevIch( ped, NULL, ped->ichMinSel); 01382 ECDeleteText(ped); 01383 updateText = TRUE; 01384 } 01385 break; 01386 01387 case 22: /* CTRL-V Paste */ 01388 SendMessage(ped->hwnd, WM_PASTE, 0, 0L); 01389 return; 01390 01391 case 24: /* CTRL-X Cut */ 01392 if (ped->ichMinSel == ped->ichMaxSel) 01393 goto IllegalChar; 01394 01395 SendMessage(ped->hwnd, WM_CUT, 0, 0L); 01396 return; 01397 01398 case 26: /* CTRL-Z Undo */ 01399 SendMessage(ped->hwnd, EM_UNDO, 0, 0L); 01400 return; 01401 01402 case VK_RETURN: 01403 case VK_ESCAPE: 01404 // 01405 // If this is an edit control for a combobox and the dropdown list 01406 // is visible, forward it up to the combo. 01407 // 01408 if (ped->listboxHwnd && SendMessage(ped->hwndParent, CB_GETDROPPEDSTATE, 0, 0L)) { 01409 SendMessage(ped->hwndParent, WM_KEYDOWN, (WPARAM)keyPress, 0L); 01410 } else 01411 goto IllegalChar; 01412 return; 01413 01414 default: 01415 if (keyPress >= 0x1E) { // 1E,1F are unicode block and segment separators 01416 /* 01417 * Hide the cursor if typing, if the mouse is captured, do not mess with this 01418 * as it is going to desapear forever (no WM_SETCURSOR is sent to restore it 01419 * at the first mouse-move) 01420 * MCostea #166951 01421 */ 01422 NtUserCallNoParam(SFI_ZZZHIDECURSORNOCAPTURE); 01423 01424 if (IS_DBCS_ENABLED() && ped->fAnsi && (ECIsDBCSLeadByte(ped,(BYTE)keyPress))) { 01425 if ((DBCSkey = DbcsCombine(ped->hwnd, keyPress)) != 0 && 01426 SLInsertText(ped,(LPSTR)&DBCSkey, 2) == 2) { 01427 InsertTextLen = 2; 01428 updateText = TRUE; 01429 } else { 01430 NtUserMessageBeep(0); 01431 } 01432 } else { // Here the original code begins 01433 InsertTextLen = 1; 01434 if (SLInsertText(ped, (LPSTR)&keyPress, 1)) 01435 updateText = TRUE; 01436 else 01437 01438 /* 01439 * Beep. Since we couldn't add the text 01440 */ 01441 NtUserMessageBeep(0); 01442 } // Here the original code ends 01443 } else { 01444 01445 /* 01446 * User hit an illegal control key 01447 */ 01448 IllegalChar: 01449 NtUserMessageBeep(0); 01450 } 01451 01452 if (!IsWindow(hwndSave)) 01453 return; 01454 break; 01455 } 01456 01457 if (updateText) { 01458 01459 /* 01460 * Dirty flag (ped->fDirty) was set when we inserted text 01461 */ 01462 ECNotifyParent(ped, EN_UPDATE); 01463 hdc = ECGetEditDC(ped, FALSE); 01464 if (!SLScrollText(ped, hdc)) { 01465 if (ped->format == ES_LEFT) { 01466 // 01467 // Call SLDrawText with correct ichStart 01468 // 01469 SLDrawText(ped, hdc, max(0, (int)(ped->ichCaret - InsertTextLen - ped->wMaxNegCcharPos))); 01470 } else { 01471 /* 01472 * We can't just draw from ichStart because string may have 01473 * shifted because of alignment. 01474 */ 01475 SLDrawText(ped, hdc, 0); 01476 } 01477 } 01478 ECReleaseEditDC(ped, hdc, FALSE); 01479 ECNotifyParent(ped, EN_CHANGE); 01480 01481 if (FWINABLE()) { 01482 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01483 } 01484 } 01485 }

LONG SLCreate PED  ,
LPCREATESTRUCT 
 

!! CREATESTRUCT AorW and in other routines

Definition at line 27 of file edslrare.c.

References CBLISTBOXID, tagED::cLines, ECCreate(), ECSetFont(), ECSetPasswordChar(), ECSetText(), FALSE, tagED::fAnsi, GetDlgItem(), gHighestUserAddress, IsEmptyString(), tagED::listboxHwnd, NULL, tagED::pwnd, REBASEPTR, TRUE, UINT, and UNDO_NONE.

Referenced by SLEditWndProc().

00030 { 00031 LPSTR lpWindowText; 00032 LONG windowStyle = ped->pwnd->style; 00033 00034 /* 00035 * Do the standard creation stuff 00036 */ 00037 if (!ECCreate(ped, windowStyle)) 00038 return (-1); 00039 00040 /* 00041 * Single lines always have no undo and 1 line 00042 */ 00043 ped->cLines = 1; 00044 ped->undoType = UNDO_NONE; 00045 00046 /* 00047 * Check if this edit control is part of a combobox and get a pointer to the 00048 * combobox structure. 00049 */ 00050 if (windowStyle & ES_COMBOBOX) 00051 ped->listboxHwnd = GetDlgItem(lpCreateStruct->hwndParent, CBLISTBOXID); 00052 00053 /* 00054 * Set the default font to be the system font. 00055 */ 00056 ECSetFont(ped, NULL, FALSE); 00057 00058 /* 00059 * Set the window text if needed. Return false if we can't set the text 00060 * SLSetText notifies the parent in case there is a no memory error. 00061 */ 00062 if ((ULONG_PTR)lpCreateStruct->lpszName > gHighestUserAddress) 00063 lpWindowText = REBASEPTR(ped->pwnd, (PVOID)lpCreateStruct->lpszName); 00064 else 00065 lpWindowText = (LPSTR)lpCreateStruct->lpszName; 00066 00067 if ((lpWindowText != NULL) 00068 && !IsEmptyString(lpWindowText, ped->fAnsi) 00069 && !ECSetText(ped, lpWindowText)) { 00070 return (-1); 00071 } 00072 00073 if (windowStyle & ES_PASSWORD) 00074 ECSetPasswordChar(ped, (UINT)'*'); 00075 00076 return TRUE; 00077 }

void SLDrawLine PED  ,
HDC  ,
int  ,
int  ,
ICH  ,
int  ,
BOOL 
 

Definition at line 507 of file editsl.c.

References _IsWindowVisible(), tagED::cch, tagED::charPasswordChar, CopyRect, tagED::cPasswordCharWidth, DWORD, ECAnsiNext(), ECAnsiPrev(), ECGetBrush(), ECLock(), ECSetEditClip(), ECUnlock(), tagED::fAnsi, tagED::fDBCS, FillRect(), tagED::format, GetSysColor(), ICH, tagED::ichScreenStart, InflateRect(), max, min, NULL, tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, SLCalcXOffsetLeft(), SLCalcXOffsetSpecial(), SYSHBR, TRUE, tagED::wMaxNegAcharPos, and tagED::wMaxNegCcharPos.

Referenced by SLChangeSelection(), and SLDrawText().

00515 { 00516 RECT rc; 00517 RECT rcClip; 00518 PSTR pText; 00519 DWORD rgbSaveBk; 00520 DWORD rgbSaveText; 00521 DWORD wSaveBkMode; 00522 int iStCount; 00523 ICH ichNewStart; 00524 HBRUSH hbrBack; 00525 00526 if (ped->pLpkEditCallout) { 00527 RIPMSG0(RIP_WARNING, "SLDrawLine - Error - Invalid call with language pack loaded"); 00528 return; 00529 } 00530 00531 // 00532 // Anything to draw? 00533 // 00534 if (xClipStPos >= xClipEndPos || !_IsWindowVisible(ped->pwnd) ) 00535 return; 00536 00537 if (ped->fAnsi && ped->fDBCS) { 00538 PSTR pT,pTOrg; 00539 int iTCount; 00540 00541 pText = ECLock(ped); 00542 ichNewStart = 0; 00543 if (ichStart > 0) { 00544 pT = pText + ichStart; 00545 ichNewStart = ichStart; 00546 00547 while (ichNewStart && 00548 (ichStart - ichNewStart < ped->wMaxNegCcharPos)) { 00549 pT = ECAnsiPrev(ped, pText, pT); 00550 ichNewStart = (ICH)(pT - pText); 00551 if (!ichNewStart) 00552 break; 00553 } 00554 00555 // B#16152 - win95. 00556 // In case of T2, SLE always set an additional margin 00557 // to erase a character (iCount == 0 case), using aveCharWidth. 00558 // It erases unexpected an extra char if we don't use ichNewStart 00559 // and it happens when wMaxNegCcharPos == 0. 00560 // 00561 if (ped->wMaxNegCcharPos == 0 && iCount == 0) { 00562 pT = ECAnsiPrev(ped, pText, pT); 00563 ichNewStart = (ICH)(pT - pText); 00564 } 00565 } 00566 00567 iTCount = 0; 00568 if (ichStart + iCount < ped->cch) { 00569 pTOrg = pT = pText + ichStart + iCount; 00570 while ((iTCount < (int)ped->wMaxNegAcharPos) && 00571 (ichStart + iCount + iTCount < ped->cch)) { 00572 pT = ECAnsiNext(ped, pT); 00573 iTCount = (int)(pT - pTOrg); 00574 } 00575 } 00576 00577 ECUnlock(ped); 00578 iCount = (int)(min(ichStart+iCount+iTCount, ped->cch) - ichNewStart); 00579 } else { 00580 // Reset ichStart to take care of the negative C widths 00581 ichNewStart = max((int)(ichStart - ped->wMaxNegCcharPos), 0); 00582 00583 // Reset ichCount to take care of the negative C and A widths 00584 iCount = (int)(min(ichStart+iCount+ped->wMaxNegAcharPos, ped->cch) 00585 - ichNewStart); 00586 } 00587 ichStart = ichNewStart; 00588 00589 // 00590 // Reset ichStart and iCount to the first one visible on the screen 00591 // 00592 if (ichStart < ped->ichScreenStart) { 00593 if (ichStart+iCount < ped->ichScreenStart) 00594 return; 00595 00596 iCount -= (ped->ichScreenStart-ichStart); 00597 ichStart = ped->ichScreenStart; 00598 } 00599 00600 CopyRect(&rc, &ped->rcFmt); 00601 00602 // 00603 // Set the drawing rectangle 00604 // 00605 rcClip.left = xClipStPos; 00606 rcClip.right = xClipEndPos; 00607 rcClip.top = rc.top; 00608 rcClip.bottom = rc.bottom; 00609 00610 // 00611 // Set the proper clipping rectangle 00612 // 00613 ECSetEditClip(ped, hdc, TRUE); 00614 00615 pText = ECLock(ped); 00616 00617 // 00618 // Calculate the starting pos for this piece of text 00619 // 00620 if (ped->format == ES_LEFT) { 00621 if (iStCount = (int)(ichStart - ped->ichScreenStart)) { 00622 rc.left += SLCalcXOffsetLeft(ped, hdc, ichStart); 00623 } 00624 } else { 00625 rc.left += SLCalcXOffsetSpecial(ped, hdc, ichStart); 00626 } 00627 00628 // 00629 // Set the background mode before calling NtUserGetControlBrush so that the app 00630 // can change it to TRANSPARENT if it wants to. 00631 // 00632 SetBkMode(hdc, OPAQUE); 00633 00634 if (fSelStatus) { 00635 hbrBack = SYSHBR(HIGHLIGHT); 00636 if (hbrBack == NULL) { 00637 goto sldl_errorexit; 00638 } 00639 rgbSaveBk = SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); 00640 rgbSaveText = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); 00641 00642 } else { 00643 // 00644 // We always want to send this so that the app has a chance to muck 00645 // with the DC. 00646 // 00647 // Note that ReadOnly and Disabled edit fields are drawn as "static" 00648 // instead of as "active." 00649 // 00650 hbrBack = ECGetBrush(ped, hdc); 00651 rgbSaveText = GetTextColor(hdc); 00652 } 00653 00654 // 00655 // Erase the rectangular area before text is drawn. Note that we inflate 00656 // the rect by 1 so that the selection color has a one pixel border around 00657 // the text. 00658 // 00659 InflateRect(&rcClip, 0, 1); 00660 FillRect(hdc, &rcClip, hbrBack); 00661 InflateRect(&rcClip, 0, -1); 00662 00663 if (ped->charPasswordChar) { 00664 wSaveBkMode = SetBkMode(hdc, TRANSPARENT); 00665 00666 for (iStCount = 0; iStCount < iCount; iStCount++) { 00667 if ( ped->fAnsi ) 00668 ExtTextOutA(hdc, rc.left, rc.top, ETO_CLIPPED, &rcClip, 00669 (LPSTR)&ped->charPasswordChar, 1, NULL); 00670 else 00671 ExtTextOutW(hdc, rc.left, rc.top, ETO_CLIPPED, &rcClip, 00672 (LPWSTR)&ped->charPasswordChar, 1, NULL); 00673 00674 rc.left += ped->cPasswordCharWidth; 00675 } 00676 00677 SetBkMode(hdc, wSaveBkMode); 00678 } else { 00679 if ( ped->fAnsi ) 00680 ExtTextOutA(hdc, rc.left, rc.top, ETO_CLIPPED, &rcClip, 00681 pText+ichStart,iCount, NULL); 00682 else 00683 ExtTextOutW(hdc, rc.left, rc.top, ETO_CLIPPED, &rcClip, 00684 ((LPWSTR)pText)+ichStart,iCount, NULL); 00685 } 00686 00687 SetTextColor(hdc, rgbSaveText); 00688 if (fSelStatus) { 00689 SetBkColor(hdc, rgbSaveBk); 00690 } 00691 00692 sldl_errorexit: 00693 ECUnlock(ped); 00694 }

void SLDrawText PED  ,
HDC  ,
ICH 
 

Definition at line 737 of file editsl.c.

References _IsWindowVisible(), BOOL, tagED::cbChar, tagED::cch, tagED::charOverhang, tagED::charPasswordChar, CopyRect, tagED::cPasswordCharWidth, ECAdjustIch(), ECCchInWidth(), ECGetBrush(), ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditDrawText, FALSE, tagED::fAnsi, tagED::fDBCS, tagED::fFocus, FillRect(), tagED::fNoHideSel, tagED::format, tagED::fTrueType, ICH, tagED::ichMaxSel, tagED::ichMinSel, tagED::ichScreenStart, tagED::pLpkEditCallout, tagED::pwnd, tagED::rcFmt, SLCalcXOffsetLeft(), SLCalcXOffsetSpecial(), SLDrawLine(), SLGetBlkEnd(), SLSetCaretPosition(), TRUE, tagED::wLeftMargin, tagED::wMaxNegA, tagED::wMaxNegC, and tagED::wRightMargin.

Referenced by ECImeComposition(), EditWndProc(), SLChar(), SLKeyDown(), SLPaint(), SLPaste(), SLReplaceSel(), SLScrollText(), and SLSetFocus().

00741 { 00742 ICH cchToDraw; 00743 RECT rc; 00744 PSTR pText; 00745 BOOL fSelStatus; 00746 int iCount, iStCount; 00747 ICH ichEnd; 00748 BOOL fNoSelection; 00749 BOOL fCalcRect; 00750 BOOL fDrawLeftMargin = FALSE; 00751 BOOL fDrawEndOfLineStrip = FALSE; 00752 SIZE size; 00753 00754 if (!_IsWindowVisible(ped->pwnd)) 00755 return; 00756 00757 if (ped->pLpkEditCallout) { 00758 // The language pack handles display while complex script support present 00759 ECGetBrush(ped, hdc); // Give user a chance to manipulate the DC 00760 pText = ECLock(ped); 00761 ped->pLpkEditCallout->EditDrawText(ped, hdc, pText, ped->cch, ped->ichMinSel, ped->ichMaxSel, ped->rcFmt.top); 00762 ECUnlock(ped); 00763 SLSetCaretPosition(ped, hdc); 00764 return; 00765 } 00766 00767 /* 00768 * When drawing the entire visible content of special-aligned sle 00769 * erase the view. 00770 */ 00771 if (ped->format != ES_LEFT && ichStart == 0) 00772 FillRect(hdc, &ped->rcFmt, ECGetBrush(ped, hdc)); 00773 00774 pText = ECLock(ped); 00775 00776 if (ichStart < ped->ichScreenStart) { 00777 #if DBG 00778 ICH ichCompare = ECAdjustIch(ped, pText, ped->ichScreenStart); 00779 UserAssert(ichCompare == ped->ichScreenStart); 00780 #endif 00781 ichStart = ped->ichScreenStart; 00782 } 00783 else if (ped->fDBCS && ped->fAnsi) { 00784 /* 00785 * If ichStart stays on trailing byte of DBCS, we have to 00786 * adjust it. 00787 */ 00788 ichStart = ECAdjustIch(ped, pText, ichStart); 00789 } 00790 00791 CopyRect((LPRECT)&rc, (LPRECT)&ped->rcFmt); 00792 00793 /* 00794 * Find out how many characters will fit on the screen so that we don't do 00795 * any needless drawing. 00796 */ 00797 cchToDraw = ECCchInWidth(ped, hdc, 00798 (LPSTR)(pText + ped->ichScreenStart * ped->cbChar), 00799 ped->cch - ped->ichScreenStart, rc.right - rc.left, TRUE); 00800 ichEnd = ped->ichScreenStart + cchToDraw; 00801 00802 /* 00803 * There is no selection if, 00804 * 1. MinSel and MaxSel are equal OR 00805 * 2. (This has lost the focus AND Selection is to be hidden) 00806 */ 00807 fNoSelection = ((ped->ichMinSel == ped->ichMaxSel) || (!ped->fFocus && !ped->fNoHideSel)); 00808 00809 if (ped->format == ES_LEFT) { 00810 if (iStCount = (int)(ichStart - ped->ichScreenStart)) { 00811 rc.left += SLCalcXOffsetLeft(ped, hdc, ichStart); 00812 } 00813 } else { 00814 rc.left += SLCalcXOffsetSpecial(ped, hdc, ichStart); 00815 } 00816 00817 // 00818 // If this is the begining of the whole line, we may have to draw a blank 00819 // strip at the begining. 00820 // 00821 if ((ichStart == 0) && ped->wLeftMargin) 00822 fDrawLeftMargin = TRUE; 00823 00824 // 00825 // If there is nothing to draw, that means we need to draw the end of 00826 // line strip, which erases the last character. 00827 // 00828 if (ichStart == ichEnd) { 00829 fDrawEndOfLineStrip = TRUE; 00830 rc.left -= ped->wLeftMargin; 00831 } 00832 00833 while (ichStart < ichEnd) { 00834 fCalcRect = TRUE; 00835 00836 if (fNoSelection) { 00837 fSelStatus = FALSE; 00838 iCount = ichEnd - ichStart; 00839 } else { 00840 if (fDrawLeftMargin) { 00841 iCount = 0; 00842 fSelStatus = FALSE; 00843 fCalcRect = FALSE; 00844 rc.right = rc.left; 00845 } else 00846 iCount = SLGetBlkEnd(ped, ichStart, ichEnd, 00847 (BOOL *)&fSelStatus); 00848 } 00849 00850 00851 if (ichStart+iCount == ichEnd) { 00852 if (fSelStatus) 00853 fDrawEndOfLineStrip = TRUE; 00854 else { 00855 rc.right = ped->rcFmt.right + ped->wRightMargin; 00856 fCalcRect = FALSE; 00857 } 00858 } 00859 00860 if (fCalcRect) { 00861 if (ped->charPasswordChar) 00862 rc.right = rc.left + ped->cPasswordCharWidth * iCount; 00863 else { 00864 if ( ped->fAnsi ) 00865 GetTextExtentPointA(hdc, pText + ichStart, 00866 iCount, &size); 00867 else 00868 GetTextExtentPointW(hdc, ((LPWSTR)pText) + ichStart, 00869 iCount, &size); 00870 rc.right = rc.left + size.cx; 00871 /* 00872 * The extent is equal to the advance width. So for TrueType fonts 00873 * we need to take care of Neg A and C. For non TrueType, the extent 00874 * includes the overhang. 00875 * If drawing the selection, draw only the advance width 00876 */ 00877 if (fSelStatus) { 00878 rc.right -= ped->charOverhang; 00879 } else if (ped->fTrueType) { 00880 rc.right += ped->wMaxNegC; 00881 if (iStCount > 0) { 00882 rc.right += ped->wMaxNegA; 00883 iStCount = 0; 00884 } 00885 } 00886 00887 } /* if (ped->charPasswordChar) */ 00888 00889 } 00890 00891 if (fDrawLeftMargin) { 00892 fDrawLeftMargin = FALSE; 00893 rc.left -= ped->wLeftMargin; 00894 if (rc.right < rc.left) { 00895 rc.right = rc.left; 00896 } 00897 } 00898 00899 SLDrawLine(ped, hdc, rc.left, rc.right, ichStart, iCount, fSelStatus); 00900 ichStart += iCount; 00901 rc.left = rc.right; 00902 /* 00903 * If we're going to draw the selection, adjust rc.left 00904 * to include advance width of the selected text 00905 * For non TT fonts, ped->wMaxNegC equals ped->charOverhang 00906 */ 00907 if (!fSelStatus && (iCount != 0) && (ichStart < ichEnd)) { 00908 rc.left -= ped->wMaxNegC; 00909 } 00910 } 00911 00912 ECUnlock(ped); 00913 00914 // Check if anything to be erased on the right hand side 00915 if (fDrawEndOfLineStrip && 00916 (rc.left < (rc.right = (ped->rcFmt.right+ped->wRightMargin)))) 00917 SLDrawLine(ped, hdc, rc.left, rc.right, ichStart, 0, FALSE); 00918 00919 SLSetCaretPosition(ped, hdc); 00920 }

LRESULT SLEditWndProc HWND  ,
PED  ,
UINT  ,
WPARAM  ,
LPARAM 
 

Definition at line 2520 of file editsl.c.

References _IsWindowVisible(), CBFDROPDOWN, tagED::cch, DefWindowProcWorker(), ECEmptyUndo(), ECGetCaretWidth, ECGetEditDC(), ECGetText(), ECReleaseEditDC(), ECSize(), ECUpdateFormat(), tagLPKEDITCALLOUT::EditCreateCaret, tagED::f40Compat, FALSE, tagED::fAnsi, tagED::fBorder, tagED::fEatNextChar, tagED::fFocus, tagED::fMouseDown, foo(), tagED::fReadOnly, GetKeyState(), HtoP, tagED::hwnd, tagED::hwndParent, ICH, tagED::ichScreenStart, L, tagED::lineHeight, tagED::listboxHwnd, NtUserBeginPaint(), NtUserDestroyCaret, NtUserEndPaint(), NtUserHideCaret(), NtUserShowCaret(), NULL, tagED::pLpkEditCallout, Pundo, tagED::pwnd, SendMessage(), SLChar(), SLCreate(), SLIchToLeftXPos(), SLKeyDown(), SLKillFocus(), SLMouseMotion(), SLMouseToIch(), SLPaint(), SLPaste(), SLReplaceSel(), SLSetCaretPosition(), SLSetFocus(), SLSetSelection(), SLUndo(), SYS_ALTERNATE, TestWF, TRUE, UINT, ValidateHwnd, WEFDLGMODALFRAME, WFHPRESENT, WFMPRESENT, WFSIZEBOX, and WFVPRESENT.

Referenced by ECClearText(), and EditWndProc().

02526 { 02527 HDC hdc; 02528 PAINTSTRUCT ps; 02529 POINT pt; 02530 02531 /* 02532 * Dispatch the various messages we can receive 02533 */ 02534 switch (message) { 02535 02536 case WM_INPUTLANGCHANGE: 02537 if (ped && ped->fFocus && ped->pLpkEditCallout) { 02538 NtUserHideCaret(hwnd); 02539 hdc = ECGetEditDC(ped, TRUE); 02540 NtUserDestroyCaret(); 02541 ped->pLpkEditCallout->EditCreateCaret (ped, hdc, ECGetCaretWidth(), ped->lineHeight, (UINT)lParam); 02542 SLSetCaretPosition(ped, hdc); 02543 ECReleaseEditDC(ped, hdc, TRUE); 02544 NtUserShowCaret(hwnd); 02545 } 02546 goto PassToDefaultWindowProc; 02547 02548 case WM_STYLECHANGED: 02549 if (ped && ped->pLpkEditCallout) { 02550 switch (wParam) { 02551 02552 case GWL_STYLE: 02553 ECUpdateFormat(ped, 02554 ((LPSTYLESTRUCT)lParam)->styleNew, 02555 GetWindowLong(ped->hwnd, GWL_EXSTYLE)); 02556 return 1L; 02557 02558 case GWL_EXSTYLE: 02559 ECUpdateFormat(ped, 02560 GetWindowLong(ped->hwnd, GWL_STYLE), 02561 ((LPSTYLESTRUCT)lParam)->styleNew); 02562 return 1L; 02563 } 02564 } 02565 02566 goto PassToDefaultWindowProc; 02567 02568 case WM_CHAR: 02569 02570 /* 02571 * wParam - the value of the key 02572 lParam - modifiers, repeat count etc (not used) 02573 */ 02574 if (!ped->fEatNextChar) 02575 SLChar(ped, (UINT)wParam); 02576 else 02577 ped->fEatNextChar = FALSE; 02578 break; 02579 02580 case WM_ERASEBKGND: 02581 02582 /* 02583 * wParam - device context handle 02584 * lParam - not used 02585 * We do nothing on this message and we don't want DefWndProc to do 02586 * anything, so return 1 02587 */ 02588 return (1L); 02589 break; 02590 02591 case WM_GETDLGCODE: { 02592 LONG code = DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS; 02593 02594 /* 02595 * If this is a WM_SYSCHAR message generated by the UNDO keystroke 02596 * we want this message so we can EAT IT in "case WM_SYSCHAR:" 02597 */ 02598 if (lParam) { 02599 switch (((LPMSG)lParam)->message) { 02600 case WM_SYSCHAR: 02601 if ((HIWORD(((LPMSG)lParam)->lParam) & SYS_ALTERNATE) && 02602 ((WORD)wParam == VK_BACK)) { 02603 code |= DLGC_WANTMESSAGE; 02604 } 02605 break; 02606 02607 case WM_KEYDOWN: 02608 if (( (((WORD)wParam == VK_RETURN) || 02609 ((WORD)wParam == VK_ESCAPE)) && 02610 (ped->listboxHwnd) && 02611 TestWF(ValidateHwnd(ped->hwndParent), CBFDROPDOWN) && 02612 SendMessage(ped->hwndParent, CB_GETDROPPEDSTATE, 0, 0L))) { 02613 code |= DLGC_WANTMESSAGE; 02614 } 02615 break; 02616 } 02617 } 02618 return code; 02619 } 02620 02621 break; 02622 02623 case WM_KEYDOWN: 02624 02625 /* 02626 * wParam - virt keycode of the given key 02627 * lParam - modifiers such as repeat count etc. (not used) 02628 */ 02629 SLKeyDown(ped, (UINT)wParam, 0); 02630 break; 02631 02632 case WM_KILLFOCUS: 02633 02634 /* 02635 * wParam - handle of the window that receives the input focus 02636 lParam - not used 02637 */ 02638 02639 SLKillFocus(ped, (HWND)wParam); 02640 break; 02641 02642 case WM_CAPTURECHANGED: 02643 if (ped->fMouseDown) 02644 ped->fMouseDown = FALSE; 02645 break; 02646 02647 case WM_MOUSEMOVE: 02648 UserAssert(ped->fMouseDown); 02649 /* 02650 * FALL THRU 02651 */ 02652 02653 case WM_LBUTTONDBLCLK: 02654 case WM_LBUTTONDOWN: 02655 case WM_LBUTTONUP: 02656 /* 02657 * wParam - contains a value that indicates which virtual keys are down 02658 * lParam - contains x and y coords of the mouse cursor 02659 */ 02660 POINTSTOPOINT(pt, lParam); 02661 SLMouseMotion(ped, message, (UINT)wParam, &pt); 02662 break; 02663 02664 case WM_CREATE: 02665 02666 /* 02667 * wParam - handle to window being created 02668 lParam - points to a CREATESTRUCT that contains copies of parameters 02669 passed to the CreateWindow function. 02670 */ 02671 return (SLCreate(ped, (LPCREATESTRUCT)lParam)); 02672 break; 02673 02674 case WM_PRINTCLIENT: 02675 // wParam -- can be hdc from subclassed paint 02676 // lParam -- unused 02677 SLPaint(ped, (HDC) wParam); 02678 break; 02679 02680 case WM_PAINT: 02681 02682 /* 02683 * wParam -- can be hdc from subclassed paint 02684 * lParam -- unused 02685 */ 02686 if (wParam) 02687 hdc = (HDC) wParam; 02688 else { 02689 // this hide/show caret is outside Begin/EndPaint to handle the 02690 // case when the caret is half in/half out of the update region 02691 NtUserHideCaret(hwnd); 02692 hdc = NtUserBeginPaint(hwnd, &ps); 02693 } 02694 02695 if (_IsWindowVisible(ped->pwnd)) 02696 SLPaint(ped, hdc); 02697 02698 if (!wParam) { 02699 NtUserEndPaint(hwnd, &ps); 02700 NtUserShowCaret(hwnd); 02701 } 02702 break; 02703 02704 case WM_PASTE: 02705 02706 /* 02707 * wParam - not used 02708 * lParam - not used 02709 */ 02710 if (!ped->fReadOnly) 02711 SLPaste(ped); 02712 break; 02713 02714 case WM_SETFOCUS: 02715 02716 /* 02717 * wParam - handle of window that loses the input focus (may be NULL) 02718 lParam - not used 02719 */ 02720 SLSetFocus(ped); 02721 break; 02722 02723 case WM_SIZE: 02724 02725 /* 02726 * wParam - defines the type of resizing fullscreen, sizeiconic, 02727 sizenormal etc. 02728 lParam - new width in LOWORD, new height in HIGHWORD of client area 02729 */ 02730 ECSize(ped, NULL, TRUE); 02731 return 0L; 02732 02733 case WM_SYSKEYDOWN: 02734 /* 02735 * wParam -- virtual key code 02736 * lParam -- modifiers 02737 */ 02738 02739 /* 02740 * Are we in a combobox with the Alt key down? 02741 */ 02742 if (ped->listboxHwnd && (lParam & 0x20000000L)) { 02743 /* 02744 * Handle Combobox support. We want alt up or down arrow to behave 02745 * like F4 key which completes the combo box selection 02746 */ 02747 if (lParam & 0x1000000) { 02748 02749 /* 02750 * This is an extended key such as the arrow keys not on the 02751 * numeric keypad so just drop the combobox. 02752 */ 02753 if (wParam == VK_DOWN || wParam == VK_UP) 02754 goto DropCombo; 02755 else 02756 goto foo; 02757 } 02758 02759 if (!(GetKeyState(VK_NUMLOCK) & 1) && 02760 (wParam == VK_DOWN || wParam == VK_UP)) { 02761 02762 /* 02763 * NUMLOCK is up and the keypad up or down arrow hit: 02764 * eat character generated by keyboard driver. 02765 */ 02766 ped->fEatNextChar = TRUE; 02767 } else { 02768 goto foo; 02769 } 02770 02771 DropCombo: 02772 if (SendMessage(ped->hwndParent, 02773 CB_GETEXTENDEDUI, 0, 0) & 0x00000001) { 02774 02775 /* 02776 * Extended ui doesn't honor VK_F4. 02777 */ 02778 if (SendMessage(ped->hwndParent, CB_GETDROPPEDSTATE, 0, 0)) 02779 return(SendMessage(ped->hwndParent, CB_SHOWDROPDOWN, 0, 0)); 02780 else 02781 return (SendMessage(ped->hwndParent, CB_SHOWDROPDOWN, 1, 0)); 02782 } else 02783 return (SendMessage(ped->listboxHwnd, WM_KEYDOWN, VK_F4, 0)); 02784 } 02785 foo: 02786 if (wParam == VK_BACK) { 02787 SendMessage(ped->hwnd, WM_UNDO, 0, 0L); 02788 break; 02789 } 02790 else 02791 goto PassToDefaultWindowProc; 02792 break; 02793 02794 case EM_GETLINE: 02795 02796 /* 02797 * wParam - line number to copy (always the first line for SL) 02798 * lParam - buffer to copy text to. FIrst word is max # of bytes to copy 02799 */ 02800 return ECGetText(ped, (*(LPWORD)lParam), (LPSTR)lParam, FALSE); 02801 02802 case EM_LINELENGTH: 02803 02804 /* 02805 * wParam - ignored 02806 * lParam - ignored 02807 */ 02808 return (LONG)ped->cch; 02809 break; 02810 02811 case EM_SETSEL: 02812 /* 02813 * wParam -- start pos 02814 * lParam -- end pos 02815 */ 02816 SLSetSelection(ped, (ICH)wParam, (ICH)lParam); 02817 break; 02818 02819 case EM_REPLACESEL: 02820 02821 /* 02822 * wParam - flag for 4.0+ apps saying whether to clear undo 02823 * lParam - points to a null terminated string of replacement text 02824 */ 02825 SLReplaceSel(ped, (LPSTR)lParam); 02826 if (!ped->f40Compat || !wParam) 02827 ECEmptyUndo(Pundo(ped)); 02828 break; 02829 02830 case EM_GETFIRSTVISIBLELINE: 02831 02832 /* 02833 * wParam - not used 02834 * lParam - not used 02835 * 02836 * effects: Returns the first visible line for single line edit controls. 02837 */ 02838 return ped->ichScreenStart; 02839 break; 02840 02841 case EM_POSFROMCHAR: 02842 // 02843 // wParam -- char index in text 02844 // lParam -- not used 02845 // This function returns the (x,y) position of the character. 02846 // y is always 0 for single. 02847 // 02848 case EM_CHARFROMPOS: 02849 // 02850 // wParam -- unused 02851 // lParam -- pt in edit client coords 02852 // This function returns 02853 // LOWORD: the position of the _closest_ char 02854 // to the passed in point. 02855 // HIWORD: the index of the line (always 0 for single) 02856 02857 { 02858 LONG xyPos; 02859 02860 hdc = ECGetEditDC(ped, TRUE); 02861 02862 if (message == EM_POSFROMCHAR) 02863 xyPos = MAKELONG(SLIchToLeftXPos(ped, hdc, (ICH)wParam), 0); 02864 else { 02865 POINTSTOPOINT(pt, lParam); 02866 xyPos = SLMouseToIch(ped, hdc, &pt); 02867 } 02868 02869 ECReleaseEditDC(ped, hdc, TRUE); 02870 return((LRESULT)xyPos); 02871 break; 02872 } 02873 02874 case WM_UNDO: 02875 case EM_UNDO: 02876 SLUndo(ped); 02877 break; 02878 02879 #if 0 02880 case WM_NCPAINT: // not in server.c gawEditWndProc[] anyway. 02881 02882 /* 02883 * LATER - This is an NT optimization. It needs to be revisited 02884 * for validity once all of the Chicago changes are done - Johnl 02885 */ 02886 02887 pwnd = (PWND)HtoP(hwnd); 02888 02889 /* 02890 * Check to see if this window has any non-client areas that 02891 * would be painted. If not, don't bother calling DefWindowProc() 02892 * since it'll be a wasted c/s transition. 02893 */ 02894 if (!ped->fBorder && 02895 TestWF(pwnd, WEFDLGMODALFRAME) == 0 && 02896 !TestWF(pwnd, (WFMPRESENT | WFVPRESENT | WFHPRESENT)) && 02897 TestWF(pwnd, WFSIZEBOX) == 0) { 02898 break; 02899 } else { 02900 goto PassToDefaultWindowProc; 02901 } 02902 break; 02903 #endif 02904 02905 default: 02906 PassToDefaultWindowProc: 02907 return DefWindowProcWorker(ped->pwnd, message, wParam, lParam, ped->fAnsi); 02908 break; 02909 } /* switch (message) */ 02910 02911 return 1L; 02912 } /* SLEditWndProc */

int SLGetBlkEnd PED  ,
ICH  ,
ICH  ,
BOOL FAR * 
 

Definition at line 706 of file editsl.c.

References FALSE, tagED::ichMaxSel, tagED::ichMinSel, min, and TRUE.

Referenced by SLDrawText().

00711 { 00712 *lpfStatus = FALSE; 00713 if (ichStart >= ped->ichMinSel) { 00714 if (ichStart >= ped->ichMaxSel) 00715 return (ichEnd - ichStart); 00716 *lpfStatus = TRUE; 00717 return (min(ichEnd, ped->ichMaxSel) - ichStart); 00718 } 00719 return (min(ichEnd, ped->ichMinSel) - ichStart); 00720 }

int SLIchToLeftXPos PED  ped,
HDC  hdc,
ICH  ich
 

fAnsi

Definition at line 182 of file editsl.c.

References tagED::aveCharWidth, tagED::cch, tagED::charOverhang, tagED::charPasswordChar, tagED::cPasswordCharWidth, ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditIchToXY, tagED::fAnsi, tagED::fDBCS, tagED::fNonPropFont, tagED::format, tagED::ichScreenStart, tagED::pLpkEditCallout, tagED::rcFmt, and SLCalcXOffsetSpecial().

Referenced by SLEditWndProc(), and SLSetCaretPosition().

00186 { 00187 int textExtent; 00188 PSTR pText; 00189 SIZE size; 00190 int cchDiff; 00191 00192 if (ped->pLpkEditCallout) { 00193 00194 pText = ECLock(ped); 00195 textExtent = ped->pLpkEditCallout->EditIchToXY(ped, hdc, pText, ped->cch, ich); 00196 ECUnlock(ped); 00197 00198 return textExtent; 00199 00200 } 00201 00202 /* 00203 * Check if we are adding lots and lots of chars. A paste for example could 00204 * cause this and GetTextExtents could overflow on this. 00205 */ 00206 cchDiff = (int)ich - (int)ped->ichScreenStart; 00207 if (cchDiff > 1000) 00208 return (30000); 00209 else if (cchDiff < -1000) 00210 return (-30000); 00211 00212 if (ped->format != ES_LEFT) 00213 return (ped->rcFmt.left + SLCalcXOffsetSpecial(ped, hdc, ich)); 00214 00215 /* 00216 * Caret position /w DBCS text, we can not optimize... 00217 */ 00218 if (ped->fNonPropFont && !ped->fDBCS) 00219 return (ped->rcFmt.left + cchDiff*ped->aveCharWidth); 00220 00221 /* 00222 * Check if password hidden chars are being used. 00223 */ 00224 if (ped->charPasswordChar) 00225 return ( ped->rcFmt.left + cchDiff*ped->cPasswordCharWidth); 00226 00227 pText = ECLock(ped); 00228 00229 if (ped->fAnsi) { 00230 if (cchDiff >= 0) { 00231 00232 GetTextExtentPointA(hdc, (LPSTR)(pText + ped->ichScreenStart), 00233 cchDiff, &size); 00234 textExtent = size.cx; 00235 00236 /* 00237 * In case of signed/unsigned overflow since the text extent may be 00238 * greater than maxint. This happens with long single line edit 00239 * controls. The rect we edit text in will never be greater than 30000 00240 * pixels so we are ok if we just ignore them. 00241 */ 00242 if (textExtent < 0 || textExtent > 31000) 00243 textExtent = 30000; 00244 } else { 00245 GetTextExtentPointA(hdc,(LPSTR)(pText + ich), -cchDiff, &size); 00246 textExtent = (-1) * size.cx; 00247 } 00248 } else { 00249 if (cchDiff >= 0) { 00250 00251 GetTextExtentPointW(hdc, (LPWSTR)(pText + ped->ichScreenStart*sizeof(WCHAR)), 00252 cchDiff, &size); 00253 textExtent = size.cx; 00254 00255 /* 00256 * In case of signed/unsigned overflow since the text extent may be 00257 * greater than maxint. This happens with long single line edit 00258 * controls. The rect we edit text in will never be greater than 30000 00259 * pixels so we are ok if we just ignore them. 00260 */ 00261 if (textExtent < 0 || textExtent > 31000) 00262 textExtent = 30000; 00263 } else { 00264 GetTextExtentPointW(hdc,(LPWSTR)(pText + ich*sizeof(WCHAR)), -cchDiff, &size); 00265 textExtent = (-1) * size.cx; 00266 } 00267 } 00268 00269 ECUnlock(ped); 00270 00271 return (ped->rcFmt.left + textExtent - 00272 (textExtent ? ped->charOverhang : 0)); 00273 }

ICH SLInsertText PED  ,
LPSTR  ,
ICH 
 

Definition at line 1074 of file editsl.c.

References tagED::cch, tagED::cchTextMax, tagED::charPasswordChar, tagED::cPasswordCharWidth, ECCchInWidth(), ECGetEditDC(), ECInsertText(), ECLock(), ECNotifyParent(), ECReleaseEditDC(), ECUnlock(), tagED::fAnsi, tagED::fAutoHScroll, tagED::fDirty, ICH, min, tagED::rcFmt, and TRUE.

Referenced by ECImeComposition(), SLChar(), SLPasteText(), SLReplaceSel(), and SLUndo().

01078 { 01079 HDC hdc; 01080 PSTR pText; 01081 ICH cchInsertCopy = cchInsert; 01082 ICH cchT; 01083 int textWidth; 01084 SIZE size; 01085 01086 /* 01087 * First determine exactly how many characters from lpText we can insert 01088 * into the ped. 01089 */ 01090 if( ped->cchTextMax <= ped->cch) 01091 cchInsert = 0; 01092 else { 01093 if (!ped->fAutoHScroll) { 01094 pText = ECLock(ped); 01095 hdc = ECGetEditDC(ped, TRUE); 01096 01097 cchInsert = min(cchInsert, (unsigned)(ped->cchTextMax - ped->cch)); 01098 if (ped->charPasswordChar) 01099 textWidth = ped->cch * ped->cPasswordCharWidth; 01100 else { 01101 if (ped->fAnsi) 01102 GetTextExtentPointA(hdc, (LPSTR)pText, ped->cch, &size); 01103 else 01104 GetTextExtentPointW(hdc, (LPWSTR)pText, ped->cch, &size); 01105 textWidth = size.cx; 01106 } 01107 cchT = ECCchInWidth(ped, hdc, lpText, cchInsert, 01108 ped->rcFmt.right - ped->rcFmt.left - 01109 textWidth, TRUE); 01110 cchInsert = min(cchInsert, cchT); 01111 01112 ECUnlock(ped); 01113 ECReleaseEditDC(ped, hdc, TRUE); 01114 } else { 01115 cchInsert = min((unsigned)(ped->cchTextMax - ped->cch), cchInsert); 01116 } 01117 } 01118 01119 01120 /* 01121 * Now try actually adding the text to the ped 01122 */ 01123 if (cchInsert && !ECInsertText(ped, lpText, &cchInsert)) { 01124 ECNotifyParent(ped, EN_ERRSPACE); 01125 return (0); 01126 } 01127 if (cchInsert) 01128 ped->fDirty = TRUE; /* Set modify flag */ 01129 01130 if (cchInsert < cchInsertCopy) { 01131 01132 /* 01133 * Notify parent that we couldn't insert all the text requested 01134 */ 01135 ECNotifyParent(ped, EN_MAXTEXT); 01136 } 01137 01138 /* 01139 * Update selection extents and the caret position. Note that ECInsertText 01140 * updates ped->ichCaret, ped->ichMinSel, and ped->ichMaxSel to all be after 01141 * the inserted text. 01142 */ 01143 return (cchInsert); 01144 }

void SLKeyDown PED  ,
DWORD  ,
int 
 

Definition at line 1529 of file editsl.c.

References BOOL, tagED::cch, CTRLDOWN, ECGetEditDC(), ECGetModKeys(), ECNextIch(), ECNotifyParent(), ECPrevIch(), ECReleaseEditDC(), ECWord(), FALSE, tagED::fAnsi, tagED::fEatNextChar, tagED::fMouseDown, tagED::fReadOnly, FWINABLE, HanjaKeyHandler(), tagED::hwnd, tagED::hwndParent, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, L, tagED::listboxHwnd, NONEDOWN, NotifyWinEvent(), NULL, tagED::pLpkEditCallout, SendMessage(), SHFTDOWN, SLChangeSelection(), SLChar(), SLDrawText(), SLMoveSelectionRestricted(), SLScrollText(), TRUE, and UINT.

Referenced by SLEditWndProc().

01533 { 01534 HDC hdc; 01535 01536 /* 01537 * Variables we will use for redrawing the updated text 01538 */ 01539 ICH newMaxSel = ped->ichMaxSel; 01540 ICH newMinSel = ped->ichMinSel; 01541 01542 /* 01543 * Flags for drawing the updated text 01544 */ 01545 BOOL updateText = FALSE; 01546 BOOL changeSelection = FALSE; /* new selection is specified by 01547 newMinSel, newMaxSel */ 01548 01549 /* 01550 * Comparisons we do often 01551 */ 01552 BOOL MinEqMax = (newMaxSel == newMinSel); 01553 BOOL MinEqCar = (ped->ichCaret == newMinSel); 01554 BOOL MaxEqCar = (ped->ichCaret == newMaxSel); 01555 01556 /* 01557 * State of shift and control keys. 01558 */ 01559 int scState; 01560 01561 /* 01562 * Combo box support 01563 */ 01564 BOOL fIsListVisible; 01565 BOOL fIsExtendedUI; 01566 01567 if (ped->fMouseDown) { 01568 01569 /* 01570 * If we are in the middle of a mouse down handler, then don't do 01571 * anything. ie. ignore keyboard input. 01572 */ 01573 return; 01574 } 01575 01576 scState = ECGetModKeys(keyMods); 01577 01578 switch (virtKeyCode) { 01579 case VK_UP: 01580 if ( ped->listboxHwnd ) { 01581 01582 /* 01583 * Handle Combobox support 01584 */ 01585 fIsExtendedUI = (BOOL)SendMessage(ped->hwndParent, CB_GETEXTENDEDUI, 0, 0); 01586 fIsListVisible = (BOOL)SendMessage(ped->hwndParent, CB_GETDROPPEDSTATE, 0, 0); 01587 01588 if (!fIsListVisible && fIsExtendedUI) { 01589 01590 /* 01591 * For TandyT 01592 */ 01593 DropExtendedUIListBox: 01594 01595 /* 01596 * Since an extendedui combo box doesn't do anything on f4, we 01597 * turn off the extended ui, send the f4 to drop, and turn it 01598 * back on again. 01599 */ 01600 SendMessage(ped->hwndParent, CB_SETEXTENDEDUI, 0, 0); 01601 SendMessage(ped->listboxHwnd, WM_KEYDOWN, VK_F4, 0); 01602 SendMessage(ped->hwndParent, CB_SETEXTENDEDUI, 1, 0); 01603 return; 01604 } else 01605 goto SendKeyToListBox; 01606 } 01607 01608 /* 01609 * else fall through 01610 */ 01611 case VK_LEFT: 01612 // 01613 // If the caret isn't at the beginning, we can move left 01614 // 01615 if (ped->ichCaret) { 01616 // 01617 // Get new caret pos. 01618 // 01619 if (scState & CTRLDOWN) { 01620 // Move caret word left 01621 ECWord(ped, ped->ichCaret, TRUE, &ped->ichCaret, NULL); 01622 } else { 01623 // Move caret char left 01624 if (ped->pLpkEditCallout) { 01625 ped->ichCaret = SLMoveSelectionRestricted(ped, ped->ichCaret, TRUE); 01626 } else 01627 ped->ichCaret = ECPrevIch(ped,NULL,ped->ichCaret); 01628 } 01629 01630 // 01631 // Get new selection 01632 // 01633 if (scState & SHFTDOWN) { 01634 if (MaxEqCar && !MinEqMax) { 01635 // Reduce selection 01636 newMaxSel = ped->ichCaret; 01637 01638 UserAssert(newMinSel == ped->ichMinSel); 01639 } else { 01640 // Extend selection 01641 newMinSel = ped->ichCaret; 01642 } 01643 } else { 01644 // 01645 // Clear selection 01646 // 01647 newMaxSel = newMinSel = ped->ichCaret; 01648 } 01649 01650 changeSelection = TRUE; 01651 } else { 01652 // 01653 // If the user tries to move left and we are at the 0th 01654 // character and there is a selection, then cancel the 01655 // selection. 01656 // 01657 if ( (ped->ichMaxSel != ped->ichMinSel) && 01658 !(scState & SHFTDOWN) ) { 01659 changeSelection = TRUE; 01660 newMaxSel = newMinSel = ped->ichCaret; 01661 } 01662 } 01663 break; 01664 01665 case VK_DOWN: 01666 if (ped->listboxHwnd) { 01667 01668 /* 01669 * Handle Combobox support 01670 */ 01671 fIsExtendedUI = (BOOL)SendMessage(ped->hwndParent, CB_GETEXTENDEDUI, 0, 0); 01672 fIsListVisible = (BOOL)SendMessage(ped->hwndParent, CB_GETDROPPEDSTATE, 0, 0); 01673 01674 if (!fIsListVisible && fIsExtendedUI) { 01675 01676 /* 01677 * For TandyT 01678 */ 01679 goto DropExtendedUIListBox; 01680 } else 01681 goto SendKeyToListBox; 01682 } 01683 01684 /* 01685 * else fall through 01686 */ 01687 case VK_RIGHT: 01688 // 01689 // If the caret isn't at the end, we can move right. 01690 // 01691 if (ped->ichCaret < ped->cch) { 01692 // 01693 // Get new caret pos. 01694 // 01695 if (scState & CTRLDOWN) { 01696 // Move caret word right 01697 ECWord(ped, ped->ichCaret, FALSE, NULL, &ped->ichCaret); 01698 } else { 01699 // Move caret char right 01700 if (ped->pLpkEditCallout) { 01701 ped->ichCaret = SLMoveSelectionRestricted(ped, ped->ichCaret, FALSE); 01702 } else 01703 ped->ichCaret = ECNextIch(ped,NULL,ped->ichCaret); 01704 } 01705 01706 // 01707 // Get new selection. 01708 // 01709 if (scState & SHFTDOWN) { 01710 if (MinEqCar && !MinEqMax) { 01711 // Reduce selection 01712 newMinSel = ped->ichCaret; 01713 01714 UserAssert(newMaxSel == ped->ichMaxSel); 01715 } else { 01716 // Extend selection 01717 newMaxSel = ped->ichCaret; 01718 } 01719 } else { 01720 // Clear selection 01721 newMaxSel = newMinSel = ped->ichCaret; 01722 } 01723 01724 changeSelection = TRUE; 01725 } else { 01726 // 01727 // If the user tries to move right and we are at the last 01728 // character and there is a selection, then cancel the 01729 // selection. 01730 // 01731 if ( (ped->ichMaxSel != ped->ichMinSel) && 01732 !(scState & SHFTDOWN) ) { 01733 newMaxSel = newMinSel = ped->ichCaret; 01734 changeSelection = TRUE; 01735 } 01736 } 01737 break; 01738 01739 case VK_HOME: 01740 // 01741 // Move caret to top. 01742 // 01743 ped->ichCaret = 0; 01744 01745 // 01746 // Update selection. 01747 // 01748 if (scState & SHFTDOWN) { 01749 if (MaxEqCar && !MinEqMax) { 01750 // Reduce selection 01751 newMinSel = ped->ichCaret; 01752 newMaxSel = ped->ichMinSel; 01753 } else { 01754 // Extend selection 01755 newMinSel = ped->ichCaret; 01756 } 01757 } else { 01758 // Clear selection 01759 newMaxSel = newMinSel = ped->ichCaret; 01760 } 01761 01762 changeSelection = TRUE; 01763 break; 01764 01765 case VK_END: 01766 // 01767 // Move caret to end. 01768 // 01769 ped->ichCaret = ped->cch; 01770 01771 // 01772 // Update selection. 01773 // 01774 newMaxSel = ped->ichCaret; 01775 if (scState & SHFTDOWN) { 01776 if (MinEqCar && !MinEqMax) { 01777 // Reduce selection 01778 newMinSel = ped->ichMaxSel; 01779 } 01780 } else { 01781 // Clear selection 01782 newMinSel = ped->ichCaret; 01783 } 01784 01785 changeSelection = TRUE; 01786 break; 01787 01788 case VK_DELETE: 01789 if (ped->fReadOnly) 01790 break; 01791 01792 switch (scState) { 01793 case NONEDOWN: 01794 01795 /* 01796 * Clear selection. If no selection, delete (clear) character 01797 * right. 01798 */ 01799 if ((ped->ichMaxSel < ped->cch) && (ped->ichMinSel == ped->ichMaxSel)) { 01800 01801 /* 01802 * Move cursor forwards and simulate a backspace. 01803 */ 01804 if (ped->pLpkEditCallout) { 01805 ped->ichMinSel = ped->ichCaret; 01806 ped->ichMaxSel = ped->ichCaret = SLMoveSelectionRestricted(ped, ped->ichCaret, FALSE); 01807 } else { 01808 ped->ichCaret = ECNextIch(ped,NULL,ped->ichCaret); 01809 ped->ichMaxSel = ped->ichMinSel = ped->ichCaret; 01810 } 01811 SLChar(ped, (UINT)VK_BACK); 01812 } 01813 if (ped->ichMinSel != ped->ichMaxSel) 01814 SLChar(ped, (UINT)VK_BACK); 01815 break; 01816 01817 case SHFTDOWN: 01818 01819 // 01820 // Send ourself a WM_CUT message if a selection exists. 01821 // Otherwise, delete the left character. 01822 // 01823 if (ped->ichMinSel == ped->ichMaxSel) { 01824 UserAssert(!ped->fEatNextChar); 01825 SLChar(ped, VK_BACK); 01826 } else 01827 SendMessage(ped->hwnd, WM_CUT, 0, 0L); 01828 01829 break; 01830 01831 case CTRLDOWN: 01832 01833 /* 01834 * Delete to end of line if no selection else delete (clear) 01835 * selection. 01836 */ 01837 if ((ped->ichMaxSel < ped->cch) && (ped->ichMinSel == ped->ichMaxSel)) { 01838 01839 /* 01840 * Move cursor to end of line and simulate a backspace. 01841 */ 01842 ped->ichMaxSel = ped->ichCaret = ped->cch; 01843 } 01844 if (ped->ichMinSel != ped->ichMaxSel) 01845 SLChar(ped, (UINT)VK_BACK); 01846 break; 01847 01848 } 01849 01850 /* 01851 * No need to update text or selection since BACKSPACE message does it 01852 * for us. 01853 */ 01854 break; 01855 01856 case VK_INSERT: 01857 switch (scState) { 01858 case CTRLDOWN: 01859 01860 /* 01861 * Copy current selection to clipboard 01862 */ 01863 SendMessage(ped->hwnd, WM_COPY, 0, 0); 01864 break; 01865 01866 case SHFTDOWN: 01867 SendMessage(ped->hwnd, WM_PASTE, 0, 0L); 01868 break; 01869 } 01870 break; 01871 01872 // VK_HANJA support 01873 case VK_HANJA: 01874 if ( HanjaKeyHandler( ped ) ) { 01875 changeSelection = TRUE; 01876 newMinSel = ped->ichCaret; 01877 newMaxSel = ped->ichCaret + (ped->fAnsi ? 2 : 1); 01878 } 01879 break; 01880 01881 case VK_F4: 01882 case VK_PRIOR: 01883 case VK_NEXT: 01884 01885 /* 01886 * Send keys to the listbox if we are a part of a combo box. This 01887 * assumes the listbox ignores keyup messages which is correct right 01888 * now. 01889 */ 01890 SendKeyToListBox: 01891 if (ped->listboxHwnd) { 01892 01893 /* 01894 * Handle Combobox support 01895 */ 01896 SendMessage(ped->listboxHwnd, WM_KEYDOWN, virtKeyCode, 0L); 01897 return; 01898 } 01899 } 01900 01901 if (changeSelection || updateText) { 01902 hdc = ECGetEditDC(ped, FALSE); 01903 01904 /* 01905 * Scroll if needed 01906 */ 01907 SLScrollText(ped, hdc); 01908 01909 if (changeSelection) 01910 SLChangeSelection(ped, hdc, newMinSel, newMaxSel); 01911 01912 if (updateText) 01913 SLDrawText(ped, hdc, 0); 01914 01915 ECReleaseEditDC(ped, hdc, FALSE); 01916 if (updateText) { 01917 ECNotifyParent(ped, EN_CHANGE); 01918 01919 if (FWINABLE()) { 01920 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01921 } 01922 } 01923 } 01924 }

void SLKillFocus PED  ,
HWND 
 

Definition at line 2394 of file editsl.c.

References ECNotifyParent(), FALSE, tagED::fFocus, tagED::fNoHideSel, tagED::hwnd, tagED::hwndParent, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, IsChild(), L, tagED::listboxHwnd, NtUserDestroyCaret, NtUserInvalidateRect(), NULL, SendMessage(), and SLSetSelection().

Referenced by SLEditWndProc().

02397 { 02398 if (ped->fFocus) { 02399 02400 /* 02401 * Destroy the caret (Win31/Chicago hides it first) 02402 */ 02403 NtUserDestroyCaret(); 02404 02405 ped->fFocus = FALSE; /* Clear focus */ 02406 /* 02407 * Do this only if we still have the focus. But we always notify the 02408 * parent that we lost the focus whether or not we originally had the 02409 * focus. 02410 */ 02411 02412 /* 02413 * Hide the current selection if needed 02414 */ 02415 if (!ped->fNoHideSel && (ped->ichMinSel != ped->ichMaxSel)) { 02416 NtUserInvalidateRect(ped->hwnd, NULL, FALSE); 02417 #if 0 02418 SLSetSelection(ped, ped->ichCaret, ped->ichCaret); 02419 #endif 02420 } 02421 } 02422 02423 /* 02424 * If we aren't a combo box, notify parent that we lost the focus. 02425 */ 02426 if (!ped->listboxHwnd) 02427 ECNotifyParent(ped, EN_KILLFOCUS); 02428 else { 02429 02430 /* 02431 * This editcontrol is part of a combo box and is losing the focus. If 02432 * the focus is NOT being sent to another control in the combo box 02433 * window, then it means the combo box is losing the focus. So we will 02434 * notify the combo box of this fact. 02435 */ 02436 if ((newFocusHwnd == NULL) || 02437 (!IsChild(ped->hwndParent, newFocusHwnd))) { 02438 // Excel has a slaker in it's midst. They're not using our combo 02439 // boxes, but they still expect to get all the internal messages 02440 // that we give to OUR comboboxes. And they expect them to be at 02441 // the same offset from WM_USER as they were in 3.1. 02442 // (JEFFBOG - 01/26/94) 02443 /* 02444 * Windows NT won't fix the bug described above: it only applies 02445 * to old 16-bit excel, and WOW converts msgs to Win3.1 values. 02446 */ 02447 02448 /* 02449 * Focus is being sent to a window which is not a child of the combo 02450 * box window which implies that the combo box is losing the focus. 02451 * Send a message to the combo box informing him of this fact so 02452 * that he can clean up... 02453 */ 02454 SendMessage(ped->hwndParent, CBEC_KILLCOMBOFOCUS, 0, 0L); 02455 } 02456 } 02457 }

void SLMouseMotion PED  ,
UINT  ,
UINT  ,
LPPOINT 
 

Definition at line 2098 of file editsl.c.

References BOOL, tagED::cch, DWORD, ECGetEditDC(), ECIsDBCSLeadByte(), ECLock(), ECReleaseEditDC(), ECUnlock(), ECWord(), FALSE, tagED::fAnsi, tagED::fDBCS, tagED::fFocus, tagED::fMouseDown, tagED::fNoHideSel, tagED::hwnd, ICH, tagED::ichCaret, tagED::ichMaxSel, tagED::ichMinSel, tagED::ichStartMaxSel, tagED::ichStartMinSel, tagED::listboxHwnd, min, NtUserReleaseCapture, NtUserSetCapture(), NtUserSetFocus(), SLChangeSelection(), SLMouseToIch(), SLScrollText(), and TRUE.

Referenced by SLEditWndProc().

02103 { 02104 DWORD selectionl; 02105 DWORD selectionh; 02106 BOOL changeSelection; 02107 ICH newMaxSel; 02108 ICH newMinSel; 02109 HDC hdc; 02110 ICH mouseIch; 02111 LPSTR pText; 02112 02113 changeSelection = FALSE; 02114 02115 newMinSel = ped->ichMinSel; 02116 newMaxSel = ped->ichMaxSel; 02117 02118 hdc = ECGetEditDC(ped, FALSE); 02119 mouseIch = SLMouseToIch(ped, hdc, mousePt); 02120 02121 switch (message) { 02122 case WM_LBUTTONDBLCLK: 02123 02124 // if shift key is down, extend selection to word we double clicked on 02125 // else clear current selection and select word. 02126 02127 // in DBCS, we have different word breaking. LiZ -- 5/5/93 02128 // In Hangeul Environment we use word selection feature because Hangeul 02129 // use SPACE as word break 02130 if (ped->fAnsi && ped->fDBCS) { 02131 pText = ECLock(ped) + mouseIch; 02132 ECWord(ped, mouseIch, 02133 (ECIsDBCSLeadByte(ped,*pText) && mouseIch < ped->cch) ? FALSE : TRUE, 02134 &selectionl, &selectionh); 02135 ECUnlock(ped); 02136 } else { 02137 ECWord(ped, mouseIch, (mouseIch) ? TRUE : FALSE, &selectionl, &selectionh); 02138 } 02139 02140 if (!(virtKeyDown & MK_SHIFT)) { 02141 // If shift key isn't down, move caret to mouse point and clear 02142 // old selection 02143 newMinSel = selectionl; 02144 newMaxSel = ped->ichCaret = selectionh; 02145 } else { 02146 // Shiftkey is down so we want to maintain the current selection 02147 // (if any) and just extend or reduce it 02148 if (ped->ichMinSel == ped->ichCaret) { 02149 newMinSel = ped->ichCaret = selectionl; 02150 ECWord(ped, newMaxSel, TRUE, &selectionl, &selectionh); 02151 } else { 02152 newMaxSel = ped->ichCaret = selectionh; 02153 ECWord(ped, newMinSel, FALSE, &selectionl, &selectionh); 02154 } 02155 /* 02156 * v-ronaar: fix bug 24627 - edit selection is weird. 02157 */ 02158 ped->ichMaxSel = ped->ichCaret; 02159 } 02160 02161 ped->ichStartMinSel = selectionl; 02162 ped->ichStartMaxSel = selectionh; 02163 02164 goto InitDragSelect; 02165 02166 case WM_MOUSEMOVE: 02167 // 02168 // We know the mouse button's down -- otherwise the OPTIMIZE 02169 // test would've failed in SLEditWndProc and never called 02170 // 02171 changeSelection = TRUE; 02172 02173 // Extend selection, move caret word right 02174 if (ped->ichStartMinSel || ped->ichStartMaxSel) { 02175 // We're in WORD SELECT mode 02176 BOOL fReverse = (mouseIch <= ped->ichStartMinSel); 02177 02178 ECWord(ped, mouseIch, !fReverse, &selectionl, &selectionh); 02179 02180 if (fReverse) { 02181 newMinSel = ped->ichCaret = selectionl; 02182 newMaxSel = ped->ichStartMaxSel; 02183 } else { 02184 newMinSel = ped->ichStartMinSel; 02185 newMaxSel = ped->ichCaret = selectionh; 02186 } 02187 } else if ((ped->ichMinSel == ped->ichCaret) && 02188 (ped->ichMinSel != ped->ichMaxSel)) 02189 // Reduce selection extent 02190 newMinSel = ped->ichCaret = mouseIch; 02191 else 02192 // Extend selection extent 02193 newMaxSel = ped->ichCaret=mouseIch; 02194 break; 02195 02196 case WM_LBUTTONDOWN: 02197 // If we currently don't have the focus yet, try to get it. 02198 if (!ped->fFocus) { 02199 if (!ped->fNoHideSel) 02200 // Clear the selection before setting the focus so that we 02201 // don't get refresh problems and flicker. Doesn't matter 02202 // since the mouse down will end up changing it anyway. 02203 ped->ichMinSel = ped->ichMaxSel = ped->ichCaret; 02204 02205 NtUserSetFocus(ped->hwnd); 02206 02207 // 02208 // BOGUS 02209 // (1) We should see if SetFocus() succeeds. 02210 // (2) We should ignore mouse messages if the first window 02211 // ancestor with a caption isn't "active." 02212 // 02213 02214 // If we are part of a combo box, then this is the first time 02215 // the edit control is getting the focus so we just want to 02216 // highlight the selection and we don't really want to position 02217 // the caret. 02218 if (ped->listboxHwnd) 02219 break; 02220 02221 // We yield at SetFocus -- text might have changed at that point 02222 // update selection and caret info accordingly 02223 // FIX for bug # 11743 -- JEFFBOG 8/23/91 02224 newMaxSel = ped->ichMaxSel; 02225 newMinSel = ped->ichMinSel; 02226 mouseIch = min(mouseIch, ped->cch); 02227 } 02228 02229 if (ped->fFocus) { 02230 // Only do this if we have the focus since a clever app may not 02231 // want to give us the focus at the SetFocus call above. 02232 if (!(virtKeyDown & MK_SHIFT)) { 02233 // If shift key isn't down, move caret to mouse point and 02234 // clear old selection 02235 newMinSel = newMaxSel = ped->ichCaret = mouseIch; 02236 } else { 02237 // Shiftkey is down so we want to maintain the current 02238 // selection (if any) and just extend or reduce it 02239 if (ped->ichMinSel == ped->ichCaret) 02240 newMinSel = ped->ichCaret = mouseIch; 02241 else 02242 newMaxSel = ped->ichCaret = mouseIch; 02243 } 02244 02245 ped->ichStartMinSel = ped->ichStartMaxSel = 0; 02246 02247 InitDragSelect: 02248 ped->fMouseDown = FALSE; 02249 NtUserSetCapture(ped->hwnd); 02250 ped->fMouseDown = TRUE; 02251 changeSelection = TRUE; 02252 } 02253 break; 02254 02255 case WM_LBUTTONUP: 02256 if (ped->fMouseDown) { 02257 ped->fMouseDown = FALSE; 02258 NtUserReleaseCapture(); 02259 } 02260 break; 02261 } 02262 02263 if (changeSelection) { 02264 SLScrollText(ped,hdc); 02265 SLChangeSelection(ped, hdc, newMinSel, newMaxSel); 02266 } 02267 02268 ECReleaseEditDC(ped, hdc, FALSE); 02269 }

ICH SLMouseToIch PED  ,
HDC  ,
LPPOINT 
 

Definition at line 1934 of file editsl.c.

References tagED::cbChar, tagED::cch, tagED::charPasswordChar, tagED::cPasswordCharWidth, DWORD, ECAdjustIch(), ECCchInWidth(), ECIsDBCSLeadByte(), ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditMouseToIch, tagED::fAnsi, tagED::fDBCS, FnGetTextExtentPoint, tagED::format, ICH, tagED::ichScreenStart, min, tagED::pLpkEditCallout, tagED::rcFmt, SLCalcXOffsetSpecial(), and TRUE.

Referenced by SLEditWndProc(), and SLMouseMotion().

01938 { 01939 PSTR pText; 01940 int width = mousePt->x; 01941 int lastHighWidth, lastLowWidth; 01942 SIZE size; 01943 ICH cch; 01944 ICH cchLo, cchHi; 01945 LPSTR lpText; 01946 FnGetTextExtentPoint pGetTextExtentPoint; 01947 01948 if (ped->pLpkEditCallout) { 01949 pText = ECLock(ped); 01950 cch = ped->pLpkEditCallout->EditMouseToIch(ped, hdc, pText, ped->cch, width); 01951 ECUnlock(ped); 01952 return cch; 01953 } 01954 01955 if (width <= ped->rcFmt.left) { 01956 01957 /* 01958 * Return either the first non visible character or return 0 if at 01959 * beginning of text 01960 */ 01961 if (ped->ichScreenStart) 01962 return (ped->ichScreenStart - 1); 01963 else 01964 return (0); 01965 } 01966 01967 if (width > ped->rcFmt.right) { 01968 pText = ECLock(ped); 01969 01970 /* 01971 * Return last char in text or one plus the last char visible 01972 */ 01973 cch = ECCchInWidth(ped, hdc, 01974 (LPSTR)(pText + ped->ichScreenStart * ped->cbChar), 01975 ped->cch - ped->ichScreenStart, ped->rcFmt.right - 01976 ped->rcFmt.left, TRUE) + ped->ichScreenStart; 01977 01978 // 01979 // This is marked as JAPAN in Win31J. But it should be a DBCS 01980 // issue. LiZ -- 5/5/93 01981 // We must check DBCS Lead byte. Because ECAdjustIch() pick up Prev Char. 01982 // 1993.3.9 by yutakas 01983 // 01984 if (ped->fAnsi && ped->fDBCS) { 01985 if (cch >= ped->cch) { 01986 cch = ped->cch; 01987 } else { 01988 if (ECIsDBCSLeadByte(ped,*(pText+cch))) { 01989 cch += 2; 01990 } else { 01991 cch ++; 01992 } 01993 } 01994 ECUnlock(ped); 01995 return cch; 01996 } else { 01997 ECUnlock(ped); 01998 if (cch >= ped->cch) 01999 return (ped->cch); 02000 else 02001 return (cch + 1); 02002 } 02003 } 02004 02005 if (ped->format != ES_LEFT) { 02006 width -= SLCalcXOffsetSpecial(ped, hdc, ped->ichScreenStart); 02007 } 02008 02009 /* 02010 * Check if password hidden chars are being used. 02011 */ 02012 if (ped->charPasswordChar) 02013 return min( (DWORD)( (width - ped->rcFmt.left) / ped->cPasswordCharWidth), 02014 ped->cch); 02015 02016 if (!ped->cch) 02017 return (0); 02018 02019 pText = ECLock(ped); 02020 lpText = pText + ped->ichScreenStart * ped->cbChar; 02021 02022 pGetTextExtentPoint = ped->fAnsi ? (FnGetTextExtentPoint)GetTextExtentPointA 02023 : (FnGetTextExtentPoint)GetTextExtentPointW; 02024 width -= ped->rcFmt.left; 02025 02026 /* 02027 * If the user clicked past the end of the text, return the last character 02028 */ 02029 cchHi = ped->cch - ped->ichScreenStart; 02030 pGetTextExtentPoint(hdc, lpText, cchHi, &size); 02031 if (size.cx <= width) { 02032 cch = cchHi; 02033 goto edAdjust; 02034 } 02035 /* 02036 * Initialize Binary Search Bounds 02037 */ 02038 cchLo = 0; 02039 cchHi ++; 02040 lastLowWidth = 0; 02041 lastHighWidth = size.cx; 02042 02043 /* 02044 * Binary search for closest char 02045 */ 02046 while (cchLo < cchHi - 1) { 02047 02048 cch = (cchHi + cchLo) / 2; 02049 pGetTextExtentPoint(hdc, lpText, cch, &size); 02050 02051 if (size.cx <= width) { 02052 cchLo = cch; 02053 lastLowWidth = size.cx; 02054 } else { 02055 cchHi = cch; 02056 lastHighWidth = size.cx; 02057 } 02058 } 02059 02060 /* 02061 * When the while ends, you can't know the exact position. 02062 * Try to see if the mouse pointer was on the farest half 02063 * of the char we got and if so, adjust cch. 02064 */ 02065 if (cchLo == cch) { 02066 /* 02067 * Need to compare with lastHighWidth 02068 */ 02069 if ((lastHighWidth - width) < (width - size.cx)) { 02070 cch++; 02071 } 02072 } else { 02073 /* 02074 * Need to compare with lastLowWidth 02075 */ 02076 if ((width - lastLowWidth) < (size.cx - width)) { 02077 cch--; 02078 } 02079 } 02080 02081 edAdjust: 02082 // 02083 // Avoid to point the intermediate of double byte character 02084 // 02085 cch = ECAdjustIch( ped, pText, cch + ped->ichScreenStart ); 02086 ECUnlock(ped); 02087 return ( cch ); 02088 }

void SLPaint PED  ,
HDC 
 

Definition at line 2280 of file editsl.c.

References _GetClientRect(), _IsWindowVisible(), DF_WINDOWFRAME, DrawFrame(), ECGetBrush(), tagED::fFlatBorder, FillRect(), tagED::hFont, tagED::hwnd, NtUserHideCaret(), NtUserShowCaret(), NULL, tagED::pwnd, and SLDrawText().

Referenced by SLEditWndProc().

02283 { 02284 HWND hwnd = ped->hwnd; 02285 HBRUSH hBrushRemote; 02286 RECT rcEdit; 02287 HANDLE hOldFont; 02288 02289 /* 02290 * Had to put in hide/show carets. The first one needs to be done before 02291 * beginpaint to correctly paint the caret if part is in the update region 02292 * and part is out. The second is for 1.03 compatibility. It breaks 02293 * micrografix's worksheet edit control if not there. 02294 */ 02295 NtUserHideCaret(hwnd); 02296 02297 if (_IsWindowVisible(ped->pwnd)) { 02298 /* 02299 * Erase the background since we don't do it in the erasebkgnd message. 02300 */ 02301 hBrushRemote = ECGetBrush(ped, hdc); 02302 _GetClientRect(ped->pwnd, (LPRECT)&rcEdit); 02303 FillRect(hdc, &rcEdit, hBrushRemote); 02304 02305 if (ped->fFlatBorder) 02306 { 02307 RECT rcT; 02308 02309 _GetClientRect(ped->pwnd, &rcT); 02310 DrawFrame(hdc, &rcT, 1, DF_WINDOWFRAME); 02311 } 02312 02313 if (ped->hFont != NULL) { 02314 /* 02315 * We have to select in the font since this may be a subclassed dc 02316 * or a begin paint dc which hasn't been initialized with out fonts 02317 * like ECGetEditDC does. 02318 */ 02319 hOldFont = SelectObject(hdc, ped->hFont); 02320 } 02321 02322 SLDrawText(ped, hdc, 0); 02323 02324 if (ped->hFont != NULL && hOldFont != NULL) { 02325 SelectObject(hdc, hOldFont); 02326 } 02327 } 02328 02329 NtUserShowCaret(hwnd); 02330 }

ICH SLPasteText PED   ) 
 

Definition at line 1157 of file editsl.c.

References tagED::fAnsi, GetClipboardData(), tagED::hwnd, ICH, NtUserCloseClipboard(), NULL, OpenClipboard(), SLInsertText(), strlen(), UINT, USERGLOBALLOCK, and USERGLOBALUNLOCK.

Referenced by SLPaste().

01159 { 01160 HANDLE hData; 01161 LPSTR lpchClip; 01162 ICH cchAdded = 0; 01163 ICH clipLength; 01164 01165 if (!OpenClipboard(ped->hwnd)) 01166 goto PasteExitNoCloseClip; 01167 01168 if (!(hData = GetClipboardData(ped->fAnsi ? CF_TEXT : CF_UNICODETEXT)) || 01169 (GlobalFlags(hData) == GMEM_INVALID_HANDLE)) { 01170 RIPMSG1(RIP_WARNING, "SLPasteText(): couldn't get a valid handle(%x)", hData); 01171 goto PasteExit; 01172 } 01173 01174 USERGLOBALLOCK(hData, lpchClip); 01175 if (lpchClip == NULL) { 01176 RIPMSG1(RIP_WARNING, "SLPasteText(): USERGLOBALLOCK(%x) failed.", hData); 01177 goto PasteExit; 01178 } 01179 01180 if (ped->fAnsi) { 01181 LPSTR lpchClip2 = lpchClip; 01182 01183 /* 01184 * Find the first carrage return or line feed. Just add text to that point. 01185 */ 01186 clipLength = (UINT)strlen(lpchClip); 01187 for (cchAdded = 0; cchAdded < clipLength; cchAdded++) 01188 if (*lpchClip2++ == 0x0D) 01189 break; 01190 01191 } else { // !fAnsi 01192 LPWSTR lpwstrClip2 = (LPWSTR)lpchClip; 01193 01194 /* 01195 * Find the first carrage return or line feed. Just add text to that point. 01196 */ 01197 clipLength = (UINT)wcslen((LPWSTR)lpchClip); 01198 for (cchAdded = 0; cchAdded < clipLength; cchAdded++) 01199 if (*lpwstrClip2++ == 0x0D) 01200 break; 01201 } 01202 01203 /* 01204 * Insert the text (SLInsertText checks line length) 01205 */ 01206 cchAdded = SLInsertText(ped, lpchClip, cchAdded); 01207 01208 USERGLOBALUNLOCK(hData); 01209 01210 PasteExit: 01211 NtUserCloseClipboard(); 01212 01213 PasteExitNoCloseClip: 01214 return (cchAdded); 01215 }

void SLReplaceSel PED  ,
LPSTR 
 

Definition at line 1225 of file editsl.c.

References _IsWindowVisible(), BOOL, ECDeleteText(), ECEmptyUndo(), ECGetEditDC(), ECNotifyParent(), ECReleaseEditDC(), ECSaveUndo(), FALSE, tagED::fAnsi, FWINABLE, tagED::hwnd, IsWindow(), NotifyWinEvent(), Pundo, tagED::pwnd, SLDrawText(), SLInsertText(), SLScrollText(), SLUndo(), strlen(), and UINT.

Referenced by ECResultStrHandler(), and SLEditWndProc().

01228 { 01229 UINT cchText; 01230 01231 // 01232 // Delete text, putting it into the clean undo buffer. 01233 // 01234 ECEmptyUndo(Pundo(ped)); 01235 ECDeleteText(ped); 01236 01237 // 01238 // B#3356 01239 // Some apps do "clear" by selecting all of the text, then replacing it 01240 // with "", in which case SLInsertText() will return 0. But that 01241 // doesn't mean failure... 01242 // 01243 if ( ped->fAnsi ) 01244 cchText = strlen(lpText); 01245 else 01246 cchText = wcslen((LPWSTR)lpText); 01247 01248 if (cchText) { 01249 BOOL fFailed; 01250 UNDO undo; 01251 HWND hwndSave; 01252 01253 // 01254 // Save undo buffer, but DO NOT CLEAR IT! 01255 // 01256 ECSaveUndo(Pundo(ped), &undo, FALSE); 01257 01258 hwndSave = ped->hwnd; 01259 fFailed = (BOOL) !SLInsertText(ped, lpText, cchText); 01260 if (!IsWindow(hwndSave)) 01261 return; 01262 01263 if (fFailed) { 01264 // 01265 // UNDO the previous edit. 01266 // 01267 ECSaveUndo(&undo, Pundo(ped), FALSE); 01268 SLUndo(ped); 01269 return; 01270 } 01271 } 01272 01273 // 01274 // Success. So update the display 01275 // 01276 ECNotifyParent(ped, EN_UPDATE); 01277 01278 if (_IsWindowVisible(ped->pwnd)) { 01279 HDC hdc; 01280 01281 hdc = ECGetEditDC(ped, FALSE); 01282 01283 if (!SLScrollText(ped, hdc)) 01284 SLDrawText(ped, hdc, 0); 01285 01286 ECReleaseEditDC(ped, hdc, FALSE); 01287 } 01288 01289 ECNotifyParent(ped, EN_CHANGE); 01290 01291 if (FWINABLE()) { 01292 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 01293 } 01294 }

BOOL SLScrollText PED  ,
HDC 
 

Definition at line 932 of file editsl.c.

References BOOL, tagED::cbChar, tagED::cch, CopyInflateRect(), ECAdjustIch(), ECAdjustIchNext(), ECCchInWidth(), ECGetBrush(), ECLock(), ECUnlock(), tagLPKEDITCALLOUT::EditHScroll, FALSE, tagED::fAnsi, tagED::fAutoHScroll, tagED::fDBCS, FillRect(), tagED::format, ICH, tagED::ichCaret, tagED::ichScreenStart, tagED::pLpkEditCallout, tagED::rcFmt, SLDrawText(), TRUE, and tagED::wLeftMargin.

Referenced by ECImeComposition(), SLChar(), SLKeyDown(), SLMouseMotion(), SLPaste(), SLReplaceSel(), and SLSetSelection().

00935 { 00936 PSTR pTextScreenStart; 00937 ICH scrollAmount; 00938 ICH newScreenStartX = ped->ichScreenStart; 00939 ICH cch; 00940 BOOLEAN fAdjustNext = FALSE; 00941 00942 if (!ped->fAutoHScroll) 00943 return (FALSE); 00944 00945 if (ped->pLpkEditCallout) { 00946 BOOL fChanged; 00947 00948 // With complex script glyph reordering, use lpk to do horz scroll 00949 pTextScreenStart = ECLock(ped); 00950 fChanged = ped->pLpkEditCallout->EditHScroll(ped, hdc, pTextScreenStart); 00951 ECUnlock(ped); 00952 00953 if (fChanged) { 00954 SLDrawText(ped, hdc, 0); 00955 } 00956 00957 return fChanged; 00958 } 00959 00960 /* 00961 * Calculate the new starting screen position 00962 */ 00963 if (ped->ichCaret <= ped->ichScreenStart) { 00964 00965 /* 00966 * Caret is to the left of the starting text on the screen we must 00967 * scroll the text backwards to bring it into view. Watch out when 00968 * subtracting unsigned numbers when we have the possibility of going 00969 * negative. 00970 */ 00971 pTextScreenStart = ECLock(ped); 00972 00973 scrollAmount = ECCchInWidth(ped, hdc, (LPSTR)pTextScreenStart, 00974 ped->ichCaret, (ped->rcFmt.right - ped->rcFmt.left) / 4, FALSE); 00975 00976 newScreenStartX = ped->ichCaret - scrollAmount; 00977 ECUnlock(ped); 00978 } else if (ped->ichCaret != ped->ichScreenStart) { 00979 pTextScreenStart = ECLock(ped); 00980 pTextScreenStart += ped->ichScreenStart * ped->cbChar; 00981 00982 cch = ECCchInWidth(ped, hdc, (LPSTR)pTextScreenStart, 00983 ped->ichCaret - ped->ichScreenStart, 00984 ped->rcFmt.right - ped->rcFmt.left, FALSE); 00985 00986 if (cch < ped->ichCaret - ped->ichScreenStart) { 00987 fAdjustNext = TRUE; 00988 00989 /* 00990 * Scroll Forward 1/4 -- if that leaves some empty space 00991 * at the end, scroll back enough to fill the space 00992 */ 00993 newScreenStartX = ped->ichCaret - (3 * cch / 4); 00994 00995 cch = ECCchInWidth(ped, hdc, (LPSTR)pTextScreenStart, 00996 ped->cch - ped->ichScreenStart, 00997 ped->rcFmt.right - ped->rcFmt.left, FALSE); 00998 00999 if (newScreenStartX > (ped->cch - cch)) 01000 newScreenStartX = ped->cch - cch; 01001 } else if (ped->format != ES_LEFT) { 01002 01003 cch = ECCchInWidth(ped, hdc, (LPSTR)pTextScreenStart, 01004 ped->cch - ped->ichScreenStart, 01005 ped->rcFmt.right - ped->rcFmt.left, FALSE); 01006 01007 /* 01008 * Scroll the text hidden behind the left border back 01009 * into view. 01010 */ 01011 if (ped->ichScreenStart == ped->cch - cch) { 01012 01013 pTextScreenStart -= ped->ichScreenStart * ped->cbChar; 01014 cch = ECCchInWidth(ped, hdc, (LPSTR)pTextScreenStart, 01015 ped->cch, ped->rcFmt.right - ped->rcFmt.left, FALSE); 01016 01017 newScreenStartX = ped->cch - cch; 01018 } 01019 } 01020 01021 ECUnlock(ped); 01022 } 01023 01024 // 01025 // Adjust newScreenStartX 01026 // 01027 if (ped->fAnsi && ped->fDBCS) { 01028 newScreenStartX = (fAdjustNext ? ECAdjustIchNext : ECAdjustIch)(ped, 01029 ECLock(ped), 01030 newScreenStartX); 01031 ECUnlock(ped); 01032 } 01033 01034 if (ped->ichScreenStart != newScreenStartX) { 01035 // Check if we have to wipe out the left margin 01036 if (ped->wLeftMargin && (ped->ichScreenStart == 0)) { 01037 RECT rc; 01038 HBRUSH hBrush; 01039 01040 hBrush = ECGetBrush(ped, hdc); 01041 01042 CopyInflateRect(&rc, &ped->rcFmt, 0, 1); 01043 rc.right = rc.left; 01044 rc.left -= ped->wLeftMargin; 01045 01046 FillRect(hdc, &rc, hBrush); 01047 } 01048 01049 ped->ichScreenStart = newScreenStartX; 01050 SLDrawText(ped, hdc, 0); 01051 01052 // Caret pos is set by SLDrawText(). 01053 return TRUE; 01054 } 01055 01056 return FALSE; 01057 }

void SLSetCaretPosition PED  ,
HDC 
 

Definition at line 126 of file editsl.c.

References tagED::aveCharWidth, tagED::cxSysCharWidth, ECImmSetCompositionWindow(), tagED::fCaretHidden, tagED::fFocus, fpImmIsIME, tagED::iCaretOffset, tagED::ichCaret, max, min, NtUserSetCaretPos, tagED::pLpkEditCallout, tagED::rcFmt, SLIchToLeftXPos(), and THREAD_HKL.

Referenced by ECSetCaretHandler(), SLChangeSelection(), SLDrawText(), SLEditWndProc(), SLSetFocus(), and SLSetSelection().

00129 { 00130 int xPosition; 00131 00132 /* 00133 * We will only position the caret if we have the focus since we don't want 00134 * to move the caret while another window could own it. 00135 */ 00136 if (!ped->fFocus) 00137 return; 00138 00139 if (ped->fCaretHidden) { 00140 NtUserSetCaretPos(-20000, -20000); 00141 return; 00142 } 00143 00144 xPosition = SLIchToLeftXPos(ped, hdc, ped->ichCaret); 00145 00146 /* 00147 * Don't let caret go out of bounds of edit control if there is too much 00148 * text. 00149 */ 00150 if (ped->pLpkEditCallout) { 00151 xPosition += ped->iCaretOffset; 00152 xPosition = max(xPosition , 0); 00153 xPosition = min(xPosition, ped->rcFmt.right - 1 - 00154 ((ped->cxSysCharWidth > ped->aveCharWidth) ? 1 : 2)); 00155 } else { 00156 xPosition = min(xPosition, ped->rcFmt.right - 00157 ((ped->cxSysCharWidth > ped->aveCharWidth) ? 1 : 2)); 00158 } 00159 00160 NtUserSetCaretPos(xPosition, ped->rcFmt.top); 00161 00162 // FE_IME SLSetCaretPosition - ECImmSetCompostionWindow( CFS_POINT ) 00163 if (fpImmIsIME(THREAD_HKL())) { 00164 ECImmSetCompositionWindow(ped, xPosition, ped->rcFmt.top); 00165 } 00166 }

void SLSetFocus PED   ) 
 

Definition at line 2341 of file editsl.c.

References ECGetCaretWidth, ECGetEditDC(), ECNotifyParent(), ECReleaseEditDC(), tagLPKEDITCALLOUT::EditCreateCaret, tagED::fFocus, tagED::fNoHideSel, tagED::hwnd, tagED::lineHeight, NtUserCreateCaret(), NtUserShowCaret(), NULL, tagED::pLpkEditCallout, SLDrawText(), SLSetCaretPosition(), and TRUE.

Referenced by SLEditWndProc().

02343 { 02344 HDC hdc; 02345 02346 if (!ped->fFocus) { 02347 02348 ped->fFocus = TRUE; /* Set focus */ 02349 02350 /* 02351 * We don't want to muck with the caret since it isn't created. 02352 */ 02353 hdc = ECGetEditDC(ped, TRUE); 02354 02355 /* 02356 * Show the current selection if necessary. 02357 */ 02358 if (!ped->fNoHideSel) 02359 SLDrawText(ped, hdc, 0); 02360 02361 /* 02362 * Create the caret 02363 */ 02364 if (ped->pLpkEditCallout) { 02365 ped->pLpkEditCallout->EditCreateCaret (ped, hdc, ECGetCaretWidth(), 02366 ped->lineHeight, 0); 02367 } 02368 else { 02369 NtUserCreateCaret(ped->hwnd, (HBITMAP)NULL, 02370 ECGetCaretWidth(), 02371 ped->lineHeight ); 02372 } 02373 SLSetCaretPosition(ped, hdc); 02374 ECReleaseEditDC(ped, hdc, TRUE); 02375 NtUserShowCaret(ped->hwnd); 02376 02377 } 02378 02379 /* 02380 * Notify parent we have the focus 02381 */ 02382 ECNotifyParent(ped, EN_SETFOCUS); 02383 }

void SLSetSelection PED  ,
ICH  ,
ICH 
 

Definition at line 283 of file editsl.c.

References ECGetEditDC(), ECReleaseEditDC(), FALSE, tagED::ichCaret, tagED::ichMaxSel, SLChangeSelection(), SLScrollText(), and SLSetCaretPosition().

Referenced by SLEditWndProc(), SLKillFocus(), and SLUndo().

00287 { 00288 HDC hdc = ECGetEditDC(ped, FALSE ); 00289 00290 if (ichSelStart == 0xFFFFFFFF) { 00291 00292 /* 00293 * Set no selection if we specify -1 00294 */ 00295 ichSelStart = ichSelEnd = ped->ichCaret; 00296 } 00297 00298 /* 00299 * Bounds ichSelStart, ichSelEnd are checked in SLChangeSelection... 00300 */ 00301 SLChangeSelection(ped, hdc, ichSelStart, ichSelEnd); 00302 00303 /* 00304 * Put the caret at the end of the selected text 00305 */ 00306 ped->ichCaret = ped->ichMaxSel; 00307 00308 SLSetCaretPosition(ped, hdc); 00309 00310 /* 00311 * We may need to scroll the text to bring the caret into view... 00312 */ 00313 SLScrollText(ped, hdc); 00314 00315 ECReleaseEditDC(ped, hdc, FALSE); 00316 }

BOOL SLUndo PED   ) 
 

Definition at line 87 of file edslrare.c.

References BOOL, ECDeleteText(), ECInvalidateClient(), ECNotifyParent(), FALSE, FChildVisible(), FWINABLE, tagED::hwnd, ICH, IsWindow(), NotifyWinEvent(), NULL, PBYTE, SLInsertText(), SLSetSelection(), TRUE, UNDO_DELETE, UNDO_INSERT, UNDO_NONE, and UserGlobalFree.

Referenced by SLEditWndProc(), and SLReplaceSel().

00089 { 00090 PBYTE hDeletedText = ped->hDeletedText; 00091 BOOL fDelete = (BOOL)(ped->undoType & UNDO_DELETE); 00092 ICH cchDeleted = ped->cchDeleted; 00093 ICH ichDeleted = ped->ichDeleted; 00094 BOOL fUpdate = FALSE; 00095 00096 if (ped->undoType == UNDO_NONE) { 00097 00098 /* 00099 * No undo... 00100 */ 00101 return FALSE; 00102 } 00103 00104 ped->hDeletedText = NULL; 00105 ped->cchDeleted = 0; 00106 ped->ichDeleted = (ICH)-1; 00107 ped->undoType &= ~UNDO_DELETE; 00108 00109 if (ped->undoType == UNDO_INSERT) { 00110 ped->undoType = UNDO_NONE; 00111 00112 /* 00113 * Set the selection to the inserted text 00114 */ 00115 SLSetSelection(ped, ped->ichInsStart, ped->ichInsEnd); 00116 ped->ichInsStart = ped->ichInsEnd = (ICH)-1; 00117 00118 #ifdef NEVER 00119 00120 /* 00121 * Now send a backspace to deleted and save it in the undo buffer... 00122 */ 00123 SLCharHandler(pped, VK_BACK); 00124 fUpdate = TRUE; 00125 #else 00126 00127 /* 00128 * Delete the selected text and save it in undo buff. 00129 * Call ECDeleteText() instead of sending a VK_BACK message 00130 * which results in an EN_UPDATE notification send even before 00131 * we insert the deleted chars. This results in Bug #6610. 00132 * Fix for Bug #6610 -- SANKAR -- 04/19/91 -- 00133 */ 00134 if (ECDeleteText(ped)) { 00135 00136 /* 00137 * Text was deleted -- flag for update and clear selection 00138 */ 00139 fUpdate = TRUE; 00140 SLSetSelection(ped, ichDeleted, ichDeleted); 00141 } 00142 #endif 00143 } 00144 00145 if (fDelete) { 00146 HWND hwndSave = ped->hwnd; // Used for validation. 00147 00148 /* 00149 * Insert deleted chars. Set the selection to the inserted text. 00150 */ 00151 SLSetSelection(ped, ichDeleted, ichDeleted); 00152 SLInsertText(ped, hDeletedText, cchDeleted); 00153 UserGlobalFree(hDeletedText); 00154 if (!IsWindow(hwndSave)) 00155 return FALSE; 00156 SLSetSelection(ped, ichDeleted, ichDeleted + cchDeleted); 00157 fUpdate = TRUE; 00158 } 00159 00160 if (fUpdate) { 00161 /* 00162 * If we have something to update, send EN_UPDATE before and 00163 * EN_CHANGE after the actual update. 00164 * A part of the fix for Bug #6610 -- SANKAR -- 04/19/91 -- 00165 */ 00166 ECNotifyParent(ped, EN_UPDATE); 00167 00168 if (FChildVisible(ped->hwnd)) { 00169 // JimA changed this to ECInvalidateClient(ped, FALSE) Nov 1994 00170 // GetClientRect(ped->hwnd, &rcEdit); 00171 // if (ped->fBorder && rcEdit.right - rcEdit.left && rcEdit.bottom - rcEdit.top) { 00172 // 00173 // /* 00174 // * Don't invalidate the border so that we avoid flicker 00175 // */ 00176 // InflateRect(&rcEdit, -1, -1); 00177 // } 00178 // NtUserInvalidateRect(ped->hwnd, &rcEdit, FALSE); 00179 ECInvalidateClient(ped, FALSE); 00180 } 00181 00182 ECNotifyParent(ped, EN_CHANGE); 00183 00184 if (FWINABLE()) { 00185 NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, ped->hwnd, OBJID_CLIENT, INDEXID_CONTAINER); 00186 } 00187 } 00188 00189 return TRUE; 00190 }

int SmartStretchDIBits HDC  hdc,
int  xD,
int  yD,
int  dxD,
int  dyD,
int  xS,
int  yS,
int  dxS,
int  dyS,
LPVOID  lpBits,
LPBITMAPINFO  lpbi,
UINT  wUsage,
DWORD  rop
 

Definition at line 84 of file cldib.c.

References LPVOID, NULL, ScaleDIB(), UINT, UserLocalAlloc, and UserLocalFree.

Referenced by BitmapFromDIB().

00098 { 00099 LPBYTE lpBitsNew; 00100 UINT bpp; 00101 RGBQUAD rgb; 00102 LPBITMAPINFOHEADER lpbiNew = NULL; 00103 00104 int i; 00105 00106 /* 00107 * thunk to USER32 00108 */ 00109 UserAssert(rop == SRCCOPY); 00110 UserAssert(wUsage == DIB_RGB_COLORS); 00111 UserAssert(xS == 0 && yS == 0); 00112 00113 if ((GetDIBColorTable(hdc, 0, 1, &rgb) != 1) && 00114 (dxD != dxS || dyD != dyS) && // 1:1 stretch just call GDI 00115 (dxD >= dxS/2) && (dyD >= dyS/2) && // less than 1:2 shrink call GDI 00116 (lpbi->bmiHeader.biCompression == 0) && // must be un-compressed 00117 (lpbi->bmiHeader.biBitCount == 4 || // input must be 4,8,24 00118 lpbi->bmiHeader.biBitCount == 8 || 00119 lpbi->bmiHeader.biBitCount == 24)) { 00120 00121 bpp = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES); 00122 00123 bpp = (bpp > 8 ? 24 : 8); 00124 00125 lpbiNew = (LPBITMAPINFOHEADER)UserLocalAlloc(0, 00126 sizeof(BITMAPINFOHEADER) + (256 * sizeof(RGBQUAD)) + 00127 (UINT)((((dxD * bpp) / 8) + 3) & ~3) * (UINT)dyD); 00128 00129 if (lpbiNew) { 00130 00131 *lpbiNew = lpbi->bmiHeader; 00132 lpbiNew->biWidth = dxD; 00133 lpbiNew->biHeight = dyD; 00134 lpbiNew->biBitCount = (WORD)bpp; 00135 lpBitsNew = (LPBYTE)lpbiNew + 00136 sizeof(BITMAPINFOHEADER) + 00137 (256 * sizeof(RGBQUAD)); 00138 00139 if (ScaleDIB((LPBITMAPINFOHEADER)lpbi, 00140 (LPVOID)lpBits, 00141 lpbiNew, 00142 lpBitsNew)) { 00143 00144 lpbi = (LPBITMAPINFO)lpbiNew; 00145 lpBits = lpBitsNew; 00146 dxS = dxD; 00147 dyS = dyD; 00148 } 00149 } 00150 } 00151 00152 i = StretchDIBits(hdc, 00153 xD, 00154 yD, 00155 dxD, 00156 dyD, 00157 xS, 00158 yS, 00159 dxS, 00160 dyS, 00161 lpBits, 00162 lpbi, 00163 wUsage, 00164 rop); 00165 00166 if (lpbiNew) 00167 UserLocalFree(lpbiNew); 00168 00169 return i; 00170 }

LRESULT APIENTRY StaticWndProcA HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1173 of file statctl.c.

References L, NULL, StaticWndProcWorker(), TRUE, and ValidateHwnd.

Referenced by ClientThreadSetup().

01178 { 01179 PWND pwnd; 01180 01181 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01182 return (0L); 01183 } 01184 01185 return StaticWndProcWorker(pwnd, message, wParam, lParam, TRUE); 01186 }

LRESULT APIENTRY StaticWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1188 of file statctl.c.

References FALSE, L, NULL, StaticWndProcWorker(), and ValidateHwnd.

Referenced by ClientThreadSetup(), and RW_RegisterControls().

01193 { 01194 PWND pwnd; 01195 01196 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 01197 return (0L); 01198 } 01199 01200 return StaticWndProcWorker(pwnd, message, wParam, lParam, FALSE); 01201 }

LRESULT StaticWndProcWorker PWND  pwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DWORD  fAnsi
 

Definition at line 840 of file statctl.c.

References _DefSetText(), _GetClientRect(), APIENTRY, tagCLS::atomClassName, tagSERVERINFO::atomSysClass, BOOL, BYTE, CHAR, CheckLock, tagSTAT::cicur, CURSOR_CALLFROMCLIENT, DefWindowProcWorker(), FALSE, tagSTAT::fDeleteIt, FNID_CLEANEDUP_BIT, FNID_STATIC, tagSTAT::fPaintKbdCuesOnly, FreeLookasideEntry(), FWINDOWMSG, gpsi, tagSTAT::hFont, tagSTAT::hImage, HWq, ICLS_DIALOG, IDSYS_STANIMATE, IMAGE_STMMAX, INITCONTROLLOOKASIDE, IS_IME_ENABLED, IS_MIDEAST_ENABLED, IsValidImage, IsVisible(), L, LOBYTE, MBToWCSEx(), NtUserAlterWindowStyle(), NtUserBeginPaint(), NtUserDestroyCursor(), NtUserEndPaint(), NtUserInvalidateRect(), NtUserKillTimer(), NtUserSetWindowFNID(), NtUserSetWindowPos(), NULL, REBASEALWAYS, rgstk, SendMessageWorker(), SetWindowState(), SFNOTIFY, SFSUNKEN, SFTYPEMASK, tagSTAT::spwnd, tagWND::spwndParent, STAT, StaticLookaside, StaticNotifyParent(), StaticRepaint(), STK_IMAGE, STK_TYPE, STK_USEFONT, STK_USETEXT, SYSMET, TestWF, TestwndChild, TRUE, Unlock, UpdateWindow(), VALIDATECLASSANDSIZE, WEFRIGHT, WEFSTATICEDGE, WFVISIBLE, xxxNextAniIconStep(), xxxSetStaticImage(), xxxStaticLoadImage(), and xxxStaticPaint().

Referenced by ClientThreadSetup(), StaticWndProcA(), and StaticWndProcW().

00846 { 00847 HWND hwnd = HWq(pwnd); 00848 BYTE bType; 00849 PSTAT pstat; 00850 static BOOL fInit = TRUE; 00851 00852 CheckLock(pwnd); 00853 00854 VALIDATECLASSANDSIZE(pwnd, FNID_STATIC); 00855 INITCONTROLLOOKASIDE(&StaticLookaside, STAT, spwnd, 8); 00856 00857 /* 00858 * If the control is not interested in this message, 00859 * pass it to DefWindowProc. 00860 */ 00861 if (!FWINDOWMSG(message, FNID_STATIC)) 00862 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 00863 00864 /* 00865 * Get the pstat for the given window now since we will use it a lot in 00866 * various handlers. This was stored using SetWindowLong(hwnd,0,pstat) when 00867 * we initially created the static control. 00868 */ 00869 pstat = ((PSTATWND)pwnd)->pstat; 00870 00871 /* 00872 * Get the control's type 00873 */ 00874 bType = TestWF(pwnd, SFTYPEMASK); 00875 00876 switch (message) { 00877 case STM_GETICON: 00878 wParam = IMAGE_ICON; 00879 00880 case STM_GETIMAGE: 00881 if (IsValidImage(wParam, bType, IMAGE_STMMAX)) { 00882 return (LRESULT)pstat->hImage; 00883 } 00884 break; 00885 00886 case STM_SETICON: 00887 lParam = (LPARAM)wParam; 00888 wParam = IMAGE_ICON; 00889 00890 case STM_SETIMAGE: 00891 if (IsValidImage(wParam, bType, IMAGE_STMMAX)) { 00892 return (LRESULT)xxxSetStaticImage(pstat, (HANDLE)lParam, FALSE); 00893 } 00894 break; 00895 00896 case WM_ERASEBKGND: 00897 00898 /* 00899 * The control will be erased in xxxStaticPaint(). 00900 */ 00901 return TRUE; 00902 00903 case WM_PRINTCLIENT: 00904 xxxStaticPaint(pstat, (HDC)wParam, FALSE); 00905 break; 00906 00907 case WM_PAINT: 00908 { 00909 HDC hdc; 00910 PAINTSTRUCT ps; 00911 00912 if ((hdc = (HDC)wParam) == NULL) { 00913 hdc = NtUserBeginPaint(hwnd, &ps); 00914 } 00915 00916 if (IsVisible(pwnd)) { 00917 xxxStaticPaint(pstat, hdc, !wParam); 00918 } 00919 00920 /* 00921 * If hwnd was destroyed, BeginPaint was automatically undone. 00922 */ 00923 if (!wParam) { 00924 NtUserEndPaint(hwnd, &ps); 00925 } 00926 } 00927 break; 00928 00929 case WM_CREATE: 00930 00931 if ((rgstk[bType] & STK_TYPE) == STK_IMAGE) { 00932 /* 00933 * Pull the name from LPCREATESTRUCT like Win95 does 00934 */ 00935 LPWSTR lpszName; 00936 LPSTR lpszAnsiName; 00937 struct { 00938 WORD tag; 00939 BYTE ordLo; 00940 BYTE ordHi; 00941 } dwUnicodeOrdinal; 00942 00943 if (fAnsi) { 00944 /* 00945 * Convert the ANSI string to unicode if it exists 00946 */ 00947 lpszAnsiName = (LPSTR)((LPCREATESTRUCT)lParam)->lpszName; 00948 if (lpszAnsiName) { 00949 if (lpszAnsiName[0] == (CHAR)0xff) { 00950 /* 00951 * Convert ANSI ordinal to UNICODE ordinal 00952 */ 00953 dwUnicodeOrdinal.tag = 0xFFFF; 00954 dwUnicodeOrdinal.ordLo = lpszAnsiName[1]; 00955 dwUnicodeOrdinal.ordHi = lpszAnsiName[2]; 00956 lpszName = (LPWSTR)&dwUnicodeOrdinal; 00957 } else { 00958 MBToWCSEx(0, lpszAnsiName, -1, &lpszName, -1, TRUE); 00959 } 00960 } else { 00961 lpszName = NULL; 00962 } 00963 } else { 00964 lpszName = (LPWSTR)(((LPCREATESTRUCT)lParam)->lpszName); 00965 } 00966 00967 /* 00968 * Load the image 00969 */ 00970 xxxStaticLoadImage(pstat, lpszName); 00971 00972 if (fAnsi && 00973 lpszName && 00974 lpszName != (LPWSTR)&dwUnicodeOrdinal) { 00975 /* 00976 * Free the converted ANSI string 00977 */ 00978 LocalFree(lpszName); 00979 } 00980 } else if (bType == SS_ETCHEDHORZ || bType == SS_ETCHEDVERT) { 00981 00982 /* 00983 * Resize static window to fit edge. Horizontal dudes 00984 * make bottom one edge from top, vertical dudes make 00985 * right edge one edge from left. 00986 */ 00987 00988 RECT rcClient; 00989 00990 _GetClientRect(pwnd, &rcClient); 00991 if (bType == SS_ETCHEDHORZ) 00992 rcClient.bottom = SYSMET(CYEDGE); 00993 else 00994 rcClient.right = SYSMET(CXEDGE); 00995 00996 NtUserSetWindowPos(hwnd, HWND_TOP, 0, 0, rcClient.right, 00997 rcClient.bottom, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); 00998 } 00999 break; 01000 01001 case WM_DESTROY: 01002 if (((rgstk[bType] & STK_TYPE) == STK_IMAGE) && 01003 (pstat->hImage != NULL) && 01004 (pstat->fDeleteIt)) { 01005 01006 if (bType == SS_BITMAP) { 01007 DeleteObject(pstat->hImage); 01008 } else if (bType == SS_ICON) { 01009 if (pstat->cicur > 1) { 01010 /* 01011 * Kill the animated cursor timer 01012 */ 01013 NtUserKillTimer(hwnd, IDSYS_STANIMATE); 01014 } 01015 NtUserDestroyCursor((HCURSOR)(pstat->hImage), CURSOR_CALLFROMCLIENT); 01016 } 01017 } 01018 break; 01019 01020 case WM_NCCREATE: 01021 if (TestWF(pwnd,WEFRIGHT)) { 01022 NtUserAlterWindowStyle(hwnd, SS_TYPEMASK, SS_RIGHT); 01023 } 01024 01025 if (TestWF(pwnd, SFSUNKEN) || 01026 ((bType == LOBYTE(SS_ETCHEDHORZ)) || (bType == LOBYTE(SS_ETCHEDVERT)))) { 01027 SetWindowState(pwnd, WEFSTATICEDGE); 01028 } 01029 goto CallDWP; 01030 01031 case WM_NCDESTROY: 01032 case WM_FINALDESTROY: 01033 if (pstat) { 01034 Unlock(&pstat->spwnd); 01035 FreeLookasideEntry(&StaticLookaside, pstat); 01036 } 01037 NtUserSetWindowFNID(hwnd, FNID_CLEANEDUP_BIT); 01038 break; 01039 01040 case WM_NCHITTEST: 01041 return (TestWF(pwnd, SFNOTIFY) ? HTCLIENT : HTTRANSPARENT); 01042 01043 case WM_LBUTTONDOWN: 01044 case WM_NCLBUTTONDOWN: 01045 if (TestWF(pwnd, SFNOTIFY)) { 01046 01047 /* 01048 * It is acceptable for an app to destroy a static label 01049 * in response to a STN_CLICKED notification. 01050 */ 01051 StaticNotifyParent(pwnd, NULL, STN_CLICKED); 01052 } 01053 break; 01054 01055 case WM_LBUTTONDBLCLK: 01056 case WM_NCLBUTTONDBLCLK: 01057 if (TestWF(pwnd, SFNOTIFY)) { 01058 01059 /* 01060 * It is acceptable for an app to destroy a static label in 01061 * response to a STN_DBLCLK notification. 01062 */ 01063 StaticNotifyParent(pwnd, NULL, STN_DBLCLK); 01064 } 01065 break; 01066 01067 case WM_SETTEXT: 01068 /* 01069 * No more hack to set icon/bitmap via WM_SETTEXT! 01070 */ 01071 if (rgstk[bType] & STK_USETEXT) { 01072 if (_DefSetText(hwnd, (LPWSTR)lParam, fAnsi)) { 01073 StaticRepaint(pstat); 01074 return TRUE; 01075 } 01076 } 01077 break; 01078 01079 case WM_ENABLE: 01080 StaticRepaint(pstat); 01081 if (TestWF(pwnd, SFNOTIFY)) { 01082 StaticNotifyParent(pwnd, NULL, (wParam ? STN_ENABLE : STN_DISABLE)); 01083 } 01084 break; 01085 01086 case WM_GETDLGCODE: 01087 return (LONG)DLGC_STATIC; 01088 01089 case WM_SETFONT: 01090 01091 /* 01092 * wParam - handle to the font 01093 * lParam - if true, redraw else don't 01094 */ 01095 if (rgstk[bType] & STK_USEFONT) { 01096 01097 pstat->hFont = (HANDLE)wParam; 01098 01099 if (lParam && TestWF(pwnd, WFVISIBLE)) { 01100 NtUserInvalidateRect(hwnd, NULL, TRUE); 01101 UpdateWindow(hwnd); 01102 } 01103 } 01104 break; 01105 01106 case WM_GETFONT: 01107 if (rgstk[bType] & STK_USEFONT) { 01108 return (LRESULT)pstat->hFont; 01109 } 01110 break; 01111 01112 case WM_TIMER: 01113 if (wParam == IDSYS_STANIMATE) { 01114 xxxNextAniIconStep(pstat); 01115 } 01116 break; 01117 01118 /* 01119 * case WM_GETTEXT: 01120 * No more hack to get icon/bitmap via WM_GETTEXT! 01121 */ 01122 01123 case WM_INPUTLANGCHANGEREQUEST: 01124 if (IS_IME_ENABLED() || IS_MIDEAST_ENABLED()) { 01125 /* 01126 * #115190 01127 * If the window is one of controls on top of dialogbox, 01128 * let the parent dialog handle it. 01129 */ 01130 if (TestwndChild(pwnd) && pwnd->spwndParent) { 01131 PWND pwndParent = REBASEALWAYS(pwnd, spwndParent); 01132 if (pwndParent) { 01133 PCLS pclsParent = REBASEALWAYS(pwndParent, pcls); 01134 01135 UserAssert(pclsParent != NULL); 01136 if (pclsParent->atomClassName == gpsi->atomSysClass[ICLS_DIALOG]) { 01137 return SendMessageWorker(pwndParent, message, wParam, lParam, FALSE); 01138 } 01139 } 01140 } 01141 } 01142 goto CallDWP; 01143 01144 case WM_UPDATEUISTATE: 01145 { 01146 /* 01147 * DWP will change the UIState bits accordingly 01148 */ 01149 DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 01150 01151 if (HIWORD(wParam) & UISF_HIDEACCEL) { 01152 /* 01153 * Change in AccelHidden state: need to repaint 01154 */ 01155 if (ISSSTEXTOROD(bType)) { 01156 pstat->fPaintKbdCuesOnly = TRUE; 01157 StaticRepaint(pstat); 01158 pstat->fPaintKbdCuesOnly = FALSE; 01159 } 01160 } 01161 } 01162 break; 01163 01164 default: 01165 CallDWP: 01166 return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi); 01167 } 01168 01169 return 0L; 01170 }

BOOL SyncSoftKbdState HIMC  hImc,
LPARAM  lParam
 

Definition at line 1448 of file imectl.c.

References BOOL, DWORD, fpImmGetConversionStatus, fpImmSetConversionStatus, and TRUE.

Referenced by ECDoIMEMenuCommand(), and ImeSystemHandler().

01451 { 01452 DWORD fdwConversion, fdwSentence, fdwNewConversion; 01453 01454 fpImmGetConversionStatus(hImc, &fdwConversion, &fdwSentence); 01455 01456 if (lParam) { 01457 fdwNewConversion = fdwConversion | IME_CMODE_SOFTKBD; 01458 } else { 01459 fdwNewConversion = fdwConversion & ~IME_CMODE_SOFTKBD; 01460 } 01461 01462 if (fdwNewConversion != fdwConversion) { 01463 fpImmSetConversionStatus(hImc, fdwNewConversion, fdwSentence); 01464 } 01465 01466 return TRUE; 01467 }

LONG TabTextOut HDC  hdc,
int  x,
int  y,
LPCWSTR  lpstring,
int  nCount,
int  nTabPositions,
CONST INT lpTabPositions,
int  iTabOrigin,
BOOL  fDrawTheText,
int  iCharset
 

Definition at line 212 of file client/drawtext.c.

References gpsi, IsSysFontAndDefaultMode(), and NULL.

Referenced by GetTabbedTextExtentA(), GetTabbedTextExtentW(), LBPrintCallback(), TabbedTextOutA(), and TabbedTextOutW().

00223 { 00224 int cxCharWidth; 00225 int cyCharHeight = 0; 00226 00227 if (nCount == -1 && lpstring) { 00228 nCount = wcslen(lpstring); 00229 } 00230 if (!lpstring || nCount < 0 || nTabPositions < 0) 00231 return 0; 00232 00233 00234 // Check if it is SysFont AND the mapping mode is MM_TEXT; 00235 // Fix made in connection with Bug #8717 --02-01-90 --SANKAR-- 00236 if (IsSysFontAndDefaultMode(hdc)) 00237 { 00238 cxCharWidth = gpsi->cxSysFontChar; 00239 cyCharHeight = gpsi->cySysFontChar; 00240 } else { 00241 cxCharWidth = GdiGetCharDimensions(hdc, NULL, &cyCharHeight); 00242 if (cxCharWidth == 0) { 00243 RIPMSG0(RIP_WARNING, "TabTextOut: GdiGetCharDimensions failed"); 00244 return 0; 00245 } 00246 } 00247 00248 return (*fpLpkTabbedTextOut)(hdc, x, y, lpstring, nCount, nTabPositions, 00249 lpTabPositions, iTabOrigin, fDrawTheText, 00250 cxCharWidth, cyCharHeight, iCharset); 00251 }

VOID TellWOWThehDlg HWND  hDlg  ) 
 

Definition at line 2801 of file client.c.

References NULL, pfnWOWTellWOWThehDlg, and VOID().

Referenced by InternalCreateDialog().

02803 { 02804 UserAssert(pfnWOWTellWOWThehDlg != NULL); 02805 02806 (*pfnWOWTellWOWThehDlg)(hDlg); 02807 }

BOOL ThunkedMenuItemInfo HMENU  hMenu,
UINT  nPosition,
BOOL  fByPosition,
BOOL  fInsert,
LPMENUITEMINFOW  lpmii,
BOOL  fAnsi
 

Definition at line 377 of file client/ntstubs.c.

References BEGINCALL, BOOL, CLEANUPLPSTRW, DWORD, ENDCALL, ERRORTRAP, _IN_STRING::fAllocated, FALSE, FIRSTCOPYLPSTROPTW, FIRSTCOPYLPWSTROPT, IS_PTR, NtUserThunkedMenuItemInfo(), NULL, and _IN_STRING::pstr.

Referenced by AppendMenu(), InsertMenu(), InsertMenuItem(), InternalInsertMenuItem(), ModifyMenu(), ModifyMenuItem(), and SetMenuItemInfo().

00384 { 00385 MENUITEMINFOW mii; 00386 IN_STRING strItem; 00387 00388 /* 00389 * Make sure cleanup will work successfully 00390 */ 00391 strItem.fAllocated = FALSE; 00392 00393 BEGINCALL() 00394 00395 /* 00396 * Make a local copy so we can make changes 00397 */ 00398 mii = *(LPMENUITEMINFO)(lpmii); 00399 00400 strItem.pstr = NULL; 00401 if (mii.fMask & MIIM_BITMAP) { 00402 if (((HBITMAP)LOWORD(HandleToUlong(mii.hbmpItem)) < HBMMENU_MAX) && IS_PTR(mii.hbmpItem)) { 00403 /* 00404 * Looks like the user was trying to insert one of the 00405 * HBMMENU_* bitmaps, but stuffed some data in the HIWORD. 00406 * We know the HIWORD data is invalid because the LOWORD 00407 * handle is below the GDI minimum. 00408 */ 00409 RIPMSG1(RIP_WARNING, "Invalid HIWORD data (0x%04X) for HBMMENU_* bitmap.", HIWORD(HandleToUlong(mii.hbmpItem))); 00410 mii.hbmpItem = (HBITMAP)LOWORD(HandleToUlong(mii.hbmpItem)); 00411 } else if (!IS_PTR(mii.hbmpItem) && (mii.hbmpItem >= HBMMENU_MAX)) { 00412 /* 00413 * The app is passing a 16-bit GDI handle. GDI handles this on the 00414 * client-side, but not on the kernel side. So convert it to 32-bits. 00415 * This fixes bug 201493 in Macromedia Director. 00416 */ 00417 HBITMAP hbmNew = GdiFixUpHandle(mii.hbmpItem); 00418 if (hbmNew) { 00419 RIPMSG2(RIP_WARNING, "Menu bitmap change, fix 16-bit bitmap handle %lx to %lx\n", mii.hbmpItem, hbmNew); 00420 mii.hbmpItem = hbmNew; 00421 } 00422 } 00423 } 00424 00425 if (mii.fMask & MIIM_STRING){ 00426 if (fAnsi) { 00427 FIRSTCOPYLPSTROPTW(&strItem, mii.dwTypeData); 00428 } else { 00429 FIRSTCOPYLPWSTROPT(&strItem, mii.dwTypeData); 00430 } 00431 } 00432 00433 retval = (DWORD)NtUserThunkedMenuItemInfo( 00434 hMenu, 00435 nPosition, 00436 fByPosition, 00437 fInsert, 00438 &mii, 00439 strItem.pstr); 00440 00441 ERRORTRAP(FALSE); 00442 CLEANUPLPSTRW(strItem); 00443 ENDCALL(BOOL); 00444 }

DWORD UserGetCodePage HDC  hdc  ) 
 

BOOL UserIsFELineBreak DWORD  dwCodePage,
WCHAR  wChar
 

BOOL UserIsFullWidth DWORD  dwCodePage,
WCHAR  wChar
 

Definition at line 535 of file rtl/drawtext.c.

References BOOL, CHAR, _FULLWIDTH_UNICODE::End, FALSE, FullWidthUnicodes, INT, NULL, NUM_FULLWIDTH_UNICODES, _FULLWIDTH_UNICODE::Start, TRUE, and UINT.

Referenced by ECWord(), GetNextWordbreak(), and MLBuildchLines().

00536 { 00537 INT index; 00538 INT cChars; 00539 #ifdef _USERK_ 00540 CHAR aChars[2]; 00541 #endif // _USERK_ 00542 00543 // 00544 // Early out for ASCII. 00545 // 00546 if (wChar < 0x0080) { 00547 // 00548 // if the character < 0x0080, it should be a halfwidth character. 00549 // 00550 return (FALSE); 00551 } 00552 // 00553 // Scan FullWdith definition table... most of FullWidth character is 00554 // defined here... this is more faster than call NLS API. 00555 // 00556 for (index = 0; index < NUM_FULLWIDTH_UNICODES; index++) { 00557 if ((wChar >= FullWidthUnicodes[index].Start) && 00558 (wChar <= FullWidthUnicodes[index].End) ) { 00559 return (TRUE); 00560 } 00561 } 00562 // 00563 // if this Unicode character is mapped to Double-Byte character, 00564 // this is also FullWidth character.. 00565 // 00566 #ifdef _USERK_ 00567 cChars = EngWideCharToMultiByte((UINT)dwCodePage,&wChar,sizeof(WCHAR),aChars,sizeof(aChars)); 00568 #else 00569 cChars = WideCharToMultiByte((UINT)dwCodePage,0,&wChar,1,NULL,0,NULL,NULL); 00570 #endif // _USERK_ 00571 00572 return(cChars > 1 ? TRUE : FALSE); 00573 }

void UserLpkPSMTextOut HDC  hdc,
int  xLeft,
int  yTop,
LPWSTR  lpsz,
int  cch,
DWORD  dwFlags
 

Definition at line 580 of file client/drawtext.c.

References dwFlags, GetPrefixCount(), NULL, SetRect(), UserLocalAlloc, and UserLocalFree.

00587 { 00588 int cx; 00589 LONG textsize, result; 00590 WCHAR achWorkBuffer[255]; 00591 WCHAR *pchOut = achWorkBuffer; 00592 TEXTMETRICW textMetric; 00593 SIZE size; 00594 RECT rc; 00595 COLORREF color; 00596 00597 if (cch > sizeof(achWorkBuffer)/sizeof(WCHAR)) { 00598 pchOut = (WCHAR*)UserLocalAlloc(HEAP_ZERO_MEMORY, (cch+1) * sizeof(WCHAR)); 00599 if (pchOut == NULL) 00600 return; 00601 } 00602 00603 result = GetPrefixCount(lpsz, cch, pchOut, cch); 00604 /* 00605 * DT_PREFIXONLY is a new 5.0 option used when switching from keyboard cues off 00606 * to on. 00607 */ 00608 if (!(dwFlags & DT_PREFIXONLY)) { 00609 TextOutW(hdc, xLeft, yTop, pchOut, cch - HIWORD(result)); 00610 } 00611 00612 /* 00613 * Any true prefix characters to underline? 00614 */ 00615 if (LOWORD(result) == 0xFFFF || dwFlags & DT_HIDEPREFIX) { 00616 if (pchOut != achWorkBuffer) 00617 UserLocalFree(pchOut); 00618 return; 00619 } 00620 00621 if (!GetTextMetricsW(hdc, &textMetric)) { 00622 textMetric.tmOverhang = 0; 00623 textMetric.tmAscent = 0; 00624 } 00625 00626 /* 00627 * For proportional fonts, find starting point of underline. 00628 */ 00629 if (LOWORD(result) != 0) { 00630 00631 /* 00632 * How far in does underline start (if not at 0th byte.). 00633 */ 00634 GetTextExtentPointW(hdc, pchOut, LOWORD(result), &size); 00635 xLeft += size.cx; 00636 00637 /* 00638 * Adjust starting point of underline if not at first char and there is 00639 * an overhang. (Italics or bold fonts.) 00640 */ 00641 xLeft = xLeft - textMetric.tmOverhang; 00642 } 00643 00644 /* 00645 * Adjust for proportional font when setting the length of the underline and 00646 * height of text. 00647 */ 00648 GetTextExtentPointW(hdc, pchOut + LOWORD(result), 1, &size); 00649 textsize = size.cx; 00650 00651 /* 00652 * Find the width of the underline character. Just subtract out the overhang 00653 * divided by two so that we look better with italic fonts. This is not 00654 * going to effect embolded fonts since their overhang is 1. 00655 */ 00656 cx = LOWORD(textsize) - textMetric.tmOverhang / 2; 00657 00658 /* 00659 * Get height of text so that underline is at bottom. 00660 */ 00661 yTop += textMetric.tmAscent + 1; 00662 00663 /* 00664 * Draw the underline using the foreground color. 00665 */ 00666 SetRect(&rc, xLeft, yTop, xLeft+cx, yTop+1); 00667 color = SetBkColor(hdc, GetTextColor(hdc)); 00668 ExtTextOutW(hdc, xLeft, yTop, ETO_OPAQUE, &rc, TEXT(""), 0, NULL); 00669 SetBkColor(hdc, color); 00670 00671 if (pchOut != achWorkBuffer) { 00672 UserLocalFree(pchOut); 00673 } 00674 }

LONG UserLpkTabbedTextOut HDC  hdc,
int  x,
int  y,
LPCWSTR  lpstring,
int  nCount,
int  nTabPositions,
CONST INT lpTabPositions,
int  iTabOrigin,
BOOL  fDrawTheText,
int  cxCharWidth,
int  cyCharHeight,
int  iCharset
 

Definition at line 253 of file client/drawtext.c.

References BOOL, FALSE, NULL, TRUE, and UINT.

00266 { 00267 SIZE textextent, viewextent, windowextent; 00268 int initialx = x; 00269 int cch; 00270 LPCWSTR lp; 00271 int iOneTab = 0; 00272 RECT rc; 00273 UINT uOpaque = (GetBkMode(hdc) == OPAQUE) ? ETO_OPAQUE : 0; 00274 BOOL fStrStart = TRUE; 00275 int ySign = 1; //Assume y increases in down direction. 00276 00277 UNREFERENCED_PARAMETER(iCharset); //Needed by lpk, but not us 00278 /* 00279 * If no tabstop positions are specified, then use a default of 8 system 00280 * font ave char widths or use the single fixed tab stop. 00281 */ 00282 if (!lpTabPositions) { 00283 // no tab stops specified -- default to a tab stop every 8 characters 00284 iOneTab = 8 * cxCharWidth; 00285 } else if (nTabPositions == 1) { 00286 // one tab stop specified -- treat value as the tab increment, one 00287 // tab stop every increment 00288 iOneTab = lpTabPositions[0]; 00289 00290 if (!iOneTab) 00291 iOneTab = 1; 00292 } 00293 00294 // Calculate if the y increases or decreases in the down direction using 00295 // the ViewPortExtent and WindowExtents. 00296 // If this call fails, hdc must be invalid 00297 if (!GetViewportExtEx(hdc, &viewextent)) 00298 return 0; 00299 GetWindowExtEx(hdc, &windowextent); 00300 if ((viewextent.cy ^ windowextent.cy) & 0x80000000) 00301 ySign = -1; 00302 00303 rc.left = initialx; 00304 rc.top = y; 00305 rc.bottom = rc.top + (ySign * cyCharHeight); 00306 00307 while (TRUE) { 00308 // count the number of characters until the next tab character 00309 // this set of characters (substring) will be the working set for 00310 // each iteration of this loop 00311 for (cch = nCount, lp = lpstring; cch && (*lp != TEXT('\t')); lp++, cch--) 00312 { 00313 } 00314 00315 // Compute the number of characters to be drawn with textout. 00316 cch = nCount - cch; 00317 00318 // Compute the number of characters remaining. 00319 nCount -= cch + 1; 00320 00321 // get height and width of substring 00322 if (cch == 0) { 00323 textextent.cx = 0; 00324 textextent.cy = cyCharHeight; 00325 } else 00326 GetTextExtentPointW(hdc, lpstring, cch, &textextent); 00327 00328 if (fStrStart) 00329 // first iteration should just spit out the first substring 00330 // no tabbing occurs until the first tab character is encountered 00331 fStrStart = FALSE; 00332 else 00333 { 00334 // not the first iteration -- tab accordingly 00335 00336 int xTab; 00337 int i; 00338 00339 if (!iOneTab) 00340 { 00341 // look thru tab stop array for next tab stop after existing 00342 // text to put this substring 00343 for (i = 0; i < nTabPositions; i++) 00344 { 00345 xTab = lpTabPositions[i]; 00346 00347 if (xTab < 0) 00348 // calc length needed to use this right justified tab 00349 xTab = (iTabOrigin - xTab) - textextent.cx; 00350 else 00351 // calc length needed to use this left justified tab 00352 xTab = iTabOrigin + xTab; 00353 00354 if (x < xTab) 00355 { 00356 // we found a tab with enough room -- let's use it 00357 x = xTab; 00358 break; 00359 } 00360 } 00361 00362 if (i == nTabPositions) 00363 // we've exhausted all of the given tab positions 00364 // go back to default of a tab stop every 8 characters 00365 iOneTab = 8 * cxCharWidth; 00366 } 00367 00368 // we have to recheck iOneTab here (instead of just saying "else") 00369 // because iOneTab will be set if we've run out of tab stops 00370 if (iOneTab) 00371 { 00372 if (iOneTab < 0) 00373 { 00374 // calc next available right justified tab stop 00375 xTab = x + textextent.cx - iTabOrigin; 00376 xTab = ((xTab / iOneTab) * iOneTab) - iOneTab - textextent.cx + iTabOrigin; 00377 } 00378 else 00379 { 00380 // calc next available left justified tab stop 00381 xTab = x - iTabOrigin; 00382 xTab = ((xTab / iOneTab) * iOneTab) + iOneTab + iTabOrigin; 00383 } 00384 x = xTab; 00385 } 00386 } 00387 00388 if (fDrawTheText) { 00389 00390 /* 00391 * Output all text up to the tab (or end of string) and get its 00392 * extent. 00393 */ 00394 rc.right = x + textextent.cx; 00395 ExtTextOutW( 00396 hdc, x, y, uOpaque, &rc, (LPWSTR)lpstring, 00397 cch, NULL); 00398 rc.left = rc.right; 00399 } 00400 00401 // Skip over the tab and the characters we just drew. 00402 x += textextent.cx; 00403 00404 // Skip over the characters we just drew. 00405 lpstring += cch; 00406 00407 // See if we have more to draw OR see if this string ends in 00408 // a tab character that needs to be drawn. 00409 if((nCount > 0) || ((nCount == 0) && (*lpstring == TEXT('\t')))) 00410 { 00411 00412 lpstring++; // Skip over the tab 00413 continue; 00414 } 00415 else 00416 break; // Break from the loop. 00417 } 00418 return MAKELONG((x - initialx), (short)textextent.cy); 00419 }

BOOL ValidateDialogPwnd PWND  pwnd  ) 
 

Definition at line 192 of file dlgmgr.c.

References AllocLookasideEntry(), BOOL, tagWND::cbwndExtra, DialogLookaside, DLG, FALSE, FNID_STATUS_BITS, HWq, InitLookaside(), NT_SUCCESS, NtUserCallHwndParam(), NULL, PDLG, TestWF, TRUE, and WFDIALOGWINDOW.

Referenced by DefDlgProcWorker(), EndDialog(), InternalCreateDialog(), MapDialogRect(), and xxxRestoreDlgFocus().

00194 { 00195 static BOOL sfInit = TRUE; 00196 PDLG pdlg; 00197 00198 /* 00199 * This bit is set if we've already run through this initialization and 00200 * have identified this window as a dialog window (able to withstand 00201 * peeks into window words at random moments in time). 00202 */ 00203 if (TestWF(pwnd, WFDIALOGWINDOW)) 00204 return TRUE; 00205 00206 if (pwnd->cbwndExtra < DLGWINDOWEXTRA) { 00207 RIPERR0(ERROR_WINDOW_NOT_DIALOG, RIP_VERBOSE, ""); 00208 return FALSE; 00209 } 00210 00211 /* 00212 * See if the pdlg was destroyed and this is a rogue message to be ignored 00213 */ 00214 if (pwnd->fnid & FNID_STATUS_BITS) { 00215 return FALSE; 00216 } 00217 00218 /* 00219 * If the lookaside buffer has not been initialized, do it now. 00220 */ 00221 if (sfInit) { 00222 if (!NT_SUCCESS(InitLookaside(&DialogLookaside, sizeof(DLG), 2))) { 00223 return FALSE; 00224 } 00225 sfInit = FALSE; 00226 } 00227 00228 if ((pdlg = (PDLG)AllocLookasideEntry(&DialogLookaside)) == NULL) { 00229 return FALSE; 00230 } 00231 00232 NtUserCallHwndParam(HWq(pwnd), (ULONG_PTR)pdlg, SFI_SETDIALOGPOINTER); 00233 00234 return TRUE; 00235 }

PWND FASTCALL ValidateHwnd HWND  hwnd  ) 
 

Definition at line 28 of file client/wow.c.

00030 { 00031 PCLIENTINFO pci = GetClientInfo(); 00032 00033 /* 00034 * Attempt fast window validation 00035 */ 00036 if (hwnd != NULL && hwnd == pci->CallbackWnd.hwnd) { 00037 return pci->CallbackWnd.pwnd; 00038 } 00039 00040 /* 00041 * Validate the handle is of the proper type. 00042 */ 00043 return HMValidateHandle(hwnd, TYPE_WINDOW); 00044 }

PWND FASTCALL ValidateHwndNoRip HWND  hwnd  ) 
 

Definition at line 47 of file client/wow.c.

References _CLIENTINFO::CallbackWnd, FASTCALL, GetClientInfo, HMValidateHandleNoRip(), _CALLBACKWND::hwnd, NULL, _CALLBACKWND::pwnd, and TYPE_WINDOW.

Referenced by DefDlgProcWorker(), DefWindowProcWorker(), DispatchClientMessage(), ImeIsUsableContext(), ImeMarkUsedContext(), ImeSetContextHandler(), ImeWndCreateHandler(), IsDialogMessageA(), IsDialogMessageW(), IsWindow(), SendMessageToUI(), SendRegisterMessageToClass(), and TranslateMDISysAccel().

00049 { 00050 PCLIENTINFO pci = GetClientInfo(); 00051 00052 /* 00053 * Attempt fast window validation 00054 */ 00055 if (hwnd != NULL && hwnd == pci->CallbackWnd.hwnd) { 00056 return pci->CallbackWnd.pwnd; 00057 } 00058 00059 /* 00060 * Validate the handle is of the proper type. 00061 */ 00062 return HMValidateHandleNoRip(hwnd, TYPE_WINDOW); 00063 }

BOOL ValidateMENUINFO LPCMENUINFO  lpmi,
DWORD  dwAPICode
 

Definition at line 607 of file clmenu.c.

References BOOL, FALSE, MENUAPI_GET, NULL, TRUE, and ValidateMENUINFO().

Referenced by GetMenuInfo(), SetMenuInfo(), and ValidateMENUINFO().

00608 { 00609 VALIDATIONFNNAME(ValidateMENUINFO) 00610 00611 if (lpmi == NULL) { 00612 VALIDATIONFAIL(lpmi); 00613 } 00614 00615 if (lpmi->cbSize != sizeof(MENUINFO)) { 00616 VALIDATIONFAIL(lpmi->cbSize); 00617 } 00618 00619 if (lpmi->fMask & ~MIM_MASK) { 00620 VALIDATIONFAIL(lpmi->fMask); 00621 } 00622 00623 /* 00624 * No more validation needed for Get calls 00625 */ 00626 if (dwAPICode == MENUAPI_GET){ 00627 return TRUE; 00628 } 00629 00630 if ((lpmi->fMask & MIM_STYLE) && (lpmi->dwStyle & ~MNS_VALID)) { 00631 VALIDATIONFAIL(lpmi->dwStyle); 00632 } 00633 00634 if (lpmi->fMask & MIM_BACKGROUND) { 00635 if ((lpmi->hbrBack != NULL) 00636 && !GdiValidateHandle((HBRUSH)lpmi->hbrBack)) { 00637 00638 VALIDATIONFAIL(lpmi->hbrBack); 00639 } 00640 } 00641 00642 return TRUE; 00643 00644 VALIDATIONERROR(FALSE); 00645 }

BOOL ValidateMENUITEMINFO LPMENUITEMINFOW  lpmiiIn,
LPMENUITEMINFOW  lpmii,
DWORD  dwAPICode
 

Referenced by GetMenuItemInfo(), InsertMenuItem(), and SetMenuItemInfo().

BOOL WowGetModuleFileName HMODULE  hModule,
LPWSTR  pwsz,
DWORD  cchMax
 

Definition at line 128 of file clres.c.

References BOOL, FALSE, and TRUE.

Referenced by ConvertDIBIcon(), and LoadIcoCur().

00132 { 00133 if (!GetModuleFileName(hModule, pwsz, cchMax)) { 00134 00135 if (cchMax < 10) { 00136 RIPMSG0(RIP_WARNING, "WowGetModuleFileName: exceeded Char-Max"); 00137 return FALSE; 00138 } 00139 00140 wsprintf(pwsz, TEXT("\001%08lx"), hModule); 00141 } 00142 00143 return TRUE; 00144 }

HICON WowServerLoadCreateCursorIcon HANDLE  hmod,
LPTSTR  lpModName,
DWORD  dwExpWinVer,
LPCTSTR  lpName,
DWORD  cb,
PVOID  pcr,
LPTSTR  lpType,
BOOL  fClient
 

VOID xxxAlterHilite PLBIV  ,
INT  ,
INT  ,
BOOL  ,
INT  ,
BOOL 
 

Definition at line 3754 of file lboxctl2.c.

References BOOL, CheckLock, CItemInWindow(), tagLBIV::cMac, FALSE, tagLBIV::fCaretOn, high, HILITEONLY, INT, IsSelected(), tagLBIV::iTop, low, max, min, SELONLY, SetSelected(), tagLBIV::spwnd, TRUE, xxxInvertLBItem(), and xxxLBSetCaret().

Referenced by xxxLBBlockHilite(), xxxLBButtonUp(), and xxxTrackMouse().

03761 { 03762 INT low; 03763 INT high; 03764 INT sLastInWindow; 03765 BOOL fCaretOn; 03766 BOOL fSelected; 03767 03768 CheckLock(plb->spwnd); 03769 03770 sLastInWindow = plb->iTop + CItemInWindow(plb, TRUE); 03771 sLastInWindow = min(sLastInWindow, plb->cMac - 1); 03772 high = max(i, j) + 1; 03773 03774 if (fCaretOn = plb->fCaretOn) { 03775 xxxLBSetCaret(plb, FALSE); 03776 } 03777 03778 for (low = min(i, j); low < high; low++) { 03779 if (low != i) { 03780 if (OpFlags & HILITEONLY) { 03781 if (fSelStatus) { 03782 fSelected = IsSelected(plb, low, SELONLY); 03783 } else { 03784 fSelected = fHilite; 03785 } 03786 if (IsSelected(plb, low, HILITEONLY) != fSelected) { 03787 if (plb->iTop <= low && low <= sLastInWindow) { 03788 03789 /* 03790 * Invert the item only if it is visible 03791 */ 03792 xxxInvertLBItem(plb, low, fSelected); 03793 } 03794 SetSelected(plb, low, fSelected, HILITEONLY); 03795 } 03796 } 03797 03798 if (OpFlags & SELONLY) { 03799 SetSelected(plb, low, fHilite, SELONLY); 03800 } 03801 } 03802 } 03803 03804 if (fCaretOn) { 03805 xxxLBSetCaret(plb, TRUE); 03806 } 03807 }

VOID xxxCaretDestroy PLBIV   ) 
 

Definition at line 3411 of file lboxctl2.c.

References CheckLock, tagLBIV::fAddSelMode, FALSE, tagLBIV::fCaptured, tagLBIV::fCaret, tagLBIV::fMouseDown, HWq, IDSYS_CARET, LBUP_NOTIFY, LBUP_RELEASECAPTURE, LBUP_SUCCESS, NtUserKillTimer(), tagLBIV::spwnd, xxxLBButtonUp(), and xxxLBSetCaret().

Referenced by ListBoxWndProcWorker().

03413 { 03414 CheckLock(plb->spwnd); 03415 03416 /* 03417 * We're losing the focus. Act like up clicks are happening so we release 03418 * capture, set the current selection, notify the parent, etc. 03419 */ 03420 if (plb->fCaptured) 03421 03422 /* 03423 * If we have the capture and we lost the focus, that means we already 03424 * changed the selection and we have to notify also the parent about 03425 * this. So we need to add also the LBUP_SUCCESS flag in this case. 03426 */ 03427 03428 xxxLBButtonUp(plb, LBUP_RELEASECAPTURE | LBUP_NOTIFY | 03429 (plb->fMouseDown ? LBUP_SUCCESS : 0)); 03430 03431 if (plb->fAddSelMode) { 03432 03433 /* 03434 * Switch off the Caret blinking 03435 */ 03436 NtUserKillTimer(HWq(plb->spwnd), IDSYS_CARET); 03437 03438 /* 03439 * Make sure the caret goes away 03440 */ 03441 xxxLBSetCaret(plb, FALSE); 03442 plb->fAddSelMode = FALSE; 03443 } 03444 03445 plb->fCaret = FALSE; 03446 }

void xxxCBCalcControlRects PCBOX  pcbox,
LPRECT  lprcList
 

Definition at line 253 of file comboini.c.

References tagCBox::buttonrc, tagCBox::CBoxStyle, CheckLock, tagCBox::cxCombo, tagCBox::cxDrop, tagCBox::cyCombo, tagCBox::cyDrop, tagCBox::editrc, tagCBox::fRightAlign, tagCBox::hFont, HW, HWq, max, NtUserGetDC(), NtUserReleaseDC, NULL, tagCBox::OwnerDraw, tagWND::rcWindow, RECALC_CYDROP, SDROPPABLE, SendMessage(), SetRectEmpty, tagWND::spmenu, tagCBox::spwnd, tagCBox::spwndParent, SYSMET, szOneChar, TestWF, ThreadLock, ThreadUnlock, UINT, and WFWIN40COMPAT.

Referenced by xxxCBCreateHandler(), and xxxCBPosition().

00254 { 00255 HDC hdc; 00256 HANDLE hOldFont = NULL; 00257 int dyEdit, dxEdit; 00258 MEASUREITEMSTRUCT mis; 00259 SIZE size; 00260 HWND hwnd = HWq(pcbox->spwnd); 00261 TL tlpwndParent; 00262 00263 CheckLock(pcbox->spwnd); 00264 00265 /* 00266 * Determine height of the edit control. We can use this info to center 00267 * the button with recpect to the edit/static text window. For example 00268 * this will be useful if owner draw and this window is tall. 00269 */ 00270 hdc = NtUserGetDC(hwnd); 00271 if (pcbox->hFont) { 00272 hOldFont = SelectObject(hdc, pcbox->hFont); 00273 } 00274 00275 // Add on CYEDGE just for some extra space in the edit field/static item. 00276 // It's really only for static text items, but we want static & editable 00277 // controls to be the same height. 00278 GetTextExtentPoint(hdc, szOneChar, 1, &size); 00279 dyEdit = size.cy + SYSMET(CYEDGE); 00280 00281 if (hOldFont) { 00282 SelectObject(hdc, hOldFont); 00283 } 00284 00285 /* 00286 * IanJa: was ReleaseDC(pcbox->hwnd, hdc); 00287 */ 00288 NtUserReleaseDC(hwnd, hdc); 00289 00290 if (pcbox->OwnerDraw) { 00291 // This is an ownerdraw combo. Have the owner tell us how tall this 00292 // item is. 00293 int iOwnerDrawHeight; 00294 00295 if (iOwnerDrawHeight = pcbox->editrc.bottom - pcbox->editrc.top) { 00296 dyEdit = iOwnerDrawHeight; 00297 } else { 00298 /* 00299 * No height has been defined yet for the static text window. Send 00300 * a measure item message to the parent 00301 */ 00302 mis.CtlType = ODT_COMBOBOX; 00303 mis.CtlID = PtrToUlong(pcbox->spwnd->spmenu); 00304 mis.itemID = (UINT)-1; 00305 mis.itemHeight = dyEdit; 00306 mis.itemData = 0; 00307 00308 ThreadLock(pcbox->spwndParent, &tlpwndParent); 00309 SendMessage(HW(pcbox->spwndParent), WM_MEASUREITEM, mis.CtlID, (LPARAM)&mis); 00310 ThreadUnlock(&tlpwndParent); 00311 00312 dyEdit = mis.itemHeight; 00313 } 00314 } 00315 /* 00316 * Set the initial width to be the combo box rect. Later we will shorten it 00317 * if there is a dropdown button. 00318 */ 00319 pcbox->cyCombo = 2*SYSMET(CYFIXEDFRAME) + dyEdit; 00320 dxEdit = pcbox->cxCombo - (2 * SYSMET(CXFIXEDFRAME)); 00321 00322 if (pcbox->cyDrop == RECALC_CYDROP) 00323 { 00324 // recompute the max height of the dropdown listbox -- full window 00325 // size MINUS edit/static height 00326 pcbox->cyDrop = max((pcbox->spwnd->rcWindow.bottom - pcbox->spwnd->rcWindow.top) - pcbox->cyCombo, 0); 00327 00328 if (!TestWF(pcbox->spwnd, WFWIN40COMPAT) && (pcbox->cyDrop == 23)) 00329 // This is VC++ 2.1's debug/release dropdown that they made super 00330 // small -- let's make 'em a wee bit bigger so the world can 00331 // continue to spin -- jeffbog -- 4/19/95 -- B#10029 00332 pcbox->cyDrop = 28; 00333 } 00334 00335 /* 00336 * Determine the rectangles for each of the windows... 1. Pop down button 2. 00337 * Edit control or generic window for static text or ownerdraw... 3. List 00338 * box 00339 */ 00340 00341 // Is there a button? 00342 if (pcbox->CBoxStyle & SDROPPABLE) { 00343 // Determine button's rectangle. 00344 pcbox->buttonrc.top = SYSMET(CYEDGE); 00345 pcbox->buttonrc.bottom = pcbox->cyCombo - SYSMET(CYEDGE); 00346 if (pcbox->fRightAlign) { 00347 pcbox->buttonrc.left = SYSMET(CXFIXEDFRAME); 00348 pcbox->buttonrc.right = pcbox->buttonrc.left + SYSMET(CXVSCROLL); 00349 } else { 00350 pcbox->buttonrc.right = pcbox->cxCombo - SYSMET(CXEDGE); 00351 pcbox->buttonrc.left = pcbox->buttonrc.right - SYSMET(CXVSCROLL); 00352 } 00353 00354 // Reduce the width of the edittext window to make room for the button. 00355 dxEdit = max(dxEdit - SYSMET(CXVSCROLL), 0); 00356 00357 } else { 00358 00359 /* 00360 * No button so make the rectangle 0 so that a point in rect will always 00361 * return false. 00362 */ 00363 SetRectEmpty(&pcbox->buttonrc); 00364 } 00365 00366 /* 00367 * So now, the edit rect is really the item area. 00368 */ 00369 pcbox->editrc.left = SYSMET(CXFIXEDFRAME); 00370 pcbox->editrc.right = pcbox->editrc.left + dxEdit; 00371 pcbox->editrc.top = SYSMET(CYFIXEDFRAME); 00372 pcbox->editrc.bottom = pcbox->editrc.top + dyEdit; 00373 00374 // Is there a right-aligned button? 00375 if ((pcbox->CBoxStyle & SDROPPABLE) && (pcbox->fRightAlign)) { 00376 pcbox->editrc.right = pcbox->cxCombo - SYSMET(CXEDGE); 00377 pcbox->editrc.left = pcbox->editrc.right - dxEdit; 00378 } 00379 00380 lprcList->left = 0; 00381 lprcList->top = pcbox->cyCombo; 00382 lprcList->right = max(pcbox->cxDrop, pcbox->cxCombo); 00383 lprcList->bottom = pcbox->cyCombo + pcbox->cyDrop; 00384 }

LONG xxxCBCommandHandler PCBOX  ,
DWORD  ,
HWND 
 

Definition at line 1494 of file combo.c.

References CheckLock, FALSE, tagCBox::fFocus, tagCBox::fKeyboardSelInListBox, tagCBox::fNoEdit, HWq, L, NULL, SAMEWOWHANDLE, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, TRUE, xxxCBGetFocusHelper(), xxxCBHideListBoxWindow(), xxxCBInternalUpdateEditWindow(), xxxCBNotifyParent(), and xxxCBUpdateListBoxWindow().

Referenced by ComboBoxWndProcWorker().

01498 { 01499 01500 CheckLock(pcbox->spwnd); 01501 01502 /* 01503 * Check the edit control notification codes. Note that currently, edit 01504 * controls don't send EN_KILLFOCUS messages to the parent. 01505 */ 01506 if (!pcbox->fNoEdit && 01507 SAMEWOWHANDLE(hwndControl, HWq(pcbox->spwndEdit))) { 01508 01509 /* 01510 * Edit control notification codes 01511 */ 01512 switch (HIWORD(wParam)) { 01513 case EN_SETFOCUS: 01514 if (!pcbox->fFocus) { 01515 01516 /* 01517 * The edit control has the focus for the first time which means 01518 * this is the first time the combo box has received the focus 01519 * and the parent must be notified that we have the focus. 01520 */ 01521 xxxCBGetFocusHelper(pcbox); 01522 } 01523 break; 01524 01525 case EN_CHANGE: 01526 xxxCBNotifyParent(pcbox, CBN_EDITCHANGE); 01527 xxxCBUpdateListBoxWindow(pcbox, FALSE); 01528 break; 01529 01530 case EN_UPDATE: 01531 xxxCBNotifyParent(pcbox, CBN_EDITUPDATE); 01532 break; 01533 01534 case EN_ERRSPACE: 01535 xxxCBNotifyParent(pcbox, CBN_ERRSPACE); 01536 break; 01537 } 01538 } 01539 01540 /* 01541 * Check listbox control notification codes 01542 */ 01543 if (SAMEWOWHANDLE(hwndControl, HWq(pcbox->spwndList))) { 01544 01545 /* 01546 * Listbox control notification codes 01547 */ 01548 switch ((int)HIWORD(wParam)) { 01549 case LBN_DBLCLK: 01550 xxxCBNotifyParent(pcbox, CBN_DBLCLK); 01551 break; 01552 01553 case LBN_ERRSPACE: 01554 xxxCBNotifyParent(pcbox, CBN_ERRSPACE); 01555 break; 01556 01557 case LBN_SELCHANGE: 01558 case LBN_SELCANCEL: 01559 if (!pcbox->fKeyboardSelInListBox) { 01560 01561 /* 01562 * If the selchange is caused by the user keyboarding through, 01563 * we don't want to hide the listbox. 01564 */ 01565 if (!xxxCBHideListBoxWindow(pcbox, TRUE, TRUE)) 01566 return(0L); 01567 } else { 01568 pcbox->fKeyboardSelInListBox = FALSE; 01569 } 01570 01571 xxxCBNotifyParent(pcbox, CBN_SELCHANGE); 01572 xxxCBInternalUpdateEditWindow(pcbox, NULL); 01573 break; 01574 } 01575 } 01576 01577 return 0L; 01578 }

VOID xxxCBCompleteEditWindow PCBOX  pcbox  ) 
 

Definition at line 1624 of file combo.c.

References CheckLock, FALSE, NULL, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, TestWF, ThreadLock, ThreadUnlock, Unlock, UserLocalAlloc, UserLocalFree, and WFANSIPROC.

Referenced by ComboBoxWndProcWorker(), xxxCBHideListBoxWindow(), and xxxCBShowListBoxWindow().

01626 { 01627 int cchText; 01628 int cchItemText; 01629 int itemNumber; 01630 LPWSTR pText; 01631 TL tlpwndEdit; 01632 TL tlpwndList; 01633 01634 CheckLock(pcbox->spwnd); 01635 01636 /* 01637 * Firstly check the edit control. 01638 */ 01639 if (pcbox->spwndEdit == NULL) { 01640 return; 01641 } 01642 01643 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 01644 ThreadLock(pcbox->spwndList, &tlpwndList); 01645 01646 /* 01647 * +1 for null terminator 01648 */ 01649 cchText = (int)SendMessageWorker(pcbox->spwndEdit, WM_GETTEXTLENGTH, 0, 0, FALSE); 01650 01651 if (cchText) { 01652 cchText++; 01653 if (!(pText = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, cchText*sizeof(WCHAR)))) 01654 goto Unlock; 01655 01656 /* 01657 * We want to be sure to free the above allocated memory even if 01658 * the client dies during callback (xxx) or some of the following 01659 * window revalidation fails. 01660 */ 01661 try { 01662 SendMessageWorker(pcbox->spwndEdit, WM_GETTEXT, cchText, (LPARAM)pText, FALSE); 01663 itemNumber = (int)SendMessageWorker(pcbox->spwndList, 01664 LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pText, FALSE); 01665 if (itemNumber == -1) 01666 itemNumber = (int)SendMessageWorker(pcbox->spwndList, 01667 LB_FINDSTRING, (WPARAM)-1, (LPARAM)pText, FALSE); 01668 } finally { 01669 UserLocalFree((HANDLE)pText); 01670 } 01671 01672 if (itemNumber == -1) { 01673 01674 /* 01675 * No close match. Blow off. 01676 */ 01677 goto Unlock; 01678 } 01679 01680 cchItemText = (int)SendMessageWorker(pcbox->spwndList, LB_GETTEXTLEN, 01681 itemNumber, 0, FALSE); 01682 if (cchItemText) { 01683 cchItemText++; 01684 if (!(pText = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, cchItemText*sizeof(WCHAR)))) 01685 goto Unlock; 01686 01687 /* 01688 * We want to be sure to free the above allocated memory even if 01689 * the client dies during callback (xxx) or some of the following 01690 * window revalidation fails. 01691 */ 01692 try { 01693 SendMessageWorker(pcbox->spwndList, LB_GETTEXT, 01694 itemNumber, (LPARAM)pText, FALSE); 01695 SendMessageWorker(pcbox->spwndEdit, WM_SETTEXT, 01696 0, (LPARAM)pText, FALSE); 01697 } finally { 01698 UserLocalFree((HANDLE)pText); 01699 } 01700 01701 SendMessageWorker(pcbox->spwndEdit, EM_SETSEL, 0, MAXLONG, !!TestWF(pcbox->spwnd, WFANSIPROC)); 01702 } 01703 } 01704 01705 Unlock: 01706 ThreadUnlock(&tlpwndList); 01707 ThreadUnlock(&tlpwndEdit); 01708 }

LRESULT xxxCBCreateHandler PCBOX  ,
PWND 
 

Definition at line 70 of file comboini.c.

References _CreateWindowEx(), tagSERVERINFO::atomSysClass, CBEDITID, CBFAUTOHSCROLL, CBFDISABLENOSCROLL, CBFDROPDOWN, CBFDROPDOWNLIST, CBFHASSTRINGS, CBFLOWERCASE, CBFNOINTEGRALHEIGHT, CBFOEMCONVERT, CBFOWNERDRAWFIXED, CBFOWNERDRAWVAR, CBFSORT, CBFUPPERCASE, CBLISTBOXID, tagCBox::CBoxStyle, CheckLock, tagCBox::cxCombo, tagCBox::cxDrop, tagCBox::cyDrop, DWORD, tagCBox::editrc, tagCBox::fCase, tagCBox::fNoEdit, tagCBox::fRightAlign, tagCBox::fRtoLReading, gpsi, HW, ICLS_COMBOLISTBOX, ICLS_EDIT, InflateRect(), L, LBS_COMBOBOX, LOBYTE, Lock, LOWERCASE, NtUserSetParent(), NtUserShowWindow(), NULL, tagCBox::OwnerDraw, OWNERDRAWFIXED, OWNERDRAWVAR, tagWND::rcWindow, REBASEPWND, RECALC_CYDROP, SDROPDOWN, SDROPDOWNLIST, SDROPPABLE, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, tagCBox::spwndParent, SSIMPLE, tagCBox::styleSave, SYSMET, TestWF, TRUE, UPPERCASE, ValidateHwnd, WEFRIGHT, WEFRTLREADING, WFANSICREATOR, WFDISABLED, WFWIN40COMPAT, xxxCBCalcControlRects(), and xxxCBSetDroppedSize().

Referenced by ComboBoxWndProcWorker().

00073 { 00074 LONG lStyleT; 00075 RECT rcList; 00076 HWND hwndList; 00077 HWND hwndEdit; 00078 DWORD lExStyle; 00079 00080 CheckLock(pwnd); 00081 00082 /* 00083 * Don't lock the combobox window: this would prevent WM_FINALDESTROY 00084 * being sent to it, so pwnd and pcbox wouldn't get freed (zombies) 00085 * until thread cleanup. (IanJa) LATER: change name from spwnd to pwnd. 00086 * Lock(&pcbox->spwnd, pwnd); - caused a 'catch-22' 00087 */ 00088 Lock(&(pcbox->spwndParent), REBASEPWND(pwnd, spwndParent)); 00089 00090 /* 00091 * Break out the style bits so that we will be able to create the listbox 00092 * and editcontrol windows. 00093 */ 00094 00095 if (TestWF(pwnd, CBFDROPDOWNLIST) == LOBYTE(CBFDROPDOWNLIST)) { 00096 pcbox->CBoxStyle = SDROPDOWNLIST; 00097 pcbox->fNoEdit = TRUE; 00098 } else if (TestWF(pwnd, CBFDROPDOWN)) 00099 pcbox->CBoxStyle = SDROPDOWN; 00100 else 00101 pcbox->CBoxStyle = SSIMPLE; 00102 00103 pcbox->fRtoLReading = (TestWF(pwnd, WEFRTLREADING) != 0); 00104 pcbox->fRightAlign = (TestWF(pwnd, WEFRIGHT) != 0); 00105 00106 if (TestWF(pwnd, CBFUPPERCASE)) 00107 pcbox->fCase = UPPERCASE; 00108 else if (TestWF(pwnd, CBFLOWERCASE)) 00109 pcbox->fCase = LOWERCASE; 00110 else 00111 pcbox->fCase = 0; 00112 00113 // Listbox item flags. 00114 if (TestWF(pwnd, CBFOWNERDRAWVAR)) 00115 pcbox->OwnerDraw = OWNERDRAWVAR; 00116 if (TestWF(pwnd, CBFOWNERDRAWFIXED)) { 00117 pcbox->OwnerDraw = OWNERDRAWFIXED; 00118 } 00119 00120 /* 00121 * Get the size of the combo box rectangle. 00122 */ 00123 // Get control sizes. 00124 pcbox->cxCombo = pwnd->rcWindow.right - pwnd->rcWindow.left; 00125 pcbox->cyDrop = RECALC_CYDROP; 00126 pcbox->cxDrop = 0; 00127 xxxCBCalcControlRects(pcbox, &rcList); 00128 00129 // 00130 // We need to do this because listboxes, as of VER40, have stopped 00131 // reinflating themselves by CXBORDER and CYBORDER. 00132 // 00133 if (!TestWF(pwnd, WFWIN40COMPAT)) 00134 InflateRect(&rcList, -SYSMET(CXBORDER), -SYSMET(CYBORDER)); 00135 00136 /* 00137 * Note that we have to create the listbox before the editcontrol since the 00138 * editcontrol code looks for and saves away the listbox pwnd and the 00139 * listbox pwnd will be NULL if we don't create it first. Also, hack in 00140 * some special +/- values for the listbox size due to the way we create 00141 * listboxes with borders. 00142 */ 00143 lStyleT = pcbox->styleSave; 00144 00145 lStyleT |= WS_CHILD | WS_VISIBLE | LBS_NOTIFY | LBS_COMBOBOX | WS_CLIPSIBLINGS; 00146 00147 if (TestWF(pwnd, WFDISABLED)) 00148 lStyleT |= WS_DISABLED; 00149 if (TestWF(pwnd, CBFNOINTEGRALHEIGHT)) 00150 lStyleT |= LBS_NOINTEGRALHEIGHT; 00151 if (TestWF(pwnd, CBFSORT)) 00152 lStyleT |= LBS_SORT; 00153 if (TestWF(pwnd, CBFHASSTRINGS)) 00154 lStyleT |= LBS_HASSTRINGS; 00155 if (TestWF(pwnd, CBFDISABLENOSCROLL)) 00156 lStyleT |= LBS_DISABLENOSCROLL; 00157 00158 if (pcbox->OwnerDraw == OWNERDRAWVAR) 00159 lStyleT |= LBS_OWNERDRAWVARIABLE; 00160 else if (pcbox->OwnerDraw == OWNERDRAWFIXED) 00161 lStyleT |= LBS_OWNERDRAWFIXED; 00162 00163 if (pcbox->CBoxStyle & SDROPPABLE) 00164 lStyleT |= WS_BORDER; 00165 00166 lExStyle = pwnd->ExStyle & (WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR); 00167 hwndList = _CreateWindowEx(lExStyle | 00168 ((pcbox->CBoxStyle & SDROPPABLE) ? WS_EX_TOOLWINDOW : WS_EX_CLIENTEDGE), 00169 MAKEINTRESOURCE(gpsi->atomSysClass[ICLS_COMBOLISTBOX]), NULL, lStyleT, 00170 rcList.left, rcList.top, rcList.right - rcList.left, 00171 rcList.bottom - rcList.top, 00172 HW(pwnd), (HMENU)CBLISTBOXID, pcbox->spwnd->hModule, NULL, 00173 0); 00174 Lock(&(pcbox->spwndList), ValidateHwnd(hwndList)); 00175 00176 if (!pcbox->spwndList) { 00177 return -1; 00178 } 00179 00180 /* 00181 * Create either the edit control or the static text rectangle. 00182 */ 00183 if (pcbox->fNoEdit) { 00184 00185 /* 00186 * No editcontrol so we will draw text directly into the combo box 00187 * window. 00188 */ 00189 /* 00190 * Don't lock the combobox window: this would prevent WM_FINALDESTROY 00191 * being sent to it, so pwnd and pcbox wouldn't get freed (zombies) 00192 * until thread cleanup. (IanJa) LATER: change name from spwnd to pwnd. 00193 * Lock(&(pcbox->spwndEdit), pcbox->spwnd); - caused a 'catch-22' 00194 */ 00195 pcbox->spwndEdit = pcbox->spwnd; 00196 } else { 00197 DWORD dwCsFlags; 00198 00199 lStyleT = WS_CHILD | WS_VISIBLE | ES_COMBOBOX | ES_NOHIDESEL; 00200 if (TestWF(pwnd, WFDISABLED)) 00201 lStyleT |= WS_DISABLED; 00202 if (TestWF(pwnd, CBFAUTOHSCROLL)) 00203 lStyleT |= ES_AUTOHSCROLL; 00204 if (TestWF(pwnd, CBFOEMCONVERT)) 00205 lStyleT |= ES_OEMCONVERT; 00206 if (pcbox->fCase) 00207 lStyleT |= (pcbox->fCase & UPPERCASE) ? ES_UPPERCASE : ES_LOWERCASE; 00208 00209 /* 00210 * Edit control need to know whether original CreateWindow*() call 00211 * was ANSI or Unicode. 00212 */ 00213 dwCsFlags = TestWF(pcbox->spwnd, WFANSICREATOR) ? CW_FLAGS_ANSI : 0L; 00214 if (lExStyle & WS_EX_RIGHT) 00215 lStyleT |= ES_RIGHT; 00216 00217 hwndEdit = _CreateWindowEx(lExStyle, 00218 MAKEINTRESOURCE(gpsi->atomSysClass[ICLS_EDIT]), NULL, lStyleT, 00219 pcbox->editrc.left, pcbox->editrc.top, 00220 pcbox->editrc.right - pcbox->editrc.left, pcbox->editrc.bottom - 00221 pcbox->editrc.top, HW(pwnd), (HMENU)CBEDITID, 00222 pcbox->spwnd->hModule, NULL, 00223 dwCsFlags); 00224 Lock(&(pcbox->spwndEdit), ValidateHwnd(hwndEdit)); 00225 } 00226 if (!pcbox->spwndEdit) 00227 return -1L; 00228 00229 if (pcbox->CBoxStyle & SDROPPABLE) { 00230 00231 NtUserShowWindow(hwndList, SW_HIDE); 00232 NtUserSetParent(hwndList, NULL); 00233 00234 // We need to do this so dropped size works right 00235 if (!TestWF(pwnd, WFWIN40COMPAT)) 00236 InflateRect(&rcList, SYSMET(CXBORDER), SYSMET(CYBORDER)); 00237 00238 xxxCBSetDroppedSize(pcbox, &rcList); 00239 } 00240 00241 /* 00242 * return anything as long as it's not -1L (-1L == error) 00243 */ 00244 return (LRESULT)pwnd; 00245 }

int xxxCBDir PCBOX  ,
UINT  ,
LPWSTR 
 

Definition at line 28 of file combodir.c.

References CheckLock, tagLBIV::spwnd, tagCBox::spwnd, tagCBox::spwndList, ThreadLock, ThreadUnlock, and xxxLbDir().

Referenced by ComboBoxWndProcWorker().

00032 { 00033 PLBIV plb; 00034 int errorValue; 00035 TL tlpwnd; 00036 00037 CheckLock(pcbox->spwnd); 00038 UserAssert(pcbox->spwndList); 00039 00040 plb = ((PLBWND)pcbox->spwndList)->pLBIV; 00041 00042 ThreadLock(plb->spwnd, &tlpwnd); 00043 errorValue = xxxLbDir(plb, attrib, pFileName); 00044 ThreadUnlock(&tlpwnd); 00045 00046 switch (errorValue) { 00047 case LB_ERR: 00048 return CB_ERR; 00049 break; 00050 case LB_ERRSPACE: 00051 return CB_ERRSPACE; 00052 break; 00053 default: 00054 return errorValue; 00055 break; 00056 } 00057 }

VOID xxxCBGetFocusHelper PCBOX   ) 
 

Definition at line 2343 of file combo.c.

References tagCBox::CBoxStyle, CheckLock, FALSE, tagCBox::fFocus, tagCBox::fNoEdit, NULL, SDROPDOWNLIST, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, TestWF, ThreadLock, ThreadUnlock, TRUE, WFANSIPROC, xxxCBInvertStaticWindow(), and xxxCBNotifyParent().

Referenced by ComboBoxWndProcWorker(), and xxxCBCommandHandler().

02345 { 02346 TL tlpwndList; 02347 TL tlpwndEdit; 02348 02349 CheckLock(pcbox->spwnd); 02350 02351 if (pcbox->fFocus) 02352 return; 02353 02354 ThreadLock(pcbox->spwndList, &tlpwndList); 02355 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 02356 02357 /* 02358 * The combo box has gotten the focus for the first time. 02359 */ 02360 02361 /* 02362 * First turn on the listbox caret 02363 */ 02364 02365 if (pcbox->CBoxStyle == SDROPDOWNLIST) 02366 SendMessageWorker(pcbox->spwndList, LBCB_CARETON, 0, 0, FALSE); 02367 02368 /* 02369 * and select all the text in the editcontrol or static text rectangle. 02370 */ 02371 02372 if (pcbox->fNoEdit) { 02373 02374 /* 02375 * Invert the static text rectangle 02376 */ 02377 xxxCBInvertStaticWindow(pcbox, TRUE, (HDC)NULL); 02378 } else if (pcbox->spwndEdit) { 02379 UserAssert(pcbox->spwnd); 02380 SendMessageWorker(pcbox->spwndEdit, EM_SETSEL, 0, MAXLONG, !!TestWF(pcbox->spwnd, WFANSIPROC)); 02381 } 02382 02383 pcbox->fFocus = TRUE; 02384 02385 /* 02386 * Notify the parent we have the focus 02387 */ 02388 xxxCBNotifyParent(pcbox, CBN_SETFOCUS); 02389 02390 ThreadUnlock(&tlpwndEdit); 02391 ThreadUnlock(&tlpwndList); 02392 }

BOOL xxxCBHideListBoxWindow PCBOX  pcbox,
BOOL  fNotifyParent,
BOOL  fSelEndOK
 

Definition at line 1719 of file combo.c.

References BOOL, tagCBox::CBoxStyle, CheckLock, tagCBox::cxCombo, tagCBox::cyCombo, tagCBox::editrc, FALSE, tagCBox::fLBoxVisible, HWq, IsWindow(), NtUserInvalidateRect(), NtUserSetWindowPos(), NtUserShowWindow(), SDROPPABLE, SEDITABLE, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndList, TestWF, ThreadLock, ThreadUnlock, TRUE, UpdateWindow(), WFWIN31COMPAT, xxxCBCompleteEditWindow(), and xxxCBNotifyParent().

Referenced by ComboBoxWndProcWorker(), xxxCBCommandHandler(), xxxCBKillFocusHelper(), xxxCBSetDroppedSize(), xxxLBoxCtlKeyInput(), and xxxTrackMouse().

01723 { 01724 HWND hwnd = HWq(pcbox->spwnd); 01725 HWND hwndList = HWq(pcbox->spwndList); 01726 TL tlpwndList; 01727 01728 01729 CheckLock(pcbox->spwnd); 01730 01731 // For 3.1+ apps, send CBN_SELENDOK to all types of comboboxes but only 01732 // allow CBN_SELENDCANCEL to be sent for droppable comboboxes 01733 if (fNotifyParent && TestWF(pcbox->spwnd, WFWIN31COMPAT) && 01734 ((pcbox->CBoxStyle & SDROPPABLE) || fSelEndOK)) { 01735 if (fSelEndOK) 01736 { 01737 xxxCBNotifyParent(pcbox, CBN_SELENDOK); 01738 } 01739 else 01740 { 01741 xxxCBNotifyParent(pcbox, CBN_SELENDCANCEL); 01742 } 01743 if (!IsWindow(hwnd)) 01744 return(FALSE); 01745 } 01746 01747 /* 01748 * return, we don't hide simple combo boxes. 01749 */ 01750 if (!(pcbox->CBoxStyle & SDROPPABLE)) { 01751 return TRUE; 01752 } 01753 01754 /* 01755 * Send a faked buttonup message to the listbox so that it can release 01756 * the capture and all. 01757 */ 01758 ThreadLock(pcbox->spwndList, &tlpwndList); 01759 01760 SendMessageWorker(pcbox->spwndList, LBCB_ENDTRACK, fSelEndOK, 0, FALSE); 01761 01762 if (pcbox->fLBoxVisible) { 01763 WORD swpFlags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE; 01764 01765 if (!TestWF(pcbox->spwnd, WFWIN31COMPAT)) 01766 swpFlags |= SWP_FRAMECHANGED; 01767 01768 pcbox->fLBoxVisible = FALSE; 01769 01770 /* 01771 * Hide the listbox window 01772 */ 01773 NtUserShowWindow(hwndList, SW_HIDE); 01774 01775 // 01776 // Invalidate the item area now since SWP() might update stuff. 01777 // Since the combo is CS_VREDRAW/CS_HREDRAW, a size change will 01778 // redraw the whole thing, including the item rect. But if it 01779 // isn't changing size, we still want to redraw the item anyway 01780 // to show focus/selection. 01781 // 01782 if (!(pcbox->CBoxStyle & SEDITABLE)) 01783 NtUserInvalidateRect(hwnd, &pcbox->editrc, TRUE); 01784 01785 NtUserSetWindowPos(hwnd, HWND_TOP, 0, 0, 01786 pcbox->cxCombo, pcbox->cyCombo, swpFlags); 01787 01788 // In case size didn't change 01789 UpdateWindow(hwnd); 01790 01791 if (pcbox->CBoxStyle & SEDITABLE) { 01792 xxxCBCompleteEditWindow(pcbox); 01793 } 01794 01795 if (fNotifyParent) { 01796 01797 /* 01798 * Notify parent we will be popping up the combo box. 01799 */ 01800 xxxCBNotifyParent(pcbox, CBN_CLOSEUP); 01801 if (!IsWindow(hwnd)) 01802 return(FALSE); 01803 } 01804 } 01805 01806 ThreadUnlock(&tlpwndList); 01807 01808 return(TRUE); 01809 }

VOID xxxCBInternalUpdateEditWindow PCBOX  ,
HDC 
 

Definition at line 2028 of file combo.c.

References CBFHASSTRINGS, CheckLock, CopyInflateRect(), CopyRect, DrawFocusRect(), DWORD, tagCBox::editrc, FALSE, tagCBox::fFocus, FillRect(), tagCBox::fLBoxVisible, tagCBox::fNoEdit, tagCBox::fRightAlign, tagCBox::fRtoLReading, GetControlBrush, tagCBox::hFont, HW, HWq, InflateRect(), IsComboVisible, msg, NtUserGetDC(), NtUserReleaseDC, NULL, tagCBox::OwnerDraw, SendMessage(), SendMessageWorker(), SetWindowText(), tagWND::spmenu, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, tagCBox::spwndParent, SYSHBR, SYSMET, SYSRGB, TestWF, ThreadLock, ThreadUnlock, UINT, UserLocalAlloc, UserLocalFree, WEFPUIACCELHIDDEN, WEFPUIFOCUSHIDDEN, WFANSIPROC, WFDISABLED, and WFWIN40COMPAT.

Referenced by ComboBoxWndProcWorker(), xxxCBCommandHandler(), xxxCBInvertStaticWindow(), xxxCBPaint(), and xxxLBoxCtlDelete().

02031 { 02032 int cchText = 0; 02033 LPWSTR pText = NULL; 02034 int sItem; 02035 HDC hdc; 02036 UINT msg; 02037 HBRUSH hbrSave; 02038 HBRUSH hbrControl; 02039 HANDLE hOldFont; 02040 DRAWITEMSTRUCT dis; 02041 RECT rc; 02042 HWND hwnd = HWq(pcbox->spwnd); 02043 TL tlpwndList; 02044 TL tlpwndEdit; 02045 TL tlpwndParent; 02046 02047 CheckLock(pcbox->spwnd); 02048 02049 /* This check is also commented out in Win3.1 and Win95 */ 02050 // if (!TestWF(pcbox->spwnd, WFVISIBLE)) { 02051 // return; 02052 // } 02053 02054 ThreadLock(pcbox->spwndParent, &tlpwndParent); 02055 ThreadLock(pcbox->spwndList, &tlpwndList); 02056 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 02057 02058 sItem = (int)SendMessageWorker(pcbox->spwndList, LB_GETCURSEL, 0, 0, FALSE); 02059 02060 /* 02061 * This 'try-finally' block ensures that the allocated 'pText' will 02062 * be freed no matter how this routine is exited. 02063 */ 02064 try { 02065 if (sItem != -1) { 02066 cchText = (int)SendMessageWorker(pcbox->spwndList, LB_GETTEXTLEN, 02067 (DWORD)sItem, 0, FALSE); 02068 if ((pText = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, (cchText+1) * sizeof(WCHAR)))) { 02069 cchText = (int)SendMessageWorker(pcbox->spwndList, LB_GETTEXT, 02070 (DWORD)sItem, (LPARAM)pText, FALSE); 02071 } 02072 } 02073 02074 if (!pcbox->fNoEdit) { 02075 02076 if (pcbox->spwndEdit) { 02077 if (TestWF(pcbox->spwnd, CBFHASSTRINGS)) 02078 SetWindowText(HWq(pcbox->spwndEdit), pText ? pText : TEXT("")); 02079 02080 if (pcbox->fFocus) { 02081 /* 02082 * Only hilite the text if we have the focus. 02083 */ 02084 SendMessageWorker(pcbox->spwndEdit, EM_SETSEL, 0, MAXLONG, !!TestWF(pcbox->spwnd, WFANSIPROC)); 02085 } 02086 } 02087 } else if (IsComboVisible(pcbox)) { 02088 if (hdcPaint) { 02089 hdc = hdcPaint; 02090 } else { 02091 hdc = NtUserGetDC(hwnd); 02092 } 02093 02094 SetBkMode(hdc, OPAQUE); 02095 if (TestWF(pcbox->spwnd, WFWIN40COMPAT)) { 02096 if (TestWF(pcbox->spwnd, WFDISABLED)) 02097 msg = WM_CTLCOLORSTATIC; 02098 else 02099 msg = WM_CTLCOLOREDIT; 02100 } else 02101 msg = WM_CTLCOLORLISTBOX; 02102 02103 hbrControl = GetControlBrush(hwnd, hdc, msg); 02104 hbrSave = SelectObject(hdc, hbrControl); 02105 02106 CopyInflateRect(&rc, &pcbox->editrc, SYSMET(CXBORDER), SYSMET(CYBORDER)); 02107 PatBlt(hdc, rc.left, rc.top, rc.right - rc.left, 02108 rc.bottom - rc.top, PATCOPY); 02109 InflateRect(&rc, -SYSMET(CXBORDER), -SYSMET(CYBORDER)); 02110 02111 if (pcbox->fFocus && !pcbox->fLBoxVisible) { 02112 // 02113 // Fill in the selected area 02114 // 02115 02116 02117 // only do the FillRect if we know its not 02118 // ownerdraw item, otherwise we mess up people up 02119 // BUT: for Compat's sake we still do this for Win 3.1 guys 02120 02121 if (!TestWF( pcbox->spwnd, WFWIN40COMPAT) || !pcbox->OwnerDraw) 02122 FillRect(hdc, &rc, SYSHBR(HIGHLIGHT)); 02123 02124 SetBkColor(hdc, SYSRGB(HIGHLIGHT)); 02125 SetTextColor(hdc, SYSRGB(HIGHLIGHTTEXT)); 02126 } else if (TestWF(pcbox->spwnd, WFDISABLED) && !pcbox->OwnerDraw) { 02127 if ((COLORREF)SYSRGB(GRAYTEXT) != GetBkColor(hdc)) 02128 SetTextColor(hdc, SYSRGB(GRAYTEXT)); 02129 } 02130 02131 if (pcbox->hFont != NULL) 02132 hOldFont = SelectObject(hdc, pcbox->hFont); 02133 02134 if (pcbox->OwnerDraw) { 02135 02136 /* 02137 * Let the app draw the stuff in the static text box. 02138 */ 02139 dis.CtlType = ODT_COMBOBOX; 02140 dis.CtlID = PtrToUlong(pcbox->spwnd->spmenu); 02141 dis.itemID = sItem; 02142 dis.itemAction = ODA_DRAWENTIRE; 02143 dis.itemState = (UINT) 02144 ((pcbox->fFocus && !pcbox->fLBoxVisible ? ODS_SELECTED : 0) | 02145 (TestWF(pcbox->spwnd, WFDISABLED) ? ODS_DISABLED : 0) | 02146 (pcbox->fFocus && !pcbox->fLBoxVisible ? ODS_FOCUS : 0) | 02147 (TestWF(pcbox->spwnd, WFWIN40COMPAT) ? ODS_COMBOBOXEDIT : 0) | 02148 (TestWF(pcbox->spwnd, WEFPUIFOCUSHIDDEN) ? ODS_NOFOCUSRECT : 0) | 02149 (TestWF(pcbox->spwnd, WEFPUIACCELHIDDEN) ? ODS_NOACCEL : 0)); 02150 02151 dis.hwndItem = hwnd; 02152 dis.hDC = hdc; 02153 CopyRect(&dis.rcItem, &rc); 02154 02155 // Don't let ownerdraw dudes draw outside of the combo client 02156 // bounds. 02157 IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom); 02158 02159 dis.itemData = (ULONG_PTR)SendMessageWorker(pcbox->spwndList, 02160 LB_GETITEMDATA, (UINT)sItem, 0, FALSE); 02161 02162 SendMessage(HW(pcbox->spwndParent), WM_DRAWITEM, dis.CtlID, 02163 (LPARAM)&dis); 02164 } else { 02165 02166 /* 02167 * Start the text one pixel within the rect so that we leave a 02168 * nice hilite border around the text. 02169 */ 02170 02171 int x ; 02172 UINT align ; 02173 02174 if (pcbox->fRightAlign ) { 02175 align = TA_RIGHT; 02176 x = rc.right - SYSMET(CXBORDER); 02177 } else { 02178 x = rc.left + SYSMET(CXBORDER); 02179 align = 0; 02180 } 02181 02182 if (pcbox->fRtoLReading ) 02183 align |= TA_RTLREADING; 02184 02185 if (align) 02186 SetTextAlign(hdc, GetTextAlign(hdc) | align); 02187 02188 // Draw the text, leaving a gap on the left & top for selection. 02189 ExtTextOut(hdc, x, rc.top + SYSMET(CYBORDER), ETO_CLIPPED | ETO_OPAQUE, 02190 &rc, pText ? pText : TEXT(""), cchText, NULL); 02191 if (pcbox->fFocus && !pcbox->fLBoxVisible) { 02192 if (!TestWF(pcbox->spwnd, WEFPUIFOCUSHIDDEN)) { 02193 DrawFocusRect(hdc, &rc); 02194 } 02195 } 02196 } 02197 02198 if (pcbox->hFont && hOldFont) { 02199 SelectObject(hdc, hOldFont); 02200 } 02201 02202 if (hbrSave) { 02203 SelectObject(hdc, hbrSave); 02204 } 02205 02206 if (!hdcPaint) { 02207 NtUserReleaseDC(hwnd, hdc); 02208 } 02209 } 02210 02211 } finally { 02212 if (pText != NULL) 02213 UserLocalFree((HANDLE)pText); 02214 } 02215 02216 ThreadUnlock(&tlpwndEdit); 02217 ThreadUnlock(&tlpwndList); 02218 ThreadUnlock(&tlpwndParent); 02219 }

VOID xxxCBInvertStaticWindow PCBOX  ,
BOOL  ,
HDC 
 

Definition at line 2230 of file combo.c.

References BOOL, CheckLock, tagCBox::fFocus, tagCBox::spwnd, UINT, and xxxCBInternalUpdateEditWindow().

Referenced by xxxCBGetFocusHelper(), and xxxCBKillFocusHelper().

02234 { 02235 BOOL focusSave = pcbox->fFocus; 02236 02237 CheckLock(pcbox->spwnd); 02238 02239 pcbox->fFocus = (UINT)fNewSelectionState; 02240 xxxCBInternalUpdateEditWindow(pcbox, hdc); 02241 02242 pcbox->fFocus = (UINT)focusSave; 02243 }

VOID xxxCBKillFocusHelper PCBOX   ) 
 

Definition at line 2402 of file combo.c.

References tagCBox::CBoxStyle, CheckLock, FALSE, tagCBox::fFocus, tagCBox::fNoEdit, L, NULL, SDROPDOWNLIST, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, TestWF, ThreadLock, ThreadUnlock, TRUE, WFANSIPROC, xxxCBHideListBoxWindow(), xxxCBInvertStaticWindow(), and xxxCBNotifyParent().

Referenced by ComboBoxWndProcWorker().

02404 { 02405 TL tlpwndList; 02406 TL tlpwndEdit; 02407 02408 CheckLock(pcbox->spwnd); 02409 02410 if (!pcbox->fFocus || pcbox->spwndList == NULL) 02411 return; 02412 02413 ThreadLock(pcbox->spwndList, &tlpwndList); 02414 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 02415 02416 /* 02417 * The combo box is losing the focus. Send buttonup clicks so that 02418 * things release the mouse capture if they have it... If the 02419 * pwndListBox is null, don't do anything. This occurs if the combo box 02420 * is destroyed while it has the focus. 02421 */ 02422 SendMessageWorker(pcbox->spwnd, WM_LBUTTONUP, 0L, 0xFFFFFFFFL, FALSE); 02423 if (!xxxCBHideListBoxWindow(pcbox, TRUE, FALSE)) 02424 return; 02425 02426 /* 02427 * Turn off the listbox caret 02428 */ 02429 02430 if (pcbox->CBoxStyle == SDROPDOWNLIST) 02431 SendMessageWorker(pcbox->spwndList, LBCB_CARETOFF, 0, 0, FALSE); 02432 02433 if (pcbox->fNoEdit) { 02434 02435 /* 02436 * Invert the static text rectangle 02437 */ 02438 xxxCBInvertStaticWindow(pcbox, FALSE, (HDC)NULL); 02439 } else if (pcbox->spwndEdit) { 02440 SendMessageWorker(pcbox->spwndEdit, EM_SETSEL, 0, 0, !!TestWF(pcbox->spwnd, WFANSIPROC)); 02441 } 02442 02443 pcbox->fFocus = FALSE; 02444 xxxCBNotifyParent(pcbox, CBN_KILLFOCUS); 02445 02446 ThreadUnlock(&tlpwndEdit); 02447 ThreadUnlock(&tlpwndList); 02448 }

LRESULT xxxCBMessageItemHandler PCBOX  ,
UINT  ,
LPVOID 
 

Definition at line 1393 of file combo.c.

References CheckLock, HW, HWq, SendMessage(), tagWND::spmenu, tagCBox::spwnd, tagCBox::spwndParent, ThreadLock, and ThreadUnlock.

Referenced by ComboBoxWndProcWorker().

01397 { 01398 LRESULT lRet; 01399 TL tlpwndParent; 01400 01401 CheckLock(pcbox->spwnd); 01402 01403 /* 01404 * Send the <foo>item message back to the application after changing some 01405 * parameters to their combo box specific versions. 01406 */ 01407 ((LPMEASUREITEMSTRUCT)lpfoo)->CtlType = ODT_COMBOBOX; 01408 ((LPMEASUREITEMSTRUCT)lpfoo)->CtlID = PtrToUlong(pcbox->spwnd->spmenu); 01409 if (message == WM_DRAWITEM) 01410 ((LPDRAWITEMSTRUCT)lpfoo)->hwndItem = HWq(pcbox->spwnd); 01411 else if (message == WM_DELETEITEM) 01412 ((LPDELETEITEMSTRUCT)lpfoo)->hwndItem = HWq(pcbox->spwnd); 01413 else if (message == WM_COMPAREITEM) 01414 ((LPCOMPAREITEMSTRUCT)lpfoo)->hwndItem = HWq(pcbox->spwnd); 01415 01416 ThreadLock(pcbox->spwndParent, &tlpwndParent); 01417 lRet = SendMessage(HW(pcbox->spwndParent), message, 01418 (WPARAM)pcbox->spwnd->spmenu, (LPARAM)lpfoo); 01419 ThreadUnlock(&tlpwndParent); 01420 01421 return lRet; 01422 }

VOID xxxCBNcDestroyHandler PWND  ,
PCBOX 
 

Definition at line 394 of file comboini.c.

References CheckLock, ComboboxLookaside, FNID_CLEANEDUP_BIT, FreeLookasideEntry(), HWq, NtUserDestroyWindow(), NtUserSetWindowFNID(), NULL, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, tagCBox::spwndParent, and Unlock.

Referenced by ComboBoxWndProcWorker().

00397 { 00398 CheckLock(pwnd); 00399 00400 /* 00401 * If there is no pcbox, there is nothing to clean up. 00402 */ 00403 if (pcbox != NULL) { 00404 00405 /* 00406 * Destroy the list box here so that it'll send WM_DELETEITEM messages 00407 * before the combo box turns into a zombie. 00408 */ 00409 if (pcbox->spwndList != NULL) { 00410 NtUserDestroyWindow(HWq(pcbox->spwndList)); 00411 Unlock(&pcbox->spwndList); 00412 } 00413 00414 pcbox->spwnd = NULL; 00415 Unlock(&pcbox->spwndParent); 00416 00417 /* 00418 * If there is no editcontrol, spwndEdit is the combobox window which 00419 * isn't locked (that would have caused a 'catch-22'). 00420 */ 00421 if (pwnd != pcbox->spwndEdit) { 00422 Unlock(&pcbox->spwndEdit); 00423 } 00424 00425 /* 00426 * Since a pointer and a handle to a fixed local object are the same. 00427 */ 00428 FreeLookasideEntry(&ComboboxLookaside, pcbox); 00429 } 00430 00431 /* 00432 * Set the window's fnid status so that we can ignore rogue messages 00433 */ 00434 NtUserSetWindowFNID(HWq(pwnd), FNID_CLEANEDUP_BIT); 00435 }

VOID xxxCBNotifyParent PCBOX  ,
SHORT 
 

Referenced by xxxCBCommandHandler(), xxxCBGetFocusHelper(), xxxCBHideListBoxWindow(), xxxCBKillFocusHelper(), and xxxCBShowListBoxWindow().

VOID xxxCBPaint PCBOX  ,
HDC 
 

Definition at line 1431 of file combo.c.

References tagCBox::buttonrc, CheckLock, tagCBox::cxCombo, tagCBox::cyCombo, DrawEdge(), DrawFrameControl(), EFREADONLY, tagCBox::f3DCombo, tagCBox::fButtonPressed, FillRect(), tagCBox::fNoEdit, tagCBox::fRightAlign, GetControlBrush, HWq, msg, tagCBox::spwnd, tagCBox::spwndEdit, TestWF, UINT, WFDISABLED, WFWIN40COMPAT, and xxxCBInternalUpdateEditWindow().

Referenced by ComboBoxWndProcWorker().

01434 { 01435 RECT rc; 01436 UINT msg; 01437 HBRUSH hbr; 01438 01439 CheckLock(pcbox->spwnd); 01440 01441 rc.left = rc.top = 0; 01442 rc.right = pcbox->cxCombo; 01443 rc.bottom = pcbox->cyCombo; 01444 if (pcbox->f3DCombo) 01445 DrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST); 01446 else 01447 DrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST | BF_FLAT | BF_MONO); 01448 01449 if (pcbox->buttonrc.left != 0) { 01450 // Draw in the dropdown arrow button 01451 DrawFrameControl(hdc, &pcbox->buttonrc, DFC_SCROLL, 01452 DFCS_SCROLLCOMBOBOX | 01453 (pcbox->fButtonPressed ? DFCS_PUSHED | DFCS_FLAT : 0) | 01454 (TestWF(pcbox->spwnd, WFDISABLED) ? DFCS_INACTIVE : 0)); 01455 #ifdef COLOR_HOTTRACKING 01456 (pcbox->fButtonHotTracked ? DFCS_HOT: 0))); 01457 #endif // COLOR_HOTTRACKING 01458 if (pcbox->fRightAlign ) 01459 rc.left = pcbox->buttonrc.right; 01460 else 01461 rc.right = pcbox->buttonrc.left; 01462 } 01463 01464 // Erase the background behind the edit/static item. Since a combo 01465 // is an edit field/list box hybrid, we use the same coloring 01466 // conventions. 01467 msg = WM_CTLCOLOREDIT; 01468 if (TestWF(pcbox->spwnd, WFWIN40COMPAT)) { 01469 if (TestWF(pcbox->spwnd, WFDISABLED) || 01470 (!pcbox->fNoEdit && pcbox->spwndEdit && TestWF(pcbox->spwndEdit, EFREADONLY))) 01471 msg = WM_CTLCOLORSTATIC; 01472 } else 01473 msg = WM_CTLCOLORLISTBOX; 01474 01475 hbr = GetControlBrush(HWq(pcbox->spwnd), hdc, msg); 01476 01477 if (pcbox->fNoEdit) 01478 xxxCBInternalUpdateEditWindow(pcbox, hdc); 01479 else 01480 FillRect(hdc, &rc, hbr); 01481 }

void xxxCBPosition PCBOX  pcbox  ) 
 

Definition at line 589 of file comboini.c.

References tagCBox::editrc, tagCBox::fNoEdit, HWq, NtUserMoveWindow(), tagCBox::spwndEdit, ThreadLock, ThreadUnlock, TRUE, xxxCBCalcControlRects(), and xxxCBSetDroppedSize().

Referenced by ComboBoxWndProcWorker(), xxxCBSetFontHandler(), and xxxCBSizeHandler().

00590 { 00591 RECT rcList; 00592 00593 // Calculate placement of components--button, item, list 00594 xxxCBCalcControlRects(pcbox, &rcList); 00595 00596 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 00597 TL tlpwndEdit; 00598 00599 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00600 NtUserMoveWindow(HWq(pcbox->spwndEdit), pcbox->editrc.left, pcbox->editrc.top, 00601 pcbox->editrc.right - pcbox->editrc.left, 00602 pcbox->editrc.bottom - pcbox->editrc.top, TRUE); 00603 ThreadUnlock(&tlpwndEdit); 00604 } 00605 00606 // Recalculate drop height & width 00607 xxxCBSetDroppedSize(pcbox, &rcList); 00608 }

LONG xxxCBSetEditItemHeight PCBOX  pcbox,
int  editHeight
 

Definition at line 485 of file comboini.c.

References tagCBox::buttonrc, tagCBox::CBoxStyle, CheckLock, tagCBox::cxCombo, tagCBox::cxDrop, tagCBox::cyCombo, tagCBox::cyDrop, tagCBox::editrc, FALSE, tagCBox::fNoEdit, HWq, max, NtUserMoveWindow(), NtUserSetWindowPos(), NULL, tagWND::rcWindow, SDROPPABLE, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, SSIMPLE, SYSMET, ThreadLock, ThreadUnlock, and TRUE.

Referenced by ComboBoxWndProcWorker().

00488 { 00489 TL tlpwndEdit; 00490 TL tlpwndList; 00491 00492 CheckLock(pcbox->spwnd); 00493 00494 if (dyEdit > 255) { 00495 RIPERR0(ERROR_INVALID_EDIT_HEIGHT, RIP_VERBOSE, ""); 00496 return CB_ERR; 00497 } 00498 00499 pcbox->editrc.bottom = pcbox->editrc.top + dyEdit; 00500 pcbox->cyCombo = pcbox->editrc.bottom + SYSMET(CYFIXEDFRAME); 00501 00502 if (pcbox->CBoxStyle & SDROPPABLE) { 00503 pcbox->buttonrc.bottom = pcbox->cyCombo - SYSMET(CYEDGE); 00504 } 00505 00506 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00507 ThreadLock(pcbox->spwndList, &tlpwndList); 00508 00509 00510 /* 00511 * Reposition the editfield. 00512 * Don't let spwndEdit or List of NULL go through; if someone adjusts 00513 * the height on a NCCREATE; same as not having 00514 * HW instead of HWq but we don't go to the kernel. 00515 */ 00516 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 00517 NtUserMoveWindow(HWq(pcbox->spwndEdit), pcbox->editrc.left, pcbox->editrc.top, 00518 pcbox->editrc.right-pcbox->editrc.left, dyEdit, TRUE); 00519 } 00520 00521 /* 00522 * Reposition the list and combobox windows. 00523 */ 00524 if (pcbox->CBoxStyle == SSIMPLE) { 00525 if (pcbox->spwndList != 0) { 00526 NtUserMoveWindow(HWq(pcbox->spwndList), 0, pcbox->cyCombo, pcbox->cxCombo, 00527 pcbox->cyDrop, FALSE); 00528 00529 NtUserSetWindowPos(HWq(pcbox->spwnd), HWND_TOP, 0, 0, 00530 pcbox->cxCombo, pcbox->cyCombo + 00531 pcbox->spwndList->rcWindow.bottom - pcbox->spwndList->rcWindow.top, 00532 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); 00533 } 00534 } else { 00535 if (pcbox->spwndList != NULL) { 00536 NtUserMoveWindow(HWq(pcbox->spwndList), pcbox->spwnd->rcWindow.left, 00537 pcbox->spwnd->rcWindow.top + pcbox->cyCombo, 00538 max(pcbox->cxDrop, pcbox->cxCombo), pcbox->cyDrop, FALSE); 00539 } 00540 00541 NtUserSetWindowPos(HWq(pcbox->spwnd), HWND_TOP, 0, 0, 00542 pcbox->cxCombo, pcbox->cyCombo, 00543 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); 00544 } 00545 00546 ThreadUnlock(&tlpwndList); 00547 ThreadUnlock(&tlpwndEdit); 00548 00549 return CB_OKAY; 00550 }

VOID xxxCBSetFontHandler PCBOX  ,
HANDLE  ,
BOOL 
 

Definition at line 443 of file comboini.c.

References CheckLock, FALSE, tagCBox::fNoEdit, tagCBox::hFont, HWq, NtUserInvalidateRect(), NULL, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, ThreadLock, ThreadUnlock, TRUE, and xxxCBPosition().

Referenced by ComboBoxWndProcWorker().

00447 { 00448 TL tlpwndEdit; 00449 TL tlpwndList; 00450 00451 CheckLock(pcbox->spwnd); 00452 00453 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 00454 ThreadLock(pcbox->spwndList, &tlpwndList); 00455 00456 pcbox->hFont = hFont; 00457 00458 if (!pcbox->fNoEdit && pcbox->spwndEdit) { 00459 SendMessageWorker(pcbox->spwndEdit, WM_SETFONT, (WPARAM)hFont, FALSE, FALSE); 00460 } 00461 00462 SendMessageWorker(pcbox->spwndList, WM_SETFONT, (WPARAM)hFont, FALSE, FALSE); 00463 00464 // Recalculate the layout of controls. This will hide the listbox also. 00465 xxxCBPosition(pcbox); 00466 00467 if (fRedraw) { 00468 NtUserInvalidateRect(HWq(pcbox->spwnd), NULL, TRUE); 00469 // LATER UpdateWindow(HW(pcbox->spwnd)); 00470 } 00471 00472 ThreadUnlock(&tlpwndList); 00473 ThreadUnlock(&tlpwndEdit); 00474 }

VOID xxxCBShowListBoxWindow PCBOX  pcbox,
BOOL  fTrack
 

Definition at line 1819 of file combo.c.

References _MonitorFromWindow(), AnimateWindow(), BOOL, tagCBox::buttonrc, CBFNOINTEGRALHEIGHT, tagCBox::CBoxStyle, CheckLock, CMS_QANIMATION, tagCBox::cxCombo, tagCBox::cxDrop, tagCBox::cyCombo, tagCBox::cyDrop, DWORD, tagCBox::editrc, tagCBox::f3DCombo, FALSE, tagCBox::fLBoxVisible, tagCBox::fMouseDown, GetAppCompatFlags2(), gpsi, HWq, tagLBIV::iTypeSearch, max, min, NtUserInvalidateRect(), NtUserSetWindowPos(), NtUserShowWindow(), NULL, PUSIF_COMBOBOXANIMATION, tagMONITOR::rcMonitor, tagWND::rcWindow, SDROPDOWN, SDROPPABLE, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndList, SYSMET, TEST_EffectPUSIF, TestWF, ThreadLock, ThreadUnlock, TRUE, UpdateWindow(), VER40, WFWIN40COMPAT, xxxCBCompleteEditWindow(), xxxCBNotifyParent(), and xxxCBUpdateListBoxWindow().

Referenced by ComboBoxWndProcWorker(), and xxxLBoxCtlKeyInput().

01821 { 01822 RECT editrc; 01823 int itemNumber; 01824 int iHeight; 01825 int yTop; 01826 DWORD dwMult; 01827 int cyItem; 01828 HWND hwnd = HWq(pcbox->spwnd); 01829 HWND hwndList = HWq(pcbox->spwndList); 01830 BOOL fAnimPos; 01831 TL tlpwndList; 01832 PMONITOR pMonitor; 01833 01834 // 01835 // THIS FUNCTION IS ONLY CALLED FOR DROPPABLE LIST COMBOBOXES 01836 // 01837 UserAssert(pcbox->CBoxStyle & SDROPPABLE); 01838 01839 CheckLock(pcbox->spwnd); 01840 01841 ThreadLock(pcbox->spwndList, &tlpwndList); 01842 01843 /* 01844 * Notify parent we will be dropping down the combo box. 01845 */ 01846 01847 xxxCBNotifyParent(pcbox, CBN_DROPDOWN); 01848 /* 01849 * Invalidate the button rect so that the depressed arrow is drawn. 01850 */ 01851 NtUserInvalidateRect(hwnd, &pcbox->buttonrc, TRUE); 01852 01853 pcbox->fLBoxVisible = TRUE; 01854 01855 if (pcbox->CBoxStyle == SDROPDOWN) { 01856 01857 /* 01858 * If an item in the listbox matches the text in the edit control, 01859 * scroll it to the top of the listbox. Select the item only if the 01860 * mouse button isn't down otherwise we will select the item when the 01861 * mouse button goes up. 01862 */ 01863 xxxCBUpdateListBoxWindow(pcbox, !pcbox->fMouseDown); 01864 if (!pcbox->fMouseDown) 01865 xxxCBCompleteEditWindow(pcbox); 01866 } else { 01867 01868 /* 01869 * Scroll the currently selected item to the top of the listbox. 01870 */ 01871 itemNumber = (int)SendMessageWorker(pcbox->spwndList, LB_GETCURSEL, 01872 0, 0, FALSE); 01873 if (itemNumber == -1) { 01874 itemNumber = 0; 01875 } 01876 SendMessageWorker(pcbox->spwndList, LB_SETTOPINDEX, itemNumber, 0, FALSE); 01877 SendMessageWorker(pcbox->spwndList, LBCB_CARETON, 0, 0, FALSE); 01878 01879 /* 01880 * We need to invalidate the edit rect so that the focus frame/invert 01881 * will be turned off when the listbox is visible. Tandy wants this for 01882 * his typical reasons... 01883 */ 01884 NtUserInvalidateRect(hwnd, &pcbox->editrc, TRUE); 01885 } 01886 01887 // 01888 // Figure out where to position the dropdown listbox. We want it just 01889 // touching the edge around the edit rectangle. Note that since the 01890 // listbox is a popup, we need the position in screen coordinates. 01891 // 01892 01893 // We want the dropdown to pop below or above the combo 01894 01895 // Get screen coords 01896 editrc.left = pcbox->spwnd->rcWindow.left; 01897 editrc.top = pcbox->spwnd->rcWindow.top; 01898 editrc.right = pcbox->spwnd->rcWindow.left + pcbox->cxCombo; 01899 editrc.bottom = pcbox->spwnd->rcWindow.top + pcbox->cyCombo; 01900 01901 // List area 01902 cyItem = (int)SendMessageWorker(pcbox->spwndList, LB_GETITEMHEIGHT, 0, 0, FALSE); 01903 01904 if (cyItem == 0) { 01905 // Make sure that it's not 0 01906 RIPMSG0( RIP_WARNING, "LB_GETITEMHEIGHT is returning 0\n" ); 01907 01908 cyItem = gpsi->cySysFontChar; 01909 } 01910 01911 // we shoulda' just been able to use cyDrop here, but thanks to VB's need 01912 // to do things their OWN SPECIAL WAY, we have to keep monitoring the size 01913 // of the listbox 'cause VB changes it directly (jeffbog 03/21/94) 01914 iHeight = max(pcbox->cyDrop, pcbox->spwndList->rcWindow.bottom - 01915 pcbox->spwndList->rcWindow.top); 01916 01917 if (dwMult = (DWORD)SendMessageWorker(pcbox->spwndList, LB_GETCOUNT, 0, 0, FALSE)) { 01918 dwMult = (DWORD)(LOWORD(dwMult) * cyItem); 01919 dwMult += SYSMET(CYEDGE); 01920 01921 if (dwMult < 0x7FFF) 01922 iHeight = min(LOWORD(dwMult), iHeight); 01923 } 01924 01925 if (!TestWF(pcbox->spwnd, CBFNOINTEGRALHEIGHT)) { 01926 UserAssert(cyItem); 01927 iHeight = ((iHeight - SYSMET(CYEDGE)) / cyItem) * cyItem + SYSMET(CYEDGE); 01928 } 01929 01930 // 01931 // Other 1/2 of old app combo fix. Make dropdown overlap combo window 01932 // a little. That way we can have a chance of invalidating the overlap 01933 // and causing a repaint to help out Publisher 2.0's toolbar combos. 01934 // See comments for PressButton() above. 01935 // 01936 pMonitor = _MonitorFromWindow(pcbox->spwnd, MONITOR_DEFAULTTOPRIMARY); 01937 if (editrc.bottom + iHeight <= pMonitor->rcMonitor.bottom) { 01938 yTop = editrc.bottom; 01939 if (!pcbox->f3DCombo) 01940 yTop -= SYSMET(CYBORDER); 01941 01942 fAnimPos = TRUE; 01943 } else { 01944 yTop = max(editrc.top - iHeight, pMonitor->rcMonitor.top); 01945 if (!pcbox->f3DCombo) 01946 yTop += SYSMET(CYBORDER); 01947 01948 fAnimPos = FALSE; 01949 } 01950 01951 if ( ! TestWF( pcbox->spwnd, WFWIN40COMPAT) ) 01952 { 01953 // fix for Winword B#7504, Combo-ListBox text gets 01954 // truncated by a small width, this is do to us 01955 // now setting size here in SetWindowPos, rather than 01956 // earlier where we did this in Win3.1 01957 01958 if ( (pcbox->spwndList->rcWindow.right - pcbox->spwndList->rcWindow.left ) > 01959 pcbox->cxDrop ) 01960 01961 pcbox->cxDrop = pcbox->spwndList->rcWindow.right - pcbox->spwndList->rcWindow.left; 01962 } 01963 01964 NtUserSetWindowPos(hwndList, HWND_TOPMOST, editrc.left, 01965 yTop, max(pcbox->cxDrop, pcbox->cxCombo), iHeight, SWP_NOACTIVATE); 01966 01967 /* 01968 * Get any drawing in the combo box window out of the way so it doesn't 01969 * invalidate any of the SPB underneath the list window. 01970 */ 01971 UpdateWindow(hwnd); 01972 01973 if (!(TEST_EffectPUSIF(PUSIF_COMBOBOXANIMATION)) 01974 || (GetAppCompatFlags2(VER40) & GACF2_ANIMATIONOFF)) { 01975 NtUserShowWindow(hwndList, SW_SHOWNA); 01976 } else { 01977 AnimateWindow(hwndList, CMS_QANIMATION, (fAnimPos ? AW_VER_POSITIVE : 01978 AW_VER_NEGATIVE) | AW_SLIDE); 01979 } 01980 01981 #ifdef LATER 01982 // 01983 // we don't have sys modal windows. 01984 // 01985 if (pwndSysModal) { 01986 01987 /* 01988 * If this combo is in a system modal dialog box, we need to explicitly 01989 * call update window otherwise we won't automatically send paint 01990 * messages to the toplevel listbox window. This is especially 01991 * noticeable in the File Open/Save sys modal dlgs which are put up at 01992 * ExitWindows time. 01993 */ 01994 UpdateWindow(hwndList); 01995 } 01996 #endif 01997 01998 /* 01999 * Restart search buffer from first char 02000 */ 02001 { 02002 PLBIV plb = ((PLBWND)pcbox->spwndList)->pLBIV; 02003 02004 if ((plb != NULL) && (plb != (PLBIV)-1)) { 02005 plb->iTypeSearch = 0; 02006 } 02007 } 02008 02009 if (fTrack && TestWF(pcbox->spwnd, WFWIN40COMPAT)) 02010 SendMessageWorker(pcbox->spwndList, LBCB_STARTTRACK, FALSE, 0, FALSE); 02011 02012 ThreadUnlock(&tlpwndList); 02013 }

VOID xxxCBSizeHandler PCBOX   ) 
 

Definition at line 563 of file comboini.c.

References CheckLock, tagCBox::cxCombo, tagCBox::cyCombo, tagCBox::cyDrop, tagWND::rcWindow, RECALC_CYDROP, tagCBox::spwnd, and xxxCBPosition().

Referenced by ComboBoxWndProcWorker().

00565 { 00566 CheckLock(pcbox->spwnd); 00567 00568 /* 00569 * Assume listbox is visible since the app should size it to its maximum 00570 * visible size. 00571 */ 00572 pcbox->cxCombo = pcbox->spwnd->rcWindow.right - pcbox->spwnd->rcWindow.left; 00573 // only recalc cyDrop if the drop down is not TOTALLY nuked by the sizing 00574 // -- Visio 1.0 -- B#13112 00575 if (((pcbox->spwnd->rcWindow.bottom - pcbox->spwnd->rcWindow.top) - pcbox->cyCombo) > 0) 00576 pcbox->cyDrop = RECALC_CYDROP; 00577 00578 // Reposition everything. 00579 xxxCBPosition(pcbox); 00580 }

VOID xxxCBUpdateListBoxWindow PCBOX  ,
BOOL 
 

Definition at line 2255 of file combo.c.

References CheckLock, DWORD, FALSE, L, NULL, SendMessageWorker(), tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, TestWF, ThreadLock, ThreadUnlock, UserLocalAlloc, UserLocalFree, and WFWIN40COMPAT.

Referenced by ComboBoxWndProcWorker(), xxxCBCommandHandler(), and xxxCBShowListBoxWindow().

02258 { 02259 int cchText; 02260 int sItem, sSel; 02261 LPWSTR pText = NULL; 02262 TL tlpwndEdit; 02263 TL tlpwndList; 02264 02265 if (pcbox->spwndEdit == NULL) { 02266 return; 02267 } 02268 02269 CheckLock(pcbox->spwnd); 02270 02271 ThreadLock(pcbox->spwndList, &tlpwndList); 02272 ThreadLock(pcbox->spwndEdit, &tlpwndEdit); 02273 02274 /* 02275 * +1 for null terminator 02276 */ 02277 02278 cchText = (int)SendMessageWorker(pcbox->spwndEdit, WM_GETTEXTLENGTH, 0, 0, FALSE); 02279 02280 if (cchText) { 02281 cchText++; 02282 pText = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, cchText*sizeof(WCHAR)); 02283 if (pText != NULL) { 02284 try { 02285 SendMessageWorker(pcbox->spwndEdit, WM_GETTEXT, cchText, (LPARAM)pText, FALSE); 02286 sItem = (int)SendMessageWorker(pcbox->spwndList, LB_FINDSTRING, 02287 (WPARAM)-1L, (LPARAM)pText, FALSE); 02288 } finally { 02289 UserLocalFree((HANDLE)pText); 02290 } 02291 } 02292 } 02293 else 02294 sItem = -1; 02295 02296 if (fSelectionAlso) { 02297 sSel = sItem; 02298 } else { 02299 sSel = -1; 02300 } 02301 02302 if (sItem == -1) 02303 { 02304 sItem = 0; 02305 02306 // 02307 // Old apps: w/ editable combos, selected 1st item in list even if 02308 // it didn't match text in edit field. This is not desirable 02309 // behavior for 4.0 dudes esp. with cancel allowed. Reason: 02310 // (1) User types in text that doesn't match list choices 02311 // (2) User drops combo 02312 // (3) User pops combo back up 02313 // (4) User presses OK in dialog that does stuff w/ combo 02314 // contents. 02315 // In 3.1, when the combo dropped, we'd select the 1st item anyway. 02316 // So the last CBN_SELCHANGE the owner got would be 0--which is 02317 // bogus because it really should be -1. In fact if you type anything 02318 // into the combo afterwards it will reset itself to -1. 02319 // 02320 // 4.0 dudes won't get this bogus 0 selection. 02321 // 02322 if (fSelectionAlso && !TestWF(pcbox->spwnd, WFWIN40COMPAT)) 02323 sSel = 0; 02324 } 02325 02326 02327 SendMessageWorker(pcbox->spwndList, LB_SETCURSEL, (DWORD)sSel, 0, FALSE); 02328 SendMessageWorker(pcbox->spwndList, LB_SETCARETINDEX, (DWORD)sItem, 0, FALSE); 02329 SendMessageWorker(pcbox->spwndList, LB_SETTOPINDEX, (DWORD)sItem, 0, FALSE); 02330 02331 ThreadUnlock(&tlpwndEdit); 02332 ThreadUnlock(&tlpwndList); 02333 }

VOID xxxCheckDefPushButton PWND  pwndDlg,
HWND  hwndOldFocus,
HWND  hwndNewFocus
 

Definition at line 84 of file dlgmgr2.c.

References _FindDlgItem(), CheckLock, HW, HWq, L, NULL, SAMEWOWHANDLE, SendMessage(), tagWND::spmenu, TestWF, ThreadLockAlways, ThreadUnlock, TRUE, UINT, ValidateHwnd, WEFCONTROLPARENT, WFDISABLED, WFWIN40COMPAT, and xxxRemoveDefaultButton().

Referenced by DefDlgProcWorker(), InternalCreateDialog(), IsDialogMessageW(), and xxxRestoreDlgFocus().

00088 { 00089 PWND pwndNewFocus; 00090 PWND pwndOldFocus; 00091 TL tlpwndT; 00092 PWND pwndT; 00093 UINT codeNewFocus = 0; 00094 UINT styleT; 00095 LONG lT; 00096 int id; 00097 00098 if (hwndNewFocus) 00099 pwndNewFocus = ValidateHwnd(hwndNewFocus); 00100 else 00101 pwndNewFocus = NULL; 00102 00103 if (hwndOldFocus) 00104 pwndOldFocus = ValidateHwnd(hwndOldFocus); 00105 else 00106 pwndOldFocus = NULL; 00107 00108 CheckLock(pwndDlg); 00109 CheckLock(pwndNewFocus); 00110 CheckLock(pwndOldFocus); 00111 00112 if (pwndNewFocus) 00113 { 00114 // Do nothing if clicking on dialog background or recursive dialog 00115 // background. 00116 if (TestWF(pwndNewFocus, WEFCONTROLPARENT)) 00117 return; 00118 00119 codeNewFocus = (UINT)SendMessage(hwndNewFocus, WM_GETDLGCODE, 0, 0L); 00120 } 00121 00122 if (SAMEWOWHANDLE(hwndOldFocus, hwndNewFocus)) { 00123 // 00124 // NEW FOR 4.0: 00125 // 00126 // There is a very common frustrating scenario for ISVs who try to 00127 // set the default ID. Our dialog manager assumes that if a push 00128 // button has the focus, it is the default button also. As such 00129 // it passes in the focus window to this routine. If someone tries 00130 // to change the focus or set the def ID such that they reside with 00131 // two different push buttons, the double-default-push button case 00132 // will result shortly. 00133 // 00134 // As such, for 4.0 dialogs, we will go check the def ID and see if 00135 // is the same as hwndOldFocus' ID. If not, then we will find IT 00136 // and use that dude as hwndOldFocus 00137 // 00138 if (codeNewFocus & DLGC_UNDEFPUSHBUTTON) 00139 { 00140 if (TestWF(pwndDlg, WFWIN40COMPAT) && hwndOldFocus) 00141 { 00142 lT = (LONG)SendMessage(HWq(pwndDlg), DM_GETDEFID, 0, 0L); 00143 id = (HIWORD(lT) == DC_HASDEFID ? LOWORD(lT) : IDOK); 00144 lT = MAKELONG(id, 0); 00145 00146 if (lT != PtrToLong(pwndNewFocus->spmenu)) 00147 { 00148 if (pwndOldFocus = _FindDlgItem(pwndDlg, lT)) 00149 { 00150 hwndOldFocus = HW(pwndOldFocus); 00151 if (SendMessage(hwndOldFocus, WM_GETDLGCODE, 0, 0L) & DLGC_DEFPUSHBUTTON) 00152 { 00153 xxxRemoveDefaultButton(pwndDlg, pwndOldFocus); 00154 goto SetNewDefault; 00155 } 00156 } 00157 } 00158 } 00159 00160 SendMessage(hwndNewFocus, BM_SETSTYLE, BS_DEFPUSHBUTTON, (LONG)TRUE); 00161 } 00162 return; 00163 } 00164 00165 /* 00166 * If the focus is changing to or from a pushbutton, then remove the 00167 * default style from the current default button 00168 */ 00169 if ((hwndOldFocus != NULL && (SendMessage(hwndOldFocus, WM_GETDLGCODE, 00170 0, 0) & (DLGC_DEFPUSHBUTTON | DLGC_UNDEFPUSHBUTTON))) || 00171 (hwndNewFocus != NULL && 00172 (codeNewFocus & (DLGC_DEFPUSHBUTTON | DLGC_UNDEFPUSHBUTTON)))) { 00173 xxxRemoveDefaultButton(pwndDlg, pwndNewFocus); 00174 } 00175 00176 SetNewDefault: 00177 /* 00178 * If moving to a button, make that button the default. 00179 */ 00180 if (codeNewFocus & DLGC_UNDEFPUSHBUTTON) { 00181 SendMessage(hwndNewFocus, BM_SETSTYLE, BS_DEFPUSHBUTTON, (LONG)TRUE); 00182 } else { 00183 00184 /* 00185 * Otherwise, make sure the original default button is default 00186 * and no others. 00187 */ 00188 00189 /* 00190 * Get the original default button handle 00191 */ 00192 lT = (LONG)SendMessage(HWq(pwndDlg), DM_GETDEFID, 0, 0L); 00193 id = (HIWORD(lT) == DC_HASDEFID ? LOWORD(lT) : IDOK); 00194 pwndT = _FindDlgItem(pwndDlg, id); 00195 00196 if (pwndT == NULL) 00197 return; 00198 ThreadLockAlways(pwndT, &tlpwndT); 00199 00200 /* 00201 * If it already has the default button style, do nothing. 00202 */ 00203 if ((styleT = (UINT)SendMessage(HWq(pwndT), WM_GETDLGCODE, 0, 0L)) & DLGC_DEFPUSHBUTTON) { 00204 ThreadUnlock(&tlpwndT); 00205 return; 00206 } 00207 00208 /* 00209 * Also check to make sure it is really a button. 00210 */ 00211 if (!(styleT & DLGC_UNDEFPUSHBUTTON)) { 00212 ThreadUnlock(&tlpwndT); 00213 return; 00214 } 00215 00216 if (!TestWF(pwndT, WFDISABLED)) { 00217 SendMessage(HWq(pwndT), BM_SETSTYLE, BS_DEFPUSHBUTTON, (LONG)TRUE); 00218 } 00219 ThreadUnlock(&tlpwndT); 00220 } 00221 }

VOID xxxCheckRedraw PLBIV  ,
BOOL  ,
INT 
 

Definition at line 3387 of file lboxctl2.c.

References CheckLock, CItemInWindow(), tagLBIV::cMac, tagLBIV::iTop, NULL, tagLBIV::spwnd, TRUE, and xxxLBInvalidateRect().

Referenced by ListBoxWndProcWorker(), xxxLbDir(), xxxLbInsertFile(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBResetContent(), and xxxLBSetFont().

03391 { 03392 CheckLock(plb->spwnd); 03393 03394 if (fConditional && plb->cMac && 03395 (sItem > (plb->iTop + CItemInWindow(plb, TRUE)))) 03396 return; 03397 03398 /* 03399 * Don't do anything if the parent is not visible. 03400 */ 03401 xxxLBInvalidateRect(plb, (LPRECT)NULL, TRUE); 03402 }

VOID xxxDestroyLBox PLBIV  ,
PWND 
 

Definition at line 375 of file lboxrare.c.

References CheckLock, ComboBoxWndProcWorker(), FALSE, FNID_CLEANEDUP_BIT, FNID_COMBOBOX, FreeLookasideEntry(), GETFNID, tagLBIV::hStrings, HWq, tagLBIV::iTabPixelPositions, ListboxLookaside, NtUserSetWindowFNID(), NULL, tagLBIV::pszTypeSearch, PTR_TO_ID, REBASEPWND, tagLBIV::rgpch, tagWND::spmenu, tagLBIV::spwnd, tagLBIV::spwndParent, Unlock, UserLocalFree, and xxxLBoxDoDeleteItems().

Referenced by ListBoxWndProcWorker().

00378 { 00379 PWND pwndParent; 00380 00381 CheckLock(pwnd); 00382 00383 if (pLBIV != NULL) { 00384 CheckLock(pLBIV->spwnd); 00385 00386 /* 00387 * If ownerdraw, send deleteitem messages to parent 00388 */ 00389 xxxLBoxDoDeleteItems(pLBIV); 00390 00391 if (pLBIV->rgpch != NULL) { 00392 UserLocalFree(pLBIV->rgpch); 00393 pLBIV->rgpch = NULL; 00394 } 00395 00396 if (pLBIV->hStrings != NULL) { 00397 UserLocalFree(pLBIV->hStrings); 00398 pLBIV->hStrings = NULL; 00399 } 00400 00401 if (pLBIV->iTabPixelPositions != NULL) { 00402 UserLocalFree((HANDLE)pLBIV->iTabPixelPositions); 00403 pLBIV->iTabPixelPositions = NULL; 00404 } 00405 00406 Unlock(&pLBIV->spwnd); 00407 Unlock(&pLBIV->spwndParent); 00408 00409 if (pLBIV->pszTypeSearch) { 00410 UserLocalFree(pLBIV->pszTypeSearch); 00411 } 00412 00413 FreeLookasideEntry(&ListboxLookaside, pLBIV); 00414 } 00415 00416 /* 00417 * Set the window's fnid status so that we can ignore rogue messages 00418 */ 00419 NtUserSetWindowFNID(HWq(pwnd), FNID_CLEANEDUP_BIT); 00420 00421 /* 00422 * If we're part of a combo box, let it know we're gone 00423 */ 00424 pwndParent = REBASEPWND(pwnd, spwndParent); 00425 if (pwndParent && GETFNID(pwndParent) == FNID_COMBOBOX) { 00426 ComboBoxWndProcWorker(pwndParent, WM_PARENTNOTIFY, 00427 MAKELONG(WM_DESTROY, PTR_TO_ID(pwnd->spmenu)), (LPARAM)HWq(pwnd), FALSE); 00428 } 00429 }

BOOL xxxDlgDirListHelper PWND  ,
LPWSTR  ,
LPBYTE  ,
int  ,
int  ,
UINT  ,
BOOL 
 

Definition at line 190 of file lboxctl3.c.

References _GetDlgItem(), achSlashStar, awchSlashStar, BOOL, CCH_CHOPTEXT_EXTRA, CCHFILEMAX, CheckLock, ChopText(), DDL_PRIVILEGES, DDL_TYPE, FALSE, FindCharPosition(), FNID_COMBOBOX, FNID_COMBOLISTBOX, FNID_LISTBOX, GETFNID, HWq, INT, IsLBoxVisible, L, MAX_PATH, NtUserInvalidateRect(), NULL, PostMessage(), SendMessage(), SetDlgItemText(), tagCBox::spwndList, szSLASHSTARDOTSTAR, TestWF, ThreadLockAlways, ThreadUnlock, TRUE, UINT, and WFWIN40COMPAT.

Referenced by DlgDirListA(), DlgDirListComboBoxA(), DlgDirListComboBoxW(), and DlgDirListW().

00198 { 00199 PWND pwndLB; 00200 TL tlpwndLB; 00201 BOOL fDir = TRUE; 00202 BOOL fRoot, bRet; 00203 BOOL fPostIt; 00204 INT cch; 00205 WCHAR ch; 00206 WCHAR szStaticPath[CCH_CHOPTEXT_EXTRA + MAX_PATH]; 00207 PWCHAR pszCurrentDir; 00208 UINT wDirMsg; 00209 LPWSTR lpchFile; 00210 LPWSTR lpchDirectory; 00211 PLBIV plb; 00212 BOOL fWasVisible = FALSE; 00213 BOOL fWin40Compat; 00214 PCBOX pcbox; 00215 00216 CheckLock(pwndDlg); 00217 00218 /* 00219 * Strip the private bit DDL_NOFILES out - KidPix passes it in my mistake! 00220 */ 00221 if (attrib & ~DDL_VALID) { 00222 RIPERR2(ERROR_INVALID_FLAGS, RIP_WARNING, "Invalid flags, %x & ~%x != 0", 00223 attrib, DDL_VALID); 00224 return FALSE; 00225 } 00226 00227 if (attrib & DDL_NOFILES) { 00228 RIPMSG0(RIP_WARNING, "DlgDirListHelper: stripping DDL_NOFILES"); 00229 attrib &= ~DDL_NOFILES; 00230 } 00231 00232 /* 00233 * Case:Works is an app that calls DlgDirList with a NULL has hwndDlg; 00234 * This is allowed because he uses NULL for idStaticPath and idListBox. 00235 * So, the validation layer has been modified to allow a NULL for hwndDlg. 00236 * But, we catch the bad apps with the following check. 00237 * Fix for Bug #11864 --SANKAR-- 08/22/91 -- 00238 */ 00239 if (!pwndDlg && (idStaticPath || idListBox)) { 00240 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, ""); 00241 return FALSE; 00242 } 00243 00244 plb = NULL; 00245 00246 /* 00247 * Do we need to add date, time, size or attribute info? 00248 * Windows checks the Atom but misses if the class has been sub-classed 00249 * as in VB. 00250 */ 00251 if (pwndLB = (PWND)_GetDlgItem(pwndDlg, idListBox)) { 00252 WORD fnid = GETFNID(pwndLB); 00253 00254 if ((fnid == FNID_LISTBOX && fListBox) || 00255 (fnid == FNID_COMBOBOX && !fListBox) || 00256 (fnid == FNID_COMBOLISTBOX && fListBox)) { 00257 if (fListBox) { 00258 plb = ((PLBWND)pwndLB)->pLBIV; 00259 } else { 00260 00261 pcbox = ((PCOMBOWND)pwndLB)->pcbox; 00262 plb = ((PLBWND)(pcbox->spwndList))->pLBIV; 00263 } 00264 } else { 00265 RIPERR0(ERROR_LISTBOX_ID_NOT_FOUND, RIP_VERBOSE, ""); 00266 } 00267 } else if (idListBox != 0) { 00268 00269 /* 00270 * Yell if the app passed an invalid list box id and keep from using a 00271 * bogus plb. PLB is NULLed above. 00272 */ 00273 RIPERR0(ERROR_LISTBOX_ID_NOT_FOUND, RIP_VERBOSE, ""); 00274 } 00275 00276 if (idStaticPath < 0 && plb != NULL) { 00277 00278 /* 00279 * Clear idStaticPath because its purpose is over. 00280 */ 00281 idStaticPath = 0; 00282 00283 } 00284 00285 fPostIt = (attrib & DDL_POSTMSGS); 00286 00287 if (lpszPathSpec) { 00288 cch = lstrlenW(lpszPathSpec); 00289 if (!cch) { 00290 if (lpszPathSpecClient != (LPBYTE)lpszPathSpec) { 00291 lpszPathSpecClient = achSlashStar; 00292 } 00293 lpszPathSpec = awchSlashStar; 00294 } else { 00295 /* 00296 * Make sure we won't overflow our buffers... 00297 */ 00298 if (cch > CCHFILEMAX) 00299 return FALSE; 00300 00301 /* 00302 * Convert lpszPathSpec into an upper case, OEM string. 00303 */ 00304 CharUpper(lpszPathSpec); 00305 lpchDirectory = lpszPathSpec; 00306 00307 lpchFile = szSLASHSTARDOTSTAR + 1; 00308 00309 if (*lpchDirectory) { 00310 00311 cch = wcslen(lpchDirectory); 00312 00313 /* 00314 * If the directory name has a * or ? in it, don't bother trying 00315 * the (slow) SetCurrentDirectory. 00316 */ 00317 if (((INT)FindCharPosition(lpchDirectory, TEXT('*')) != cch) || 00318 ((INT)FindCharPosition(lpchDirectory, TEXT('?')) != cch) || 00319 !SetCurrentDirectory(lpchDirectory)) { 00320 00321 /* 00322 * Set 'fDir' and 'fRoot' accordingly. 00323 */ 00324 lpchFile = lpchDirectory + cch; 00325 fDir = *(lpchFile - 1) == TEXT('\\'); 00326 fRoot = 0; 00327 while (cch--) { 00328 ch = *(lpchFile - 1); 00329 if (ch == TEXT('*') || ch == TEXT('?')) 00330 fDir = TRUE; 00331 00332 if (ch == TEXT('\\') || ch == TEXT('/') || ch == TEXT(':')) { 00333 fRoot = (cch == 0 || *(lpchFile - 2) == TEXT(':') || 00334 (ch == TEXT(':'))); 00335 break; 00336 } 00337 lpchFile--; 00338 } 00339 00340 /* 00341 * To remove Bug #16, the following error return is to be removed. 00342 * In order to prevent the existing apps from breaking up, it is 00343 * decided that the bug will not be fixed and will be mentioned 00344 * in the documentation. 00345 * --SANKAR-- Sep 21 00346 */ 00347 00348 /* 00349 * If no wildcard characters, return error. 00350 */ 00351 if (!fDir) { 00352 RIPERR0(ERROR_NO_WILDCARD_CHARACTERS, RIP_VERBOSE, ""); 00353 return FALSE; 00354 } 00355 00356 /* 00357 * Special case for lpchDirectory == "\" 00358 */ 00359 if (fRoot) 00360 lpchFile++; 00361 00362 /* 00363 * Do we need to change directories? 00364 */ 00365 if (fRoot || cch >= 0) { 00366 00367 /* 00368 * Replace the Filename's first char with a nul. 00369 */ 00370 ch = *--lpchFile; 00371 *lpchFile = TEXT('\0'); 00372 00373 /* 00374 * Change the current directory. 00375 */ 00376 if (*lpchDirectory) { 00377 bRet = SetCurrentDirectory(lpchDirectory); 00378 if (!bRet) { 00379 00380 /* 00381 * Restore the filename before we return... 00382 */ 00383 *((LPWSTR)lpchFile)++ = ch; 00384 return FALSE; 00385 } 00386 } 00387 00388 /* 00389 * Restore the filename's first character. 00390 */ 00391 *lpchFile++ = ch; 00392 } 00393 00394 /* 00395 * Undo damage caused by special case above. 00396 */ 00397 if (fRoot) { 00398 lpchFile--; 00399 } 00400 } 00401 } 00402 00403 /* 00404 * This is copying on top of the data the client passed us! Since 00405 * the LB_DIR or CB_DIR could be posted, and since we need to 00406 * pass a client side string pointer when we do that, we need 00407 * to copy this new data back to the client! 00408 */ 00409 if (fPostIt && lpszPathSpecClient != (LPBYTE)lpszPathSpec) { 00410 WCSToMB(lpchFile, -1, &lpszPathSpecClient, MAXLONG, FALSE); 00411 } 00412 wcscpy(lpszPathSpec, lpchFile); 00413 } 00414 } 00415 /* 00416 * In some cases, the ChopText requires extra space ahead of the path: 00417 * Give it CCH_CHOPTEXT_EXTRA extra spaces. (See ChopText() above). 00418 */ 00419 pszCurrentDir = szStaticPath + CCH_CHOPTEXT_EXTRA; 00420 GetCurrentDirectory( 00421 sizeof(szStaticPath)/sizeof(WCHAR) - CCH_CHOPTEXT_EXTRA, 00422 pszCurrentDir); 00423 00424 /* 00425 * If we have a listbox, lock it down 00426 */ 00427 if (pwndLB != NULL) { 00428 ThreadLockAlways(pwndLB, &tlpwndLB); 00429 } 00430 00431 /* 00432 * Fill in the static path item. 00433 */ 00434 if (idStaticPath) { 00435 00436 /* 00437 * To fix a bug OemToAnsi() call is inserted; SANKAR--Sep 16th 00438 */ 00439 // OemToChar(szCurrentDir, szCurrentDir); 00440 CharLower(pszCurrentDir); 00441 SetDlgItemText(HWq(pwndDlg), idStaticPath, ChopText(pwndDlg, idStaticPath, szStaticPath)); 00442 } 00443 00444 /* 00445 * Fill in the directory List/ComboBox if it exists. 00446 */ 00447 if (idListBox && pwndLB != NULL) { 00448 00449 HWND hwndLB = HWq(pwndLB); 00450 00451 wDirMsg = (UINT)(fListBox ? LB_RESETCONTENT : CB_RESETCONTENT); 00452 00453 if (fPostIt) { 00454 PostMessage(hwndLB, wDirMsg, 0, 0L); 00455 } else { 00456 if (plb != NULL && (fWasVisible = IsLBoxVisible(plb))) { 00457 SendMessage(hwndLB, WM_SETREDRAW, FALSE, 0L); 00458 } 00459 SendMessage(hwndLB, wDirMsg, 0, 0L); 00460 } 00461 00462 wDirMsg = (UINT)(fListBox ? LB_DIR : CB_DIR); 00463 00464 if (attrib == DDL_DRIVES) 00465 attrib |= DDL_EXCLUSIVE; 00466 00467 // 00468 // Hack for DDL_EXCLUSIVE to REALLY work. 00469 // 00470 fWin40Compat = TestWF(pwndLB, WFWIN40COMPAT); 00471 00472 // 00473 // BACKWARDS COMPATIBILITY HACK 00474 // 00475 // We want DDL_EXCLUSIVE to _really_ work for new apps. I.E., we 00476 // want apps to be able to specify DDL_DRIVES/DDL_VOLUMES with 00477 // DDL_EXCLUSIVE and privilege bits -- and have only those items 00478 // matching show up, w/out files. 00479 // 00480 if (attrib & DDL_EXCLUSIVE) 00481 { 00482 if (fWin40Compat) 00483 { 00484 if (attrib & (DDL_DRIVES | DDL_DIRECTORY)) 00485 attrib |= DDL_NOFILES; 00486 } 00487 else 00488 { 00489 if (attrib == (DDL_DRIVES | DDL_EXCLUSIVE)) 00490 attrib |= DDL_NOFILES; 00491 } 00492 } 00493 00494 if (!(attrib & DDL_NOFILES)) { 00495 00496 /* 00497 * Add everything except the subdirectories and disk drives. 00498 */ 00499 if (fPostIt) { 00500 /* 00501 * Post lpszPathSpecClient, the client side pointer. 00502 */ 00503 #ifdef WASWIN31 00504 PostMessage(hwndLB, wDirMsg, attrib & 00505 ~(DDL_DIRECTORY | DDL_DRIVES | DDL_POSTMSGS), 00506 (LPARAM)lpszPathSpecClient); 00507 #else 00508 /* 00509 * On NT, keep DDL_POSTMSGS in wParam because we need to know 00510 * in the wndproc whether the pointer is clientside or server 00511 * side. 00512 */ 00513 PostMessage(hwndLB, wDirMsg, 00514 attrib & ~(DDL_DIRECTORY | DDL_DRIVES), 00515 (LPARAM)lpszPathSpecClient); 00516 #endif 00517 00518 } else { 00519 00520 /* 00521 * IanJa: #ifndef WIN16 (32-bit Windows), attrib gets extended 00522 * to LONG wParam automatically by the compiler 00523 */ 00524 SendMessage(hwndLB, wDirMsg, 00525 attrib & ~(DDL_DIRECTORY | DDL_DRIVES), 00526 (LPARAM)lpszPathSpec); 00527 } 00528 00529 #ifdef WASWIN31 00530 /* 00531 * Strip out just the subdirectory and drive bits. 00532 */ 00533 attrib &= (DDL_DIRECTORY | DDL_DRIVES); 00534 #else 00535 // 00536 // B#1433 00537 // The old code stripped out read-only, hidden, system, and archive 00538 // information for subdirectories, making it impossible to have 00539 // a listbox w/ hidden directories! 00540 // 00541 00542 /* 00543 * Strip out just the subdirectory and drive bits. ON NT, keep 00544 * the DDL_POSTMSG bit so we know how to thunk this message. 00545 */ 00546 if (!fWin40Compat) 00547 attrib &= DDL_TYPE; 00548 else 00549 { 00550 attrib &= (DDL_TYPE | (attrib & DDL_PRIVILEGES)); 00551 attrib |= DDL_NOFILES; 00552 } 00553 // attrib &= (DDL_DIRECTORY | DDL_DRIVES | DDL_POSTMSGS); 00554 #endif 00555 } 00556 00557 // 00558 // Add directories and volumes to the listbox. 00559 // 00560 if (attrib & DDL_TYPE) { 00561 00562 /* 00563 * Add the subdirectories and disk drives. 00564 */ 00565 lpszPathSpec = szSLASHSTARDOTSTAR + 1; 00566 00567 attrib |= DDL_EXCLUSIVE; 00568 00569 if (fPostIt) { 00570 /* 00571 * Post lpszPathSpecClient, the client side pointer (see text 00572 * above). 00573 */ 00574 PostMessage(hwndLB, wDirMsg, attrib, (LPARAM)lpszPathSpecClient); 00575 } else { 00576 SendMessage(hwndLB, wDirMsg, attrib, (LPARAM)lpszPathSpec); 00577 } 00578 } 00579 00580 if (!fPostIt && fWasVisible) { 00581 SendMessage(hwndLB, WM_SETREDRAW, TRUE, 0L); 00582 NtUserInvalidateRect(hwndLB, NULL, TRUE); 00583 } 00584 } 00585 00586 if (pwndLB != NULL) { 00587 ThreadUnlock(&tlpwndLB); 00588 } 00589 00590 return TRUE; 00591 }

INT xxxFindString PLBIV  ,
LPWSTR  ,
INT  ,
INT  ,
BOOL 
 

Definition at line 2802 of file lboxctl2.c.

References CheckLock, tagLBIV::cMac, Compare(), tagLBIV::dwLocaleId, EQ, tagLBIV::fHasData, tagLBIV::fHasStrings, tagLBIV::fSort, GT, tagLBIV::hStrings, HW, HWq, INT, LT, tagLBItem::offsz, pODRg, PREFIX, tagLBIV::rgpch, SendMessage(), tagWND::spmenu, tagLBIV::spwnd, tagLBIV::spwndParent, ThreadLock, ThreadUnlock, and UINT.

Referenced by ListBoxWndProcWorker(), and xxxLBoxCtlCharInput().

02808 { 02809 /* 02810 * Search for a prefix match (case-insensitive equal/prefix) 02811 * sStart == -1 means start from beginning, else start looking at sStart+1 02812 * assumes cMac > 0. 02813 */ 02814 INT sInd; /* index of string */ 02815 INT sStop; /* index to stop searching at */ 02816 lpLBItem pRg; 02817 TL tlpwndParent; 02818 INT sortResult; 02819 02820 /* 02821 * Owner-Draw version of pRg 02822 */ 02823 #define pODRg ((lpLBODItem)pRg) 02824 COMPAREITEMSTRUCT cis; 02825 LPWSTR listboxString; 02826 02827 CheckLock(plb->spwnd); 02828 02829 if (plb->fHasStrings && (!lpstr || !*lpstr)) 02830 return LB_ERR; 02831 02832 if (!plb->fHasData) { 02833 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "FindString called on NODATA lb"); 02834 return LB_ERR; 02835 } 02836 02837 if ((sInd = sStart + 1) >= plb->cMac) 02838 sInd = (fWrap ? 0 : plb->cMac - 1); 02839 02840 sStop = (fWrap ? sInd : 0); 02841 02842 /* 02843 * If at end and no wrap, stop right away 02844 */ 02845 if (((sStart >= plb->cMac - 1) && !fWrap) || (plb->cMac < 1)) { 02846 return LB_ERR; 02847 } 02848 02849 /* 02850 * Apps could pass in an invalid sStart like -2 and we would blow up. 02851 * Win 3.1 would not so we need to fixup sInd to be zero 02852 */ 02853 if (sInd < 0) 02854 sInd = 0; 02855 02856 pRg = (lpLBItem)(plb->rgpch); 02857 02858 do { 02859 if (plb->fHasStrings) { 02860 02861 /* 02862 * Searching for string matches. 02863 */ 02864 listboxString = (LPWSTR)((LPBYTE)plb->hStrings + pRg[sInd].offsz); 02865 02866 if (code == PREFIX && 02867 listboxString && 02868 *lpstr != TEXT('[') && 02869 *listboxString == TEXT('[')) { 02870 02871 /* 02872 * If we are looking for a prefix string and the first items 02873 * in this string are [- then we ignore them. This is so 02874 * that in a directory listbox, the user can goto drives 02875 * by selecting the drive letter. 02876 */ 02877 listboxString++; 02878 if (*listboxString == TEXT('-')) 02879 listboxString++; 02880 } 02881 02882 if (Compare(lpstr, listboxString, plb->dwLocaleId) <= code) { 02883 goto FoundIt; 02884 } 02885 02886 } else { 02887 if (plb->fSort) { 02888 02889 /* 02890 * Send compare item messages to the parent for sorting 02891 */ 02892 cis.CtlType = ODT_LISTBOX; 02893 cis.CtlID = PtrToUlong(plb->spwnd->spmenu); 02894 cis.hwndItem = HWq(plb->spwnd); 02895 cis.itemID1 = (UINT)-1; 02896 cis.itemData1 = (ULONG_PTR)lpstr; 02897 cis.itemID2 = (UINT)sInd; 02898 cis.itemData2 = pODRg[sInd].itemData; 02899 cis.dwLocaleId = plb->dwLocaleId; 02900 02901 ThreadLock(plb->spwndParent, &tlpwndParent); 02902 sortResult = (INT)SendMessage(HW(plb->spwndParent), WM_COMPAREITEM, 02903 cis.CtlID, (LPARAM)&cis); 02904 ThreadUnlock(&tlpwndParent); 02905 02906 02907 if (sortResult == -1) { 02908 sortResult = LT; 02909 } else if (sortResult == 1) { 02910 sortResult = GT; 02911 } else { 02912 sortResult = EQ; 02913 } 02914 02915 if (sortResult <= code) { 02916 goto FoundIt; 02917 } 02918 } else { 02919 02920 /* 02921 * Searching for app supplied long data matches. 02922 */ 02923 if ((ULONG_PTR)lpstr == pODRg[sInd].itemData) 02924 goto FoundIt; 02925 } 02926 } 02927 02928 /* 02929 * Wrap round to beginning of list 02930 */ 02931 if (++sInd == plb->cMac) 02932 sInd = 0; 02933 } while (sInd != sStop); 02934 02935 sInd = -1; 02936 02937 FoundIt: 02938 return sInd; 02939 }

PWND xxxGotoNextMnem PWND  pwndDlg,
PWND  pwndStart,
WCHAR  ch
 

Definition at line 219 of file dmmnem.c.

References _GetNextDlgTabItem(), BOOL, BST_DONTCLICK, BUTTONSTATE, CheckLock, DlgSetFocus(), FALSE, FNID_BUTTON, HW, HWq, L, NULL, PTR_TO_ID, REBASEPWND, SendMessage(), tagWND::spmenu, TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, WFDISABLED, and xxxGNM_FindNextMnem().

Referenced by IsDialogMessageW().

00223 { 00224 UINT code; 00225 PWND pwndFirstFound = NULL; 00226 int count = 0; 00227 TL tlpwnd; 00228 PWND pwndT; 00229 HWND hwnd; 00230 00231 CheckLock(pwndDlg); 00232 CheckLock(pwnd); 00233 00234 ThreadLock(pwnd, &tlpwnd); 00235 00236 /* 00237 * Loop for a long time but not long enough so we hang... 00238 */ 00239 while (count < 256 * 2) { 00240 00241 /* 00242 * If the dialog box doesn't has the mnemonic specified, return NULL. 00243 */ 00244 if ((pwnd = xxxGNM_FindNextMnem(pwndDlg, pwnd, ch)) == NULL) { 00245 ThreadUnlock(&tlpwnd); 00246 return NULL; 00247 } 00248 hwnd = HWq(pwnd); 00249 00250 ThreadUnlock(&tlpwnd); 00251 ThreadLock(pwnd, &tlpwnd); 00252 00253 code = (UINT)SendMessage(hwnd, WM_GETDLGCODE, 0, 0L); 00254 00255 /* 00256 * If a non-disabled static item, then jump ahead to nearest tabstop. 00257 */ 00258 if (code & DLGC_STATIC && !TestWF(pwnd, WFDISABLED)) { 00259 pwndT = _GetNextDlgTabItem(pwndDlg, pwnd, FALSE); 00260 00261 /* 00262 * If there is no other tab item, keep looking 00263 */ 00264 if (pwndT == NULL) 00265 continue; 00266 pwnd = pwndT; 00267 hwnd = HWq(pwnd); 00268 00269 ThreadUnlock(&tlpwnd); 00270 ThreadLock(pwnd, &tlpwnd); 00271 00272 /* 00273 * I suppose we should do a getdlgcode here, but who is going to 00274 * label a button with a static control? The setup guys, that's 00275 * who... Also, generally useful for ownerdraw buttons which are 00276 * labeled with a static text item. 00277 */ 00278 code = (UINT)SendMessage(hwnd, WM_GETDLGCODE, 0, 0L); 00279 } 00280 00281 if (!TestWF(pwnd, WFDISABLED)) { 00282 00283 /* 00284 * Is it a Pushbutton? 00285 */ 00286 if (!(code & DLGC_BUTTON)) { 00287 00288 /* 00289 * No, simply give it the focus. 00290 */ 00291 DlgSetFocus(hwnd); 00292 } else { 00293 00294 /* 00295 * Yes, click it, but don't give it the focus. 00296 */ 00297 if ((code & DLGC_DEFPUSHBUTTON) || (code & DLGC_UNDEFPUSHBUTTON)) { 00298 00299 /* 00300 * Flash the button. 00301 */ 00302 SendMessage(hwnd, BM_SETSTATE, TRUE, 0L); 00303 00304 /* 00305 * Delay 00306 */ 00307 #ifdef LATER 00308 // JimA - 2/19/92 00309 // There oughta be a better way of doing this... 00310 for (i = 0; i < 10000; i++) 00311 ; 00312 #else 00313 Sleep(1); 00314 #endif 00315 00316 /* 00317 * Un-Flash it. 00318 */ 00319 SendMessage(hwnd, BM_SETSTATE, FALSE, 0L); 00320 00321 /* 00322 * Send the WM_COMMAND message. 00323 */ 00324 pwndT = REBASEPWND(pwnd, spwndParent); 00325 SendMessage(HW(pwndT), WM_COMMAND, 00326 MAKELONG(PTR_TO_ID(pwnd->spmenu), BN_CLICKED), (LPARAM)hwnd); 00327 ThreadUnlock(&tlpwnd); 00328 return (PWND)1; 00329 } else { 00330 00331 /* 00332 * Because BM_CLICK processing will result in BN_CLICK msg, 00333 * xxxSetFocus must be prevented from sending the same msg; 00334 * Otherwise, it will notify parent twice! 00335 * Fix for Bug #3024 -- SANKAR -- 09-22-89 -- 00336 */ 00337 BOOL fIsNTButton; 00338 PBUTN pbutn; 00339 00340 fIsNTButton = (pwnd->fnid == FNID_BUTTON); 00341 if (fIsNTButton) { 00342 pbutn = ((PBUTNWND)pwnd)->pbutn; 00343 BUTTONSTATE(pbutn) |= BST_DONTCLICK; 00344 } else { 00345 RIPMSG0(RIP_WARNING, "xxxGotoNextMnem: fnid != FNID_BUTTON"); 00346 } 00347 00348 DlgSetFocus(hwnd); 00349 00350 if (fIsNTButton) { 00351 BUTTONSTATE(pbutn) &= ~BST_DONTCLICK; 00352 } 00353 00354 /* 00355 * Send click message if button has a UNIQUE mnemonic 00356 */ 00357 if (xxxGNM_FindNextMnem(pwndDlg, pwnd, ch) == pwnd) { 00358 SendMessage(hwnd, BM_CLICK, TRUE, 0L); 00359 } 00360 } 00361 } 00362 00363 ThreadUnlock(&tlpwnd); 00364 return pwnd; 00365 } else { 00366 00367 /* 00368 * Stop if we've looped back to the first item we checked 00369 */ 00370 if (pwnd == pwndFirstFound) { 00371 ThreadUnlock(&tlpwnd); 00372 return NULL; 00373 } 00374 00375 if (pwndFirstFound == NULL) 00376 pwndFirstFound = pwnd; 00377 } 00378 00379 count++; 00380 00381 } /* Loop for a long time */ 00382 00383 ThreadUnlock(&tlpwnd); 00384 return NULL; 00385 }

VOID xxxInsureVisible PLBIV  ,
INT  ,
BOOL 
 

Definition at line 2092 of file lboxctl2.c.

References CheckLock, CItemInWindow(), FALSE, tagLBIV::fMultiColumn, INT, tagLBIV::itemsPerColumn, tagLBIV::iTop, LastFullVisible(), LBPage(), max, tagLBIV::numberOfColumns, tagLBIV::OwnerDraw, OWNERDRAWVAR, tagLBIV::spwnd, TRUE, and xxxNewITop().

Referenced by ListBoxWndProcWorker(), xxxLBButtonUp(), xxxLBoxCtlDelete(), xxxLBoxCtlKeyInput(), xxxLBSetCurSel(), xxxLBSetSel(), and xxxSetISelBase().

02096 { 02097 INT sLastVisibleItem; 02098 02099 CheckLock(plb->spwnd); 02100 02101 if (iSel < plb->iTop) { 02102 xxxNewITop(plb, iSel); 02103 } else { 02104 if (fPartial) { 02105 02106 /* 02107 * 1 must be subtracted to get the last visible item 02108 * A part of the fix for Bug #3727 -- 01/14/91 -- SANKAR 02109 */ 02110 sLastVisibleItem = plb->iTop + CItemInWindow(plb, TRUE) - (INT)1; 02111 } else { 02112 sLastVisibleItem = LastFullVisible(plb); 02113 } 02114 02115 if (plb->OwnerDraw != OWNERDRAWVAR) { 02116 if (iSel > sLastVisibleItem) { 02117 if (plb->fMultiColumn) { 02118 xxxNewITop(plb, 02119 ((iSel / plb->itemsPerColumn) - 02120 max(plb->numberOfColumns-1,0)) * plb->itemsPerColumn); 02121 } else { 02122 xxxNewITop(plb, (INT)max(0, iSel - sLastVisibleItem + plb->iTop)); 02123 } 02124 } 02125 } else if (iSel > sLastVisibleItem) 02126 xxxNewITop(plb, LBPage(plb, iSel, FALSE)); 02127 } 02128 }

VOID xxxInvertLBItem PLBIV  ,
INT  ,
BOOL 
 

Definition at line 1111 of file lboxctl2.c.

References BOOL, CheckLock, CItemInWindow(), FALSE, tagLBIV::fCaretOn, FillRect(), tagLBIV::fNoSel, tagLBIV::hdc, IsLBoxVisible, tagLBIV::iTop, LBGetDC(), LBGetItemRect(), LBReleaseDC(), NULL, tagLBIV::OwnerDraw, tagLBIV::spwnd, TRUE, UINT, xxxLBDrawLBItem(), xxxLBGetBrush(), xxxLBoxDrawItem(), and xxxLBSetCaret().

Referenced by ListBoxWndProcWorker(), xxxAlterHilite(), xxxLBButtonUp(), xxxLBoxCtlKeyInput(), xxxLBSetCurSel(), xxxResetWorld(), and xxxTrackMouse().

01115 { 01116 RECT rect; 01117 BOOL fCaretOn; 01118 HBRUSH hbrControl; 01119 BOOL fNewDC; 01120 01121 CheckLock(plb->spwnd); 01122 01123 // Skip if item isn't showing. 01124 if (plb->fNoSel || (i < plb->iTop) || (i >= (plb->iTop + CItemInWindow(plb, TRUE)))) 01125 return; 01126 01127 if (IsLBoxVisible(plb)) { 01128 LBGetItemRect(plb, i, &rect); 01129 01130 /* 01131 * Only turn off the caret if it is on. This avoids annoying caret 01132 * flicker when nesting xxxCaretOns and xxxCaretOffs. 01133 */ 01134 if (fCaretOn = plb->fCaretOn) { 01135 xxxLBSetCaret(plb, FALSE); 01136 } 01137 01138 fNewDC = LBGetDC(plb); 01139 01140 hbrControl = xxxLBGetBrush(plb, NULL); 01141 01142 if (!plb->OwnerDraw) { 01143 if (!fHilite) { 01144 FillRect(plb->hdc, &rect, hbrControl); 01145 hbrControl = NULL; 01146 } 01147 01148 xxxLBDrawLBItem(plb, i, &rect, fHilite, hbrControl); 01149 } else { 01150 01151 /* 01152 * We are ownerdraw so fill in the drawitem struct and send off 01153 * to the owner. 01154 */ 01155 xxxLBoxDrawItem(plb, i, ODA_SELECT, 01156 (UINT)(fHilite ? ODS_SELECTED : 0), &rect); 01157 } 01158 01159 if (fNewDC) 01160 LBReleaseDC(plb); 01161 01162 /* 01163 * Turn the caret back on only if it was originally on. 01164 */ 01165 if (fCaretOn) { 01166 xxxLBSetCaret(plb, TRUE); 01167 } 01168 } 01169 }

VOID xxxLBBlockHilite PLBIV  ,
INT  ,
BOOL 
 

Definition at line 3651 of file lboxctl2.c.

References abs, BOOL, CheckLock, FALSE, tagLBIV::fNewItemState, HILITEANDSEL, HILITEONLY, tagLBIV::iLastMouseMove, tagLBIV::iMouseDown, INT, tagLBIV::spwnd, TRUE, and xxxAlterHilite().

Referenced by xxxLBoxCtlKeyInput(), and xxxTrackMouse().

03655 { 03656 INT sCurPosOffset; 03657 INT sLastPosOffset; 03658 INT sHiliteOrSel; 03659 BOOL fUseSelStatus; 03660 BOOL DeHiliteStatus; 03661 03662 CheckLock(plb->spwnd); 03663 03664 if (fKeyBoard) { 03665 03666 /* 03667 * Set both Hilite and Selection states 03668 */ 03669 sHiliteOrSel = HILITEANDSEL; 03670 03671 /* 03672 * Do not use the Selection state while de-hiliting 03673 */ 03674 fUseSelStatus = FALSE; 03675 DeHiliteStatus = FALSE; 03676 } else { 03677 03678 /* 03679 * Set/Reset only the Hilite state 03680 */ 03681 sHiliteOrSel = HILITEONLY; 03682 03683 /* 03684 * Use the selection state for de-hilighting 03685 */ 03686 fUseSelStatus = TRUE; 03687 DeHiliteStatus = plb->fNewItemState; 03688 } 03689 03690 03691 03692 /* 03693 * The idea of the routine is to : 03694 * 1. De-hilite the old range (iMouseDown to iLastMouseDown) and 03695 * 2. Hilite the new range (iMouseDwon to iSelFromPt) 03696 */ 03697 03698 /* 03699 * Offset of current mouse position from the anchor point 03700 */ 03701 sCurPosOffset = plb->iMouseDown - iSelFromPt; 03702 03703 /* 03704 * Offset of last mouse position from the anchor point 03705 */ 03706 sLastPosOffset = plb->iMouseDown - plb->iLastMouseMove; 03707 03708 /* 03709 * Check if both current position and last position lie on the same 03710 * side of the anchor point. 03711 */ 03712 if ((sCurPosOffset * sLastPosOffset) >= 0) { 03713 03714 /* 03715 * Yes they are on the same side; So, highlight/dehighlight only 03716 * the difference. 03717 */ 03718 if (abs(sCurPosOffset) > abs(sLastPosOffset)) { 03719 xxxAlterHilite(plb, plb->iLastMouseMove, iSelFromPt, 03720 plb->fNewItemState, sHiliteOrSel, FALSE); 03721 } else { 03722 xxxAlterHilite(plb, iSelFromPt, plb->iLastMouseMove, DeHiliteStatus, 03723 sHiliteOrSel, fUseSelStatus); 03724 } 03725 } else { 03726 xxxAlterHilite(plb, plb->iMouseDown, plb->iLastMouseMove, 03727 DeHiliteStatus, sHiliteOrSel, fUseSelStatus); 03728 xxxAlterHilite(plb, plb->iMouseDown, iSelFromPt, 03729 plb->fNewItemState, sHiliteOrSel, FALSE); 03730 } 03731 }

void xxxLBButtonUp PLBIV  plb,
UINT  uFlags
 

Definition at line 1875 of file lboxctl2.c.

References CheckLock, CItemInWindow(), EXTENDEDSEL, FALSE, tagLBIV::fCaptured, tagLBIV::fDoubleClick, tagLBIV::fMouseDown, tagLBIV::fNewItemState, tagLBIV::fNotify, FWINABLE, HWq, IDSYS_SCROLL, tagLBIV::iLastMouseMove, tagLBIV::iLastSelection, tagLBIV::iMouseDown, tagLBIV::iSel, tagLBIV::iSelBase, tagLBIV::iTop, LBEvent(), LBUP_NOTIFY, LBUP_RELEASECAPTURE, LBUP_RESETSELECTION, LBUP_SELCHANGE, LBUP_SUCCESS, NtUserKillTimer(), NtUserReleaseCapture, tagLBIV::pcbox, SELONLY, tagLBIV::spwnd, TestWF, TRUE, WFWIN31COMPAT, WFWIN40COMPAT, tagLBIV::wMultiple, xxxAlterHilite(), xxxInsureVisible(), xxxInvertLBItem(), and xxxNotifyOwner().

Referenced by ListBoxWndProcWorker(), xxxCaretDestroy(), and xxxTrackMouse().

01876 { 01877 01878 CheckLock(plb->spwnd); 01879 01880 /* 01881 * If the list box is an Extended listbox, then change the select status 01882 * of all items between the anchor and the last mouse position to the 01883 * newItemState 01884 */ 01885 if (plb->wMultiple == EXTENDEDSEL) 01886 xxxAlterHilite(plb, plb->iMouseDown, plb->iLastMouseMove, 01887 plb->fNewItemState, SELONLY, FALSE); 01888 01889 /* 01890 * This is a combo box and user upclicked outside the listbox 01891 * so we want to restore the original selection. 01892 */ 01893 if (plb->pcbox && (uFlags & LBUP_RESETSELECTION)) { 01894 int iSelOld; 01895 01896 iSelOld = plb->iSel; 01897 01898 if (iSelOld >= 0) 01899 xxxInvertLBItem(plb, plb->iSel, FALSE); 01900 01901 plb->iSel = plb->iLastSelection; 01902 xxxInvertLBItem(plb, plb->iSel, TRUE); 01903 01904 /* 01905 * Note that we always send selection events before we tell the 01906 * app. This is on purpose--the app may turn around and select 01907 * something else when notified. In which case our event would 01908 * be out of order. 01909 */ 01910 if (FWINABLE()) 01911 LBEvent(plb, EVENT_OBJECT_SELECTION, plb->iSel); 01912 01913 /* 01914 * On win-95 and NT4 the check used to be !(uFlags & LBUP_NOTIFY) which 01915 * is a bug because we would notify even when the lb is not LBUP_NOTIFY 01916 */ 01917 if ((uFlags & LBUP_NOTIFY) && plb->fNotify && (iSelOld != plb->iSel)) 01918 xxxNotifyOwner(plb, LBN_SELCHANGE); 01919 } 01920 01921 NtUserKillTimer(HWq(plb->spwnd), IDSYS_SCROLL); 01922 plb->fMouseDown = FALSE; 01923 if (plb->fCaptured) { 01924 plb->fCaptured = FALSE; 01925 if (uFlags & LBUP_RELEASECAPTURE) 01926 NtUserReleaseCapture(); 01927 } 01928 /* 01929 * Don't scroll item as long as any part of it is visible 01930 */ 01931 if (plb->iSelBase < plb->iTop || 01932 plb->iSelBase > plb->iTop + CItemInWindow(plb, TRUE)) 01933 xxxInsureVisible(plb, plb->iSelBase, FALSE); 01934 01935 if (plb->fNotify) { 01936 if (uFlags & LBUP_NOTIFY) { 01937 if (uFlags & LBUP_SUCCESS) { 01938 /* 01939 * ArtMaster needs this SELCHANGE notification now! 01940 */ 01941 if ((plb->fDoubleClick) && !TestWF(plb->spwnd, WFWIN31COMPAT)) 01942 xxxNotifyOwner(plb, LBN_SELCHANGE); 01943 01944 /* 01945 * Notify owner of click or double click on selection 01946 */ 01947 xxxNotifyOwner(plb, (plb->fDoubleClick) ? LBN_DBLCLK : LBN_SELCHANGE); 01948 } else { 01949 /* 01950 * Notify owner that the attempted selection was cancelled. 01951 */ 01952 xxxNotifyOwner(plb, LBN_SELCANCEL); 01953 } 01954 } else if (uFlags & LBUP_SELCHANGE) { 01955 /* 01956 * Did we do some semi-selecting with mouse moves, then hit Enter? 01957 * If so, we need to make sure the app knows that something was 01958 * really truly selected. 01959 */ 01960 UserAssert(TestWF(plb->spwnd, WFWIN40COMPAT)); 01961 if (plb->iLastSelection != plb->iSel) 01962 xxxNotifyOwner(plb, LBN_SELCHANGE); 01963 01964 } 01965 } 01966 01967 }

LONG xxxLBCreate PLBIV  ,
PWND  ,
LPCREATESTRUCT 
 

Definition at line 62 of file lboxrare.c.

References _GetDesktopWindow, tagWND::cbwndExtra, tagLBIV::cxChar, tagLBIV::cxColumn, tagLBIV::cyChar, tagLBIV::dwLocaleId, EXTENDEDSEL, FALSE, tagLBIV::fDeferUpdate, tagLBIV::fDisableNoScroll, tagLBIV::fHasData, tagLBIV::fHasStrings, tagLBIV::fHorzBar, tagLBIV::fIgnoreSizeMsg, tagLBIV::fInitialized, tagLBIV::fMultiColumn, tagLBIV::fNewItemState, tagLBIV::fNoIntegralHeight, tagLBIV::fNoSel, tagLBIV::fNotify, tagLBIV::fRedraw, tagLBIV::fRightAlign, tagLBIV::fRtoLReading, tagLBIV::fSmoothScroll, tagLBIV::fSort, tagLBIV::fUseTabStops, tagLBIV::fVertBar, tagLBIV::fWantKeyboardInput, gpsi, tagLBIV::hdc, tagLBIV::hStrings, HW, HWq, tagLBIV::iLastMouseMove, tagLBIV::iLastSelection, tagLBIV::iMouseDown, InitHStrings(), tagLBIV::iSel, tagLBIV::itemsPerColumn, L, LBS_COMBOBOX, LBSetCItemFullMax(), LBSetTabStops(), Lock, MULTIPLESEL, NtUserGetDC(), NtUserMoveWindow(), NtUserReleaseDC, NULL, tagLBIV::numberOfColumns, tagLBIV::OwnerDraw, OWNERDRAWFIXED, OWNERDRAWVAR, tagLBIV::pcbox, PostMessage(), REBASEPWND, SendMessage(), SINGLESEL, tagWND::spmenu, tagLBIV::spwndParent, tagWND::spwndParent, SYSMET, TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, WEFRIGHT, WEFRTLREADING, WFWIN40COMPAT, and tagLBIV::wMultiple.

Referenced by ListBoxWndProcWorker().

00064 { 00065 UINT style; 00066 MEASUREITEMSTRUCT measureItemStruct; 00067 TL tlpwndParent; 00068 HDC hdc; 00069 00070 /* 00071 * Once we make it here, nobody can change the ownerdraw style bits 00072 * by calling SetWindowLong. The window style must match the flags in plb 00073 * 00074 */ 00075 plb->fInitialized = TRUE; 00076 00077 style = pwnd->style; 00078 00079 /* 00080 * Compatibility hack. 00081 */ 00082 if (pwnd->spwndParent == NULL) 00083 Lock(&(plb->spwndParent), _GetDesktopWindow()); 00084 else 00085 Lock(&(plb->spwndParent), REBASEPWND(pwnd, spwndParent)); 00086 00087 /* 00088 * Break out the style bits 00089 */ 00090 plb->fRedraw = ((style & LBS_NOREDRAW) == 0); 00091 plb->fDeferUpdate = FALSE; 00092 plb->fNotify = (UINT)((style & LBS_NOTIFY) != 0); 00093 plb->fVertBar = ((style & WS_VSCROLL) != 0); 00094 plb->fHorzBar = ((style & WS_HSCROLL) != 0); 00095 00096 if (!TestWF(pwnd, WFWIN40COMPAT)) { 00097 // for 3.x apps, if either scroll bar was specified, the app got BOTH 00098 if (plb->fVertBar || plb->fHorzBar) 00099 plb->fVertBar = plb->fHorzBar = TRUE; 00100 } 00101 00102 plb->fRtoLReading = (TestWF(pwnd, WEFRTLREADING) != 0); 00103 plb->fRightAlign = (TestWF(pwnd, WEFRIGHT) != 0); 00104 plb->fDisableNoScroll = ((style & LBS_DISABLENOSCROLL) != 0); 00105 00106 plb->fSmoothScroll = TRUE; 00107 00108 /* 00109 * LBS_NOSEL gets priority over any other selection style. Next highest 00110 * priority goes to LBS_EXTENDEDSEL. Then LBS_MULTIPLESEL. 00111 */ 00112 if (TestWF(pwnd, WFWIN40COMPAT) && (style & LBS_NOSEL)) { 00113 plb->wMultiple = SINGLESEL; 00114 plb->fNoSel = TRUE; 00115 } else if (style & LBS_EXTENDEDSEL) { 00116 plb->wMultiple = EXTENDEDSEL; 00117 } else { 00118 plb->wMultiple = (UINT)((style & LBS_MULTIPLESEL) ? MULTIPLESEL : SINGLESEL); 00119 } 00120 00121 plb->fNoIntegralHeight = ((style & LBS_NOINTEGRALHEIGHT) != 0); 00122 plb->fWantKeyboardInput = ((style & LBS_WANTKEYBOARDINPUT) != 0); 00123 plb->fUseTabStops = ((style & LBS_USETABSTOPS) != 0); 00124 if (plb->fUseTabStops) { 00125 00126 /* 00127 * Set tab stops every <default> dialog units. 00128 */ 00129 LBSetTabStops(plb, 0, NULL); 00130 } 00131 plb->fMultiColumn = ((style & LBS_MULTICOLUMN) != 0); 00132 plb->fHasStrings = TRUE; 00133 plb->iLastSelection = -1; 00134 plb->iMouseDown = -1; /* Anchor point for multi selection */ 00135 plb->iLastMouseMove = -1; 00136 00137 /* 00138 * Get ownerdraw style bits 00139 */ 00140 if ((style & LBS_OWNERDRAWFIXED)) { 00141 plb->OwnerDraw = OWNERDRAWFIXED; 00142 } else if ((style & LBS_OWNERDRAWVARIABLE) && !plb->fMultiColumn) { 00143 plb->OwnerDraw = OWNERDRAWVAR; 00144 00145 /* 00146 * Integral height makes no sense with var height owner draw 00147 */ 00148 plb->fNoIntegralHeight = TRUE; 00149 } 00150 00151 if (plb->OwnerDraw && !(style & LBS_HASSTRINGS)) { 00152 00153 /* 00154 * If owner draw, do they want the listbox to maintain strings? 00155 */ 00156 plb->fHasStrings = FALSE; 00157 } 00158 00159 /* 00160 * If user specifies sort and not hasstrings, then we will send 00161 * WM_COMPAREITEM messages to the parent. 00162 */ 00163 plb->fSort = ((style & LBS_SORT) != 0); 00164 00165 /* 00166 * "No data" lazy-eval listbox mandates certain other style settings 00167 */ 00168 plb->fHasData = TRUE; 00169 00170 if (style & LBS_NODATA) { 00171 if (plb->OwnerDraw != OWNERDRAWFIXED || plb->fSort || plb->fHasStrings) { 00172 RIPERR0(ERROR_INVALID_FLAGS, RIP_WARNING, 00173 "NODATA listbox must be OWNERDRAWFIXED, w/o SORT or HASSTRINGS"); 00174 } else { 00175 plb->fHasData = FALSE; 00176 } 00177 } 00178 00179 plb->dwLocaleId = GetThreadLocale(); 00180 00181 /* 00182 * Check if this is part of a combo box 00183 */ 00184 if ((style & LBS_COMBOBOX) != 0) { 00185 00186 /* 00187 * Get the pcbox structure contained in the parent window's extra data 00188 * pointer. Check cbwndExtra to ensure compatibility with SQL windows. 00189 */ 00190 if (plb->spwndParent->cbwndExtra != 0) 00191 plb->pcbox = ((PCOMBOWND)(plb->spwndParent))->pcbox; 00192 } 00193 00194 /* 00195 * No need to set these to 0 since that was done for us when we Alloced 00196 * the PLBIV. 00197 */ 00198 00199 /* 00200 * plb->rgpch = (PBYTE)0; 00201 */ 00202 00203 /* 00204 * plb->iSelBase = plb->iTop = 0; 00205 */ 00206 00207 /* 00208 * plb->fMouseDown = FALSE; 00209 */ 00210 00211 /* 00212 * plb->fCaret = FALSE; 00213 */ 00214 00215 /* 00216 * plb->fCaretOn = FALSE; 00217 */ 00218 00219 /* 00220 * plb->maxWidth = 0; 00221 */ 00222 00223 plb->iSel = -1; 00224 00225 plb->hdc = NULL; 00226 00227 /* 00228 * Set the keyboard state so that when the user keyboard clicks he selects 00229 * an item. 00230 */ 00231 plb->fNewItemState = TRUE; 00232 00233 InitHStrings(plb); 00234 00235 if (plb->fHasStrings && plb->hStrings == NULL) { 00236 return -1L; 00237 } 00238 00239 hdc = NtUserGetDC(HWq(pwnd)); 00240 plb->cxChar = GdiGetCharDimensions(hdc, NULL, &plb->cyChar); 00241 NtUserReleaseDC(HWq(pwnd), hdc); 00242 00243 if (plb->cxChar == 0) { 00244 RIPMSG0(RIP_WARNING, "xxxLBCreate: GdiGetCharDimensions failed"); 00245 plb->cxChar = gpsi->cxSysFontChar; 00246 plb->cyChar = gpsi->cySysFontChar; 00247 } 00248 00249 if (plb->OwnerDraw == OWNERDRAWFIXED) { 00250 00251 /* 00252 * Query for item height only if we are fixed height owner draw. Note 00253 * that we don't care about an item's width for listboxes. 00254 */ 00255 measureItemStruct.CtlType = ODT_LISTBOX; 00256 measureItemStruct.CtlID = PtrToUlong(pwnd->spmenu); 00257 00258 /* 00259 * System font height is default height 00260 */ 00261 measureItemStruct.itemHeight = plb->cyChar; 00262 measureItemStruct.itemWidth = 0; 00263 measureItemStruct.itemData = 0; 00264 00265 /* 00266 * IanJa: #ifndef WIN16 (32-bit Windows), plb->id gets extended 00267 * to LONG wParam automatically by the compiler 00268 */ 00269 ThreadLock(plb->spwndParent, &tlpwndParent); 00270 SendMessage(HW(plb->spwndParent), WM_MEASUREITEM, 00271 measureItemStruct.CtlID, 00272 (LPARAM)&measureItemStruct); 00273 ThreadUnlock(&tlpwndParent); 00274 00275 /* 00276 * Use default height if given 0. This prevents any possible future 00277 * div-by-zero errors. 00278 */ 00279 if (measureItemStruct.itemHeight) 00280 plb->cyChar = measureItemStruct.itemHeight; 00281 00282 00283 if (plb->fMultiColumn) { 00284 00285 /* 00286 * Get default column width from measure items struct if we are a 00287 * multicolumn listbox. 00288 */ 00289 plb->cxColumn = measureItemStruct.itemWidth; 00290 } 00291 } else if (plb->OwnerDraw == OWNERDRAWVAR) 00292 plb->cyChar = 0; 00293 00294 00295 if (plb->fMultiColumn) { 00296 00297 /* 00298 * Set these default values till we get the WM_SIZE message and we 00299 * calculate them properly. This is because some people create a 00300 * 0 width/height listbox and size it later. We don't want to have 00301 * problems with invalid values in these fields 00302 */ 00303 if (plb->cxColumn <= 0) 00304 plb->cxColumn = 15 * plb->cxChar; 00305 plb->numberOfColumns = plb->itemsPerColumn = 1; 00306 } 00307 00308 LBSetCItemFullMax(plb); 00309 00310 // Don't do this for 4.0 apps. It'll make everyone's lives easier and 00311 // fix the anomaly that a combo & list created the same width end up 00312 // different when all is done. 00313 // B#1520 00314 00315 if (!TestWF(pwnd, WFWIN40COMPAT)) { 00316 plb->fIgnoreSizeMsg = TRUE; 00317 NtUserMoveWindow(HWq(pwnd), 00318 lpcs->x - SYSMET(CXBORDER), 00319 lpcs->y - SYSMET(CYBORDER), 00320 lpcs->cx + SYSMET(CXEDGE), 00321 lpcs->cy + SYSMET(CYEDGE), 00322 FALSE); 00323 plb->fIgnoreSizeMsg = FALSE; 00324 } 00325 00326 if (!plb->fNoIntegralHeight) { 00327 00328 /* 00329 * Send a message to ourselves to resize the listbox to an integral 00330 * height. We need to do it this way because at create time we are all 00331 * mucked up with window rects etc... 00332 * IanJa: #ifndef WIN16 (32-bit Windows), wParam 0 gets extended 00333 * to wParam 0L automatically by the compiler. 00334 */ 00335 PostMessage(HWq(pwnd), WM_SIZE, 0, 0L); 00336 } 00337 00338 return 1L; 00339 }

INT xxxLbDir PLBIV  ,
UINT  ,
LPWSTR 
 

Definition at line 839 of file lboxctl3.c.

References BOOL, Buffer, Buffer2, CCHFILEMAX, CheckLock, tagLBIV::cMac, DWORD, EXCLUDE_ATTR, FALSE, FIND_ATTR, HWq, INT, INVALID_HANDLE_VALUE, IsLBoxVisible, LB_CreateLBLine(), LBI_ADD, MSGFLAG_SPECIAL_THUNK, SendMessage(), tagLBIV::spwnd, TRUE, UINT, xxxCheckRedraw(), xxxLBInsertItem(), xxxLBShowHideScrollBars(), and xxxNotifyOwner().

Referenced by ListBoxWndProcWorker(), and xxxCBDir().

00843 { 00844 INT result; 00845 BOOL fWasVisible, bRet; 00846 WCHAR Buffer[CCHFILEMAX + 1]; 00847 WCHAR Buffer2[CCHFILEMAX + 1]; 00848 HANDLE hFind; 00849 WIN32_FIND_DATA ffd; 00850 UINT attribFile; 00851 DWORD mDrives; 00852 INT cDrive; 00853 UINT attribInclMask, attribExclMask; 00854 00855 CheckLock(plb->spwnd); 00856 00857 /* 00858 * Make sure the buffer is valid and copy it onto the stack. Why? Because 00859 * there is a chance that lhszFileSpec is pointing to an invalid string 00860 * because some app posted a CB_DIR or LB_DIR without the DDL_POSTMSGS 00861 * bit set. 00862 */ 00863 try { 00864 wcscpy(Buffer2, lhszFileSpec); 00865 lhszFileSpec = Buffer2; 00866 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00867 return -1; 00868 } 00869 00870 result = -1; 00871 00872 #ifndef UNICODE 00873 CharToOem(lhszFileSpec, lhszFileSpec); 00874 #endif 00875 00876 if (fWasVisible = IsLBoxVisible(plb)) { 00877 SendMessage(HWq(plb->spwnd), WM_SETREDRAW, FALSE, 0); 00878 } 00879 00880 /* 00881 * First we add the files then the directories and drives. 00882 * If they only wanted drives then skip the file query 00883 * Also under Windows specifing only 0x8000 (DDL_EXCLUSIVE) adds no files). 00884 */ 00885 00886 00887 // if ((attrib != (DDL_EXCLUSIVE | DDL_DRIVES)) && (attrib != DDL_EXCLUSIVE) && 00888 if (attrib != (DDL_EXCLUSIVE | DDL_DRIVES | DDL_NOFILES)) { 00889 hFind = FindFirstFile(lhszFileSpec, &ffd); 00890 00891 if (hFind != INVALID_HANDLE_VALUE) { 00892 00893 /* 00894 * If this is not an exclusive search, include normal files. 00895 */ 00896 attribInclMask = attrib & FIND_ATTR; 00897 if (!(attrib & DDL_EXCLUSIVE)) 00898 attribInclMask |= FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_READONLY | 00899 FILE_ATTRIBUTE_ARCHIVE; 00900 00901 /* 00902 * Make a mask of the attributes to be excluded from 00903 * the search. 00904 */ 00905 attribExclMask = ~attrib & EXCLUDE_ATTR; 00906 00907 // LATER BUG - scottlu 00908 // Win3 assumes doing a LoadCursor here will return the same wait cursor that 00909 // has already been created, whereas calling ServerLoadCursor creates a new 00910 // one every time! 00911 // hCursorT = NtUserSetCursor(ServerLoadCursor(NULL, IDC_WAIT)); 00912 00913 00914 // FindFirst/Next works different in NT then DOS. Under DOS you passed in 00915 // a set of attributes under NT you get back a set of attributes and have 00916 // to test for those attributes (Dos input attributes were Hidden, System 00917 // and Directoy) the dos find first always returned ReadOnly and archive files 00918 00919 // we are going to select a file in one of two cases. 00920 // 1) if any of the attrib bits are set on the file. 00921 // 2) if we want normal files and the file is a notmal file (the file attrib 00922 // bits don't contain any NOEXCLBITS 00923 00924 do { 00925 attribFile = (UINT)ffd.dwFileAttributes; 00926 if (attribFile == FILE_ATTRIBUTE_COMPRESSED) { 00927 attribFile = FILE_ATTRIBUTE_NORMAL; 00928 } 00929 attribFile &= ~FILE_ATTRIBUTE_COMPRESSED; 00930 00931 /* 00932 * Accept those files that have only the 00933 * attributes that we are looking for. 00934 */ 00935 if ((attribFile & attribInclMask) != 0 && 00936 (attribFile & attribExclMask) == 0) { 00937 if (attribFile & DDL_DIRECTORY) { 00938 00939 /* 00940 * Don't include '.' (current directory) in list. 00941 */ 00942 if (*((LPDWORD)&ffd.cFileName[0]) == 0x0000002E) 00943 goto cfnf; 00944 00945 /* 00946 * If we're not looking for dirs, ignore it 00947 */ 00948 if (!(attrib & DDL_DIRECTORY)) 00949 goto cfnf; 00950 00951 } else if (attrib & DDL_NOFILES) { 00952 /* 00953 * Don't include files if DDL_NOFILES is set. 00954 */ 00955 goto cfnf; 00956 } 00957 00958 LB_CreateLBLine(&ffd, 00959 Buffer); 00960 result = xxxLBInsertItem(plb, Buffer, 0, MSGFLAG_SPECIAL_THUNK | LBI_ADD); 00961 } 00962 cfnf: 00963 bRet = FindNextFile(hFind, &ffd); 00964 00965 } while (result >= -1 && bRet); 00966 FindClose(hFind); 00967 00968 // LATER see above comment 00969 // NtUserSetCursor(hCursorT); 00970 } 00971 } 00972 00973 /* 00974 * If drive bit set, include drives in the list. 00975 */ 00976 if (result != LB_ERRSPACE && (attrib & DDL_DRIVES)) { 00977 ffd.cFileName[0] = TEXT('['); 00978 ffd.cFileName[1] = ffd.cFileName[3] = TEXT('-'); 00979 ffd.cFileName[4] = TEXT(']'); 00980 ffd.cFileName[5] = 0; 00981 mDrives = GetLogicalDrives(); 00982 for (cDrive = 0; mDrives; mDrives >>= 1, cDrive++) { 00983 if (mDrives & 1) { 00984 ffd.cFileName[2] = (WCHAR)(TEXT('A') + cDrive); 00985 00986 /* 00987 * We have to set the SPECIAL_THUNK bit because we are 00988 * adding a server side string to a list box that may not 00989 * be HASSTRINGS so we have to force the server-client 00990 * string thunk. 00991 */ 00992 if ((result = xxxLBInsertItem(plb, CharLower(ffd.cFileName), -1, 00993 MSGFLAG_SPECIAL_THUNK)) < 0) { 00994 break; 00995 } 00996 } 00997 } 00998 } 00999 01000 if (result == LB_ERRSPACE) { 01001 xxxNotifyOwner(plb, LB_ERRSPACE); 01002 } 01003 01004 if (fWasVisible) { 01005 SendMessage(HWq(plb->spwnd), WM_SETREDRAW, TRUE, 0); 01006 } 01007 01008 xxxLBShowHideScrollBars(plb); 01009 01010 xxxCheckRedraw(plb, FALSE, 0); 01011 01012 if (result != LB_ERRSPACE) { 01013 01014 /* 01015 * Return index of last item in the listbox. We can't just return 01016 * result because that is the index of the last item added which may 01017 * be in the middle somewhere if the LBS_SORT style is on. 01018 */ 01019 return plb->cMac - 1; 01020 } else { 01021 return result; 01022 } 01023 }

LONG xxxLBInitStorage PLBIV  plb,
BOOL  fAnsi,
INT  cItems,
INT  cb
 

Definition at line 342 of file lboxctl1.c.

References tagLBIV::cchStrings, tagLBIV::cMac, tagLBIV::cMax, tagLBIV::fHasStrings, GrowMem(), tagLBIV::hStrings, tagLBIV::ichAlloc, INT, UserLocalReAlloc, and xxxNotifyOwner().

Referenced by ListBoxWndProcWorker().

00343 { 00344 HANDLE hMem; 00345 INT cbChunk; 00346 00347 /* 00348 * if the app is talking ANSI, then adjust for the worst case in unicode 00349 * where each single ansi byte translates to one 16 bit unicode value 00350 */ 00351 if (fAnsi) { 00352 cb *= sizeof(WCHAR) ; 00353 } /* if */ 00354 00355 /* 00356 * Fail if either of the parameters look bad. 00357 */ 00358 if ((cItems < 0) || (cb < 0)) { 00359 xxxNotifyOwner(plb, LBN_ERRSPACE); 00360 return LB_ERRSPACE; 00361 } /* if */ 00362 00363 /* 00364 * try to grow the pointer array (if necessary) accounting for the free space 00365 * already available. 00366 */ 00367 cItems -= plb->cMax - plb->cMac ; 00368 if ((cItems > 0) && !GrowMem(plb, cItems)) { 00369 xxxNotifyOwner(plb, LBN_ERRSPACE); 00370 return LB_ERRSPACE; 00371 } /* if */ 00372 00373 /* 00374 * now grow the string space if necessary 00375 */ 00376 if (plb->fHasStrings) { 00377 if ((cbChunk = (plb->ichAlloc + cb)) > plb->cchStrings) { 00378 00379 /* 00380 * Round up to the nearest 256 byte chunk. 00381 */ 00382 cbChunk = (cbChunk & ~0xff) + 0x100; 00383 if (!(hMem = UserLocalReAlloc(plb->hStrings, (LONG)cbChunk, 0))) { 00384 xxxNotifyOwner(plb, LBN_ERRSPACE); 00385 return LB_ERRSPACE; 00386 } 00387 plb->hStrings = hMem; 00388 plb->cchStrings = cbChunk; 00389 } /* if */ 00390 } /* if */ 00391 00392 /* 00393 * return the number of items that can be stored 00394 */ 00395 return plb->cMax ; 00396 }

INT xxxLbInsertFile PLBIV  ,
LPWSTR 
 

Definition at line 1036 of file lboxctl3.c.

References CCHFILEMAX, CheckLock, FALSE, INT, INVALID_HANDLE_VALUE, LB_CreateLBLine(), LBI_ADD, MSGFLAG_SPECIAL_THUNK, tagLBIV::spwnd, xxxCheckRedraw(), xxxLBInsertItem(), and xxxNotifyOwner().

Referenced by ListBoxWndProcWorker().

01039 { 01040 WCHAR chBuffer[CCHFILEMAX + 1]; 01041 INT result = -1; 01042 HANDLE hFind; 01043 WIN32_FIND_DATA ffd; 01044 01045 CheckLock(plb->spwnd); 01046 01047 hFind = FindFirstFile(lpFile, &ffd); 01048 if (hFind != INVALID_HANDLE_VALUE) { 01049 FindClose(hFind); 01050 LB_CreateLBLine(&ffd, chBuffer); 01051 result = xxxLBInsertItem(plb, chBuffer, 0, MSGFLAG_SPECIAL_THUNK | LBI_ADD); 01052 } 01053 01054 if (result == LB_ERRSPACE) { 01055 xxxNotifyOwner(plb, result); 01056 } 01057 01058 xxxCheckRedraw(plb, FALSE, 0); 01059 return result; 01060 }

int xxxLBInsertItem PLBIV  ,
LPWSTR  ,
int  ,
UINT 
 

Referenced by ListBoxWndProcWorker(), xxxLbDir(), and xxxLbInsertFile().

BOOL xxxLBInvalidateRect PLBIV  plb,
LPRECT  lprc,
BOOL  fErase
 

Definition at line 38 of file lboxctl2.c.

References BOOL, CheckLock, FALSE, tagLBIV::fDeferUpdate, tagLBIV::fRedraw, HWq, IsLBoxVisible, NtUserInvalidateRect(), tagLBIV::spwnd, and TRUE.

Referenced by ListBoxWndProcWorker(), xxxCheckRedraw(), xxxLBoxCtlDelete(), xxxLBSelRange(), xxxLBSetCount(), and xxxLBSetSel().

00039 { 00040 CheckLock(plb->spwnd); 00041 00042 if (IsLBoxVisible(plb)) { 00043 NtUserInvalidateRect(HWq(plb->spwnd), lprc, fErase); 00044 return(TRUE); 00045 } 00046 00047 if (!plb->fRedraw) 00048 plb->fDeferUpdate = TRUE; 00049 00050 return(FALSE); 00051 }

VOID xxxLBoxCtlCharInput PLBIV  ,
UINT  ,
BOOL 
 

Definition at line 2948 of file lboxctl2.c.

References BOOL, BYTE, CheckLock, tagLBIV::cMac, DbcsCombine(), tagLBIV::fAddSelMode, FALSE, tagLBIV::fHasStrings, tagLBIV::fMouseDown, tagLBIV::fSort, GetKeyState(), gpsi, HWq, IDSYS_LBSEARCH, INT, IS_DBCS_ENABLED, tagLBIV::iSelBase, tagLBIV::iTypeSearch, LB_KEYDOWN, MAX_TYPESEARCH, MBToWCSEx(), MULTIPLESEL, NtUserMessageBeep, NtUserSetTimer(), NULL, PREFIX, tagLBIV::pszTypeSearch, SendMessageWorker(), tagLBIV::spwnd, tagLBIV::spwndParent, THREAD_CODEPAGE, ThreadLock, ThreadUnlock, TRUE, UserLocalAlloc, tagLBIV::wMultiple, xxxFindString(), and xxxLBoxCtlKeyInput().

Referenced by ListBoxWndProcWorker().

02952 { 02953 INT iSel; 02954 BOOL fControl; 02955 TL tlpwndParent; 02956 02957 CheckLock(plb->spwnd); 02958 02959 if (plb->cMac == 0 || plb->fMouseDown) { 02960 02961 /* 02962 * Get out if we are in the middle of mouse routines or if we have no 02963 * items in the listbox, we just return without doing anything. 02964 */ 02965 return; 02966 } 02967 02968 fControl = (GetKeyState(VK_CONTROL) < 0); 02969 02970 switch (inputChar) { 02971 case VK_ESCAPE: 02972 plb->iTypeSearch = 0; 02973 if (plb->pszTypeSearch) 02974 plb->pszTypeSearch[0] = 0; 02975 break; 02976 02977 case VK_BACK: 02978 if (plb->iTypeSearch) { 02979 plb->pszTypeSearch[plb->iTypeSearch--] = 0; 02980 if (plb->fSort) { 02981 iSel = -1; 02982 goto TypeSearch; 02983 } 02984 } 02985 break; 02986 02987 case VK_SPACE: 02988 if (plb->fAddSelMode || plb->wMultiple == MULTIPLESEL) 02989 break; 02990 /* Otherwise, for single/extended selection listboxes not in add 02991 * selection mode, let the space go thru as a type search character 02992 * FALL THRU 02993 */ 02994 02995 default: 02996 02997 /* 02998 * Move selection to first item beginning with the character the 02999 * user typed. We don't want do this if we are using owner draw. 03000 */ 03001 03002 if (fAnsi && IS_DBCS_ENABLED() && IsDBCSLeadByteEx(THREAD_CODEPAGE(), (BYTE)inputChar)) { 03003 WCHAR wch; 03004 LPWSTR lpwstr = &wch; 03005 03006 inputChar = DbcsCombine(HWq(plb->spwnd), (BYTE)inputChar); 03007 RIPMSG1(RIP_VERBOSE, "xxxLBoxCtlCharInput: combined DBCS. 0x%04x", inputChar); 03008 03009 if (inputChar == 0) { 03010 RIPMSG1(RIP_WARNING, "xxxLBoxCtlCharInput: cannot combine two DBCS. LB=0x%02x", 03011 inputChar); 03012 break; 03013 } 03014 // If it is DBCS, let's ignore the ctrl status. 03015 fControl = FALSE; 03016 03017 // Convert DBCS to UNICODE. 03018 // Note: Leading byte is in the low byte, trailing byte is in high byte. 03019 // Let's assume Little Endian CPUs only, so inputChar can directly be 03020 // input for MBSToWCSEx as an ANSI string. 03021 if (MBToWCSEx(THREAD_CODEPAGE(), (LPCSTR)&inputChar, 2, &lpwstr, 1, FALSE) == 0) { 03022 RIPMSG1(RIP_WARNING, "xxxLBoxCtlCharInput: cannot convert 0x%04x to UNICODE.", 03023 inputChar); 03024 break; 03025 } 03026 inputChar = wch; 03027 } 03028 03029 if (plb->fHasStrings) { 03030 // Incremental Type Search processing 03031 // 03032 // update szTypeSearch string and then move to the first item from 03033 // the current selection whose prefix matches szTypeSearch 03034 // 03035 // the szTypeSearch will continue to grow until a "long enough" 03036 // gap between key entries is encountered -- at which point any 03037 // more searching will start over 03038 03039 /* 03040 * Undo CONTROL-char to char 03041 */ 03042 if (fControl && inputChar < 0x20) 03043 inputChar += 0x40; 03044 03045 if (plb->iTypeSearch == MAX_TYPESEARCH) { 03046 NtUserMessageBeep(0); 03047 break; 03048 } 03049 iSel = -1; 03050 03051 if (plb->pszTypeSearch == NULL) 03052 plb->pszTypeSearch = (LPWSTR)UserLocalAlloc(HEAP_ZERO_MEMORY, sizeof(WCHAR) * (MAX_TYPESEARCH + 1)); 03053 03054 if (plb->pszTypeSearch == NULL) { 03055 NtUserMessageBeep(0); 03056 break; 03057 } 03058 03059 plb->pszTypeSearch[plb->iTypeSearch++] = (WCHAR) inputChar; 03060 plb->pszTypeSearch[plb->iTypeSearch] = 0; 03061 03062 TypeSearch: 03063 if (plb->fSort) { 03064 // Set timer to determine when to kill incremental searching 03065 NtUserSetTimer(HWq(plb->spwnd), IDSYS_LBSEARCH, 03066 gpsi->dtLBSearch, NULL); 03067 } else { 03068 // If this is not a sorted listbox, no incremental search. 03069 plb->iTypeSearch = 0; 03070 iSel = plb->iSelBase; 03071 } 03072 03073 03074 /* 03075 * Search for the item beginning with the given character starting 03076 * at iSel+1. We will wrap the search to the beginning of the 03077 * listbox if we don't find the item. If SHIFT is down and we are 03078 * a multiselection lb, then the item's state will be set to 03079 * plb->fNewItemState according to the current mode. 03080 */ 03081 iSel = xxxFindString(plb, plb->pszTypeSearch, iSel, PREFIX, TRUE); 03082 if (iSel == -1) { 03083 // no match found -- check for prefix match 03084 // (i.e. "p" find FIRST item that starts with 'p', 03085 // "pp" find NEXT item that starts with 'p') 03086 if(plb->iTypeSearch) 03087 { 03088 plb->iTypeSearch--; 03089 if ((plb->iTypeSearch == 1) && (plb->pszTypeSearch[0] == plb->pszTypeSearch[1])) 03090 { 03091 plb->pszTypeSearch[1] = 0; 03092 iSel = xxxFindString(plb, plb->pszTypeSearch, plb->iSelBase, PREFIX, TRUE); 03093 } 03094 } 03095 } 03096 // if match is found -- select it 03097 if (iSel != -1) 03098 { 03099 CtlKeyInput: 03100 xxxLBoxCtlKeyInput(plb, LB_KEYDOWN, iSel); 03101 03102 } 03103 } else { 03104 if (plb->spwndParent != NULL) { 03105 ThreadLock(plb->spwndParent, &tlpwndParent); 03106 iSel = (INT)SendMessageWorker(plb->spwndParent, WM_CHARTOITEM, 03107 MAKELONG(inputChar, plb->iSelBase), (LPARAM)HWq(plb->spwnd), fAnsi); 03108 ThreadUnlock(&tlpwndParent); 03109 } else 03110 iSel = -1; 03111 03112 if (iSel != -1 && iSel != -2) 03113 goto CtlKeyInput; 03114 03115 } 03116 break; 03117 } 03118 }

INT xxxLBoxCtlDelete PLBIV  ,
INT 
 

Definition at line 842 of file lboxctl1.c.

References CheckLock, tagLBIV::cMac, EXTENDEDSEL, FALSE, tagLBIV::fFromInsert, tagLBIV::fHasData, tagLBIV::fHasStrings, FWINABLE, tagLBIV::hStrings, tagLBIV::ichAlloc, tagLBIV::iMouseDown, INT, tagLBIV::iSel, tagLBIV::iSelBase, tagLBIV::iTop, LBEvent(), LBGetItemRect(), LBSetCItemFullMax(), min, NULL, tagLBItem::offsz, tagLBIV::OwnerDraw, OWNERDRAWVAR, PBYTE, tagLBIV::pcbox, tagLBIV::rgpch, SendMessageWorker(), SINGLESEL, tagCBox::spwnd, tagLBIV::spwnd, TestWF, ThreadLock, ThreadUnlock, TRUE, WFWIN40COMPAT, tagLBIV::wMultiple, xxxCBInternalUpdateEditWindow(), xxxCheckRedraw(), xxxInsureVisible(), xxxLBInvalidateRect(), xxxLBoxDeleteItem(), and xxxLBShowHideScrollBars().

Referenced by ListBoxWndProcWorker().

00845 { 00846 LONG cb; 00847 LPBYTE lp; 00848 LPBYTE lpT; 00849 RECT rc; 00850 int cbItem; /* size of Item in rgpch */ 00851 LPWSTR lpString; 00852 PBYTE pbStrings; 00853 INT cbStringLen; 00854 LPBYTE itemNumbers; 00855 INT sTmp; 00856 TL tlpwnd; 00857 00858 CheckLock(plb->spwnd); 00859 00860 if (sItem < 0 || sItem >= plb->cMac) { 00861 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00862 return LB_ERR; 00863 } 00864 00865 if (FWINABLE()) { 00866 LBEvent(plb, EVENT_OBJECT_DESTROY, sItem); 00867 } 00868 00869 if (plb->cMac == 1) { 00870 00871 /* 00872 * When the item count is 0, we send a resetcontent message so that we 00873 * can reclaim our string space this way. 00874 */ 00875 SendMessageWorker(plb->spwnd, LB_RESETCONTENT, 0, 0, FALSE); 00876 goto FinishUpDelete; 00877 } 00878 00879 /* 00880 * Get the rectangle associated with the last item in the listbox. If it is 00881 * visible, we need to invalidate it. When we delete an item, everything 00882 * scrolls up to replace the item deleted so we must make sure we erase the 00883 * old image of the last item in the listbox. 00884 */ 00885 if (LBGetItemRect(plb, (INT)(plb->cMac - 1), &rc)) { 00886 xxxLBInvalidateRect(plb, &rc, TRUE); 00887 } 00888 00889 // 3.1 and earlier used to only send WM_DELETEITEMs if it was an ownerdraw 00890 // listbox. 4.0 and above will send WM_DELETEITEMs for every item that has 00891 // nonzero item data. 00892 if (TestWF(plb->spwnd, WFWIN40COMPAT) || (plb->OwnerDraw && plb->fHasData)) { 00893 xxxLBoxDeleteItem(plb, sItem); 00894 } 00895 00896 plb->cMac--; 00897 00898 cbItem = (plb->fHasStrings ? sizeof(LBItem) 00899 : (plb->fHasData ? sizeof(LBODItem): 0)); 00900 cb = ((plb->cMac - sItem) * cbItem); 00901 00902 /* 00903 * Byte for the selection status of the item. 00904 */ 00905 if (plb->wMultiple != SINGLESEL) { 00906 cb += (plb->cMac + 1); 00907 } 00908 00909 if (plb->OwnerDraw == OWNERDRAWVAR) { 00910 00911 /* 00912 * One byte for the height of the item. 00913 */ 00914 cb += (plb->cMac + 1); 00915 } 00916 00917 /* 00918 * Might be nodata and singlesel, for instance. 00919 * but what out for the case where cItem == cMac (and cb == 0). 00920 */ 00921 if ((cb != 0) || plb->fHasStrings) { 00922 lp = plb->rgpch; 00923 00924 lpT = (lp + (sItem * cbItem)); 00925 00926 if (plb->fHasStrings) { 00927 /* 00928 * If we has strings with each item, then we want to compact the string 00929 * heap so that we can recover the space occupied by the string of the 00930 * deleted item. 00931 */ 00932 /* 00933 * Get the string which we will be deleting 00934 */ 00935 pbStrings = (PBYTE)(plb->hStrings); 00936 lpString = (LPTSTR)(pbStrings + ((lpLBItem)lpT)->offsz); 00937 cbStringLen = (wcslen(lpString) + 1) * sizeof(WCHAR); /* include null terminator */ 00938 00939 /* 00940 * Now compact the string array 00941 */ 00942 plb->ichAlloc = plb->ichAlloc - cbStringLen; 00943 00944 RtlMoveMemory(lpString, (PBYTE)lpString + cbStringLen, 00945 plb->ichAlloc + (pbStrings - (LPBYTE)lpString)); 00946 00947 /* 00948 * We have to update the string pointers in plb->rgpch since all the 00949 * string after the deleted string have been moved down stringLength 00950 * bytes. Note that we have to explicitly check all items in the list 00951 * box if the string was allocated after the deleted item since the 00952 * LB_SORT style allows a lower item number to have a string allocated 00953 * at the end of the string heap for example. 00954 */ 00955 itemNumbers = lp; 00956 for (sTmp = 0; sTmp <= plb->cMac; sTmp++) { 00957 lpLBItem p =(lpLBItem)itemNumbers; 00958 if ( (LPTSTR)(p->offsz + pbStrings) > lpString ) { 00959 p->offsz -= cbStringLen; 00960 } 00961 p++; 00962 itemNumbers=(LPBYTE)p; 00963 } 00964 } 00965 00966 /* 00967 * Now compact the pointers to the strings (or the long app supplied values 00968 * if ownerdraw without strings). 00969 */ 00970 RtlMoveMemory(lpT, lpT + cbItem, cb); 00971 00972 /* 00973 * Compress the multiselection bytes 00974 */ 00975 if (plb->wMultiple != SINGLESEL) { 00976 lpT = (lp + (plb->cMac * cbItem) + sItem); 00977 RtlMoveMemory(lpT, lpT + 1, plb->cMac - sItem + 00978 (plb->OwnerDraw == OWNERDRAWVAR ? plb->cMac + 1 : 0)); 00979 } 00980 00981 if (plb->OwnerDraw == OWNERDRAWVAR) { 00982 /* 00983 * Compress the height bytes 00984 */ 00985 lpT = (lp + (plb->cMac * cbItem) + (plb->wMultiple ? plb->cMac : 0) 00986 + sItem); 00987 RtlMoveMemory(lpT, lpT + 1, plb->cMac - sItem); 00988 } 00989 00990 } 00991 00992 if (plb->wMultiple == SINGLESEL) { 00993 if (plb->iSel == sItem) { 00994 plb->iSel = -1; 00995 00996 if (plb->pcbox != NULL) { 00997 ThreadLock(plb->pcbox->spwnd, &tlpwnd); 00998 xxxCBInternalUpdateEditWindow(plb->pcbox, NULL); 00999 ThreadUnlock(&tlpwnd); 01000 } 01001 } else if (plb->iSel > sItem) 01002 plb->iSel--; 01003 } 01004 01005 if ((plb->iMouseDown != -1) && (sItem <= plb->iMouseDown)) 01006 plb->iMouseDown = -1; 01007 01008 if (plb->iSelBase && sItem == plb->iSelBase) 01009 plb->iSelBase--; 01010 01011 if (plb->cMac) { 01012 plb->iSelBase = min(plb->iSelBase, plb->cMac - 1); 01013 } else { 01014 plb->iSelBase = 0; 01015 } 01016 01017 if ((plb->wMultiple == EXTENDEDSEL) && (plb->iSel == -1)) 01018 plb->iSel = plb->iSelBase; 01019 01020 if (plb->OwnerDraw == OWNERDRAWVAR) 01021 LBSetCItemFullMax(plb); 01022 01023 /* 01024 * We always set a new iTop. The iTop won't change if it doesn't need to 01025 * but it will change if: 1. The iTop was deleted or 2. We need to change 01026 * the iTop so that we fill the listbox. 01027 */ 01028 xxxInsureVisible(plb, plb->iTop, FALSE); 01029 01030 FinishUpDelete: 01031 01032 /* 01033 * Check if scroll bars need to be shown/hidden 01034 */ 01035 plb->fFromInsert = TRUE; 01036 xxxLBShowHideScrollBars(plb); 01037 plb->fFromInsert = FALSE; 01038 01039 xxxCheckRedraw(plb, TRUE, sItem); 01040 xxxInsureVisible(plb, plb->iSelBase, FALSE); 01041 01042 return plb->cMac; 01043 }

VOID xxxLBoxCtlHScroll PLBIV  ,
INT  ,
INT 
 

Referenced by ListBoxWndProcWorker(), xxxLBInsertItem(), xxxLBShowHideScrollBars(), and xxxLBSize().

VOID xxxLBoxCtlHScrollMultiColumn PLBIV  ,
INT  ,
INT 
 

Definition at line 71 of file lboxmult.c.

References CheckLock, tagLBIV::cMac, tagLBIV::fRightAlign, tagLBIV::fSmoothScroll, INT, tagLBIV::itemsPerColumn, tagLBIV::iTop, tagLBIV::numberOfColumns, tagLBIV::spwnd, TRUE, xxxLBShowHideScrollBars(), and xxxNewITop().

Referenced by ListBoxWndProcWorker(), xxxLBoxCtlHScroll(), and xxxTrackMouse().

00075 { 00076 INT iTop = plb->iTop; 00077 00078 CheckLock(plb->spwnd); 00079 00080 if (!plb->cMac) return; 00081 00082 switch (cmd) { 00083 case SB_LINEUP: 00084 if (plb->fRightAlign) 00085 goto ReallyLineDown; 00086 ReallyLineUp: 00087 iTop -= plb->itemsPerColumn; 00088 break; 00089 case SB_LINEDOWN: 00090 if (plb->fRightAlign) 00091 goto ReallyLineUp; 00092 ReallyLineDown: 00093 iTop += plb->itemsPerColumn; 00094 break; 00095 case SB_PAGEUP: 00096 if (plb->fRightAlign) 00097 goto ReallyPageDown; 00098 ReallyPageUp: 00099 iTop -= plb->itemsPerColumn * plb->numberOfColumns; 00100 break; 00101 case SB_PAGEDOWN: 00102 if (plb->fRightAlign) 00103 goto ReallyPageUp; 00104 ReallyPageDown: 00105 iTop += plb->itemsPerColumn * plb->numberOfColumns; 00106 break; 00107 case SB_THUMBTRACK: 00108 case SB_THUMBPOSITION: 00109 if (plb->fRightAlign) { 00110 int iCols = plb->cMac ? ((plb->cMac-1) / plb->itemsPerColumn) + 1 : 0; 00111 00112 xAmt = iCols - (xAmt + plb->numberOfColumns); 00113 if (xAmt<0) 00114 xAmt=0; 00115 } 00116 iTop = xAmt * plb->itemsPerColumn; 00117 break; 00118 case SB_TOP: 00119 if (plb->fRightAlign) 00120 goto ReallyBottom; 00121 ReallyTop: 00122 iTop = 0; 00123 break; 00124 case SB_BOTTOM: 00125 if (plb->fRightAlign) 00126 goto ReallyTop; 00127 ReallyBottom: 00128 iTop = plb->cMac - 1 - ((plb->cMac - 1) % plb->itemsPerColumn); 00129 break; 00130 case SB_ENDSCROLL: 00131 plb->fSmoothScroll = TRUE; 00132 xxxLBShowHideScrollBars(plb); 00133 break; 00134 } 00135 00136 xxxNewITop(plb, iTop); 00137 }

VOID xxxLBoxCtlKeyInput PLBIV  ,
UINT  ,
UINT 
 

Definition at line 2183 of file lboxctl2.c.

References BOOL, tagCBox::CBoxStyle, CheckLock, tagLBIV::cItemFullMax, tagLBIV::cMac, CTLDOWN, EXTENDEDSEL, tagLBIV::fAddSelMode, FALSE, tagCBox::fExtendedUI, tagCBox::fKeyboardSelInListBox, tagCBox::fLBoxVisible, tagLBIV::fMouseDown, tagLBIV::fMultiColumn, tagLBIV::fNewItemState, tagLBIV::fNotify, tagLBIV::fRightAlign, tagLBIV::fWantKeyboardInput, FWINABLE, GetKeyState(), gpsi, HILITEANDSEL, HILITEONLY, HW, HWq, IDSYS_CARET, tagLBIV::iLastMouseMove, tagLBIV::iLastSelection, tagLBIV::iMouseDown, IncrementISel(), INT, tagLBIV::iSel, tagLBIV::iSelBase, IsSelected(), tagLBIV::itemsPerColumn, tagLBIV::iTypeSearch, L, LB_KEYDOWN, LBEvent(), LBPage(), msg, MULTIPLESEL, NtUserKillTimer(), NtUserSetTimer(), tagLBIV::OwnerDraw, OWNERDRAWVAR, tagLBIV::pcbox, PostMessage(), SDROPPABLE, SELONLY, SendMessage(), SetSelected(), SHIFTDOWN, SINGLESEL, tagCBox::spwnd, tagLBIV::spwnd, tagLBIV::spwndParent, TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, VERKEY_BACKSLASH, VERKEY_SLASH, WFHSCROLL, tagLBIV::wMultiple, xxxCBHideListBoxWindow(), xxxCBShowListBoxWindow(), xxxInsureVisible(), xxxInvertLBItem(), xxxLBBlockHilite(), xxxLBoxCaretBlinker(), xxxLBSetCaret(), xxxLBShowHideScrollBars(), xxxNotifyOwner(), xxxResetWorld(), and xxxSetISelBase().

Referenced by ListBoxWndProcWorker(), and xxxLBoxCtlCharInput().

02187 { 02188 INT i; 02189 INT iNewISel; 02190 INT cItemPageScroll; 02191 PCBOX pcbox; 02192 BOOL fDropDownComboBox; 02193 BOOL fExtendedUIComboBoxClosed; 02194 BOOL hScrollBar = TestWF(plb->spwnd, WFHSCROLL); 02195 UINT wModifiers = 0; 02196 BOOL fSelectKey = FALSE; /* assume it is a navigation key */ 02197 UINT uEvent = 0; 02198 HWND hwnd = HWq(plb->spwnd); 02199 TL tlpwndParent; 02200 TL tlpwnd; 02201 02202 CheckLock(plb->spwnd); 02203 02204 pcbox = plb->pcbox; 02205 02206 /* 02207 * Is this a dropdown style combo box/listbox ? 02208 */ 02209 fDropDownComboBox = pcbox && (pcbox->CBoxStyle & SDROPPABLE); 02210 02211 /* 02212 *Is this an extended ui combo box which is closed? 02213 */ 02214 fExtendedUIComboBoxClosed = fDropDownComboBox && pcbox->fExtendedUI && 02215 !pcbox->fLBoxVisible; 02216 02217 if (plb->fMouseDown || (!plb->cMac && vKey != VK_F4)) { 02218 02219 /* 02220 * Ignore keyboard input if we are in the middle of a mouse down deal or 02221 * if there are no items in the listbox. Note that we let F4's go 02222 * through for combo boxes so that the use can pop up and down empty 02223 * combo boxes. 02224 */ 02225 return; 02226 } 02227 02228 /* 02229 * Modifiers are considered only in EXTENDED sel list boxes. 02230 */ 02231 if (plb->wMultiple == EXTENDEDSEL) { 02232 02233 /* 02234 * If multiselection listbox, are any modifiers used ? 02235 */ 02236 if (GetKeyState(VK_SHIFT) < 0) 02237 wModifiers = SHIFTDOWN; 02238 if (GetKeyState(VK_CONTROL) < 0) 02239 wModifiers += CTLDOWN; 02240 02241 /* 02242 * Please Note that (SHIFTDOWN + CTLDOWN) == (SHCTLDOWN) 02243 */ 02244 } 02245 02246 if (msg == LB_KEYDOWN) { 02247 02248 /* 02249 * This is a listbox "go to specified item" message which means we want 02250 * to go to a particular item number (given by vKey) directly. ie. the 02251 * user has typed a character and we want to go to the item which 02252 * starts with that character. 02253 */ 02254 iNewISel = (INT)vKey; 02255 goto TrackKeyDown; 02256 } 02257 02258 cItemPageScroll = plb->cItemFullMax; 02259 02260 if (cItemPageScroll > 1) 02261 cItemPageScroll--; 02262 02263 if (plb->fWantKeyboardInput) { 02264 02265 /* 02266 * Note: msg must not be LB_KEYDOWN here or we'll be in trouble... 02267 */ 02268 ThreadLock(plb->spwndParent, &tlpwndParent); 02269 iNewISel = (INT)SendMessage(HW(plb->spwndParent), WM_VKEYTOITEM, 02270 MAKELONG(vKey, plb->iSelBase), (LPARAM)hwnd); 02271 ThreadUnlock(&tlpwndParent); 02272 02273 if (iNewISel == -2) { 02274 02275 /* 02276 * Don't move the selection... 02277 */ 02278 return; 02279 } 02280 if (iNewISel != -1) { 02281 02282 /* 02283 * Jump directly to the item provided by the app 02284 */ 02285 goto TrackKeyDown; 02286 } 02287 02288 /* 02289 * else do default processing of the character. 02290 */ 02291 } 02292 02293 switch (vKey) { 02294 // LATER IanJa: not language independent!!! 02295 // We could use VkKeyScan() to find out which is the '\' key 02296 // This is VK_OEM_5 '\|' for US English only. 02297 // Germans, Italians etc. have to type CTRL+^ (etc) for this. 02298 // This is documented as File Manager behaviour for 3.0, but apparently 02299 // not for 3.1., although functionality remains. We should still fix it, 02300 // although German (etc?) '\' is generated with AltGr (Ctrl-Alt) (???) 02301 case VERKEY_BACKSLASH: /* '\' character for US English */ 02302 02303 /* 02304 * Check if this is CONTROL-\ ; If so Deselect all items 02305 */ 02306 if ((wModifiers & CTLDOWN) && (plb->wMultiple != SINGLESEL)) { 02307 xxxLBSetCaret(plb, FALSE); 02308 xxxResetWorld(plb, plb->iSelBase, plb->iSelBase, FALSE); 02309 02310 /* 02311 * And select the current item 02312 */ 02313 SetSelected(plb, plb->iSelBase, TRUE, HILITEANDSEL); 02314 xxxInvertLBItem(plb, plb->iSelBase, TRUE); 02315 uEvent = EVENT_OBJECT_SELECTION; 02316 goto CaretOnAndNotify; 02317 } 02318 return; 02319 break; 02320 02321 case VK_DIVIDE: /* NumPad '/' character on enhanced keyboard */ 02322 // LATER IanJa: not language independent!!! 02323 // We could use VkKeyScan() to find out which is the '/' key 02324 // This is VK_OEM_2 '/?' for US English only. 02325 // Germans, Italians etc. have to type CTRL+# (etc) for this. 02326 case VERKEY_SLASH: /* '/' character */ 02327 02328 /* 02329 * Check if this is CONTROL-/ ; If so select all items 02330 */ 02331 if ((wModifiers & CTLDOWN) && (plb->wMultiple != SINGLESEL)) { 02332 xxxLBSetCaret(plb, FALSE); 02333 xxxResetWorld(plb, -1, -1, TRUE); 02334 02335 uEvent = EVENT_OBJECT_SELECTIONWITHIN; 02336 02337 CaretOnAndNotify: 02338 xxxLBSetCaret(plb, TRUE); 02339 if (FWINABLE()) { 02340 LBEvent(plb, uEvent, plb->iSelBase); 02341 } 02342 xxxNotifyOwner(plb, LBN_SELCHANGE); 02343 } 02344 return; 02345 break; 02346 02347 case VK_F8: 02348 02349 /* 02350 * The "Add" mode is possible only in Multiselection listboxes... Get 02351 * into it via SHIFT-F8... (Yes, sometimes these UI people are sillier 02352 * than your "typical dumb user"...) 02353 */ 02354 if (plb->wMultiple != SINGLESEL && wModifiers == SHIFTDOWN) { 02355 02356 /* 02357 * We have to make the caret blink! Do something... 02358 */ 02359 if (plb->fAddSelMode) { 02360 02361 /* 02362 * Switch off the Caret blinking 02363 */ 02364 NtUserKillTimer(hwnd, IDSYS_CARET); 02365 02366 /* 02367 * Make sure the caret does not vanish 02368 */ 02369 xxxLBSetCaret(plb, TRUE); 02370 } else { 02371 02372 /* 02373 * Create a timer to make the caret blink 02374 */ 02375 NtUserSetTimer(hwnd, IDSYS_CARET, gpsi->dtCaretBlink, 02376 xxxLBoxCaretBlinker); 02377 } 02378 02379 /* 02380 * Toggle the Add mode flag 02381 */ 02382 plb->fAddSelMode = (UINT)!plb->fAddSelMode; 02383 } 02384 return; 02385 case VK_SPACE: /* Selection key is space */ 02386 i = 0; 02387 fSelectKey = TRUE; 02388 break; 02389 02390 case VK_PRIOR: 02391 if (fExtendedUIComboBoxClosed) { 02392 02393 /* 02394 * Disable movement keys for TandyT. 02395 */ 02396 return; 02397 } 02398 02399 if (plb->OwnerDraw == OWNERDRAWVAR) { 02400 i = LBPage(plb, plb->iSelBase, FALSE) - plb->iSelBase; 02401 } else { 02402 i = -cItemPageScroll; 02403 } 02404 break; 02405 02406 case VK_NEXT: 02407 if (fExtendedUIComboBoxClosed) { 02408 02409 /* 02410 * Disable movement keys for TandyT. 02411 */ 02412 return; 02413 } 02414 02415 if (plb->OwnerDraw == OWNERDRAWVAR) { 02416 i = LBPage(plb, plb->iSelBase, TRUE) - plb->iSelBase; 02417 } else { 02418 i = cItemPageScroll; 02419 } 02420 break; 02421 02422 case VK_HOME: 02423 if (fExtendedUIComboBoxClosed) { 02424 02425 /* 02426 * Disable movement keys for TandyT. 02427 */ 02428 return; 02429 } 02430 02431 i = (INT_MIN/2)+1; /* A very big negative number */ 02432 break; 02433 02434 case VK_END: 02435 if (fExtendedUIComboBoxClosed) { 02436 02437 /* 02438 * Disable movement keys for TandyT. 02439 */ 02440 return; 02441 } 02442 02443 i = (INT_MAX/2)-1; /* A very big positive number */ 02444 break; 02445 02446 case VK_LEFT: 02447 if (plb->fMultiColumn) { 02448 if (plb->fRightAlign 02449 #ifdef USE_MIRRORING 02450 ^ (!!TestWF(plb->spwnd, WEFLAYOUTRTL)) 02451 02452 #endif 02453 ) 02454 goto ReallyRight; 02455 ReallyLeft: 02456 if (plb->iSelBase / plb->itemsPerColumn == 0) { 02457 i = 0; 02458 } else { 02459 i = -plb->itemsPerColumn; 02460 } 02461 break; 02462 } 02463 02464 if (hScrollBar) { 02465 goto HandleHScrolling; 02466 } else { 02467 02468 /* 02469 * Fall through and handle this as if the up arrow was pressed. 02470 */ 02471 02472 vKey = VK_UP; 02473 } 02474 02475 /* 02476 * Fall through 02477 */ 02478 02479 case VK_UP: 02480 if (fExtendedUIComboBoxClosed) 02481 // Disable movement keys for TandyT. 02482 return; 02483 02484 i = -1; 02485 break; 02486 02487 case VK_RIGHT: 02488 if (plb->fMultiColumn) { 02489 if (plb->fRightAlign 02490 #ifdef USE_MIRRORING 02491 ^ (!!TestWF(plb->spwnd, WEFLAYOUTRTL)) 02492 02493 #endif 02494 ) 02495 goto ReallyLeft; 02496 ReallyRight: 02497 if (plb->iSelBase / plb->itemsPerColumn == plb->cMac / plb->itemsPerColumn) { 02498 i = 0; 02499 } else { 02500 i = plb->itemsPerColumn; 02501 } 02502 break; 02503 } 02504 if (hScrollBar) { 02505 HandleHScrolling: 02506 PostMessage(hwnd, WM_HSCROLL, 02507 (vKey == VK_RIGHT ? SB_LINEDOWN : SB_LINEUP), 0L); 02508 return; 02509 } else { 02510 02511 /* 02512 * Fall through and handle this as if the down arrow was 02513 * pressed. 02514 */ 02515 vKey = VK_DOWN; 02516 } 02517 02518 /* 02519 * Fall through 02520 */ 02521 02522 case VK_DOWN: 02523 if (fExtendedUIComboBoxClosed) { 02524 02525 /* 02526 * If the combo box is closed, down arrow should open it. 02527 */ 02528 if (!pcbox->fLBoxVisible) { 02529 02530 /* 02531 * If the listbox isn't visible, just show it 02532 */ 02533 ThreadLock(pcbox->spwnd, &tlpwnd); 02534 xxxCBShowListBoxWindow(pcbox, TRUE); 02535 ThreadUnlock(&tlpwnd); 02536 } 02537 return; 02538 } 02539 i = 1; 02540 break; 02541 02542 case VK_ESCAPE: 02543 case VK_RETURN: 02544 if (!fDropDownComboBox || !pcbox->fLBoxVisible) 02545 return; 02546 02547 // | If this is a dropped listbox for a combobox and the ENTER | 02548 // | key is pressed, close up the listbox, so FALLTHRU | 02549 // V V 02550 02551 case VK_F4: 02552 if (fDropDownComboBox && !pcbox->fExtendedUI) { 02553 02554 /* 02555 * If we are a dropdown combo box/listbox we want to process 02556 * this key. BUT for TandtT, we don't do anything on VK_F4 if we 02557 * are in extended ui mode. 02558 */ 02559 ThreadLock(pcbox->spwnd, &tlpwnd); 02560 if (!pcbox->fLBoxVisible) { 02561 02562 /* 02563 * If the listbox isn't visible, just show it 02564 */ 02565 xxxCBShowListBoxWindow(pcbox, (vKey != VK_ESCAPE)); 02566 } else { 02567 02568 /* 02569 * Ok, the listbox is visible. So hide the listbox window. 02570 */ 02571 xxxCBHideListBoxWindow(pcbox, TRUE, (vKey != VK_ESCAPE)); 02572 } 02573 ThreadUnlock(&tlpwnd); 02574 } 02575 02576 /* 02577 * Fall through to the return 02578 */ 02579 02580 default: 02581 return; 02582 } 02583 02584 /* 02585 * Find out what the new selection should be 02586 */ 02587 iNewISel = IncrementISel(plb, plb->iSelBase, i); 02588 02589 02590 if (plb->wMultiple == SINGLESEL) { 02591 if (plb->iSel == iNewISel) { 02592 02593 /* 02594 * If we are single selection and the keystroke is moving us to an 02595 * item which is already selected, we don't have to do anything... 02596 */ 02597 return; 02598 } 02599 02600 uEvent = EVENT_OBJECT_SELECTION; 02601 02602 plb->iTypeSearch = 0; 02603 if ((vKey == VK_UP || vKey == VK_DOWN) && 02604 !IsSelected(plb, plb->iSelBase, HILITEONLY)) { 02605 02606 /* 02607 * If the caret is on an unselected item and the user just hits the 02608 * up or down arrow key (ie. with no shift or ctrl modifications), 02609 * then we will just select the item the cursor is at. This is 02610 * needed for proper behavior in combo boxes but do we always want 02611 * to run this code??? Note that this is only used in single 02612 * selection list boxes since it doesn't make sense in the 02613 * multiselection case. Note that an LB_KEYDOWN message must not be 02614 * checked here because the vKey will be an item number not a 02615 * VK_and we will goof. Thus, trackkeydown label is below this to 02616 * fix a bug caused by it being above this... 02617 */ 02618 iNewISel = (plb->iSelBase == -1) ? 0 : plb->iSelBase; 02619 } 02620 } 02621 02622 TrackKeyDown: 02623 02624 xxxSetISelBase(plb, iNewISel); 02625 02626 xxxLBSetCaret(plb, FALSE); 02627 02628 if (wModifiers & SHIFTDOWN) { 02629 // Check if iMouseDown is un-initialised 02630 if (plb->iMouseDown == -1) 02631 plb->iMouseDown = iNewISel; 02632 if (plb->iLastMouseMove == -1) 02633 plb->iLastMouseMove = iNewISel; 02634 02635 // Check if we are in ADD mode 02636 if (plb->fAddSelMode) { 02637 /* Preserve all the pre-existing selections except the 02638 * ones connected with the last anchor point; If the last 02639 * Preserve all the previous selections 02640 */ 02641 /* Deselect only the selection connected with the last 02642 * anchor point; If the last anchor point is associated 02643 * with de-selection, then do not do it 02644 */ 02645 02646 if (!plb->fNewItemState) 02647 plb->iLastMouseMove = plb->iMouseDown; 02648 02649 /* We haven't done anything here because, LBBlockHilite() 02650 * will take care of wiping out the selection between 02651 * Anchor point and iLastMouseMove and select the block 02652 * between anchor point and current cursor location 02653 */ 02654 } else { 02655 /* We are not in ADD mode */ 02656 /* Remove all selections except between the anchor point 02657 * and last mouse move because it will be taken care of in 02658 * LBBlockHilite 02659 */ 02660 xxxResetWorld(plb, plb->iMouseDown, plb->iLastMouseMove, FALSE); 02661 } 02662 02663 uEvent = EVENT_OBJECT_SELECTIONWITHIN; 02664 02665 /* LBBlockHilite takes care to deselect the block between 02666 * the anchor point and iLastMouseMove and select the block 02667 * between the anchor point and the current cursor location 02668 */ 02669 /* Toggle all items to the same selection state as the item 02670 * item at the anchor point) from the anchor point to the 02671 * current cursor location. 02672 */ 02673 plb->fNewItemState = IsSelected(plb, plb->iMouseDown, SELONLY); 02674 xxxLBBlockHilite(plb, iNewISel, TRUE); 02675 02676 plb->iLastMouseMove = iNewISel; 02677 /* Preserve the existing anchor point */ 02678 } else { 02679 /* Check if this is in ADD mode */ 02680 if ((plb->fAddSelMode) || (plb->wMultiple == MULTIPLESEL)) { 02681 /* Preserve all pre-exisiting selections */ 02682 if (fSelectKey) { 02683 /* Toggle the selection state of the current item */ 02684 plb->fNewItemState = !IsSelected(plb, iNewISel, SELONLY); 02685 SetSelected(plb, iNewISel, plb->fNewItemState, HILITEANDSEL); 02686 02687 xxxInvertLBItem(plb, iNewISel, plb->fNewItemState); 02688 02689 /* Set the anchor point at the current location */ 02690 plb->iLastMouseMove = plb->iMouseDown = iNewISel; 02691 uEvent = (plb->fNewItemState ? EVENT_OBJECT_SELECTIONADD : 02692 EVENT_OBJECT_SELECTIONREMOVE); 02693 } 02694 } else { 02695 /* We are NOT in ADD mode */ 02696 /* Remove all existing selections except iNewISel, to 02697 * avoid flickering. 02698 */ 02699 xxxResetWorld(plb, iNewISel, iNewISel, FALSE); 02700 02701 /* Select the current item */ 02702 SetSelected(plb, iNewISel, TRUE, HILITEANDSEL); 02703 xxxInvertLBItem(plb, iNewISel, TRUE); 02704 02705 /* Set the anchor point at the current location */ 02706 plb->iLastMouseMove = plb->iMouseDown = iNewISel; 02707 uEvent = EVENT_OBJECT_SELECTION; 02708 } 02709 } 02710 02711 /* 02712 * Move the cursor to the new location 02713 */ 02714 xxxInsureVisible(plb, iNewISel, FALSE); 02715 xxxLBShowHideScrollBars(plb); 02716 02717 xxxLBSetCaret(plb, TRUE); 02718 02719 if (FWINABLE() && uEvent) { 02720 LBEvent(plb, uEvent, iNewISel); 02721 } 02722 02723 /* 02724 * Should we notify our parent? 02725 */ 02726 if (plb->fNotify) { 02727 if (fDropDownComboBox && pcbox->fLBoxVisible) { 02728 02729 /* 02730 * If we are in a drop down combo box/listbox and the listbox is 02731 * visible, we need to set the fKeyboardSelInListBox bit so that the 02732 * combo box code knows not to hide the listbox since the selchange 02733 * message is caused by the user keyboarding through... 02734 */ 02735 pcbox->fKeyboardSelInListBox = TRUE; 02736 plb->iLastSelection = iNewISel; 02737 } 02738 xxxNotifyOwner(plb, LBN_SELCHANGE); 02739 } 02740 }

VOID xxxLBoxCtlScroll PLBIV  ,
INT  ,
INT 
 

Referenced by ListBoxWndProcWorker(), xxxLBSize(), and xxxTrackMouse().

VOID xxxLBoxDeleteItem PLBIV  ,
INT 
 

Definition at line 1053 of file lboxctl1.c.

References CheckLock, tagLBIV::fHasData, HWq, LBGetItemData(), NULL, SendMessage(), tagWND::spmenu, tagLBIV::spwnd, tagLBIV::spwndParent, ThreadLock, and ThreadUnlock.

Referenced by xxxLBoxCtlDelete(), and xxxLBoxDoDeleteItems().

01056 { 01057 DELETEITEMSTRUCT dis; 01058 TL tlpwndParent; 01059 01060 CheckLock(plb->spwnd); 01061 if (plb->spwnd == NULL) 01062 return; 01063 01064 /* 01065 * Bug 262122 - joejo 01066 * No need to send message if no data! 01067 */ 01068 if (!plb->fHasData) { 01069 return; 01070 } 01071 01072 /* 01073 * Fill the DELETEITEMSTRUCT 01074 */ 01075 dis.CtlType = ODT_LISTBOX; 01076 dis.CtlID = PtrToUlong(plb->spwnd->spmenu); 01077 dis.itemID = sItem; 01078 dis.hwndItem = HWq(plb->spwnd); 01079 01080 /* 01081 * Bug 262122 - joejo 01082 * Fixed in 93 so that ItemData was passed. For some reason, not 01083 * merged in. 01084 */ 01085 dis.itemData = LBGetItemData(plb, sItem); 01086 01087 if (plb->spwndParent != NULL) { 01088 ThreadLock(plb->spwndParent, &tlpwndParent); 01089 SendMessage(HWq(plb->spwndParent), WM_DELETEITEM, dis.CtlID, 01090 (LPARAM)&dis); 01091 ThreadUnlock(&tlpwndParent); 01092 } 01093 }

VOID xxxLBoxDoDeleteItems PLBIV   ) 
 

Definition at line 350 of file lboxrare.c.

References CheckLock, tagLBIV::cMac, tagLBIV::fHasData, INT, tagLBIV::OwnerDraw, tagLBIV::spwnd, and xxxLBoxDeleteItem().

Referenced by xxxDestroyLBox(), and xxxLBResetContent().

00352 { 00353 INT sItem; 00354 00355 CheckLock(plb->spwnd); 00356 00357 /* 00358 * Send WM_DELETEITEM message for ownerdraw listboxes which are 00359 * being deleted. (NODATA listboxes don't send such, though.) 00360 */ 00361 if (plb->OwnerDraw && plb->cMac && plb->fHasData) { 00362 for (sItem = plb->cMac - 1; sItem >= 0; sItem--) { 00363 xxxLBoxDeleteItem(plb, sItem); 00364 } 00365 } 00366 }

VOID xxxLBoxDrawItem PLBIV  ,
INT  ,
UINT  ,
UINT  ,
LPRECT 
 

Definition at line 3558 of file lboxctl2.c.

References CheckLock, tagLBIV::cMac, CopyRect, tagLBIV::fHasData, tagLBIV::hdc, HW, HWq, L, LBGetItemData(), SendMessage(), tagWND::spmenu, tagLBIV::spwnd, tagLBIV::spwndParent, TestWF, ThreadLock, ThreadUnlock, UINT, WEFPUIACCELHIDDEN, WEFPUIFOCUSHIDDEN, WFDISABLED, and WFWIN31COMPAT.

Referenced by xxxInvertLBItem(), xxxLBPaint(), and xxxLBSetCaret().

03564 { 03565 DRAWITEMSTRUCT dis; 03566 TL tlpwndParent; 03567 03568 CheckLock(plb->spwnd); 03569 03570 /* 03571 * Fill the DRAWITEMSTRUCT with the unchanging constants 03572 */ 03573 03574 dis.CtlType = ODT_LISTBOX; 03575 dis.CtlID = PtrToUlong(plb->spwnd->spmenu); 03576 03577 /* 03578 * Use -1 if an invalid item number is being used. This is so that the app 03579 * can detect if it should draw the caret (which indicates the lb has the 03580 * focus) in an empty listbox 03581 */ 03582 dis.itemID = (UINT)(item < plb->cMac ? item : -1); 03583 dis.itemAction = itemAction; 03584 dis.hwndItem = HWq(plb->spwnd); 03585 dis.hDC = plb->hdc; 03586 dis.itemState = itemState | 03587 (UINT)(TestWF(plb->spwnd, WFDISABLED) ? ODS_DISABLED : 0); 03588 03589 if (TestWF(plb->spwnd, WEFPUIFOCUSHIDDEN)) { 03590 dis.itemState |= ODS_NOFOCUSRECT; 03591 } 03592 if (TestWF(plb->spwnd, WEFPUIACCELHIDDEN)) { 03593 dis.itemState |= ODS_NOACCEL; 03594 } 03595 03596 /* 03597 * Set the app supplied data 03598 */ 03599 if (!plb->cMac || !plb->fHasData) { 03600 03601 /* 03602 * If no strings or no items, just use 0 for data. This is so that we 03603 * can display a caret when there are no items in the listbox. 03604 * 03605 * Lazy-eval listboxes of course have no data to pass - only itemID. 03606 */ 03607 dis.itemData = 0L; 03608 } else { 03609 dis.itemData = LBGetItemData(plb, item); 03610 } 03611 03612 CopyRect(&dis.rcItem, lprect); 03613 03614 /* 03615 * Set the window origin to the horizontal scroll position. This is so that 03616 * text can always be drawn at 0,0 and the view region will only start at 03617 * the horizontal scroll offset. We pass this as wParam 03618 */ 03619 /* 03620 * Note: Only pass the itemID in wParam for 3.1 or newer apps. We break 03621 * ccMail otherwise. 03622 */ 03623 03624 ThreadLock(plb->spwndParent, &tlpwndParent); 03625 SendMessage(HW(plb->spwndParent), WM_DRAWITEM, 03626 TestWF(plb->spwndParent, WFWIN31COMPAT) ? dis.CtlID : 0, 03627 (LPARAM)&dis); 03628 ThreadUnlock(&tlpwndParent); 03629 }

VOID xxxLBPaint PLBIV  ,
HDC  ,
LPRECT 
 

Definition at line 798 of file lboxctl2.c.

References _GetClientRect(), BOOL, CheckLock, CItemInWindow(), tagLBIV::cMac, tagLBIV::cyChar, FALSE, tagLBIV::fCaretOn, tagLBIV::fHorzBar, FillRect(), tagLBIV::fMultiColumn, tagLBIV::fNoSel, tagLBIV::fRightAlign, tagLBIV::hdc, HILITEONLY, INT, IntersectRect(), IsSelected(), tagLBIV::iTop, LBGetItemRect(), LBInitDC(), LBTermDC(), min, NULL, tagLBIV::OwnerDraw, OWNERDRAWVAR, tagLBIV::spwnd, TRUE, UINT, tagLBIV::xOrigin, tagLBIV::xRightOrigin, xxxLBDrawLBItem(), xxxLBGetBrush(), xxxLBoxDrawItem(), and xxxLBSetCaret().

Referenced by ListBoxWndProcWorker().

00802 { 00803 INT i; 00804 RECT rect; 00805 RECT scratchRect; 00806 BOOL fHilite; 00807 INT iLastItem; 00808 HBRUSH hbrSave = NULL; 00809 HBRUSH hbrControl; 00810 BOOL fCaretOn; 00811 RECT rcBounds; 00812 HDC hdcSave; 00813 00814 CheckLock(plb->spwnd); 00815 00816 if (lprcBounds == NULL) { 00817 lprcBounds = &rcBounds; 00818 _GetClientRect(plb->spwnd, lprcBounds); 00819 } 00820 00821 hdcSave = plb->hdc; 00822 plb->hdc = hdc; 00823 00824 // Initialize dc. 00825 LBInitDC(plb); 00826 00827 // Turn caret off 00828 if (fCaretOn = plb->fCaretOn) 00829 xxxLBSetCaret(plb, FALSE); 00830 00831 hbrSave = NULL; 00832 hbrControl = xxxLBGetBrush(plb, &hbrSave); 00833 00834 // Get listbox's client 00835 _GetClientRect(plb->spwnd, &rect); 00836 00837 // Adjust width of client rect for scrolled amount 00838 // fix for #140, t-arthb 00839 if (plb->fRightAlign && !(plb->fMultiColumn || plb->OwnerDraw) && plb->fHorzBar) 00840 rect.right += plb->xOrigin + (plb->xRightOrigin - plb->xOrigin); 00841 else 00842 rect.right += plb->xOrigin; 00843 00844 // Get the index of the last item visible on the screen. This is also 00845 // valid for var height ownerdraw. 00846 iLastItem = plb->iTop + CItemInWindow(plb,TRUE); 00847 iLastItem = min(iLastItem, plb->cMac - 1); 00848 00849 // Fill in the background of the listbox if it's an empty listbox 00850 // or if we're doing a control print 00851 if (iLastItem == -1) 00852 FillRect(plb->hdc, &rect, hbrControl); 00853 00854 00855 // Allow AnimateWindow() catch the apps that do not use our DC when 00856 // drawing the list box 00857 SetBoundsRect(plb->hdc, NULL, DCB_RESET | DCB_ENABLE); 00858 00859 for (i = plb->iTop; i <= iLastItem; i++) { 00860 00861 /* 00862 * Note that rect contains the clientrect from when we did the 00863 * _GetClientRect so the width is correct. We just need to adjust 00864 * the top and bottom of the rectangle to the item of interest. 00865 */ 00866 rect.bottom = rect.top + plb->cyChar; 00867 00868 if ((UINT)i < (UINT)plb->cMac) { 00869 00870 /* 00871 * If var height, get the rectangle for the item. 00872 */ 00873 if (plb->OwnerDraw == OWNERDRAWVAR || plb->fMultiColumn) { 00874 LBGetItemRect(plb, i, &rect); 00875 } 00876 00877 if (IntersectRect(&scratchRect, lprcBounds, &rect)) { 00878 fHilite = !plb->fNoSel && IsSelected(plb, i, HILITEONLY); 00879 00880 if (plb->OwnerDraw) { 00881 00882 /* 00883 * Fill in the drawitem struct 00884 */ 00885 xxxLBoxDrawItem(plb, i, ODA_DRAWENTIRE, 00886 (UINT)(fHilite ? ODS_SELECTED : 0), &rect); 00887 } else { 00888 xxxLBDrawLBItem(plb, i, &rect, fHilite, hbrControl); 00889 } 00890 } 00891 } 00892 rect.top = rect.bottom; 00893 } 00894 00895 if (hbrSave != NULL) 00896 SelectObject(hdc, hbrSave); 00897 00898 if (fCaretOn) 00899 xxxLBSetCaret(plb, TRUE); 00900 00901 LBTermDC(plb); 00902 00903 plb->hdc = hdcSave; 00904 }

BOOL xxxLBResetContent PLBIV  plb  ) 
 

Definition at line 797 of file lboxctl1.c.

References BOOL, tagLBIV::cMac, tagLBIV::cMax, FALSE, tagLBIV::hStrings, HWq, tagLBIV::iLastSelection, InitHStrings(), tagLBIV::iSel, tagLBIV::iSelBase, IsVisible(), tagLBIV::iTop, NtUserInvalidateRect(), NULL, tagLBIV::rgpch, tagLBIV::spwnd, TestWF, TRUE, UserLocalFree, WFWIN31COMPAT, tagLBIV::xOrigin, xxxCheckRedraw(), xxxLBoxDoDeleteItems(), and xxxLBShowHideScrollBars().

Referenced by ListBoxWndProcWorker().

00799 { 00800 if (!plb->cMac) 00801 return TRUE; 00802 00803 xxxLBoxDoDeleteItems(plb); 00804 00805 if (plb->rgpch != NULL) { 00806 UserLocalFree(plb->rgpch); 00807 plb->rgpch = NULL; 00808 } 00809 00810 if (plb->hStrings != NULL) { 00811 UserLocalFree(plb->hStrings); 00812 plb->hStrings = NULL; 00813 } 00814 00815 InitHStrings(plb); 00816 00817 if (TestWF(plb->spwnd, WFWIN31COMPAT)) 00818 xxxCheckRedraw(plb, FALSE, 0); 00819 else if (IsVisible(plb->spwnd)) 00820 NtUserInvalidateRect(HWq(plb->spwnd), NULL, TRUE); 00821 00822 plb->iSelBase = 0; 00823 plb->iTop = 0; 00824 plb->cMac = 0; 00825 plb->cMax = 0; 00826 plb->xOrigin = 0; 00827 plb->iLastSelection = 0; 00828 plb->iSel = -1; 00829 00830 xxxLBShowHideScrollBars(plb); 00831 return TRUE; 00832 }

VOID xxxLBSelRange PLBIV  ,
INT  ,
INT  ,
BOOL 
 

Referenced by ListBoxWndProcWorker().

void xxxLBSetCaret PLBIV  plb,
BOOL  fSetCaret
 

Definition at line 430 of file lboxctl2.c.

References BOOL, DrawFocusRect(), tagLBIV::fCaret, tagLBIV::fCaretOn, tagLBIV::hdc, HILITEONLY, tagLBIV::iSelBase, IsLBoxVisible, IsSelected(), LBGetDC(), LBGetItemRect(), LBReleaseDC(), tagLBIV::OwnerDraw, tagLBIV::spwnd, SYSRGB, TestWF, UINT, WEFPUIFOCUSHIDDEN, WINDOW, and xxxLBoxDrawItem().

Referenced by ListBoxWndProcWorker(), xxxAlterHilite(), xxxCaretDestroy(), xxxInvertLBItem(), xxxLBoxCaretBlinker(), xxxLBoxCtlHScroll(), xxxLBoxCtlKeyInput(), xxxLBoxCtlScroll(), xxxLBPaint(), xxxLBSetCurSel(), xxxLBSetRedraw(), xxxLBSetSel(), xxxNewITopEx(), xxxResetWorld(), xxxSetISelBase(), and xxxTrackMouse().

00431 { 00432 RECT rc; 00433 BOOL fNewDC; 00434 00435 if (plb->fCaret && ((BOOL) plb->fCaretOn != !!fSetCaret)) { 00436 if (IsLBoxVisible(plb)) { 00437 /* Turn the caret (located at plb->iSelBase) on */ 00438 fNewDC = LBGetDC(plb); 00439 00440 LBGetItemRect(plb, plb->iSelBase, &rc); 00441 00442 if (fNewDC) { 00443 SetBkColor(plb->hdc, SYSRGB(WINDOW)); 00444 SetTextColor(plb->hdc, SYSRGB(WINDOWTEXT)); 00445 } 00446 00447 if (plb->OwnerDraw) { 00448 /* Fill in the drawitem struct */ 00449 UINT itemState = (fSetCaret) ? ODS_FOCUS : 0; 00450 00451 if (IsSelected(plb, plb->iSelBase, HILITEONLY)) 00452 itemState |= ODS_SELECTED; 00453 00454 xxxLBoxDrawItem(plb, plb->iSelBase, ODA_FOCUS, itemState, &rc); 00455 } else if (!TestWF(plb->spwnd, WEFPUIFOCUSHIDDEN)) { 00456 COLORREF crBk = SetBkColor(plb->hdc, SYSRGB(WINDOW)); 00457 COLORREF crText = SetTextColor(plb->hdc, SYSRGB(WINDOWTEXT)); 00458 00459 DrawFocusRect(plb->hdc, &rc); 00460 00461 SetBkColor(plb->hdc, crBk); 00462 SetTextColor(plb->hdc, crText); 00463 } 00464 00465 if (fNewDC) 00466 LBReleaseDC(plb); 00467 } 00468 plb->fCaretOn = !!fSetCaret; 00469 } 00470 }

INT xxxLBSetCount PLBIV  ,
INT 
 

Definition at line 1107 of file lboxctl1.c.

References BOOL, CheckLock, CITEMSALLOC, tagLBIV::cMac, tagLBIV::cMax, FALSE, tagLBIV::fHasData, tagLBIV::fHasStrings, tagLBIV::fRedraw, tagLBIV::iLastSelection, INT, tagLBIV::iSel, tagLBIV::iSelBase, tagLBIV::iTop, L, LBCalcAllocNeeded(), NULL, tagLBIV::rgpch, SendMessageWorker(), tagLBIV::spwnd, TRUE, UINT, UserLocalAlloc, UserLocalReAlloc, tagLBIV::xOrigin, xxxLBInvalidateRect(), xxxLBSetRedraw(), xxxLBShowHideScrollBars(), and xxxNotifyOwner().

Referenced by ListBoxWndProcWorker().

01110 { 01111 UINT cbRequired; 01112 BOOL fRedraw; 01113 01114 CheckLock(plb->spwnd); 01115 01116 /* 01117 * SetCount is only valid on lazy-eval ("nodata") listboxes. 01118 * All other lboxen must add their items one at a time, although 01119 * they may SetCount(0) via RESETCONTENT. 01120 */ 01121 if (plb->fHasStrings || plb->fHasData) { 01122 RIPERR0(ERROR_SETCOUNT_ON_BAD_LB, RIP_VERBOSE, ""); 01123 return LB_ERR; 01124 } 01125 01126 if (cItems == 0) { 01127 SendMessageWorker(plb->spwnd, LB_RESETCONTENT, 0, 0, FALSE); 01128 return 0; 01129 } 01130 01131 // If redraw isn't turned off, turn it off now 01132 if (fRedraw = plb->fRedraw) 01133 xxxLBSetRedraw(plb, FALSE); 01134 01135 cbRequired = LBCalcAllocNeeded(plb, cItems); 01136 01137 /* 01138 * Reset selection and position 01139 */ 01140 plb->iSelBase = 0; 01141 plb->iTop = 0; 01142 plb->cMax = 0; 01143 plb->xOrigin = 0; 01144 plb->iLastSelection = 0; 01145 plb->iSel = -1; 01146 01147 if (cbRequired != 0) { // Only if record instance data required 01148 01149 /* 01150 * If listbox was previously empty, prepare for the 01151 * realloc-based alloc strategy ahead. 01152 */ 01153 if (plb->rgpch == NULL) { 01154 plb->rgpch = UserLocalAlloc(HEAP_ZERO_MEMORY, 0L); 01155 plb->cMax = 0; 01156 01157 if (plb->rgpch == NULL) { 01158 xxxNotifyOwner(plb, LBN_ERRSPACE); 01159 return LB_ERRSPACE; 01160 } 01161 } 01162 01163 /* 01164 * rgpch might not have enough room for the new record instance 01165 * data, so check and realloc as necessary. 01166 */ 01167 if (cItems >= plb->cMax) { 01168 INT cMaxNew; 01169 UINT cbNew; 01170 HANDLE hmemNew; 01171 01172 /* 01173 * Since GrowMem presumes a one-item-at-a-time add schema, 01174 * SetCount can't use it. Too bad. 01175 */ 01176 cMaxNew = cItems+CITEMSALLOC; 01177 cbNew = LBCalcAllocNeeded(plb, cMaxNew); 01178 hmemNew = UserLocalReAlloc(plb->rgpch, cbNew, HEAP_ZERO_MEMORY); 01179 01180 if (hmemNew == NULL) { 01181 xxxNotifyOwner(plb, LBN_ERRSPACE); 01182 return LB_ERRSPACE; 01183 } 01184 01185 plb->rgpch = hmemNew; 01186 plb->cMax = cMaxNew; 01187 } 01188 01189 /* 01190 * Reset the item instance data (multisel annotations) 01191 */ 01192 RtlZeroMemory(plb->rgpch, cbRequired); 01193 } 01194 01195 plb->cMac = cItems; 01196 01197 // Turn redraw back on 01198 if (fRedraw) 01199 xxxLBSetRedraw(plb, TRUE); 01200 01201 xxxLBInvalidateRect(plb, NULL, TRUE); 01202 // Not In Chicago -- FritzS 01203 // NtUserSetScrollPos(plb->spwnd, SB_HORZ, 0, plb->fRedraw); 01204 // NtUserSetScrollPos(plb->spwnd, SB_VERT, 0, plb->fRedraw); 01205 xxxLBShowHideScrollBars(plb); // takes care of fRedraw 01206 01207 return 0; 01208 }

INT xxxLBSetCurSel PLBIV  ,
INT 
 

Referenced by ListBoxWndProcWorker().

VOID xxxLBSetFont PLBIV  ,
HANDLE  ,
BOOL 
 

Definition at line 438 of file lboxrare.c.

References CheckLock, tagLBIV::cxChar, tagLBIV::cyChar, FALSE, tagLBIV::fMultiColumn, tagLBIV::fNoIntegralHeight, gpsi, tagLBIV::hFont, HWq, LBCalcItemRowsAndColumns(), LBSetCItemFullMax(), NtUserGetDC(), NtUserReleaseDC, NULL, tagLBIV::OwnerDraw, tagLBIV::pcbox, tagWND::rcClient, tagLBIV::spwnd, TestWF, WFWIN40COMPAT, xxxCheckRedraw(), and xxxLBSize().

Referenced by ListBoxWndProcWorker().

00442 { 00443 HDC hdc; 00444 HANDLE hOldFont = NULL; 00445 int iHeight; 00446 00447 CheckLock(plb->spwnd); 00448 00449 plb->hFont = hFont; 00450 00451 hdc = NtUserGetDC(HWq(plb->spwnd)); 00452 00453 if (hFont) { 00454 hOldFont = SelectObject(hdc, hFont); 00455 if (!hOldFont) { 00456 plb->hFont = NULL; 00457 } 00458 } 00459 00460 plb->cxChar = GdiGetCharDimensions(hdc, NULL, &iHeight); 00461 if (plb->cxChar == 0) { 00462 RIPMSG0(RIP_WARNING, "xxxLBSetFont: GdiGetCharDimensions failed"); 00463 plb->cxChar = gpsi->cxSysFontChar; 00464 iHeight = gpsi->cySysFontChar; 00465 } 00466 00467 00468 if (!plb->OwnerDraw && (plb->cyChar != iHeight)) { 00469 00470 /* 00471 * We don't want to mess up the cyChar height for owner draw listboxes 00472 * so don't do this. 00473 */ 00474 plb->cyChar = iHeight; 00475 00476 /* 00477 * Only resize the listbox for 4.0 dudes, or combo dropdowns. 00478 * Macromedia Director 4.0 GP-faults otherwise. 00479 */ 00480 if (!plb->fNoIntegralHeight && 00481 (plb->pcbox || TestWF(plb->spwnd, WFWIN40COMPAT))) { 00482 xxxLBSize(plb, 00483 plb->spwnd->rcClient.right - plb->spwnd->rcClient.left, 00484 plb->spwnd->rcClient.bottom - plb->spwnd->rcClient.top); 00485 } 00486 } 00487 00488 if (hOldFont) { 00489 SelectObject(hdc, hOldFont); 00490 } 00491 00492 /* 00493 * IanJa: was ReleaseDC(hwnd, hdc); 00494 */ 00495 NtUserReleaseDC(HWq(plb->spwnd), hdc); 00496 00497 if (plb->fMultiColumn) { 00498 LBCalcItemRowsAndColumns(plb); 00499 } 00500 00501 LBSetCItemFullMax(plb); 00502 00503 if (fRedraw) 00504 xxxCheckRedraw(plb, FALSE, 0); 00505 }

VOID xxxLBSetRedraw PLBIV  plb,
BOOL  fRedraw
 

Definition at line 3172 of file lboxctl2.c.

References CheckLock, FALSE, tagLBIV::fDeferUpdate, tagLBIV::fRedraw, HWq, NULL, RedrawWindow, tagLBIV::spwnd, TRUE, UINT, xxxLBSetCaret(), and xxxLBShowHideScrollBars().

Referenced by ListBoxWndProcWorker(), and xxxLBSetCount().

03175 { 03176 CheckLock(plb->spwnd); 03177 03178 if (fRedraw) 03179 fRedraw = TRUE; 03180 03181 if (plb->fRedraw != (UINT)fRedraw) { 03182 plb->fRedraw = !!fRedraw; 03183 03184 if (fRedraw) { 03185 xxxLBSetCaret(plb, TRUE); 03186 xxxLBShowHideScrollBars(plb); 03187 03188 if (plb->fDeferUpdate) { 03189 plb->fDeferUpdate = FALSE; 03190 RedrawWindow(HWq(plb->spwnd), NULL, NULL, 03191 RDW_INVALIDATE | RDW_ERASE | 03192 RDW_FRAME | RDW_ALLCHILDREN); 03193 } 03194 } 03195 } 03196 }

LONG xxxLBSetSel PLBIV  ,
BOOL  ,
INT 
 

Definition at line 3455 of file lboxctl2.c.

References _IsWindowVisible(), CheckLock, tagLBIV::cMac, FALSE, tagLBIV::fCaret, tagLBIV::fCaretOn, FWINABLE, HILITEANDSEL, tagLBIV::iLastMouseMove, tagLBIV::iMouseDown, INT, tagLBIV::iSel, tagLBIV::iSelBase, IsSelected(), LBEvent(), LBGetItemRect(), SELONLY, SetSelected(), SINGLESEL, tagLBIV::spwnd, TRUE, UINT, tagLBIV::wMultiple, xxxInsureVisible(), xxxLBInvalidateRect(), and xxxLBSetCaret().

Referenced by ListBoxWndProcWorker().

03459 { 03460 INT sItem; 03461 RECT rc; 03462 UINT uEvent = 0; 03463 03464 CheckLock(plb->spwnd); 03465 03466 /* 03467 * Bug 17656. WinZip's accelerator key for 'DeSelect All' sends a LB_SETSEL 03468 * message with lparam = 0x0000ffff instead of 0xffffffff(-1). If iSel 03469 * is equal to 0x0000ffff and there are less than 0xffff elements in the 03470 * list we set iSel equal to 0xffffffff. 03471 */ 03472 if ((iSel == (UINT)0xffff) && (iSel >= plb->cMac)) { 03473 iSel = -1; 03474 RIPMSG0(RIP_WARNING, "Sign extending iSel=0xffff to 0xffffffff"); 03475 } 03476 03477 03478 if ((plb->wMultiple == SINGLESEL) || (iSel != -1 && iSel >= plb->cMac)) { 03479 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, 03480 "xxxLBSetSel:Invalid iSel or SINGLESEL listbox"); 03481 return LB_ERR; 03482 } 03483 03484 xxxLBSetCaret(plb, FALSE); 03485 03486 if (iSel == -1/*(INT)0xffff*/) { 03487 03488 /* 03489 * Set/clear selection from all items if -1 03490 */ 03491 for (sItem = 0; sItem < plb->cMac; sItem++) { 03492 if (IsSelected(plb, sItem, SELONLY) != fSelect) { 03493 SetSelected(plb, sItem, fSelect, HILITEANDSEL); 03494 if (LBGetItemRect(plb, sItem, &rc)) { 03495 xxxLBInvalidateRect(plb, &rc, FALSE); 03496 } 03497 } 03498 } 03499 xxxLBSetCaret(plb, TRUE); 03500 uEvent = EVENT_OBJECT_SELECTIONWITHIN; 03501 } else { 03502 if (fSelect) { 03503 03504 /* 03505 * Check if the item if fully hidden and scroll it into view if it 03506 * is. Note that we don't want to scroll partially visible items 03507 * into full view because this breaks the shell... 03508 */ 03509 xxxInsureVisible(plb, iSel, TRUE); 03510 plb->iSelBase = plb->iSel = iSel; 03511 03512 plb->iMouseDown = plb->iLastMouseMove = iSel; 03513 uEvent = EVENT_OBJECT_FOCUS; 03514 } else { 03515 uEvent = EVENT_OBJECT_SELECTIONREMOVE; 03516 } 03517 SetSelected(plb, iSel, fSelect, HILITEANDSEL); 03518 03519 /* 03520 * Note that we set the caret on bit directly so that we avoid flicker 03521 * when drawing this item. ie. We turn on the caret, redraw the item and 03522 * turn it back on again. 03523 */ 03524 if (!fSelect && plb->iSelBase != iSel) { 03525 xxxLBSetCaret(plb, TRUE); 03526 } else if (plb->fCaret) { 03527 plb->fCaretOn = TRUE; 03528 } 03529 03530 if (LBGetItemRect(plb, iSel, &rc)) { 03531 xxxLBInvalidateRect(plb, &rc, FALSE); 03532 } 03533 } 03534 03535 if (FWINABLE() && _IsWindowVisible(plb->spwnd)) { 03536 if (uEvent == EVENT_OBJECT_FOCUS) { 03537 LBEvent(plb, uEvent, plb->iSelBase); 03538 uEvent = EVENT_OBJECT_SELECTION; 03539 } 03540 LBEvent(plb, uEvent, iSel); 03541 } 03542 03543 return 0; 03544 }

VOID xxxLBShowHideScrollBars PLBIV   ) 
 

Definition at line 125 of file lboxctl1.c.

References BOOL, FALSE, tagLBIV::fFromInsert, tagLBIV::fHorzBar, tagLBIV::fMultiColumn, tagLBIV::fRedraw, tagLBIV::fVertBar, tagLBIV::iTop, TRUE, tagLBIV::xOrigin, xxxLBoxCtlHScroll(), xxxNewITop(), and xxxSetLBScrollParms().

Referenced by ListBoxWndProcWorker(), xxxLbDir(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxLBoxCtlHScroll(), xxxLBoxCtlHScrollMultiColumn(), xxxLBoxCtlKeyInput(), xxxLBoxCtlScroll(), xxxLBResetContent(), xxxLBSetCount(), xxxLBSetRedraw(), and xxxLBSize().

00127 { 00128 BOOL fVertDone = FALSE; 00129 BOOL fHorzDone = FALSE; 00130 00131 // Don't do anything if there are no scrollbars or if parents 00132 // are invisible. 00133 if ((!plb->fHorzBar && !plb->fVertBar) || !plb->fRedraw) 00134 return; 00135 00136 // 00137 // Adjust iTop if necessary but DO NOT REDRAW PERIOD. We never did 00138 // in 3.1. There's a potential bug: 00139 // If someone doesn't have redraw off and inserts an item in the 00140 // same position as the caret, we'll tell them to draw before they may 00141 // have called LB_SETITEMDATA for their item. This is because we turn 00142 // the caret off & on inside of NewITop(), even if the item isn't 00143 // changing. 00144 // So we just want to reflect the position/scroll changes. 00145 // CheckRedraw() will _really_ redraw the visual changes later if 00146 // redraw isn't off. 00147 // 00148 00149 if (!plb->fFromInsert) { 00150 xxxNewITop(plb, plb->iTop); 00151 fVertDone = TRUE; 00152 } 00153 00154 if (!plb->fMultiColumn) { 00155 if (!plb->fFromInsert) { 00156 fHorzDone = TRUE; 00157 xxxLBoxCtlHScroll(plb, SB_THUMBPOSITION, plb->xOrigin); 00158 } 00159 00160 if (!fVertDone) 00161 xxxSetLBScrollParms(plb, SB_VERT); 00162 } 00163 if (!fHorzDone) 00164 xxxSetLBScrollParms(plb, SB_HORZ); 00165 }

VOID xxxLBSize PLBIV  ,
INT  ,
INT 
 

Definition at line 514 of file lboxrare.c.

References _GetClientRect(), BOOL, CheckLock, tagLBIV::cMac, CopyInflateRect(), cy, tagLBIV::cyChar, FALSE, tagLBIV::fDeferUpdate, tagLBIV::fMultiColumn, tagLBIV::fNoIntegralHeight, tagLBIV::fRedraw, tagLBIV::fSized, GetWindowBorders(), HWq, tagLBIV::iSelBase, IsLBoxVisible, tagLBIV::iTop, LBCalcItemRowsAndColumns(), LBGetItemRect(), LBSetCItemFullMax(), max, tagLBIV::maxWidth, NtUserInvalidateRect(), NtUserSetWindowPos(), NULL, tagWND::rcWindow, tagLBIV::spwnd, SYSMET, TestWF, TRUE, WFVSCROLL, WFWIN40COMPAT, tagLBIV::xOrigin, xxxLBoxCtlHScroll(), xxxLBoxCtlScroll(), xxxLBShowHideScrollBars(), and xxxNewITop().

Referenced by ListBoxWndProcWorker(), and xxxLBSetFont().

00518 { 00519 RECT rc; 00520 int iTopOld; 00521 BOOL fSizedSave; 00522 00523 CheckLock(plb->spwnd); 00524 00525 if (!plb->fNoIntegralHeight) { 00526 int cBdrs = GetWindowBorders(plb->spwnd->style, plb->spwnd->ExStyle, TRUE, TRUE); 00527 00528 CopyInflateRect(&rc, &plb->spwnd->rcWindow, 0, -cBdrs * SYSMET(CYBORDER)); 00529 00530 // Size the listbox to fit an integral # of items in its client 00531 if ((rc.bottom - rc.top) % plb->cyChar) { 00532 int iItems = (rc.bottom - rc.top); 00533 00534 // B#2285 - If its a 3.1 app its SetWindowPos needs 00535 // to be window based dimensions not Client ! 00536 // this crunches Money into using a scroll bar 00537 00538 if ( ! TestWF( plb->spwnd, WFWIN40COMPAT ) ) 00539 iItems += (cBdrs * SYSMET(CYEDGE)); // so add it back in 00540 00541 iItems /= plb->cyChar; 00542 00543 NtUserSetWindowPos(HWq(plb->spwnd), HWND_TOP, 0, 0, rc.right - rc.left, 00544 iItems * plb->cyChar + (SYSMET(CYEDGE) * cBdrs), 00545 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); 00546 00547 /* 00548 * Changing the size causes us to recurse. Upon return 00549 * the state is where it should be and nothing further 00550 * needs to be done. 00551 */ 00552 return; 00553 } 00554 } 00555 00556 if (plb->fMultiColumn) { 00557 00558 /* 00559 * Compute the number of DISPLAYABLE rows and columns in the listbox 00560 */ 00561 LBCalcItemRowsAndColumns(plb); 00562 } else { 00563 00564 /* 00565 * Adjust the current horizontal position to eliminate as much 00566 * empty space as possible from the right side of the items. 00567 */ 00568 _GetClientRect(plb->spwnd, &rc); 00569 if ((plb->maxWidth - plb->xOrigin) < (rc.right - rc.left)) 00570 plb->xOrigin = max(0, plb->maxWidth - (rc.right - rc.left)); 00571 } 00572 00573 LBSetCItemFullMax(plb); 00574 00575 /* 00576 * Adjust the top item in the listbox to eliminate as much empty space 00577 * after the last item as possible 00578 * (fix for bugs #8490 & #3836) 00579 */ 00580 iTopOld = plb->iTop; 00581 fSizedSave = plb->fSized; 00582 plb->fSized = FALSE; 00583 xxxNewITop(plb, plb->iTop); 00584 00585 /* 00586 * If changing the top item index caused a resize, there is no 00587 * more work to be done here. 00588 */ 00589 if (plb->fSized) 00590 return; 00591 plb->fSized = fSizedSave; 00592 00593 if (IsLBoxVisible(plb)) { 00594 /* 00595 * This code no longer blows because it's fixed right!!! We could 00596 * optimize the fMultiColumn case with some more code to figure out 00597 * if we really need to invalidate the whole thing but note that some 00598 * 3.0 apps depend on this extra invalidation (AMIPRO 2.0, bug 14620) 00599 * 00600 * For 3.1 apps, we blow off the invalidaterect in the case where 00601 * cx and cy are 0 because this happens during the processing of 00602 * the posted WM_SIZE message when we are created which would otherwise 00603 * cause us to flash. 00604 */ 00605 if ((plb->fMultiColumn && !(cx == 0 && cy == 0)) || 00606 plb->iTop != iTopOld) 00607 NtUserInvalidateRect(HWq(plb->spwnd), NULL, TRUE); 00608 else if (plb->iSelBase >= 0) { 00609 00610 /* 00611 * Invalidate the item with the caret so that if the listbox 00612 * grows horizontally, we redraw it properly. 00613 */ 00614 LBGetItemRect(plb, plb->iSelBase, &rc); 00615 NtUserInvalidateRect(HWq(plb->spwnd), &rc, FALSE); 00616 } 00617 } else if (!plb->fRedraw) 00618 plb->fDeferUpdate = TRUE; 00619 00620 /* 00621 * Send "fake" scroll bar messages to update the scroll positions since we 00622 * changed size. 00623 */ 00624 if (TestWF(plb->spwnd, WFVSCROLL)) { 00625 xxxLBoxCtlScroll(plb, SB_ENDSCROLL, 0); 00626 } 00627 00628 /* 00629 * We count on this to call LBShowHideScrollBars except when plb->cMac == 0! 00630 */ 00631 xxxLBoxCtlHScroll(plb, SB_ENDSCROLL, 0); 00632 00633 /* 00634 * Show/hide scroll bars depending on how much stuff is visible... 00635 * 00636 * Note: Now we only call this guy when cMac == 0, because it is 00637 * called inside the LBoxCtlHScroll with SB_ENDSCROLL otherwise. 00638 */ 00639 if (plb->cMac == 0) 00640 xxxLBShowHideScrollBars(plb); 00641 }

VOID xxxNewITop PLBIV  ,
INT 
 

Definition at line 2000 of file lboxctl2.c.

References xxxNewITopEx().

Referenced by LBCalcItemRowsAndColumns(), ListBoxWndProcWorker(), xxxInsureVisible(), xxxLBoxCtlHScrollMultiColumn(), xxxLBShowHideScrollBars(), and xxxLBSize().

02001 { 02002 xxxNewITopEx(plb, iTopNew, 0); 02003 }

VOID xxxNewITopEx PLBIV  ,
INT  ,
DWORD 
 

Definition at line 2012 of file lboxctl2.c.

References _GetClientRect(), abs, BOOL, CheckLock, tagLBIV::cItemFullMax, tagLBIV::cxColumn, tagLBIV::cyChar, dwFlags, DWORD, FALSE, tagLBIV::fCaretOn, tagLBIV::fMultiColumn, tagLBIV::fRightAlign, HWq, IsLBoxVisible, tagLBIV::itemsPerColumn, tagLBIV::iTop, LBCalcVarITopScrollAmt(), LBGetScrollFlags(), NULL, tagLBIV::numberOfColumns, tagLBIV::OwnerDraw, OWNERDRAWVAR, ScrollWindowEx(), tagLBIV::spwnd, TRUE, UpdateWindow(), xxxLBSetCaret(), and xxxSetLBScrollParms().

Referenced by xxxLBoxCtlScroll(), and xxxNewITop().

02016 { 02017 int iTopOld; 02018 BOOL fCaretOn; 02019 BOOL fMulti = plb->fMultiColumn; 02020 02021 CheckLock(plb->spwnd); 02022 02023 // Always try to turn off caret whether or not redraw is on 02024 if (fCaretOn = plb->fCaretOn) 02025 xxxLBSetCaret(plb, FALSE); 02026 02027 iTopOld = (fMulti) ? (plb->iTop / plb->itemsPerColumn) : plb->iTop; 02028 plb->iTop = iTopNew; 02029 iTopNew = xxxSetLBScrollParms(plb, (fMulti) ? SB_HORZ : SB_VERT); 02030 plb->iTop = (fMulti) ? (iTopNew * plb->itemsPerColumn) : iTopNew; 02031 02032 if (!IsLBoxVisible(plb)) { 02033 return; 02034 } 02035 02036 if (iTopNew != iTopOld) { 02037 int xAmt, yAmt; 02038 RECT rc; 02039 DWORD dwFlags; 02040 02041 _GetClientRect(plb->spwnd, &rc); 02042 02043 if (fMulti) { 02044 yAmt = 0; 02045 if (abs(iTopNew - iTopOld) > plb->numberOfColumns) 02046 // Handle scrolling a large number of columns properly so that 02047 // we don't overflow the size of a rect. 02048 xAmt = 32000; 02049 else { 02050 xAmt = (iTopOld - iTopNew) * plb->cxColumn; 02051 if (plb->fRightAlign) 02052 xAmt = -xAmt; 02053 } 02054 } else { 02055 xAmt = 0; 02056 if (plb->OwnerDraw == OWNERDRAWVAR) { 02057 // 02058 // Have to fake iTopOld for OWNERDRAWVAR listboxes so that 02059 // the scrolling amount calculations work properly. 02060 // 02061 plb->iTop = iTopOld; 02062 yAmt = LBCalcVarITopScrollAmt(plb, iTopOld, iTopNew); 02063 plb->iTop = iTopNew; 02064 } else if (abs(iTopNew - iTopOld) > plb->cItemFullMax) 02065 yAmt = 32000; 02066 else 02067 yAmt = (iTopOld - iTopNew) * plb->cyChar; 02068 } 02069 02070 dwFlags = LBGetScrollFlags(plb, dwTime); 02071 ScrollWindowEx(HWq(plb->spwnd), xAmt, yAmt, NULL, &rc, NULL, 02072 NULL, dwFlags); 02073 UpdateWindow(HWq(plb->spwnd)); 02074 } 02075 02076 // Note that although we turn off the caret regardless of redraw, we 02077 // only turn it on if redraw is true. Slimy thing to fixup many 02078 // caret related bugs... 02079 if (fCaretOn) 02080 // Turn the caret back on only if we turned it off. This avoids 02081 // annoying caret flicker. 02082 xxxLBSetCaret(plb, TRUE); 02083 }

VOID xxxNotifyOwner PLBIV  ,
INT 
 

Definition at line 1244 of file lboxctl2.c.

References CheckLock, HW, HWq, PTR_TO_ID, SendMessage(), tagWND::spmenu, tagLBIV::spwnd, tagLBIV::spwndParent, ThreadLock, and ThreadUnlock.

Referenced by ListBoxWndProcWorker(), xxxLBButtonUp(), xxxLbDir(), xxxLBInitStorage(), xxxLbInsertFile(), xxxLBInsertItem(), xxxLBoxCtlKeyInput(), and xxxLBSetCount().

01247 { 01248 TL tlpwndParent; 01249 01250 CheckLock(plb->spwnd); 01251 01252 ThreadLock(plb->spwndParent, &tlpwndParent); 01253 SendMessage(HW(plb->spwndParent), WM_COMMAND, 01254 MAKELONG(PTR_TO_ID(plb->spwnd->spmenu), sEvt), (LPARAM)HWq(plb->spwnd)); 01255 ThreadUnlock(&tlpwndParent); 01256 }

VOID xxxRemoveDefaultButton PWND  pwndDlg,
PWND  pwndStart
 

Definition at line 31 of file dlgmgr2.c.

References _GetChildControl(), _NextControl(), CheckLock, HWq, L, NULL, SendMessage(), TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, and WEFCONTROLPARENT.

Referenced by xxxCheckDefPushButton(), and xxxSaveDlgFocus().

00034 { 00035 UINT code; 00036 PWND pwnd; 00037 PWND pwndDup; 00038 TL tlpwnd; 00039 00040 CheckLock(pwndRoot); 00041 CheckLock(pwndStart); 00042 00043 if (!pwndStart || TestWF(pwndStart, WEFCONTROLPARENT)) 00044 pwndStart = _NextControl(pwndRoot, NULL, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED); 00045 else 00046 pwndStart = _GetChildControl(pwndRoot, pwndStart); 00047 00048 if (!pwndStart) 00049 return; 00050 00051 pwnd = pwndStart; 00052 do { 00053 pwndDup = pwnd; 00054 00055 ThreadLock(pwnd, &tlpwnd); 00056 00057 code = (UINT)SendMessage(HWq(pwnd), WM_GETDLGCODE, 0, 0L); 00058 00059 if (code & DLGC_DEFPUSHBUTTON) { 00060 SendMessage(HWq(pwnd), BM_SETSTYLE, BS_PUSHBUTTON, (LONG)TRUE); 00061 } 00062 00063 pwnd = _NextControl(pwndRoot, pwnd, 0); 00064 00065 ThreadUnlock(&tlpwnd); 00066 00067 } while (pwnd && (pwnd != pwndStart) && (pwnd != pwndDup)); 00068 00069 #if DBG 00070 if (pwnd && (pwnd != pwndStart) && (pwnd != pwndDup)) { 00071 RIPMSG0(RIP_WARNING, "xxxRemoveDefaultButton bailing potential infinite loop!"); 00072 } 00073 #endif 00074 00075 }

VOID xxxResetWorld PLBIV  ,
INT  ,
INT  ,
BOOL 
 

Definition at line 1181 of file lboxctl2.c.

References BOOL, CheckLock, CItemInWindow(), tagLBIV::cMac, FALSE, tagLBIV::fCaretOn, HILITEANDSEL, HILITEONLY, INT, tagLBIV::iSel, IsSelected(), tagLBIV::iTop, SetSelected(), SINGLESEL, tagLBIV::spwnd, TRUE, tagLBIV::wMultiple, xxxInvertLBItem(), and xxxLBSetCaret().

Referenced by xxxLBoxCtlKeyInput(), and xxxTrackMouse().

01186 { 01187 INT i; 01188 INT iLastInWindow; 01189 BOOL fCaretOn; 01190 01191 CheckLock(plb->spwnd); 01192 01193 /* 01194 * If iStart and iEnd are not in correct order we swap them 01195 */ 01196 01197 if (iStart > iEnd) { 01198 i = iStart; 01199 iStart = iEnd; 01200 iEnd = i; 01201 } 01202 01203 if (plb->wMultiple == SINGLESEL) { 01204 if (plb->iSel != -1 && ((plb->iSel < iStart) || (plb->iSel > iEnd))) { 01205 xxxInvertLBItem(plb, plb->iSel, fSelect); 01206 plb->iSel = -1; 01207 } 01208 return; 01209 } 01210 01211 iLastInWindow = plb->iTop + CItemInWindow(plb, TRUE); 01212 01213 if (fCaretOn = plb->fCaretOn) 01214 xxxLBSetCaret(plb, FALSE); 01215 01216 for (i = 0; i < plb->cMac; i++) { 01217 if (i == iStart) 01218 // skip range to be preserved 01219 i = iEnd; 01220 else { 01221 if ((plb->iTop <= i) && (i <= iLastInWindow) && 01222 (fSelect != IsSelected(plb, i, HILITEONLY))) 01223 // Only invert the item if it is visible and present Selection 01224 // state is different from what is required. 01225 xxxInvertLBItem(plb, i, fSelect); 01226 01227 // Set all items outside of preserved range to unselected 01228 SetSelected(plb, i, fSelect, HILITEANDSEL); 01229 } 01230 } 01231 01232 if (fCaretOn) 01233 xxxLBSetCaret(plb, TRUE); 01234 01235 }

VOID xxxSetISelBase PLBIV  ,
INT 
 

Definition at line 1265 of file lboxctl2.c.

References _IsWindowVisible(), CheckLock, FALSE, FWINABLE, tagLBIV::iSelBase, LBEvent(), tagLBIV::spwnd, TRUE, xxxInsureVisible(), and xxxLBSetCaret().

Referenced by ListBoxWndProcWorker(), xxxLBoxCtlKeyInput(), and xxxTrackMouse().

01268 { 01269 CheckLock(plb->spwnd); 01270 01271 xxxLBSetCaret(plb, FALSE); 01272 plb->iSelBase = sItem; 01273 xxxLBSetCaret(plb, TRUE); 01274 01275 if (FWINABLE()) { 01276 xxxInsureVisible(plb, plb->iSelBase, FALSE); 01277 if (_IsWindowVisible(plb->spwnd)) { 01278 LBEvent(plb, EVENT_OBJECT_FOCUS, sItem); 01279 } 01280 } 01281 }

int xxxSetLBScrollParms PLBIV  plb,
int  nCtl
 

Definition at line 26 of file lboxctl1.c.

References BOOL, tagLBIV::cItemFullMax, _SCROLLPOS::cItems, tagLBIV::cMac, FALSE, tagLBIV::fDisableNoScroll, tagLBIV::fHorzBar, tagLBIV::fHorzInitialized, _SCROLLPOS::fMask, tagLBIV::fMultiColumn, tagLBIV::fRedraw, tagLBIV::fRightAlign, tagLBIV::fVertBar, tagLBIV::fVertInitialized, tagLBIV::HPos, HWq, _SCROLLPOS::iPage, _SCROLLPOS::iPos, _SCROLLPOS::iReturn, tagLBIV::itemsPerColumn, tagLBIV::iTop, max, tagLBIV::maxWidth, min, NtUserSetScrollInfo(), tagLBIV::numberOfColumns, PSCROLLPOS, tagWND::rcClient, tagLBIV::spwnd, TRUE, UINT, tagLBIV::VPos, and tagLBIV::xOrigin.

Referenced by xxxLBoxCtlHScroll(), xxxLBShowHideScrollBars(), and xxxNewITopEx().

00027 { 00028 int iPos; 00029 int cItems; 00030 UINT iPage; 00031 SCROLLINFO si; 00032 BOOL fNoScroll = FALSE; 00033 PSCROLLPOS psp; 00034 BOOL fCacheInitialized; 00035 int iReturn; 00036 00037 if (nCtl == SB_VERT) { 00038 iPos = plb->iTop; 00039 cItems = plb->cMac; 00040 iPage = plb->cItemFullMax; 00041 if (!plb->fVertBar) 00042 fNoScroll = TRUE; 00043 psp = &plb->VPos; 00044 fCacheInitialized = plb->fVertInitialized; 00045 } else { 00046 if (plb->fMultiColumn) { 00047 iPos = plb->iTop / plb->itemsPerColumn; 00048 cItems = plb->cMac ? ((plb->cMac - 1) / plb->itemsPerColumn) + 1 : 0; 00049 iPage = plb->numberOfColumns; 00050 if (plb->fRightAlign && cItems) 00051 iPos = cItems - iPos - 1; 00052 } else { 00053 iPos = plb->xOrigin; 00054 cItems = plb->maxWidth; 00055 iPage = plb->spwnd->rcClient.right - plb->spwnd->rcClient.left; 00056 } 00057 00058 if (!plb->fHorzBar) 00059 fNoScroll = TRUE; 00060 psp = &plb->HPos; 00061 fCacheInitialized = plb->fHorzInitialized; 00062 } 00063 00064 if (cItems) 00065 cItems--; 00066 00067 if (fNoScroll) { 00068 // Limit page to 0, posMax + 1 00069 iPage = max(min((int)iPage, cItems + 1), 0); 00070 00071 // Limit pos to 0, posMax - (page - 1). 00072 return(max(min(iPos, cItems - ((iPage) ? (int)(iPage - 1) : 0)), 0)); 00073 } else { 00074 si.fMask = SIF_ALL; 00075 if (plb->fDisableNoScroll) 00076 si.fMask |= SIF_DISABLENOSCROLL; 00077 00078 /* 00079 * If the scrollbar is already where we want it, do nothing. 00080 */ 00081 if (fCacheInitialized) { 00082 if (psp->fMask == si.fMask && 00083 psp->cItems == cItems && psp->iPage == iPage && 00084 psp->iPos == iPos) 00085 return psp->iReturn; 00086 } else if (nCtl == SB_VERT) { 00087 plb->fVertInitialized = TRUE; 00088 } else { 00089 plb->fHorzInitialized = TRUE; 00090 } 00091 00092 si.cbSize = sizeof(SCROLLINFO); 00093 si.nMin = 0; 00094 si.nMax = cItems; 00095 si.nPage = iPage; 00096 00097 if (plb->fMultiColumn && plb->fRightAlign) 00098 si.nPos = (iPos+1) > (int)iPage ? iPos - iPage + 1 : 0; 00099 else 00100 si.nPos = iPos; 00101 00102 iReturn = NtUserSetScrollInfo(HWq(plb->spwnd), nCtl, &si, plb->fRedraw); 00103 if (plb->fMultiColumn && plb->fRightAlign) 00104 iReturn = cItems - (iReturn + iPage - 1); 00105 00106 /* 00107 * Update the position cache 00108 */ 00109 psp->fMask = si.fMask; 00110 psp->cItems = cItems; 00111 psp->iPage = iPage; 00112 psp->iPos = iPos; 00113 psp->iReturn = iReturn; 00114 00115 return iReturn; 00116 } 00117 }

VOID xxxTrackMouse PLBIV  ,
UINT  ,
POINT 
 

Definition at line 1290 of file lboxctl2.c.

References _ClientToScreen(), _GetClientRect(), BOOL, CheckLock, tagLBIV::cMac, CTLDOWN, DWORD, EXTENDEDSEL, tagLBIV::fAddSelMode, FALSE, tagLBIV::fCaptured, tagLBIV::fCaret, tagLBIV::fDoubleClick, FindNCHit(), tagLBIV::fMouseDown, tagLBIV::fMultiColumn, tagLBIV::fNewItemState, tagLBIV::fRightAlign, FWINABLE, GetKeyState(), gpsi, HILITE, HILITEANDSEL, HILITEONLY, HW, HWq, IDSYS_CARET, IDSYS_SCROLL, tagLBIV::iLastMouseMove, tagLBIV::iLastSelection, tagLBIV::iMouseDown, INT, tagLBIV::iSel, tagLBIV::iSelBase, ISelFromPt(), IsSelected(), LBEvent(), LBUP_NOTIFY, LBUP_RELEASECAPTURE, LBUP_RESETSELECTION, LBUP_SUCCESS, max, MULTIPLESEL, NOMODIFIER, NtUserCallNoParam(), NtUserDragDetect(), NtUserKillTimer(), NtUserReleaseCapture, NtUserSetCapture(), NtUserSetFocus(), NtUserSetTimer(), NULL, tagLBIV::pcbox, PtInRect(), tagLBIV::ptPrev, tagWND::rcClient, tagWND::rcWindow, SendMessage(), SendMessageWorker(), SetSelected(), SHCTLDOWN, SHIFTDOWN, SINGLESEL, tagLBIV::spwnd, tagCBox::spwndEdit, tagLBIV::spwndParent, TestWF, ThreadLock, ThreadUnlock, TRUE, UINT, WEFDRAGOBJECT, tagLBIV::wMultiple, tagLBIV::xOrigin, xxxAlterHilite(), xxxCBHideListBoxWindow(), xxxInvertLBItem(), xxxLBBlockHilite(), xxxLBButtonUp(), xxxLBoxCtlHScrollMultiColumn(), xxxLBoxCtlScroll(), xxxLBSetCaret(), xxxResetWorld(), and xxxSetISelBase().

Referenced by ListBoxWndProcWorker().

01294 { 01295 INT iSelFromPt; 01296 INT iSelTemp; 01297 BOOL mousetemp; 01298 BOOL fMouseInRect; 01299 RECT rcClient; 01300 UINT wModifiers = 0; 01301 BOOL fSelected; 01302 UINT uEvent = 0; 01303 INT trackPtRetn; 01304 HWND hwnd = HWq(plb->spwnd); 01305 TL tlpwndEdit; 01306 TL tlpwndParent; 01307 01308 CheckLock(plb->spwnd); 01309 01310 /* 01311 * Optimization: do nothing if mouse not captured 01312 */ 01313 if ((wMsg != WM_LBUTTONDOWN) && (wMsg != WM_LBUTTONDBLCLK)) { 01314 if (!plb->fCaptured) { 01315 return; 01316 } 01317 /* 01318 * If we are processing a WM_MOUSEMOVE but the mouse has not moved from 01319 * the previous point, then we may be dealing with a mouse "jiggle" sent 01320 * from the kernel (see zzzInvalidateDCCache). If we process this, we will 01321 * snap the listbox selection back to where the mouse cursor is pointing, 01322 * even if the user has not touched the mouse. FritzS: NT5 bug 220722. 01323 * Some apps (like MSMoney98) rely on this, so added the bLastRITWasKeyboard 01324 * check. MCostea #244450 01325 */ 01326 if ((wMsg == WM_MOUSEMOVE) && RtlEqualMemory(&pt, &(plb->ptPrev), sizeof(POINT)) 01327 && gpsi->bLastRITWasKeyboard) { 01328 RIPMSG0(RIP_WARNING, "xxxTrackMouse ignoring WM_MOUSEMOVE with no mouse movement"); 01329 return; 01330 } 01331 } 01332 01333 mousetemp = ISelFromPt(plb, pt, &iSelFromPt); 01334 01335 /* 01336 * If we allow the user to cancel his selection then fMouseInRect is true if 01337 * the mouse is in the listbox client area otherwise it is false. If we 01338 * don't allow the user to cancel his selection, then fMouseInRect will 01339 * always be true. This allows us to implement cancelable selection 01340 * listboxes ie. The selection reverts to the origional one if the user 01341 * releases the mouse outside of the listbox. 01342 */ 01343 fMouseInRect = !mousetemp || !plb->pcbox; 01344 01345 _GetClientRect(plb->spwnd, &rcClient); 01346 01347 switch (wMsg) { 01348 case WM_LBUTTONDBLCLK: 01349 case WM_LBUTTONDOWN: 01350 /* 01351 * We want to divert mouse clicks. If the user clicks outside 01352 * of a dropped down listbox, we want to popup it up, using 01353 * the current selection. 01354 */ 01355 if (plb->fCaptured) { 01356 /* 01357 * If plb->pcbox is NULL, this is a listbox that 01358 * received a WM_LBUTTONDOWN again w/o receiving 01359 * a WM_LBUTTONUP for the previous WM_LBUTTONDOWN 01360 * bug 01361 */ 01362 if (plb->pcbox && mousetemp) { 01363 _ClientToScreen(plb->spwnd, &pt); 01364 01365 if (!PtInRect(&plb->spwnd->rcWindow, pt)) { 01366 /* 01367 * Cancel selection if clicked outside of combo; 01368 * Accept if clicked on combo button or item. 01369 */ 01370 xxxCBHideListBoxWindow(plb->pcbox, TRUE, FALSE); 01371 } else if (!PtInRect(&plb->spwnd->rcClient, pt)) { 01372 /* 01373 * Let it pass through. Save, restore capture in 01374 * case user is clicking on scrollbar. 01375 */ 01376 plb->fCaptured = FALSE; 01377 NtUserReleaseCapture(); 01378 01379 SendMessageWorker(plb->spwnd, WM_NCLBUTTONDOWN, 01380 FindNCHit(plb->spwnd, POINTTOPOINTS(pt)), 01381 MAKELONG(pt.x, pt.y), FALSE); 01382 01383 NtUserSetCapture(hwnd); 01384 plb->fCaptured = TRUE; 01385 } 01386 01387 break; 01388 } 01389 01390 plb->fCaptured = FALSE; 01391 NtUserReleaseCapture(); 01392 } 01393 01394 if (plb->pcbox) { 01395 01396 /* 01397 * If this listbox is in a combo box, set the focus to the combo 01398 * box window so that the edit control/static text is also 01399 * activated 01400 */ 01401 ThreadLock(plb->pcbox->spwndEdit, &tlpwndEdit); 01402 NtUserSetFocus(HWq(plb->pcbox->spwndEdit)); 01403 ThreadUnlock(&tlpwndEdit); 01404 } else { 01405 01406 /* 01407 * Get the focus if the listbox is clicked in and we don't 01408 * already have the focus. If we don't have the focus after 01409 * this, run away... 01410 */ 01411 NtUserSetFocus(hwnd); 01412 if (!plb->fCaret) 01413 return; 01414 } 01415 01416 if (plb->fAddSelMode) { 01417 01418 /* 01419 * If it is in "Add" mode, quit it using shift f8 key... 01420 * However, since we can't send shift key state, we have to turn 01421 * this off directly... 01422 */ 01423 01424 /* 01425 *SendMessage(HW(plb->spwnd),WM_KEYDOWN, (UINT)VK_F8, 0L); 01426 */ 01427 01428 /* 01429 * Switch off the Caret blinking 01430 */ 01431 NtUserKillTimer(hwnd, IDSYS_CARET); 01432 01433 /* 01434 * Make sure the caret does not vanish 01435 */ 01436 xxxLBSetCaret(plb, TRUE); 01437 plb->fAddSelMode = FALSE; 01438 } 01439 01440 if (!plb->cMac) { 01441 01442 /* 01443 * Don't even bother handling the mouse if no items in the 01444 * listbox since the code below assumes >0 items in the 01445 * listbox. We will just get the focus (the statement above) if 01446 * we don't already have it. 01447 */ 01448 break; 01449 } 01450 01451 if (mousetemp) { 01452 01453 /* 01454 * Mouse down occurred in a empty spot. Just ignore it. 01455 */ 01456 break; 01457 } 01458 01459 plb->fDoubleClick = (wMsg == WM_LBUTTONDBLCLK); 01460 01461 if (!plb->fDoubleClick) { 01462 01463 /* 01464 * This hack put in for the shell. Tell the shell where in the 01465 * listbox the user clicked and at what item number. The shell 01466 * can return 0 to continue normal mouse tracking or TRUE to 01467 * abort mouse tracking. 01468 */ 01469 ThreadLock(plb->spwndParent, &tlpwndParent); 01470 trackPtRetn = (INT)SendMessage(HW(plb->spwndParent), WM_LBTRACKPOINT, 01471 (DWORD)iSelFromPt, MAKELONG(pt.x+plb->xOrigin, pt.y)); 01472 ThreadUnlock(&tlpwndParent); 01473 if (trackPtRetn) { 01474 if (trackPtRetn == 2) { 01475 01476 /* 01477 * Ignore double clicks 01478 */ 01479 NtUserCallNoParam(SFI__RESETDBLCLK); 01480 } 01481 return; 01482 } 01483 } 01484 01485 if (plb->pcbox) { 01486 01487 /* 01488 * Save the last selection if this is a combo box. So that it 01489 * can be restored if user decides to cancel the selection by up 01490 * clicking outside the listbox. 01491 */ 01492 plb->iLastSelection = plb->iSel; 01493 } 01494 01495 /* 01496 * Save for timer 01497 */ 01498 plb->ptPrev = pt; 01499 01500 plb->fMouseDown = TRUE; 01501 NtUserSetCapture(hwnd); 01502 plb->fCaptured = TRUE; 01503 01504 if (plb->fDoubleClick) { 01505 01506 /* 01507 * Double click. Fake a button up and exit 01508 */ 01509 xxxTrackMouse(plb, WM_LBUTTONUP, pt); 01510 return; 01511 } 01512 01513 /* 01514 * Set the system timer so that we can autoscroll if the mouse is 01515 * outside the bounds of the listbox rectangle 01516 */ 01517 NtUserSetTimer(hwnd, IDSYS_SCROLL, gpsi->dtScroll, NULL); 01518 01519 01520 01521 /* 01522 * If extended multiselection listbox, are any modifier key pressed? 01523 */ 01524 if (plb->wMultiple == EXTENDEDSEL) { 01525 if (GetKeyState(VK_SHIFT) < 0) 01526 wModifiers = SHIFTDOWN; 01527 if (GetKeyState(VK_CONTROL) < 0) 01528 wModifiers += CTLDOWN; 01529 01530 /* 01531 * Please Note that (SHIFTDOWN + CTLDOWN) == (SHCTLDOWN) 01532 */ 01533 } 01534 01535 01536 switch (wModifiers) { 01537 case NOMODIFIER: 01538 MouseMoveHandler: 01539 if (plb->iSelBase != iSelFromPt) { 01540 xxxLBSetCaret(plb, FALSE); 01541 } 01542 01543 /* 01544 * We only look at the mouse if the point it is pointing to is 01545 * not selected. Since we are not in ExtendedSelMode, anywhere 01546 * the mouse points, we have to set the selection to that item. 01547 * Hence, if the item isn't selected, it means the mouse never 01548 * pointed to it before so we can select it. We ignore already 01549 * selected items so that we avoid flashing the inverted 01550 * selection rectangle. Also, we could get WM_SYSTIMER simulated 01551 * mouse moves which would cause flashing otherwise... 01552 */ 01553 01554 iSelTemp = (fMouseInRect ? iSelFromPt : -1); 01555 01556 /* 01557 * If the LB is either SingleSel or Extended multisel, clear all 01558 * old selections except the new one being made. 01559 */ 01560 if (plb->wMultiple != MULTIPLESEL) { 01561 xxxResetWorld(plb, iSelTemp, iSelTemp, FALSE); 01562 /* 01563 * This will be TRUE if iSelTemp isn't -1 (like below) 01564 * and also if it is but there is a current selection. 01565 */ 01566 if ((iSelTemp == -1) && (plb->iSel != -1)) { 01567 uEvent = EVENT_OBJECT_SELECTIONREMOVE; 01568 } 01569 } 01570 01571 fSelected = IsSelected(plb, iSelTemp, HILITEONLY); 01572 if (iSelTemp != -1) { 01573 01574 /* 01575 * If it is MULTIPLESEL, then toggle; For others, only if 01576 * not selected already, select it. 01577 */ 01578 if (((plb->wMultiple == MULTIPLESEL) && (wMsg != WM_LBUTTONDBLCLK)) || !fSelected) { 01579 SetSelected(plb, iSelTemp, !fSelected, HILITEANDSEL); 01580 01581 /* 01582 * And invert it 01583 */ 01584 xxxInvertLBItem(plb, iSelTemp, !fSelected); 01585 fSelected = !fSelected; /* Set the new state */ 01586 if (plb->wMultiple == MULTIPLESEL) { 01587 uEvent = (fSelected ? EVENT_OBJECT_SELECTIONADD : 01588 EVENT_OBJECT_SELECTIONREMOVE); 01589 } else { 01590 uEvent = EVENT_OBJECT_SELECTION; 01591 } 01592 } 01593 } 01594 01595 /* 01596 * We have to set iSel in case this is a multisel lb. 01597 */ 01598 plb->iSel = iSelTemp; 01599 01600 /* 01601 * Set the new anchor point 01602 */ 01603 plb->iMouseDown = iSelFromPt; 01604 plb->iLastMouseMove = iSelFromPt; 01605 plb->fNewItemState = fSelected; 01606 01607 break; 01608 case SHIFTDOWN: 01609 01610 /* 01611 * This is so that we can handle click and drag for multisel 01612 * listboxes using Shift modifier key . 01613 */ 01614 plb->iLastMouseMove = plb->iSel = iSelFromPt; 01615 01616 01617 01618 /* 01619 * Check if an anchor point already exists 01620 */ 01621 if (plb->iMouseDown == -1) { 01622 plb->iMouseDown = iSelFromPt; 01623 01624 /* 01625 * Reset all the previous selections 01626 */ 01627 xxxResetWorld(plb, plb->iMouseDown, plb->iMouseDown, FALSE); 01628 01629 /* 01630 * Select the current position 01631 */ 01632 SetSelected(plb, plb->iMouseDown, TRUE, HILITEANDSEL); 01633 xxxInvertLBItem(plb, plb->iMouseDown, TRUE); 01634 /* 01635 * We are changing the selction to this item only 01636 */ 01637 uEvent = EVENT_OBJECT_SELECTION; 01638 } else { 01639 01640 /* 01641 * Reset all the previous selections 01642 */ 01643 xxxResetWorld(plb, plb->iMouseDown, plb->iMouseDown, FALSE); 01644 01645 /* 01646 * Select all items from anchor point upto current click pt 01647 */ 01648 xxxAlterHilite(plb, plb->iMouseDown, iSelFromPt, HILITE, HILITEONLY, FALSE); 01649 uEvent = EVENT_OBJECT_SELECTIONWITHIN; 01650 } 01651 plb->fNewItemState = (UINT)TRUE; 01652 break; 01653 01654 case CTLDOWN: 01655 01656 /* 01657 * This is so that we can handle click and drag for multisel 01658 * listboxes using Control modifier key. 01659 */ 01660 01661 /* 01662 * Reset the anchor point to the current point 01663 */ 01664 plb->iMouseDown = plb->iLastMouseMove = plb->iSel = iSelFromPt; 01665 01666 /* 01667 * The state we will be setting items to 01668 */ 01669 plb->fNewItemState = (UINT)!IsSelected(plb, iSelFromPt, (UINT)HILITEONLY); 01670 01671 /* 01672 * Toggle the current point 01673 */ 01674 SetSelected(plb, iSelFromPt, plb->fNewItemState, HILITEANDSEL); 01675 xxxInvertLBItem(plb, iSelFromPt, plb->fNewItemState); 01676 uEvent = (plb->fNewItemState ? EVENT_OBJECT_SELECTIONADD : 01677 EVENT_OBJECT_SELECTIONREMOVE); 01678 break; 01679 01680 case SHCTLDOWN: 01681 01682 /* 01683 * This is so that we can handle click and drag for multisel 01684 * listboxes using Shift and Control modifier keys. 01685 */ 01686 01687 /* 01688 * Preserve all the previous selections 01689 */ 01690 01691 /* 01692 * Deselect only the selection connected with the last 01693 * anchor point; If the last anchor point is associated with a 01694 * de-selection, then do not do it 01695 */ 01696 if (plb->fNewItemState) { 01697 xxxAlterHilite(plb, plb->iMouseDown, plb->iLastMouseMove, FALSE, HILITEANDSEL, FALSE); 01698 } 01699 plb->iLastMouseMove = plb->iSel = iSelFromPt; 01700 01701 /* 01702 * Check if an anchor point already exists 01703 */ 01704 if (plb->iMouseDown == -1) { 01705 01706 /* 01707 * No existing anchor point; Make the current pt as anchor 01708 */ 01709 plb->iMouseDown = iSelFromPt; 01710 } 01711 01712 /* 01713 * If one exists preserve the most recent anchor point 01714 */ 01715 01716 /* 01717 * The state we will be setting items to 01718 */ 01719 plb->fNewItemState = (UINT)IsSelected(plb, plb->iMouseDown, HILITEONLY); 01720 01721 /* 01722 * Select all items from anchor point upto current click pt 01723 */ 01724 xxxAlterHilite(plb, plb->iMouseDown, iSelFromPt, plb->fNewItemState, HILITEONLY, FALSE); 01725 uEvent = EVENT_OBJECT_SELECTIONWITHIN; 01726 break; 01727 } 01728 01729 /* 01730 * Set the new base point (the outline frame caret). We do the check 01731 * first to avoid flashing the caret unnecessarly. 01732 */ 01733 if (plb->iSelBase != iSelFromPt) { 01734 01735 /* 01736 * Since xxxSetISelBase always turns on the caret, we don't need to 01737 * do it here... 01738 */ 01739 xxxSetISelBase(plb, iSelFromPt); 01740 } 01741 01742 /* 01743 * SetISelBase will change the focus and send a focus event. 01744 * Then we send the selection event. 01745 */ 01746 if (FWINABLE() && uEvent) { 01747 LBEvent(plb, uEvent, iSelFromPt); 01748 } 01749 if (wMsg == WM_LBUTTONDOWN && TestWF(plb->spwnd, WEFDRAGOBJECT)) { 01750 if (NtUserDragDetect(hwnd, pt)) { 01751 01752 /* 01753 * User is trying to drag object... 01754 */ 01755 01756 /* 01757 * Fake an up click so that the item is selected... 01758 */ 01759 xxxTrackMouse(plb, WM_LBUTTONUP, pt); 01760 01761 /* 01762 * Notify parent 01763 * #ifndef WIN16 (32-bit Windows), plb->iSelBase gets 01764 * zero-extended to LONG wParam automatically by the compiler. 01765 */ 01766 ThreadLock(plb->spwndParent, &tlpwndParent); 01767 SendMessage(HW(plb->spwndParent), WM_BEGINDRAG, plb->iSelBase, 01768 (LPARAM)hwnd); 01769 ThreadUnlock(&tlpwndParent); 01770 } else { 01771 xxxTrackMouse(plb, WM_LBUTTONUP, pt); 01772 } 01773 return; 01774 } 01775 break; 01776 01777 case WM_MOUSEMOVE: { 01778 int dist; 01779 int iTimer; 01780 01781 /* 01782 * Save for timer. 01783 */ 01784 plb->ptPrev = pt; 01785 /* 01786 * Autoscroll listbox if mouse button is held down and mouse is 01787 * moved outside of the listbox 01788 */ 01789 if (plb->fMouseDown) { 01790 if (plb->fMultiColumn) { 01791 if ((pt.x < 0) || (pt.x >= rcClient.right - 1)) { 01792 /* 01793 * Reset timer interval based on distance from listbox. 01794 * use a longer default interval because each multicolumn 01795 * scrolling increment is larger 01796 */ 01797 dist = pt.x < 0 ? -pt.x : (pt.x - rcClient.right + 1); 01798 iTimer = ((gpsi->dtScroll * 3) / 2) - ((WORD) dist << 4); 01799 01800 if (plb->fRightAlign) 01801 xxxLBoxCtlHScrollMultiColumn(plb, (pt.x < 0 ? SB_LINEDOWN : SB_LINEUP), 0); 01802 else 01803 xxxLBoxCtlHScrollMultiColumn(plb, (pt.x < 0 ? SB_LINEUP : SB_LINEDOWN), 0); 01804 01805 goto SetTimerAndSel; 01806 } 01807 } else if ((pt.y < 0) || (pt.y >= rcClient.bottom - 1)) { 01808 /* 01809 * Reset timer interval based on distance from listbox. 01810 */ 01811 dist = pt.y < 0 ? -pt.y : (pt.y - rcClient.bottom + 1); 01812 iTimer = gpsi->dtScroll - ((WORD) dist << 4); 01813 01814 xxxLBoxCtlScroll(plb, (pt.y < 0 ? SB_LINEUP : SB_LINEDOWN), 0); 01815 SetTimerAndSel: 01816 NtUserSetTimer(hwnd, IDSYS_SCROLL, max(iTimer, 1), NULL); 01817 ISelFromPt(plb, pt, &iSelFromPt); 01818 } 01819 } else { 01820 /* 01821 * Ignore if not in client since we don't autoscroll 01822 */ 01823 if (!PtInRect(&rcClient, pt)) 01824 break; 01825 } 01826 01827 switch (plb->wMultiple) { 01828 case SINGLESEL: 01829 01830 /* 01831 * If it is a single selection or plain multisel list box 01832 */ 01833 goto MouseMoveHandler; 01834 break; 01835 01836 case MULTIPLESEL: 01837 case EXTENDEDSEL: 01838 01839 /* 01840 * Handle mouse movement with extended selection of items 01841 */ 01842 if (plb->iSelBase != iSelFromPt) { 01843 xxxSetISelBase(plb, iSelFromPt); 01844 01845 /* 01846 * If this is an extended Multi sel list box, then 01847 * adjust the display of the range due to the mouse move 01848 */ 01849 if (plb->wMultiple == EXTENDEDSEL) { 01850 xxxLBBlockHilite(plb, iSelFromPt, FALSE); 01851 if (FWINABLE()) 01852 LBEvent(plb, EVENT_OBJECT_SELECTIONWITHIN, iSelFromPt); 01853 } 01854 plb->iLastMouseMove = iSelFromPt; 01855 } 01856 break; 01857 } 01858 break; 01859 } 01860 case WM_LBUTTONUP: 01861 if (plb->fMouseDown) 01862 xxxLBButtonUp(plb, LBUP_RELEASECAPTURE | LBUP_NOTIFY | 01863 (mousetemp ? LBUP_RESETSELECTION : 0) | 01864 (fMouseInRect ? LBUP_SUCCESS : 0)); 01865 } 01866 }


Variable Documentation

HMODULE ghImm32
 

Definition at line 2524 of file usercli.h.

Referenced by _InitializeImmEntryTable(), User32InitializeImmEntryTable(), and UserClientDllInitialize().

ImmApiEntries gImmApiEntries
 

Definition at line 2523 of file usercli.h.

Referenced by _InitializeImmEntryTable(), IMPGetIMEA(), IMPGetIMEW(), IMPQueryIMEA(), IMPQueryIMEW(), IMPSetIMEA(), IMPSetIMEW(), SendIMEMessageExA(), SendIMEMessageExW(), User32InitializeImmEntryTable(), WINNLSEnableIME(), and WINNLSGetEnableStatus().

PTHREADINFO PtiCurrent(VOID)
 


Generated on Sat May 15 19:45:57 2004 for test by doxygen 1.3.7