ReactOS 0.4.16-dev-237-gd6eebaa
biditext.c File Reference
#include "biditext.h"
Include dependency graph for biditext.c:

Go to the source code of this file.

Functions

DWORD WINAPI LpkGetCharacterPlacement (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, GCP_RESULTSW *lpResults, DWORD dwFlags, DWORD dwUnused)
 
BOOL WINAPI LpkExtTextOut (HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
 
int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
 
INT_PTR CALLBACK AboutDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void ShowAboutDialog (HWND owner)
 
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL RegisterMainWindowClass ()
 
HWND CreateMainWindow ()
 

Variables

HINSTANCE g_hInstance = NULL
 
static LPCTSTR MainWndClass = TEXT("BiDi Test")
 

Function Documentation

◆ AboutDialogProc()

INT_PTR CALLBACK AboutDialogProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 80 of file biditext.c.

81{
82 switch (uMsg)
83 {
84 case WM_COMMAND:
85 {
86 WORD id = LOWORD(wParam);
87
88 switch (id)
89 {
90 case IDOK:
91 case IDCANCEL:
92 {
93 EndDialog(hwndDlg, (INT_PTR)id);
94 return (INT_PTR)TRUE;
95 }
96 }
97 break;
98 }
99
100 case WM_INITDIALOG:
101 {
102 return (INT_PTR)TRUE;
103 }
104 }
105
106 return (INT_PTR)FALSE;
107}
WPARAM wParam
Definition: combotst.c:138
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned short WORD
Definition: ntddk_ex.h:93
#define LOWORD(l)
Definition: pedump.c:82
int32_t INT_PTR
Definition: typedefs.h:64
#define IDCANCEL
Definition: winuser.h:834
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
#define IDOK
Definition: winuser.h:833
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by ShowAboutDialog().

◆ CreateMainWindow()

HWND CreateMainWindow ( void  )

Definition at line 330 of file biditext.c.

331{
332 /* Create instance of main window */
335
336 if (hWnd)
337 {
338 /* Add "about" to the system menu */
339 HMENU hSysMenu = GetSystemMenu(hWnd, FALSE);
340 InsertMenu(hSysMenu, 5, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
341 InsertMenu(hSysMenu, 6, MF_BYPOSITION, ID_HELP_ABOUT, TEXT("About"));
342 }
343
344 return hWnd;
345}
HWND hWnd
Definition: settings.c:17
#define ID_HELP_ABOUT
Definition: resource.h:61
HINSTANCE g_hInstance
Definition: biditext.c:23
static LPCTSTR MainWndClass
Definition: biditext.c:116
#define NULL
Definition: types.h:112
#define TEXT(s)
Definition: k32.h:26
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define CreateWindowEx
Definition: winuser.h:5767
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MF_SEPARATOR
Definition: winuser.h:137
#define MF_BYPOSITION
Definition: winuser.h:203
#define CW_USEDEFAULT
Definition: winuser.h:225
#define InsertMenu
Definition: winuser.h:5815

Referenced by _tWinMain(), and wWinMain().

◆ LpkExtTextOut()

BOOL WINAPI LpkExtTextOut ( HDC  hdc,
int  x,
int  y,
UINT  fuOptions,
const RECT lprc,
LPCWSTR  lpString,
UINT  uCount,
const INT lpDx,
INT  unknown 
)

Definition at line 193 of file lpk.c.

203{
205 LPWSTR reordered_str = NULL;
206 INT cGlyphs;
207 DWORD dwSICFlags = SIC_COMPLEX;
208 BOOL bResult, bReorder;
209
211
212 fuOptions |= ETO_IGNORELANGUAGE;
213
214 /* Check text direction */
216 fuOptions |= ETO_RTLREADING;
217
218 /* If text direction is RTL change flag to account neutral characters */
219 if (fuOptions & ETO_RTLREADING)
220 dwSICFlags |= SIC_NEUTRAL;
221
222 /* Check if the string requires complex script processing and not a "glyph indices" array */
223 if (ScriptIsComplex(lpString, uCount, dwSICFlags) == S_OK && !(fuOptions & ETO_GLYPH_INDEX))
224 {
225 /* reordered_str is used as fallback in case the glyphs array fails to generate,
226 BIDI_Reorder() doesn't attempt to write into reordered_str if memory allocation fails */
227 reordered_str = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WCHAR));
228
229 bReorder = BIDI_Reorder(hdc, lpString, uCount, GCP_REORDER,
230 (fuOptions & ETO_RTLREADING) ? WINE_GCPW_FORCE_RTL : WINE_GCPW_FORCE_LTR,
231 reordered_str, uCount, NULL, &glyphs, &cGlyphs);
232
233 /* Now display the reordered text if any of the arrays is valid and if BIDI_Reorder() succeeded */
234 if ((glyphs || reordered_str) && bReorder)
235 {
236 if (glyphs)
237 {
238 fuOptions |= ETO_GLYPH_INDEX;
239 uCount = cGlyphs;
240 }
241
242 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc,
243 glyphs ? (LPWSTR)glyphs : reordered_str, uCount, lpDx);
244 }
245 else
246 {
247 WARN("BIDI_Reorder failed, falling back to original string.\n");
248 bResult = ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
249 }
250
252 HeapFree(GetProcessHeap(), 0, reordered_str);
253
254 return bResult;
255 }
256
257 return ExtTextOutW(hdc, x, y, fuOptions, lprc, lpString, uCount, lpDx);
258}
#define WARN(fmt,...)
Definition: precomp.h:61
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag)
Definition: usp10.c:3074
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetLayout(_In_ HDC hdc)
Definition: coord.c:750
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define S_OK
Definition: intsafe.h:52
BOOL BIDI_Reorder(HDC hDC, LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags, LPWSTR lpOutString, INT uCountOut, UINT *lpOrder, WORD **lpGlyphs, INT *cGlyphs)
Definition: bidi.c:320
HDC hdc
Definition: main.c:9
static UINT UINT LPWORD glyphs
Definition: font.c:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define WINE_GCPW_FORCE_LTR
Definition: ros_lpk.h:88
#define WINE_GCPW_FORCE_RTL
Definition: ros_lpk.h:89
uint16_t * LPWORD
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define SIC_COMPLEX
Definition: usp10.h:56
#define SIC_NEUTRAL
Definition: usp10.h:58
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799
UINT WINAPI GetTextAlign(_In_ HDC)
Definition: text.c:838
#define LAYOUT_RTL
Definition: wingdi.h:1371
#define TA_RTLREADING
Definition: wingdi.h:934
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define GCP_REORDER
Definition: wingdi.h:843
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4469
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ LpkGetCharacterPlacement()

DWORD WINAPI LpkGetCharacterPlacement ( HDC  hdc,
LPCWSTR  lpString,
INT  uCount,
INT  nMaxExtent,
GCP_RESULTSW lpResults,
DWORD  dwFlags,
DWORD  dwUnused 
)

◆ MainWndProc()

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

Definition at line 119 of file biditext.c.

120{
121 switch (msg)
122 {
123 case WM_COMMAND:
124 {
125 WORD id = LOWORD(wParam);
126
127 switch (id)
128 {
129 case ID_HELP_ABOUT:
130 {
132 return 0;
133 }
134
135 case ID_FILE_EXIT:
136 {
138 return 0;
139 }
140 }
141 break;
142 }
143
144 case WM_GETMINMAXINFO:
145 {
146 /* Prevent our window from being sized too small */
147 MINMAXINFO *minMax = (MINMAXINFO*)lParam;
148 minMax->ptMinTrackSize.x = 220;
149 minMax->ptMinTrackSize.y = 110;
150
151 return 0;
152 }
153
154 /* Item from system menu has been invoked */
155 case WM_SYSCOMMAND:
156 {
157 WORD id = LOWORD(wParam);
158
159 switch (id)
160 {
161 /* Show "about" dialog on about system menu item */
162 case ID_HELP_ABOUT:
163 {
165 return 0;
166 }
167 }
168 break;
169 }
170
171 case WM_PAINT:
172 {
173 PAINTSTRUCT ps;
174
175 HDC hdc = BeginPaint(hWnd, &ps);
176
177 enum
178 {
179 ALEF = 0x5D0,
180 BET,
181 GIMEL,
182 DALET,
183 HEY,
184 VAV,
185 ZAYIN,
186 HET,
187 TET,
188 YUD
189 };
190
191 const WCHAR szString[] = {ALEF, BET, GIMEL, DALET, HEY, 'A', 'B', 'C', 'D', VAV, ZAYIN, HET, TET, YUD, 0};
192 const WCHAR szReversedString[] = {HEY, DALET, GIMEL, BET, ALEF, 'A', 'B', 'C', 'D', YUD, TET, HET, ZAYIN, VAV, 0};
193 int Len = lstrlenW(szString);
194 int i, xpos, tempLength;
195 WCHAR tempString[20] = { 0 };
196 WCHAR Glyphs[100] = { 0 };
197 WCHAR OutString[100] = { 0 };
198 INT lpCaretPos[100] = { 0 };
199 UINT lpOrder[100] = { 0 };
200 GCP_RESULTSW Results = { 0 };
201
202 Results.lStructSize = sizeof(Results);
203 Results.lpOutString = OutString;
204 Results.lpGlyphs = Glyphs;
205 Results.nGlyphs = 100;
206 Results.lpCaretPos = lpCaretPos;
207 Results.lpOrder = lpOrder;
208
210
211 TextOutW(hdc, 10, 10, L"Proper (string being used):", 27);
212 TextOutW(hdc, 200, 10, szString, 14);
213 TextOutW(hdc, 10, 30, L"Reversed (example):", 19);
214 TextOutW(hdc, 200, 30, szReversedString, 14);
215
216 TextOutW(hdc, 10, 50, L"String with NULL LpkETO call (not reversed):", 44);
217 LpkExtTextOut(hdc, 10, 70, 0, NULL, szString, Len, NULL, 0);
218
219 TextOutW(hdc, 10, 90, L"String with ETO_IGNORELANGUAGE LpkETO call (not reversed):", 58);
220 LpkExtTextOut(hdc, 10, 110, ETO_IGNORELANGUAGE, NULL, szString, Len, NULL, 0);
221
222 TextOutW(hdc, 10, 130, L"String with GCP_REORDER and ETO_GLYPH_INDEX LpkGCP call (not reversed):", 71);
223 LpkGetCharacterPlacement(hdc, szString, Len, 0, &Results, GCP_REORDER, 0);
224 LpkExtTextOut(hdc, 10, 150, ETO_GLYPH_INDEX, NULL, Glyphs, Results.nGlyphs, NULL, 0);
225 TextOutW(hdc, 10, 170, L"String with GCP_REORDER and ETO_IGNORELANGUAGE LpkGCP call (not reversed, lpOutString):", 87);
226 ExtTextOutW(hdc, 10, 190, ETO_IGNORELANGUAGE, NULL, OutString, Results.nGlyphs, NULL);
227
228 TextOutW(hdc, 10, 210, L"String without GCP_REORDER and ETO_GLYPH_INDEX LpkGCP call (reversed):", 70);
229 LpkGetCharacterPlacement(hdc, szString, Len, 0, &Results, 0, 0);
230 LpkExtTextOut(hdc, 10, 230, ETO_GLYPH_INDEX, NULL, Glyphs, Results.nGlyphs, NULL, 0);
231 TextOutW(hdc, 10, 250, L"String without GCP_REORDER and ETO_IGNORELANGUAGE LpkGCP call (reversed, lpOutString):", 86);
232 ExtTextOutW(hdc, 10, 270, ETO_IGNORELANGUAGE, NULL, OutString, Len, NULL);
233
234 TextOutW(hdc, 10, 290, L"String with ETO_IGNORELANGUAGE ETO call (reversed, not Lpk direct call!):", 73);
235 ExtTextOutW(hdc, 10, 310, ETO_IGNORELANGUAGE, NULL, szString, Len, NULL);
236
237 TextOutW(hdc, 10, 330, L"String with ETO_RTLREADING LpkETO call (slight order change)", 60);
238 LpkExtTextOut(hdc, 10, 350, ETO_RTLREADING, NULL, szString, Len, NULL, 0);
239
240 TextOutW(hdc, 10, 370, L"String with ETO_RTLREADING ETO call (slight order change)", 57);
241 ExtTextOutW(hdc, 10, 390, ETO_RTLREADING, NULL, szString, Len, NULL);
242
243 GetCharacterPlacementW(hdc, szString, Len, 0, &Results, GCP_REORDER);
244 TextOutW(hdc, 10, 410, L"Glyph positions with GCP_REORDER flag", 37);
245
246 /* Prints per column the location of the character in the string, reordered location, its position and the character itself */
247 for (i = 0, xpos = 10; i < Len; i++, xpos += 30)
248 {
249 StringCchPrintfW(tempString, 20, L"%d", i);
250 tempLength = lstrlenW(tempString);
251 TextOutW(hdc, xpos, 430, tempString, tempLength);
252
253 StringCchPrintfW(tempString, 20, L"%d", lpOrder[i]);
254 tempLength = lstrlenW(tempString);
255 TextOutW(hdc, xpos, 450, tempString, tempLength);
256
257 StringCchPrintfW(tempString, 20, L"%d", lpCaretPos[i]);
258 tempLength = lstrlenW(tempString);
259 TextOutW(hdc, xpos, 470, tempString, tempLength);
260
261 TextOutW(hdc, xpos, 490, &szString[i], 1);
262 }
263 TextOutW(hdc, xpos, 430, L"Character location", 18);
264 TextOutW(hdc, xpos, 450, L"lpOrder[i]", 10);
265 TextOutW(hdc, xpos, 470, L"lpCaretPos[i]", 13);
266 TextOutW(hdc, xpos, 490, L"String[i]", 9);
267
268 GetCharacterPlacementW(hdc, szString, Len, 0, &Results, 0);
269 TextOutW(hdc, 10, 510, L"Glyph positions without GCP_REORDER flag", 40);
270
271 for (i = 0, xpos = 10; i < Len; i++, xpos += 30)
272 {
273 StringCchPrintfW(tempString, 20, L"%d", i);
274 tempLength = lstrlenW(tempString);
275 TextOutW(hdc, xpos, 530, tempString, tempLength);
276
277 StringCchPrintfW(tempString, 20, L"%d", lpOrder[i]);
278 tempLength = lstrlenW(tempString);
279 TextOutW(hdc, xpos, 550, tempString, tempLength);
280
281 StringCchPrintfW(tempString, 20, L"%d", lpCaretPos[i]);
282 tempLength = lstrlenW(tempString);
283 TextOutW(hdc, xpos, 570, tempString, tempLength);
284
285 TextOutW(hdc, xpos, 590, &szString[i], 1);
286 }
287 TextOutW(hdc, xpos, 530, L"Character location", 18);
288 TextOutW(hdc, xpos, 550, L"lpOrder[i]", 10);
289 TextOutW(hdc, xpos, 570, L"lpCaretPos[i]", 13);
290 TextOutW(hdc, xpos, 590, L"String[i]", 9);
291
292 EndPaint(hWnd, &ps);
293 break;
294 }
295
296 case WM_DESTROY:
297 {
299 return 0;
300 }
301 }
302
304}
#define msg(x)
Definition: auth_time.c:54
#define ID_FILE_EXIT
Definition: resource.h:46
void ShowAboutDialog(HWND owner)
Definition: biditext.c:110
LPARAM lParam
Definition: combotst.c:139
#define Len
Definition: deflate.h:82
#define lstrlenW
Definition: compat.h:750
LPKGCP LpkGetCharacterPlacement
Definition: utils.c:6
LPKETO LpkExtTextOut
Definition: utils.c:5
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
@ HET
Definition: kbdheb.c:77
@ YUD
Definition: kbdheb.c:79
@ VAV
Definition: kbdheb.c:75
@ ZAYIN
Definition: kbdheb.c:76
@ DALET
Definition: kbdheb.c:73
@ TET
Definition: kbdheb.c:78
@ BET
Definition: kbdheb.c:71
@ HEY
Definition: kbdheb.c:74
@ ALEF
Definition: kbdheb.c:70
@ GIMEL
Definition: kbdheb.c:72
static HDC
Definition: imagelist.c:88
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define DefWindowProc
Definition: ros2win.h:31
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
INT * lpCaretPos
Definition: wingdi.h:2435
LPWSTR lpOutString
Definition: wingdi.h:2432
UINT * lpOrder
Definition: wingdi.h:2433
LPWSTR lpGlyphs
Definition: wingdi.h:2437
DWORD lStructSize
Definition: wingdi.h:2431
POINT ptMinTrackSize
Definition: winuser.h:3633
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
DWORD WINAPI GetCharacterPlacementW(_In_ HDC hdc, _In_reads_(nCount) LPCWSTR lpString, _In_ int nCount, _In_ int nMexExtent, _Inout_ LPGCP_RESULTSW lpResults, _In_ DWORD dwFlags)
#define TRANSPARENT
Definition: wingdi.h:950
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define WM_PAINT
Definition: winuser.h:1623
#define WM_SYSCOMMAND
Definition: winuser.h:1744
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_GETMINMAXINFO
Definition: winuser.h:1643
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define WM_DESTROY
Definition: winuser.h:1612
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by RegisterMainWindowClass().

◆ RegisterMainWindowClass()

BOOL RegisterMainWindowClass ( void  )

Definition at line 307 of file biditext.c.

308{
309 WNDCLASSEX wc;
310
311 /* Class for our main window */
312 wc.cbSize = sizeof(wc);
313 wc.style = 0;
315 wc.cbClsExtra = 0;
316 wc.cbWndExtra = 0;
321 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
325
326 return (RegisterClassEx(&wc)) ? TRUE : FALSE;
327}
#define IDI_APPICON
Definition: resource.h:166
#define IDR_MAINMENU
Definition: resource.h:40
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: biditext.c:119
static HICON
Definition: imagelist.c:80
int cbClsExtra
Definition: winuser.h:3207
HINSTANCE hInstance
Definition: winuser.h:3209
HCURSOR hCursor
Definition: winuser.h:3211
LPCSTR lpszMenuName
Definition: winuser.h:3213
HICON hIconSm
Definition: winuser.h:3215
UINT style
Definition: winuser.h:3205
int cbWndExtra
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3204
WNDPROC lpfnWndProc
Definition: winuser.h:3206
LPCSTR lpszClassName
Definition: winuser.h:3214
HICON hIcon
Definition: winuser.h:3210
HBRUSH hbrBackground
Definition: winuser.h:3212
HICON HCURSOR
Definition: windef.h:299
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_ARROW
Definition: winuser.h:687
#define RegisterClassEx
Definition: winuser.h:5849
#define LR_SHARED
Definition: winuser.h:1103
#define LoadImage
Definition: winuser.h:5827
#define IMAGE_CURSOR
Definition: winuser.h:213
#define LR_DEFAULTCOLOR
Definition: winuser.h:1090
#define LR_DEFAULTSIZE
Definition: winuser.h:1097
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define COLOR_BTNFACE
Definition: winuser.h:931

Referenced by wWinMain().

◆ ShowAboutDialog()

void ShowAboutDialog ( HWND  owner)

Definition at line 110 of file biditext.c.

111{
113}
INT_PTR CALLBACK AboutDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: biditext.c:80
#define IDD_ABOUTDIALOG
Definition: biditext.h:29
#define DialogBox
Definition: winuser.h:5773

Referenced by MainWndProc().

◆ wWinMain()

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

Definition at line 27 of file biditext.c.

31{
33 HWND hWnd;
34 HACCEL hAccelerators;
35 MSG msg;
36
37 /* Assign global HINSTANCE */
39
40 /* Initialise common controls */
41 icc.dwSize = sizeof(icc);
44
45 /* Register our main window class, or error */
47 {
48 MessageBox(NULL, TEXT("Error registering main window class."), TEXT("Error"), MB_ICONERROR | MB_OK);
49 return 0;
50 }
51
52 /* Create our main window, or error */
53 if (!(hWnd = CreateMainWindow()))
54 {
55 MessageBox(NULL, TEXT("Error creating main window."), TEXT("Error"), MB_ICONERROR | MB_OK);
56 return 0;
57 }
58
59 /* Load accelerators */
61
62 /* Show main window and force a paint */
63 ShowWindow(hWnd, nCmdShow | SW_MAXIMIZE);
65
66 /* Main message loop */
67 while (GetMessage(&msg, NULL, 0, 0) > 0)
68 {
69 if (!TranslateAccelerator(hWnd, hAccelerators, &msg))
70 {
73 }
74 }
75
76 return (int)msg.wParam;
77}
BOOL RegisterMainWindowClass()
Definition: biditext.c:307
HWND CreateMainWindow()
Definition: biditext.c:330
HINSTANCE hInstance
Definition: charmap.c:19
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define IDR_ACCELERATOR
Definition: resource.h:103
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define MB_ICONERROR
Definition: winuser.h:790
#define GetMessage
Definition: winuser.h:5802
BOOL WINAPI UpdateWindow(_In_ HWND)
#define MB_OK
Definition: winuser.h:793
#define MessageBox
Definition: winuser.h:5834
#define DispatchMessage
Definition: winuser.h:5777
#define SW_MAXIMIZE
Definition: winuser.h:775
#define TranslateAccelerator
Definition: winuser.h:5872
#define LoadAccelerators
Definition: winuser.h:5822

Variable Documentation

◆ g_hInstance

◆ MainWndClass

LPCTSTR MainWndClass = TEXT("BiDi Test")
static

Definition at line 116 of file biditext.c.

Referenced by CreateMainWindow(), and RegisterMainWindowClass().