ReactOS 0.4.15-dev-8119-g4fb2fdb
edittest.c File Reference
#include <windows.h>
#include "utils.h"
Include dependency graph for edittest.c:

Go to the source code of this file.

Macros

#define CREATEWINDOW   106
 
#define CREATEWINDOWEX   107
 
#define CREATEWINDOWW   108
 
#define ResultX   0
 
#define ResultY   305
 
#define NOTIFYX   350
 
#define NOTIFYY   285
 
#define BUFFERLEN   80 /* Size of buffer to hold result strings */
 
#define TestStr   "The quick brown fox jumps over the lazy dog"
 
#define TestStrW   L"This is a WCHAR string" /* Wide to support unicode edits */
 
#define MAXMESSAGEBUTTONS   42
 
#define ReplaceTextStr   "->> Replaced!! <<-"
 
#define NUMBERBUTTONS   26
 

Typedefs

typedef void FunctionHandler(HWND, DWORD, WPARAM, LPARAM)
 
typedef FunctionHandlerLPFUNCTIONHANDLER
 

Functions

VOID PrintTextXY (char *Text, int x, int y, int len)
 
static VOID HandlePrintReturnHex (HWND handle, DWORD Msg, WPARAM wParam, LPARAM lParam)
 
static VOID HandleSetHandlePrintHex (HWND handle, DWORD Msg, WPARAM wParam, LPARAM lParam)
 
static VOID HandlePrintReturnStr (HWND handle, DWORD Msg, WPARAM wParam, LPARAM lParam)
 
static VOID HandlePrintRect (HWND handle, DWORD Msg, WPARAM wParam, LPARAM lParam)
 
static VOID HandlePrintPasswdChar (HWND handle, DWORD Msg, WPARAM wParam, LPARAM lParam)
 
HWND CreateCheckButton (const char *lpWindowName, DWORD xSize, DWORD id)
 
HWND CreatePushButton (const char *lpWindowName, DWORD xSize, DWORD id, DWORD Style)
 
VOID ReadNHide ()
 
VOID ForwardToSecondPage ()
 
VOID BackToFirstPage ()
 
VOID BackToInitialPage ()
 
LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
HWND RegisterAndCreateWindow (HINSTANCE hInst, const char *className, const char *title)
 
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdParam, int cmdShow)
 

Variables

HWND g_hwnd = NULL
 
HINSTANCE g_hInst = NULL
 
int pos = 10
 
int n = 0
 
int yButPos = 10
 
int xButPos = 10
 
DWORD EditStyle = 0
 
DWORD EditWidth = 240
 
DWORD EditHeight = 250
 
BOOL UnicodeUsed = FALSE
 
HWND hwndEdit = NULL
 
POINTL point ={10,3}
 
RECT rect = {0,0,20,20}
 
RECT rect2
 
DWORD StartP
 
DWORD EndP
 
charAllocatedText
 
charNewText = "New text for the edit control"
 
wchar_tNewTextW = L"New text for the edit control in UNICODE"
 
char TextBuffer [BUFFERLEN] ={'R','e','s','u','l','t',':',' '}
 
struct {
   char *   Text
 
   DWORD   MsgCode
 
   WPARAM   wParam
 
   LPARAM   lParam
 
   LPFUNCTIONHANDLER   Handler
 
Msg []
 
DWORD EditStyles []
 
charStyleNames []
 
HWND Buttons [NUMBERBUTTONS]
 
HWND MessageButtons [MAXMESSAGEBUTTONS]
 
HWND Back1But
 
HWND Back2But
 
HWND NextBut
 

Macro Definition Documentation

◆ BUFFERLEN

#define BUFFERLEN   80 /* Size of buffer to hold result strings */

Definition at line 25 of file edittest.c.

◆ CREATEWINDOW

#define CREATEWINDOW   106

Definition at line 15 of file edittest.c.

◆ CREATEWINDOWEX

#define CREATEWINDOWEX   107

Definition at line 16 of file edittest.c.

◆ CREATEWINDOWW

#define CREATEWINDOWW   108

Definition at line 17 of file edittest.c.

◆ MAXMESSAGEBUTTONS

#define MAXMESSAGEBUTTONS   42

Definition at line 32 of file edittest.c.

◆ NOTIFYX

#define NOTIFYX   350

Definition at line 22 of file edittest.c.

◆ NOTIFYY

#define NOTIFYY   285

Definition at line 23 of file edittest.c.

◆ NUMBERBUTTONS

#define NUMBERBUTTONS   26

Definition at line 260 of file edittest.c.

◆ ReplaceTextStr

#define ReplaceTextStr   "->> Replaced!! <<-"

Definition at line 54 of file edittest.c.

◆ ResultX

#define ResultX   0

Definition at line 19 of file edittest.c.

◆ ResultY

#define ResultY   305

Definition at line 20 of file edittest.c.

◆ TestStr

#define TestStr   "The quick brown fox jumps over the lazy dog"

Definition at line 28 of file edittest.c.

◆ TestStrW

#define TestStrW   L"This is a WCHAR string" /* Wide to support unicode edits */

Definition at line 30 of file edittest.c.

Typedef Documentation

◆ FunctionHandler

typedef void FunctionHandler(HWND, DWORD, WPARAM, LPARAM)

Definition at line 62 of file edittest.c.

◆ LPFUNCTIONHANDLER

Definition at line 63 of file edittest.c.

Function Documentation

◆ BackToFirstPage()

VOID BackToFirstPage ( )

Definition at line 341 of file edittest.c.

342 {
343 int i;
344 for (i=0;i<26;i++)ShowWindow(MessageButtons[i],SW_SHOW);
349 }
#define MAXMESSAGEBUTTONS
Definition: edittest.c:32
HWND MessageButtons[MAXMESSAGEBUTTONS]
Definition: edittest.c:262
HWND NextBut
Definition: edittest.c:264
HWND Back2But
Definition: edittest.c:263
HWND Back1But
Definition: edittest.c:263
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:775

Referenced by WndProc().

◆ BackToInitialPage()

VOID BackToInitialPage ( )

Definition at line 352 of file edittest.c.

353 {
354 int i;
356 for (i=0 ; i< NUMBERBUTTONS ; i++) {ShowWindow(Buttons[i],SW_SHOW);}
357 for (i=0;i<26;i++)ShowWindow(MessageButtons[i],SW_HIDE);
360 }
#define NUMBERBUTTONS
Definition: edittest.c:260
HWND hwndEdit
Definition: edittest.c:48
HWND Buttons[NUMBERBUTTONS]
Definition: edittest.c:261
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by WndProc().

◆ CreateCheckButton()

HWND CreateCheckButton ( const char lpWindowName,
DWORD  xSize,
DWORD  id 
)

Definition at line 268 of file edittest.c.

269 {
270 HWND h;
271 h = CreateWindowEx(0,
272 "BUTTON",
273 lpWindowName,
275 xButPos, /* x */
276 yButPos, /* y */
277 xSize, /* nWidth */
278 20, /* nHeight */
279 g_hwnd,
280 UlongToHandle(id),
281 g_hInst,
282 NULL
283 );
284 yButPos += 21;
285 return h;
286 }
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define NULL
Definition: types.h:112
int yButPos
Definition: edittest.c:39
HWND g_hwnd
Definition: edittest.c:34
int xButPos
Definition: edittest.c:40
HINSTANCE g_hInst
Definition: edittest.c:35
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define CreateWindowEx
Definition: winuser.h:5755

Referenced by WndProc().

◆ CreatePushButton()

HWND CreatePushButton ( const char lpWindowName,
DWORD  xSize,
DWORD  id,
DWORD  Style 
)

Definition at line 289 of file edittest.c.

290 {
291
292 HWND h = CreateWindow("BUTTON",
293 lpWindowName,
295 xButPos, // x
296 yButPos, // y
297 xSize, // nWidth
298 20, // nHeight
299 g_hwnd,
300 (HMENU)(ULONG_PTR) id,
301 g_hInst,
302 NULL
303 );
304
305 yButPos += 21;
306 return h;
307 }
const DWORD Style
Definition: appswitch.c:71
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define BS_PUSHBUTTON
Definition: pedump.c:651
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CreateWindow
Definition: winuser.h:5754

Referenced by WndProc().

◆ ForwardToSecondPage()

VOID ForwardToSecondPage ( )

Definition at line 329 of file edittest.c.

Referenced by WndProc().

◆ HandlePrintPasswdChar()

static VOID HandlePrintPasswdChar ( HWND  handle,
DWORD  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 149 of file edittest.c.

150 {
151 HDC hdc;
153
154 int s;
155
156 if (ret)
157 {
158 s = 1;
159 TextBuffer[8] = (char)(ret);
160 }
161 else
162 {
163 TextBuffer[8] = 'N';
164 TextBuffer[9] = 'U';
165 TextBuffer[10] = 'L';
166 TextBuffer[11] = 'L';
167 s = 4;
168 }
169
170 hdc = GetDC (g_hwnd);
172
176 }
unsigned char
Definition: typeof.h:29
RECT rect
Definition: edittest.c:51
struct @1639 Msg[]
WPARAM wParam
Definition: edittest.c:183
#define ResultX
Definition: edittest.c:19
char TextBuffer[BUFFERLEN]
Definition: edittest.c:60
LPARAM lParam
Definition: edittest.c:184
#define ResultY
Definition: edittest.c:20
GLdouble s
Definition: gl.h:2039
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
int ret
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define SYSTEM_FIXED_FONT
Definition: wingdi.h:912
#define TextOut
Definition: wingdi.h:4483
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
#define SendMessage
Definition: winuser.h:5843
HDC WINAPI GetDC(_In_opt_ HWND)

◆ HandlePrintRect()

static VOID HandlePrintRect ( HWND  handle,
DWORD  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 131 of file edittest.c.

132 {
133 TextBuffer[8] = (char)(BUFFERLEN - 8); /* Setting the max size to put chars in first byte */
135
136 htoa(rect.top,&TextBuffer[8]);
137 TextBuffer[8+8] = ' ';
138 htoa(rect.bottom,&TextBuffer[8+8+1]);
139 TextBuffer[8+8+8+1] = ' ';
140 htoa(rect.left,&TextBuffer[8+8+8+1+1]);
141 TextBuffer[8+8+8+8+1+1] = ' ';
142 htoa(rect.right,&TextBuffer[8+8+8+8+1+1+1]);
143
145 }
#define BUFFERLEN
Definition: edittest.c:25
VOID PrintTextXY(char *Text, int x, int y, int len)
Definition: edittest.c:66
VOID htoa(unsigned int val, char *buf)
Definition: utils.c:10
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

◆ HandlePrintReturnHex()

static VOID HandlePrintReturnHex ( HWND  handle,
DWORD  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 79 of file edittest.c.

◆ HandlePrintReturnStr()

static VOID HandlePrintReturnStr ( HWND  handle,
DWORD  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 121 of file edittest.c.

122 {
123 int ret;
124 TextBuffer[8] = (char)(BUFFERLEN - 8); /* Setting the max size to put chars in first byte */
127 }

◆ HandleSetHandlePrintHex()

static VOID HandleSetHandlePrintHex ( HWND  handle,
DWORD  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 89 of file edittest.c.

90 {
91 LPVOID pMem;
92 HANDLE hNewBuffer;
93 int ret;
94
96 if (UnicodeUsed)
97 {
98 hNewBuffer = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT, 100);
99 pMem = LocalLock(hNewBuffer);
100 strcpyw_((wchar_t*)pMem,NewTextW);
101 }
102 else
103 {
104 hNewBuffer = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT,50);
105 pMem = LocalLock(hNewBuffer);
106 strcpy_((char*)pMem,NewText);
107 }
108
109 LocalUnlock(pMem);
110 hNewBuffer = LocalHandle(pMem);
111
112 /* Updates the buffer and displays new buffer */
113 ret = SendMessage(handle, EM_SETHANDLE, (WPARAM)hNewBuffer, 0L);
114
115 htoa(ret,&TextBuffer[8]);
117 }
char * NewText
Definition: edittest.c:57
BOOL UnicodeUsed
Definition: edittest.c:46
wchar_t * NewTextW
Definition: edittest.c:58
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
LPVOID NTAPI LocalLock(HLOCAL hMem)
Definition: heapmem.c:1616
BOOL NTAPI LocalUnlock(HLOCAL hMem)
Definition: heapmem.c:1805
HLOCAL NTAPI LocalHandle(LPCVOID pMem)
Definition: heapmem.c:1605
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
VOID strcpy_(char *dst, const char *src)
Definition: utils.c:23
VOID strcpyw_(wchar_t *dst, wchar_t *src)
Definition: utils.c:29
#define L(x)
Definition: ntvdm.h:50
#define LMEM_MOVEABLE
Definition: winbase.h:369
#define LMEM_ZEROINIT
Definition: winbase.h:375
UINT_PTR WPARAM
Definition: windef.h:207
#define EM_GETHANDLE
Definition: winuser.h:1989
#define EM_SETHANDLE
Definition: winuser.h:2009

◆ PrintTextXY()

VOID PrintTextXY ( char Text,
int  x,
int  y,
int  len 
)

Definition at line 66 of file edittest.c.

67{
68 HDC hdc;
69 hdc = GetDC (g_hwnd);
71
72 TextOut (hdc, x,y,Text,len);
75}
char * Text
Definition: edittest.c:181
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum GLsizei len
Definition: glext.h:6722

Referenced by HandlePrintRect(), HandlePrintReturnHex(), HandlePrintReturnStr(), HandleSetHandlePrintHex(), and WndProc().

◆ ReadNHide()

VOID ReadNHide ( )

Definition at line 310 of file edittest.c.

311 {
312 int i;
313 EditStyle = 0;
314 for (i=0 ; i< 19 ; i++)
315 {
319 }
320
322 for (i=0 ; i< 26 ; i++) ShowWindow(MessageButtons[i],SW_SHOW);
323
326 }
DWORD EditStyle
Definition: edittest.c:42
DWORD EditStyles[]
Definition: edittest.c:246
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1918

Referenced by WndProc().

◆ RegisterAndCreateWindow()

HWND RegisterAndCreateWindow ( HINSTANCE  hInst,
const char className,
const char title 
)

Definition at line 580 of file edittest.c.

583{
584 WNDCLASSEX wc;
585 HWND hwnd;
586
587 g_hInst = hInst;
588
589 wc.cbSize = sizeof (WNDCLASSEX);
590
591 wc.lpfnWndProc = WndProc; /* window procedure */
592 wc.hInstance = hInst; /* owner of the class */
593
594 wc.lpszClassName = className;
595 wc.hCursor = LoadCursor ( 0, (LPCTSTR)IDC_ARROW );
596 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
598 wc.cbClsExtra = 0;
599 wc.cbWndExtra = 0;
600 wc.hIcon = 0;
601 wc.hIconSm = 0;
602 wc.lpszMenuName = 0;
603
604 if ( !RegisterClassEx ( &wc ) )
605 return NULL;
606
608 0, /* dwStyleEx */
609 className, /* class name */
610 title, /* window title */
611
612 WS_OVERLAPPEDWINDOW, /* dwStyle */
613
614 1, /* x */
615 1, /* y */
616 560, /* width */
617 350, /* height */
618 NULL, /* hwndParent */
619 NULL, /* hMenu */
620 hInst,
621 0
622 );
623
624 if (!hwnd) return NULL;
625
628
629 return hwnd;
630}
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: edittest.c:364
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
static char title[]
Definition: ps.c:92
int cbClsExtra
Definition: winuser.h:3204
HINSTANCE hInstance
Definition: winuser.h:3206
HCURSOR hCursor
Definition: winuser.h:3208
LPCSTR lpszMenuName
Definition: winuser.h:3210
HICON hIconSm
Definition: winuser.h:3212
UINT style
Definition: winuser.h:3202
int cbWndExtra
Definition: winuser.h:3205
UINT cbSize
Definition: winuser.h:3201
WNDPROC lpfnWndProc
Definition: winuser.h:3203
LPCSTR lpszClassName
Definition: winuser.h:3211
HICON hIcon
Definition: winuser.h:3207
HBRUSH hbrBackground
Definition: winuser.h:3209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define CS_VREDRAW
Definition: winuser.h:658
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define RegisterClassEx
Definition: winuser.h:5837
BOOL WINAPI UpdateWindow(_In_ HWND)
#define LoadCursor
Definition: winuser.h:5812
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define COLOR_BTNFACE
Definition: winuser.h:928
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Referenced by WinMain().

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hInst,
HINSTANCE  hPrevInst,
LPSTR  cmdParam,
int  cmdShow 
)

Definition at line 634 of file edittest.c.

635{
636 char className [] = "Edit Control Test";
637 MSG msg;
638
639 RegisterAndCreateWindow ( hInst, className, "Edit Control Styles Test" );
640
641 // Message loop
642 while (GetMessage (&msg, NULL, 0, 0))
643 {
646 }
647 return msg.wParam;
648
649}
#define msg(x)
Definition: auth_time.c:54
HWND RegisterAndCreateWindow(HINSTANCE hInst, const char *className, const char *title)
Definition: edittest.c:580
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define GetMessage
Definition: winuser.h:5790
#define DispatchMessage
Definition: winuser.h:5765

◆ WndProc()

LRESULT CALLBACK WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 364 of file edittest.c.

365{
366 int i;
367 switch ( msg )
368 {
369 case WM_CREATE:
370 g_hwnd = hwnd;
371
372 /* ---- Initial page ---- */
373
374 for (i = 0 ; i < 14 ; i++)
376
377 xButPos += 160;
378 yButPos = 10;
379
380 for (; i < 19 ; i++)
382
383 Buttons[i++] = CreatePushButton("Width +",70,100,WS_VISIBLE);
384 Buttons[i++] = CreatePushButton("Width -",70,101,WS_VISIBLE);
385
386 Buttons[i++] = CreatePushButton("Height +",70,102,WS_VISIBLE);
387 Buttons[i++] = CreatePushButton("Height -",70,103,WS_VISIBLE);
388
389 Buttons[i++] = CreatePushButton("CreateWindowA",140,CREATEWINDOW,WS_VISIBLE);
390 Buttons[i++] = CreatePushButton("CreateWindowExA",140,CREATEWINDOWEX,WS_VISIBLE);
391 Buttons[i++] = CreatePushButton("CreateWindowExW",140,CREATEWINDOWW,WS_VISIBLE);
392
393
394 /* ---- The 1st page of buttons ---- */
395
396 xButPos = 0;
397 yButPos = 10;
398
399 for (i = 0 ; i < 14 ; i++)
400 MessageButtons[i] = CreatePushButton(Msg[i].Text,170,600+i,0);
401
402 xButPos += 180;
403 yButPos = 10;
404
405 for (; i < 26 ; i++)
406 MessageButtons[i] = CreatePushButton(Msg[i].Text,170,600+i,0);
407
408 Back1But = CreatePushButton("Back - destroys edit",170,400,0);
409 NextBut = CreatePushButton("Next",170,401,0);
410
411 /* ---- The 2nd page of buttons ------*/
412
413 xButPos = 0;
414 yButPos = 10;
415
416 for (; i<40; i++)
417 MessageButtons[i] = CreatePushButton(Msg[i].Text,170,600+i,0);
418
419 xButPos += 180;
420 yButPos = 10;
421
422 for (; i < MAXMESSAGEBUTTONS ; i++)
423 MessageButtons[i] = CreatePushButton(Msg[i].Text,170,600+i,0);
424
425 Back2But = CreatePushButton("Back",170,402,0);
426
427 break;
428
429 case WM_COMMAND:
430 if (LOWORD(wParam) >= 600)
431 {
432 Msg[LOWORD(wParam)-600].Handler(hwndEdit,
433 Msg[LOWORD(wParam)-600].MsgCode,
434 Msg[LOWORD(wParam)-600].wParam,
435 Msg[LOWORD(wParam)-600].lParam);
436 break;
437 }
438
439 switch(LOWORD(wParam)){
440
441 case 100:
442 EditWidth += 10;
443 break;
444
445 case 101:
446 EditWidth -= 10;
447 break;
448
449 case 102:
450 EditHeight += 10;
451 break;
452
453 case 103:
454 EditHeight -= 10;
455 break;
456
457 case 400:
459 break;
460
461 case 401:
463 break;
464
465 case 402:
467 break;
468
469 case CREATEWINDOW:
471 ReadNHide();
472 hwndEdit = CreateWindow("EDIT",
473 TestStr,
475 350,
476 10,
477 EditWidth,
479 g_hwnd,
480 NULL,
481 g_hInst,
482 NULL);
483 break;
484
485 case CREATEWINDOWEX:
487 ReadNHide();
489 "EDIT",
490 TestStr,
492 350,
493 10,
494 EditWidth,
496 g_hwnd,
497 NULL,
498 g_hInst,
499 NULL);
500 break;
501
502 case CREATEWINDOWW:
504 ReadNHide();
506 L"EDIT",
507 TestStrW,
509 350,
510 10,
511 EditWidth,
513 g_hwnd,
514 NULL,
515 g_hInst,
516 NULL);
517 break;
518 }
519
520 if (lParam == (LPARAM)hwndEdit)
521 switch(HIWORD(wParam))
522 {
523 case EN_CHANGE:
524 PrintTextXY("EN_CHANGE notification",NOTIFYX,NOTIFYY,22);
525 break;
526
527 case EN_ERRSPACE:
528 PrintTextXY("EN_ERRSPACE notification",NOTIFYX,NOTIFYY,24);
529 break;
530
531 /* --- FIXME not defined in w32api-2.3 headers
532 case H_SCROLL:
533 PrintTextXY("H_SCROLL notification",NOTIFYX,NOTIFYY,21);
534 break; */
535
536 /* --- FIXME not defined in w32api-2.3 headers
537 case KILL_FOCUS:
538 PrintTextXY("KILL_FOCUS notification",NOTIFYX,NOTIFYY,23);
539 break; */
540
541 /* --- FIXME not defined in w32api-2.3 headers
542 case EN_MAXTEST:
543 PrintTextXY("EN_MAXTEXT notification",NOTIFYX,NOTIFYY,23);
544 break; */
545
546 case EN_SETFOCUS:
547 PrintTextXY("EN_SETFOCUS notification",NOTIFYX,NOTIFYY,24);
548 break;
549
550 case EN_UPDATE:
551 PrintTextXY("EN_UPDATE notification",NOTIFYX,NOTIFYY + 20,22);
552 break;
553
554 case EN_VSCROLL:
555 PrintTextXY("EN_VSCROLL notification",NOTIFYX,NOTIFYY,23);
556 break;
557
558 }
559
560 break;
561
562 case WM_SIZE :
563 return 0;
564
565 case WM_CLOSE:
567 return 0;
568
570 return 0;
571
572 case WM_DESTROY:
574 return 0;
575 }
576 return DefWindowProc ( hwnd, msg, wParam, lParam );
577}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HWND CreatePushButton(const char *lpWindowName, DWORD xSize, DWORD id, DWORD Style)
Definition: edittest.c:289
VOID ReadNHide()
Definition: edittest.c:310
VOID BackToFirstPage()
Definition: edittest.c:341
#define NOTIFYX
Definition: edittest.c:22
char * StyleNames[]
Definition: edittest.c:253
DWORD EditHeight
Definition: edittest.c:44
DWORD MsgCode
Definition: edittest.c:182
#define NOTIFYY
Definition: edittest.c:23
#define TestStrW
Definition: edittest.c:30
#define CREATEWINDOWW
Definition: edittest.c:17
DWORD EditWidth
Definition: edittest.c:43
#define CREATEWINDOWEX
Definition: edittest.c:16
#define TestStr
Definition: edittest.c:28
VOID BackToInitialPage()
Definition: edittest.c:352
HWND CreateCheckButton(const char *lpWindowName, DWORD xSize, DWORD id)
Definition: edittest.c:268
#define CREATEWINDOW
Definition: edittest.c:15
VOID ForwardToSecondPage()
Definition: edittest.c:329
#define LOWORD(l)
Definition: pedump.c:82
#define DefWindowProc
Definition: ros2win.h:31
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_CLOSE
Definition: winuser.h:1621
#define WM_CREATE
Definition: winuser.h:1608
#define EN_SETFOCUS
Definition: winuser.h:2027
#define EN_UPDATE
Definition: winuser.h:2028
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WM_QUERYENDSESSION
Definition: winuser.h:1622
#define EN_VSCROLL
Definition: winuser.h:2029
#define WM_DESTROY
Definition: winuser.h:1609
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define EN_ERRSPACE
Definition: winuser.h:2023
#define EN_CHANGE
Definition: winuser.h:2022

Referenced by RegisterAndCreateWindow().

Variable Documentation

◆ AllocatedText

char* AllocatedText

Definition at line 56 of file edittest.c.

◆ Back1But

HWND Back1But

◆ Back2But

HWND Back2But

Definition at line 263 of file edittest.c.

Referenced by BackToFirstPage(), ForwardToSecondPage(), and WndProc().

◆ Buttons

HWND Buttons[NUMBERBUTTONS]

Definition at line 261 of file edittest.c.

Referenced by BackToInitialPage(), ReadNHide(), and WndProc().

◆ EditHeight

DWORD EditHeight = 250

Definition at line 44 of file edittest.c.

Referenced by WndProc().

◆ EditStyle

DWORD EditStyle = 0

Definition at line 42 of file edittest.c.

Referenced by ReadNHide(), and WndProc().

◆ EditStyles

DWORD EditStyles[]
Initial value:
= {
}
#define ES_PASSWORD
Definition: pedump.c:670
#define ES_READONLY
Definition: pedump.c:675
#define ES_LOWERCASE
Definition: pedump.c:669
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define ES_WANTRETURN
Definition: pedump.c:676
#define ES_UPPERCASE
Definition: pedump.c:668
#define WS_BORDER
Definition: pedump.c:625
#define ES_NOHIDESEL
Definition: pedump.c:673
#define WS_VSCROLL
Definition: pedump.c:627
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_DISABLED
Definition: pedump.c:621
#define ES_LEFT
Definition: pedump.c:664
#define WS_HSCROLL
Definition: pedump.c:628
#define ES_CENTER
Definition: pedump.c:665
#define ES_RIGHT
Definition: pedump.c:666
#define ES_MULTILINE
Definition: pedump.c:667
#define WS_THICKFRAME
Definition: pedump.c:630
#define ES_OEMCONVERT
Definition: pedump.c:674
#define ES_NUMBER
Definition: winuser.h:301

Definition at line 246 of file edittest.c.

Referenced by ReadNHide().

◆ EditWidth

DWORD EditWidth = 240

Definition at line 43 of file edittest.c.

Referenced by WndProc().

◆ EndP

DWORD EndP

Definition at line 52 of file edittest.c.

◆ g_hInst

HINSTANCE g_hInst = NULL

Definition at line 35 of file edittest.c.

Referenced by CreateCheckButton(), CreatePushButton(), RegisterAndCreateWindow(), and WndProc().

◆ g_hwnd

HWND g_hwnd = NULL

◆ Handler

Definition at line 185 of file edittest.c.

◆ hwndEdit

HWND hwndEdit = NULL

Definition at line 48 of file edittest.c.

Referenced by BackToInitialPage(), and WndProc().

◆ lParam

◆ MessageButtons

HWND MessageButtons[MAXMESSAGEBUTTONS]

◆ 

◆ MsgCode

DWORD MsgCode

Definition at line 182 of file edittest.c.

Referenced by WndProc().

◆ n

int n = 0

Definition at line 38 of file edittest.c.

◆ NewText

char* NewText = "New text for the edit control"

Definition at line 57 of file edittest.c.

Referenced by HandleSetHandlePrintHex().

◆ NewTextW

wchar_t* NewTextW = L"New text for the edit control in UNICODE"

Definition at line 58 of file edittest.c.

Referenced by HandleSetHandlePrintHex().

◆ NextBut

HWND NextBut

◆ point

POINTL point ={10,3}

Definition at line 50 of file edittest.c.

Referenced by af_glyph_hints_align_edge_points(), af_glyph_hints_align_strong_points(), af_glyph_hints_align_weak_points(), af_glyph_hints_reload(), af_glyph_hints_save(), af_latin_hints_compute_segments(), brush_fill_pixels(), CC_MouseCheckColorGraph(), CC_MouseCheckPredefColorArray(), CC_MouseCheckResultWindow(), CC_MouseCheckUserColorArray(), CC_PaintCross(), CC_WMInitDialog(), cff_builder_add_point(), ATL::CWindow::ChildWindowFromPoint(), ATL::CWindow::ChildWindowFromPointEx(), convert_utf16bom(), copy_mipmap_chain(), CRect::CRect(), CRYPT_AsnDecodeDistPoint(), CRYPT_AsnEncodeIssuingDistPoint(), DECLARE_INTERFACE_(), Decompose_Curve(), RdpClientUI::Display_Polygon(), RdpClientUI::Display_RepaintPolygon(), Graphics::DrawImage(), FT_Outline_Decompose(), ft_stroke_border_get_counts(), FT_Stroker_LineTo(), FT_Stroker_ParseOutline(), ft_stroker_subpath_start(), GdipGetPathGradientCenterPoint(), GdipGetPathGradientCenterPointI(), GdipSetPathGradientCenterPoint(), GdipSetPathGradientCenterPointI(), get_bezier_glyph_outline(), get_line_to_point_y_distance(), get_native_glyph_outline(), PathGradientBrush::GetCenterPoint(), OpenGLSurfaceEvaluator::inEvalCoord2f(), OpenGLSurfaceEvaluator::inEvalMesh2(), OpenGLSurfaceEvaluator::inEvalPoint2(), IntGdiWidenPath(), IntTrackMouseEvent(), GraphicsPath::IsOutlineVisible(), Graphics::IsVisible(), Region::IsVisible(), GraphicsPath::IsVisible(), LISTVIEW_UpdateHeaderSize(), MD_ListView_OnInsertMarkHitTest(), ME_HandleMessage(), CRect::MoveToXY(), CPoint::Offset(), CRect::OffsetRect(), CPoint::operator!=(), CPoint::operator+(), CSize::operator+(), CRect::operator+(), CPoint::operator+=(), CRect::operator+=(), CPoint::operator-(), CSize::operator-(), CRect::operator-(), CPoint::operator-=(), CRect::operator-=(), CPoint::operator==(), PATH_LineTo(), PATH_PolyPolyline(), ps_builder_add_point(), psh_glyph_compute_extrema(), psh_glyph_find_blue_points(), psh_glyph_find_strong_points(), psh_glyph_init(), psh_glyph_interpolate_normal_points(), psh_glyph_interpolate_other_points(), psh_glyph_interpolate_strong_points(), psh_glyph_load_points(), psh_glyph_save_points(), psh_hint_table_find_strong_points(), CRect::PtInRect(), resample_bitmap_pixel(), resample_bitmap_pixel_premult(), CDefView::SelectAndPositionItem(), PathGradientBrush::SetCenterPoint(), SPY_DumpStructure(), symt_add_function_point(), SysMouseWImpl_Acquire(), t1_builder_add_point(), test_decodeCRLDistPoints(), test_decodeCRLIssuingDistPoint(), test_dpi_mapping(), test_EM_CHARFROMPOS(), test_encodeCRLDistPoints(), test_encodeCRLIssuingDistPoint(), test_events(), test_fromhrgn(), test_GetMouseMovePointsEx(), test_getregiondata(), test_IConnectionPoint(), test_pathgradientcenterpoint(), test_word_wrap(), triangulation_add_point(), ArcTessellator::trim_power_coeffs(), and ui_polygon().

◆ pos

int pos = 10

Definition at line 37 of file edittest.c.

◆ rect

RECT rect = {0,0,20,20}

Definition at line 51 of file edittest.c.

Referenced by HandlePrintPasswdChar(), HandlePrintRect(), and PrintTextXY().

◆ rect2

◆ StartP

DWORD StartP

Definition at line 52 of file edittest.c.

◆ StyleNames

char* StyleNames[]
Initial value:
= {
"WS_THICKFRAME","WS_DISABLED","WS_BORDER","ES_LOWERCASE","ES_UPPERCASE","ES_NUMBER","ES_AUTOVSCROLL",
"ES_AUTOHSCROLL","ES_LEFT","ES_CENTER","ES_RIGHT","ES_MULTILINE",
"ES_NOHIDESEL","ES_OEMCONVERT","ES_PASSWORD","ES_READONLY","ES_WANTRETURN",
"WS_HSCROLL","WS_VSCROLL"
}

Definition at line 253 of file edittest.c.

Referenced by WndProc().

◆ Text

char* Text

Definition at line 181 of file edittest.c.

Referenced by PrintTextXY(), and WndProc().

◆ TextBuffer

char TextBuffer[BUFFERLEN] ={'R','e','s','u','l','t',':',' '}

◆ UnicodeUsed

BOOL UnicodeUsed = FALSE

Definition at line 46 of file edittest.c.

Referenced by HandleSetHandlePrintHex(), and WndProc().

◆ wParam

◆ xButPos

int xButPos = 10

Definition at line 40 of file edittest.c.

Referenced by CreateCheckButton(), CreatePushButton(), and WndProc().

◆ yButPos

int yButPos = 10

Definition at line 39 of file edittest.c.

Referenced by CreateCheckButton(), CreatePushButton(), and WndProc().