ReactOS  0.4.15-dev-1384-g878186b
CAutoComplete.cpp File Reference
#include "precomp.h"
Include dependency graph for CAutoComplete.cpp:

Go to the source code of this file.

Functions

static void Edit_BackWord (HWND hwndEdit)
 

Variables

static const WCHAR autocomplete_propertyW []
 

Function Documentation

◆ Edit_BackWord()

static void Edit_BackWord ( HWND  hwndEdit)
static

Definition at line 284 of file CAutoComplete.cpp.

285 {
286  INT iStart, iEnd;
287  iStart = iEnd = 0;
289 
290  if (iStart != iEnd || iStart < 0)
291  return;
292 
294  if (cchText < (size_t)iStart || (INT)cchText <= 0)
295  return;
296 
297  CComHeapPtr<WCHAR> pszText;
298  if (!pszText.Allocate(cchText + 1))
299  return;
300 
301  if (GetWindowTextW(hwndEdit, pszText, cchText + 1) <= 0)
302  return;
303 
304  WORD types[2];
305  for (--iStart; 0 < iStart; --iStart)
306  {
307  GetStringTypeW(CT_CTYPE1, &pszText[iStart - 1], 2, types);
308  if (((types[0] & C1_PUNCT) && !(types[1] & C1_SPACE)) ||
309  ((types[0] & C1_SPACE) && (types[1] & (C1_ALPHA | C1_DIGIT))))
310  {
313  return;
314  }
315  }
316 
317  if (iStart == 0)
318  {
321  }
322 }
#define TRUE
Definition: types.h:120
_In_ UINT iStart
Definition: wingdi.h:3619
UINT_PTR WPARAM
Definition: windef.h:207
int32_t INT
Definition: typedefs.h:58
#define EM_GETSEL
Definition: winuser.h:1979
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
LONG_PTR LPARAM
Definition: windef.h:208
_In_ int cchText
Definition: winuser.h:4440
#define C1_ALPHA
Definition: unicode.h:39
Definition: cmds.c:130
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: lang.c:1699
#define C1_DIGIT
Definition: unicode.h:33
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define EM_SETSEL
Definition: winuser.h:2000
unsigned short WORD
Definition: ntddk_ex.h:93
#define CT_CTYPE1
Definition: winnls.h:234
#define C1_PUNCT
Definition: unicode.h:35
static const WCHAR L[]
Definition: oid.c:1250
HWND hwndEdit
Definition: combotst.c:65
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define C1_SPACE
Definition: unicode.h:34
#define EM_REPLACESEL
Definition: winuser.h:1988

Referenced by CAutoComplete::ACEditSubclassProc().

Variable Documentation

◆ autocomplete_propertyW

const WCHAR autocomplete_propertyW[]
static
Initial value:
= {'W','i','n','e',' ','A','u','t','o',
'c','o','m','p','l','e','t','e',' ',
'c','o','n','t','r','o','l',0}

Definition at line 41 of file CAutoComplete.cpp.

Referenced by CAutoComplete::ACEditSubclassProc(), CAutoComplete::Init(), and CAutoComplete::~CAutoComplete().