ReactOS  0.4.15-dev-1206-g731eddf
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  {
41  ret = UserLpkPSMTextOut(hdc, 400, ypos, str, lstrlenW(str), dwFlags);
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:609
int32_t INT
Definition: typedefs.h:58
const WCHAR * str
_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:426
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define USERLPK
Definition: psmtest.c:27
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
INT WINAPI UserLpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
Definition: font.c:413
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define LPK
Definition: psmtest.c:26
INT WINAPI LpkPSMTextOut(HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
Definition: lpk.c:389

Referenced by MainWndProc().

◆ LpkPSMTextOut()

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

Definition at line 389 of file lpk.c.

390 {
391  SIZE size;
392  TEXTMETRICW tm;
393  int prefix_offset, len;
394  LPWSTR display_str = NULL;
395 
396  if (!lpString || cString <= 0)
397  return 0;
398 
399  if (dwFlags & DT_NOPREFIX)
400  {
401  LpkExtTextOut(hdc, x, y, 0, NULL, lpString, cString, NULL, 0);
402  GetTextExtentPointW(hdc, lpString, cString, &size);
403  return size.cx;
404  }
405 
406  display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
407 
408  if (!display_str)
409  return 0;
410 
411  PSM_PrepareToDraw(lpString, cString, display_str, &len);
412 
413  if (!(dwFlags & DT_PREFIXONLY))
414  LpkExtTextOut(hdc, x, y, 0, NULL, display_str, len, NULL, 0);
415 
416  if (!(dwFlags & DT_HIDEPREFIX))
417  {
418  prefix_offset = PSM_FindLastPrefix(lpString, cString);
420  LPK_DrawUnderscore(hdc, x, y + tm.tmAscent + 1, display_str, len, prefix_offset);
421  }
422 
423  GetTextExtentPointW(hdc, display_str, len + 1, &size);
424  HeapFree(GetProcessHeap(), 0, display_str);
425 
426  return size.cx;
427 }
#define DT_HIDEPREFIX
Definition: winuser.h:547
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
smooth NULL
Definition: ftsmooth.c:416
static int PSM_FindLastPrefix(LPCWSTR str, int count)
Definition: lpk.c:22
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI LpkExtTextOut(HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
Definition: lpk.c:202
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
Definition: time.h:76
static void LPK_DrawUnderscore(HDC hdc, int x, int y, LPCWSTR str, int count, int offset)
Definition: lpk.c:66
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static void PSM_PrepareToDraw(LPCWSTR str, INT count, LPWSTR new_str, LPINT new_count)
Definition: lpk.c:41
#define HeapFree(x, y, z)
Definition: compat.h:594
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

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,
160  TSADI_SOFIT,
161  TSADI,
162  QOF,
163  RESH,
164  SHIN,
165  TAV
166  };
167 
168  LOGFONTW font;
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);
188  DrawTest(hdc, 20, Test, DT_NOPREFIX, LPK);
191  DrawTest(hdc, 80, Test2, 0, LPK);
192  DrawTest(hdc, 100, Test2, DT_CALCRECT, 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  {
279  PostQuitMessage(0);
280  return 0;
281  }
282  }
283  return DefWindowProcW(hWnd, msg, wParam, lParam);
284 }
POINT ptMinTrackSize
Definition: winuser.h:3605
#define DT_EXPANDTABS
Definition: winuser.h:532
#define DT_HIDEPREFIX
Definition: winuser.h:547
#define DT_RTLREADING
Definition: winuser.h:539
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
Definition: kbdheb.c:82
Definition: mk_font.cpp:20
Definition: kbdheb.c:70
Definition: kbdheb.c:77
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define ZeroMemory
Definition: winbase.h:1648
Definition: kbdheb.c:92
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
Definition: text.c:853
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
WPARAM wParam
Definition: combotst.c:138
Definition: kbdheb.c:76
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
VOID Test3(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:266
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:808
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1034
#define DT_CALCRECT
Definition: winuser.h:526
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define TRANSPARENT
Definition: wingdi.h:949
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
Definition: kbdheb.c:71
static HFONT hfont
Definition: kbdheb.c:74
#define WM_DESTROY
Definition: winuser.h:1591
Definition: kbdheb.c:79
Definition: kbdheb.c:96
Definition: kbdheb.c:93
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: kbdheb.c:78
Definition: kbdheb.c:86
Definition: kbdheb.c:94
Definition: kbdheb.c:75
#define WM_PAINT
Definition: winuser.h:1602
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
#define USERLPK
Definition: psmtest.c:27
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
Definition: kbdheb.c:81
#define DT_SINGLELINE
Definition: winuser.h:540
Definition: kbdheb.c:72
Definition: kbdheb.c:84
Definition: kbdheb.c:73
Definition: kbdheb.c:87
VOID Test2(PTEST Test, HANDLE hEvent)
Definition: tmrqueue.c:192
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
static void DrawTest(HDC hdc, int ypos, LPCWSTR str, DWORD dwFlags, int testtype)
Definition: psmtest.c:28
Definition: kbdheb.c:95
#define LPK
Definition: psmtest.c:26
#define TA_RTLREADING
Definition: wingdi.h:933
Definition: kbdheb.c:88
LPARAM lParam
Definition: combotst.c:139
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
Definition: kbdheb.c:90

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;
416  TEXTMETRICW tm;
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 }
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define DT_HIDEPREFIX
Definition: winuser.h:547
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
#define PREFIX
Definition: font.c:409
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static HPEN hpen
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define PS_SOLID
Definition: wingdi.h:585
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
COLORREF WINAPI GetTextColor(_In_ HDC)
Definition: text.c:831
smooth NULL
Definition: ftsmooth.c:416
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
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define iswspace(_c)
Definition: ctype.h:669
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
Definition: time.h:76
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
static const WORD INT INT LPINT LPINT LPSIZE size
Definition: font.c:53
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:594
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

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;
67  wc.hInstance = hInstance;
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 
88  NULL, NULL, hInstance, NULL);
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 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
int cbWndExtra
Definition: winuser.h:3195
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IMAGE_CURSOR
Definition: winuser.h:213
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
HICON hIcon
Definition: winuser.h:3197
HICON HCURSOR
Definition: windef.h:299
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDI_APPICON
Definition: psmtest.c:15
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
static LPCWSTR MainWndClass
Definition: psmtest.c:24
HINSTANCE hInstance
Definition: charmap.c:20
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
int cbClsExtra
Definition: winuser.h:3194
LPCWSTR lpszClassName
Definition: winuser.h:3201
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
HBRUSH hbrBackground
Definition: winuser.h:3199
UINT cbSize
Definition: winuser.h:3191
#define IDR_ACCELERATOR
Definition: psmtest.c:16
HINSTANCE hInstance
Definition: winuser.h:3196
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
static const WCHAR L[]
Definition: oid.c:1250
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 InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define COLOR_BTNFACE
Definition: winuser.h:918
#define MB_ICONERROR
Definition: winuser.h:781
HCURSOR hCursor
Definition: winuser.h:3198
UINT style
Definition: winuser.h:3192
WNDPROC lpfnWndProc
Definition: winuser.h:3193
#define MB_OK
Definition: winuser.h:784
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HICON hIconSm
Definition: winuser.h:3202
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define LoadImage
Definition: winuser.h:5790
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define SW_MAXIMIZE
Definition: winuser.h:766
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: psmtest.c:118

Variable Documentation

◆ MainWndClass

LPCWSTR MainWndClass = L"PSM Test"
static

Definition at line 24 of file psmtest.c.

Referenced by wWinMain().