ReactOS 0.4.15-dev-8222-g9164419
psmtest.c File Reference
#include <windows.h>
#include <commctrl.h>
#include <strsafe.h>
Include dependency graph for psmtest.c:

Go to the source code of this file.

Macros

#define IDI_APPICON   101
 
#define IDR_ACCELERATOR   103
 
#define LPK   1
 
#define USERLPK   2
 

Functions

LRESULT CALLBACK MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
INT WINAPI LpkPSMTextOut (HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
 
INT WINAPI UserLpkPSMTextOut (HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
 
static void DrawTest (HDC hdc, int ypos, LPCWSTR str, DWORD dwFlags, int testtype)
 
int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
 

Variables

static LPCWSTR MainWndClass = L"PSM Test"
 

Macro Definition Documentation

◆ IDI_APPICON

#define IDI_APPICON   101

Definition at line 15 of file psmtest.c.

◆ IDR_ACCELERATOR

#define IDR_ACCELERATOR   103

Definition at line 16 of file psmtest.c.

◆ LPK

#define LPK   1

Definition at line 26 of file psmtest.c.

◆ USERLPK

#define USERLPK   2

Definition at line 27 of file psmtest.c.

Function Documentation

◆ DrawTest()

static void DrawTest ( HDC  hdc,
int  ypos,
LPCWSTR  str,
DWORD  dwFlags,
int  testtype 
)
static

Definition at line 28 of file psmtest.c.

29{
30 WCHAR Result[100];
31 INT ret = 0;
32
33 if (testtype == LPK)
34 {
35 ret = LpkPSMTextOut(hdc, 0, ypos, str, (!str) ? 10 : lstrlenW(str), dwFlags);
36 StringCchPrintfW(Result, 100, L"Return Value = %d", ret);
37 TextOutW(hdc, 200, ypos, Result, lstrlenW(Result));
38 }
39 else if (testtype == USERLPK)
40 {
42 StringCchPrintfW(Result, 100, L"Return Value = %d", ret);
43 TextOutW(hdc, 600, ypos, Result, lstrlenW(Result));
44 }
45
46}
#define lstrlenW
Definition: compat.h:750
HDC hdc
Definition: main.c:9
#define L(x)
Definition: ntvdm.h:50
INT WINAPI LpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
Definition: lpk.c:380
INT WINAPI UserLpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
Definition: font.c:413
#define LPK
Definition: psmtest.c:26
#define USERLPK
Definition: psmtest.c:27
const WCHAR * str
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
int32_t INT
Definition: typedefs.h:58
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by MainWndProc().

◆ LpkPSMTextOut()

INT WINAPI LpkPSMTextOut ( HDC  hdc,
int  x,
int  y,
LPCWSTR  lpString,
int  cString,
DWORD  dwFlags 
)

Definition at line 380 of file lpk.c.

381{
382 SIZE size;
384 int prefix_offset, len;
385 LPWSTR display_str = NULL;
386
387 if (!lpString || cString <= 0)
388 return 0;
389
390 if (dwFlags & DT_NOPREFIX)
391 {
392 LpkExtTextOut(hdc, x, y, 0, NULL, lpString, cString, NULL, 0);
393 GetTextExtentPointW(hdc, lpString, cString, &size);
394 return size.cx;
395 }
396
397 display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
398
399 if (!display_str)
400 return 0;
401
402 PSM_PrepareToDraw(lpString, cString, display_str, &len);
403
404 if (!(dwFlags & DT_PREFIXONLY))
405 LpkExtTextOut(hdc, x, y, 0, NULL, display_str, len, NULL, 0);
406
407 if (!(dwFlags & DT_HIDEPREFIX))
408 {
409 prefix_offset = PSM_FindLastPrefix(lpString, cString);
411 LPK_DrawUnderscore(hdc, x, y + tm.tmAscent + 1, display_str, len, prefix_offset);
412 }
413
414 GetTextExtentPointW(hdc, display_str, len + 1, &size);
415 HeapFree(GetProcessHeap(), 0, display_str);
416
417 return size.cx;
418}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
LPKETO LpkExtTextOut
Definition: utils.c:5
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
static void PSM_PrepareToDraw(LPCWSTR str, INT count, LPWSTR new_str, LPINT new_count)
Definition: lpk.c:41
static void LPK_DrawUnderscore(HDC hdc, int x, int y, LPCWSTR str, int count, int offset)
Definition: lpk.c:66
static int PSM_FindLastPrefix(LPCWSTR str, int count)
Definition: lpk.c:22
Definition: time.h:68
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
#define DT_HIDEPREFIX
Definition: winuser.h:547
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DrawTest().

◆ MainWndProc()

LRESULT CALLBACK MainWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 118 of file psmtest.c.

119{
120 switch (msg)
121 {
122
123 case WM_GETMINMAXINFO:
124 {
125 /* Prevent our window from being sized too small */
126 MINMAXINFO *minMax = (MINMAXINFO*)lParam;
127 minMax->ptMinTrackSize.x = 220;
128 minMax->ptMinTrackSize.y = 110;
129
130 return 0;
131 }
132
133 case WM_PAINT:
134 {
135 PAINTSTRUCT ps;
136 HDC hdc = BeginPaint(hWnd, &ps);
137
138 enum {
139 ALEF = 0x5D0,
140 BET,
141 GIMEL,
142 DALET,
143 HEY,
144 VAV,
145 ZAYIN,
146 HET,
147 TET,
148 YUD,
149 KAF_SOFIT,
150 KAF,
151 LAMED,
152 MEM_SOFIT,
153 MEM,
154 NUN_SOFIT,
155 NUN,
156 SAMEKH,
157 AYIN,
158 PEY_SOFIT,
159 PEY,
161 TSADI,
162 QOF,
163 RESH,
164 SHIN,
165 TAV
166 };
167
169 HFONT hfont;
170 WCHAR Test[] = L"&Test Text";
171 WCHAR Test2[] = L"&Test\nText";
172 WCHAR Test3[] = L"&Test\tText";
173 WCHAR Test4[] = L"&Test T&ex&t";
174 WCHAR Test5[] = { TET, QOF, SAMEKH, TET, L' ', L'&', BET, DALET, YUD, QOF, HEY, 0 };
175 WCHAR Test6[] = L"Test&&Text";
176 WCHAR Test7[] = { BET, DALET, YUD, QOF, HEY, L'&', 'T','e','s','t', 0};
177 WCHAR Test8[] = L"TestText&";
178 WCHAR Test9[] = L"TestText&&";
179 WCHAR Test10[] = L"TestText";
180
181 ZeroMemory(&font, sizeof(LOGFONTW));
182 StringCchCopyW(font.lfFaceName, 32, L"Microsoft Sans Serif");
186
187 DrawTest(hdc, 0, Test, 0, LPK);
191 DrawTest(hdc, 80, Test2, 0, LPK);
193 DrawTest(hdc, 120, Test3, 0, LPK);
195 DrawTest(hdc, 160, NULL, 0, LPK);
196 DrawTest(hdc, 180, Test4, 0, LPK);
197 DrawTest(hdc, 200, Test4, DT_NOPREFIX, LPK);
198 DrawTest(hdc, 220, Test4, DT_HIDEPREFIX, LPK);
199 DrawTest(hdc, 240, Test5, 0, LPK);
200 DrawTest(hdc, 260, Test5, DT_NOPREFIX, LPK);
201 DrawTest(hdc, 280, Test5, DT_HIDEPREFIX, LPK);
202 DrawTest(hdc, 300, Test5, DT_PREFIXONLY, LPK);
203 DrawTest(hdc, 320, Test6, 0, LPK);
204 DrawTest(hdc, 340, Test6, DT_NOPREFIX, LPK);
205 DrawTest(hdc, 360, Test6, DT_HIDEPREFIX, LPK);
206 DrawTest(hdc, 380, Test6, DT_PREFIXONLY, LPK);
207 DrawTest(hdc, 400, Test7, 0, LPK);
208 DrawTest(hdc, 420, Test7, DT_NOPREFIX, LPK);
209 DrawTest(hdc, 440, Test7, DT_HIDEPREFIX, LPK);
210 DrawTest(hdc, 460, Test7, DT_PREFIXONLY, LPK);
211 DrawTest(hdc, 480, Test7, DT_RTLREADING, LPK);
213 DrawTest(hdc, 500, Test7, 0, LPK);
215 DrawTest(hdc, 520, Test8, 0, LPK);
216 DrawTest(hdc, 540, Test8, DT_NOPREFIX, LPK);
217 DrawTest(hdc, 560, Test8, DT_HIDEPREFIX, LPK);
218 DrawTest(hdc, 580, Test8, DT_PREFIXONLY, LPK);
219 DrawTest(hdc, 600, Test9, 0, LPK);
220 DrawTest(hdc, 620, Test9, DT_NOPREFIX, LPK);
221 DrawTest(hdc, 640, Test9, DT_HIDEPREFIX, LPK);
222 DrawTest(hdc, 660, Test9, DT_PREFIXONLY, LPK);
223 DrawTest(hdc, 680, Test10, 0, LPK);
224 DrawTest(hdc, 700, Test10, DT_NOPREFIX, LPK);
225 DrawTest(hdc, 720, Test10, DT_HIDEPREFIX, LPK);
226 DrawTest(hdc, 740, Test10, DT_PREFIXONLY, LPK);
227
228 TextOutW(hdc, 100, 760, L"LpkPSMTextOut", 13);
229
230 DrawTest(hdc, 0, Test, 0, USERLPK);
234 DrawTest(hdc, 80, Test2, 0, USERLPK);
236 DrawTest(hdc, 120, Test3, 0, USERLPK);
238 /* DrawTest(hdc, 160, NULL, 0, USERLPK); */ /* Crash on windows */
239 DrawTest(hdc, 180, Test4, 0, USERLPK);
240 DrawTest(hdc, 200, Test4, DT_NOPREFIX, USERLPK);
241 DrawTest(hdc, 220, Test4, DT_HIDEPREFIX, USERLPK);
242 DrawTest(hdc, 240, Test5, 0, USERLPK);
243 DrawTest(hdc, 260, Test5, DT_NOPREFIX, USERLPK);
244 DrawTest(hdc, 280, Test5, DT_HIDEPREFIX, USERLPK);
245 DrawTest(hdc, 300, Test5, DT_PREFIXONLY, USERLPK);
246 DrawTest(hdc, 320, Test6, 0, USERLPK);
247 DrawTest(hdc, 340, Test6, DT_NOPREFIX, USERLPK);
248 DrawTest(hdc, 360, Test6, DT_HIDEPREFIX, USERLPK);
249 DrawTest(hdc, 380, Test6, DT_PREFIXONLY, USERLPK);
250 DrawTest(hdc, 400, Test7, 0, USERLPK);
251 DrawTest(hdc, 420, Test7, DT_NOPREFIX, USERLPK);
252 DrawTest(hdc, 440, Test7, DT_HIDEPREFIX, USERLPK);
253 DrawTest(hdc, 460, Test7, DT_PREFIXONLY, USERLPK);
254 DrawTest(hdc, 480, Test7, DT_RTLREADING, USERLPK);
256 DrawTest(hdc, 500, Test7, 0, USERLPK);
258 DrawTest(hdc, 520, Test8, 0, USERLPK);
259 DrawTest(hdc, 540, Test8, DT_NOPREFIX, USERLPK);
260 DrawTest(hdc, 560, Test8, DT_HIDEPREFIX, USERLPK);
261 DrawTest(hdc, 580, Test8, DT_PREFIXONLY, USERLPK);
262 DrawTest(hdc, 600, Test9, 0, USERLPK);
263 DrawTest(hdc, 620, Test9, DT_NOPREFIX, USERLPK);
264 DrawTest(hdc, 640, Test9, DT_HIDEPREFIX, USERLPK);
265 DrawTest(hdc, 660, Test9, DT_PREFIXONLY, USERLPK);
266 DrawTest(hdc, 680, Test10, 0, USERLPK);
267 DrawTest(hdc, 700, Test10, DT_NOPREFIX, USERLPK);
268 DrawTest(hdc, 720, Test10, DT_HIDEPREFIX, USERLPK);
269 DrawTest(hdc, 740, Test10, DT_PREFIXONLY, USERLPK);
270
271 TextOutW(hdc, 500, 760, L"UserLpkPSMTextOut", 17);
272
273 EndPaint(hWnd, &ps);
274 break;
275 }
276
277 case WM_DESTROY:
278 {
280 return 0;
281 }
282 }
284}
static HFONT hfont
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
@ HET
Definition: kbdheb.c:77
@ NUN
Definition: kbdheb.c:86
@ YUD
Definition: kbdheb.c:79
@ VAV
Definition: kbdheb.c:75
@ TSADI
Definition: kbdheb.c:92
@ ZAYIN
Definition: kbdheb.c:76
@ MEM
Definition: kbdheb.c:84
@ LAMED
Definition: kbdheb.c:82
@ DALET
Definition: kbdheb.c:73
@ TET
Definition: kbdheb.c:78
@ BET
Definition: kbdheb.c:71
@ TAV
Definition: kbdheb.c:96
@ TSADI_SOFIT
Definition: kbdheb.c:91
@ SHIN
Definition: kbdheb.c:95
@ MEM_SOFIT
Definition: kbdheb.c:83
@ AYIN
Definition: kbdheb.c:88
@ PEY
Definition: kbdheb.c:90
@ PEY_SOFIT
Definition: kbdheb.c:89
@ HEY
Definition: kbdheb.c:74
@ KAF_SOFIT
Definition: kbdheb.c:80
@ QOF
Definition: kbdheb.c:93
@ ALEF
Definition: kbdheb.c:70
@ SAMEKH
Definition: kbdheb.c:87
@ RESH
Definition: kbdheb.c:94
@ KAF
Definition: kbdheb.c:81
@ GIMEL
Definition: kbdheb.c:72
@ NUN_SOFIT
Definition: kbdheb.c:85
void Test2(void)
Definition: terminate.cpp:76
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: mk_font.cpp:20
static void DrawTest(HDC hdc, int ypos, LPCWSTR str, DWORD dwFlags, int testtype)
Definition: psmtest.c:28
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
POINT ptMinTrackSize
Definition: winuser.h:3630
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
VOID Test3(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:266
#define ZeroMemory
Definition: winbase.h:1712
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:838
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
Definition: text.c:883
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define TRANSPARENT
Definition: wingdi.h:950
#define TA_RTLREADING
Definition: wingdi.h:934
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define WM_PAINT
Definition: winuser.h:1620
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_RTLREADING
Definition: winuser.h:539
#define WM_GETMINMAXINFO
Definition: winuser.h:1640
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define WM_DESTROY
Definition: winuser.h:1609
#define DT_EXPANDTABS
Definition: winuser.h:532
#define DT_CALCRECT
Definition: winuser.h:526
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by wWinMain().

◆ UserLpkPSMTextOut()

INT WINAPI UserLpkPSMTextOut ( HDC  hdc,
int  x,
int  y,
LPCWSTR  lpString,
int  cString,
DWORD  dwFlags 
)

Definition at line 413 of file font.c.

414{
415 SIZE size;
417 int len, i = 0, j = 0;
418 int prefix_count = 0, prefix_offset = -1;
419 LPWSTR display_str = NULL;
420 int prefix_x, prefix_end;
421 HPEN hpen;
422 HPEN oldPen;
423
424 if (!lpString || cString <= 0)
425 return 0;
426
427 if (dwFlags & DT_NOPREFIX) /* Windows ignores this */
428 {
429 TextOutW(hdc, x, y, lpString, cString);
430 GetTextExtentPointW(hdc, lpString, cString, &size);
431 return size.cx;
432 }
433
434 display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
435
436 if (!display_str)
437 return 0;
438
439 while (i < cString)
440 {
441 if (lpString[i] == PREFIX || (iswspace(lpString[i]) && lpString[i] != L' '))
442 {
443 if (i < cString - 1 && lpString[i + 1] == PREFIX)
444 display_str[j++] = lpString[i++];
445 else
446 i++;
447 }
448 else
449 {
450 display_str[j++] = lpString[i++];
451 }
452 }
453
454 display_str[j] = L'\0';
455 len = wcslen(display_str);
456
457 if (!(dwFlags & DT_PREFIXONLY))
458 TextOutW(hdc, x, y, display_str, len);
459
460 if (!(dwFlags & DT_HIDEPREFIX))
461 {
462
463 for (i = 0; i < cString - 1; i++)
464 {
465 if (lpString[i] == PREFIX && lpString[i + 1] != PREFIX)
466 {
467 prefix_offset = i - prefix_count;
468 prefix_count++;
469 }
470 else if (lpString[i] == PREFIX && lpString[i + 1] == PREFIX)
471 {
472 i++;
473 }
474 }
475
477
478 if (prefix_offset != -1)
479 {
480 GetTextExtentPointW(hdc, display_str, prefix_offset, &size);
481 prefix_x = x + size.cx;
482 GetTextExtentPointW(hdc, display_str, prefix_offset + 1, &size);
483 prefix_end = x + size.cx - 1;
485 oldPen = SelectObject(hdc, hpen);
486 MoveToEx(hdc, prefix_x, y + tm.tmAscent + 1, NULL);
487 LineTo(hdc, prefix_end, y + tm.tmAscent + 1);
488 SelectObject(hdc, oldPen);
490 }
491 }
492
493 GetTextExtentPointW(hdc, display_str, len + 1, &size);
494 HeapFree(GetProcessHeap(), 0, display_str);
495
496 return size.cx;
497}
static HPEN hpen
pKey DeleteObject()
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
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 GLint GLint j
Definition: glfuncs.h:250
#define iswspace(_c)
Definition: ctype.h:669
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PREFIX
Definition: font.c:409
COLORREF WINAPI GetTextColor(_In_ HDC)
Definition: text.c:861
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586

Referenced by DrawTest().

◆ wWinMain()

int WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPTSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 50 of file psmtest.c.

54{
56 HWND hWnd;
57 HACCEL hAccelerators;
58 MSG msg;
59 WNDCLASSEXW wc;
60
61 /* Class for our main window */
62 wc.cbSize = sizeof(wc);
63 wc.style = 0;
65 wc.cbClsExtra = 0;
66 wc.cbWndExtra = 0;
71 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
74
75 /* Initialise common controls */
76 icc.dwSize = sizeof(icc);
79
80 /* Register our main window class, or error */
81 if (!RegisterClassExW(&wc))
82 {
83 MessageBoxW(NULL, L"Error registering main window class.", L"Error", MB_ICONERROR | MB_OK);
84 return 0;
85 }
86
89
90 /* Create our main window, or error */
91 if (!hWnd)
92 {
93 MessageBoxW(NULL, L"Error creating main window.", L"Error", MB_ICONERROR | MB_OK);
94 return 0;
95 }
96
97 /* Load accelerators */
99
100 /* Show main window and force a paint */
101 ShowWindow(hWnd, nCmdShow | SW_MAXIMIZE);
103
104 /* Main message loop */
105 while (GetMessageW(&msg, NULL, 0, 0) > 0)
106 {
107 if (!TranslateAcceleratorW(hWnd, hAccelerators, &msg))
108 {
111 }
112 }
113
114 return (int)msg.wParam;
115}
HINSTANCE hInstance
Definition: charmap.c:19
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
static HICON
Definition: imagelist.c:84
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: psmtest.c:118
static LPCWSTR MainWndClass
Definition: psmtest.c:24
#define IDR_ACCELERATOR
Definition: psmtest.c:16
#define IDI_APPICON
Definition: psmtest.c:15
LPCWSTR lpszClassName
Definition: winuser.h:3226
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HCURSOR hCursor
Definition: winuser.h:3223
HICON hIconSm
Definition: winuser.h:3227
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
int cbClsExtra
Definition: winuser.h:3219
HICON hIcon
Definition: winuser.h:3222
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
HICON HCURSOR
Definition: windef.h:299
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2234
#define IDC_ARROW
Definition: winuser.h:687
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:787
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)
BOOL WINAPI UpdateWindow(_In_ HWND)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define LR_SHARED
Definition: winuser.h:1100
#define MB_OK
Definition: winuser.h:790
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define LoadImage
Definition: winuser.h:5824
#define IMAGE_CURSOR
Definition: winuser.h:213
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SW_MAXIMIZE
Definition: winuser.h:772
#define COLOR_BTNFACE
Definition: winuser.h:928

Variable Documentation

◆ MainWndClass

LPCWSTR MainWndClass = L"PSM Test"
static

Definition at line 24 of file psmtest.c.

Referenced by wWinMain().