ReactOS  0.4.15-dev-1054-gd029a62
wordpad.c
Go to the documentation of this file.
1 #include "precomp.h"
2 
5 
6 int WINAPI
7 _tWinMain(HINSTANCE hThisInstance,
8  HINSTANCE hPrevInstance,
9  LPTSTR lpCmdLine,
10  int nCmdShow)
11 {
12  LPTSTR lpAppName, lpVersion, lpTitle;
13  HWND hMainWnd;
14  MSG Msg;
15  BOOL bRet;
16  int Ret = 1;
17  size_t len;
19 
20  hInstance = hThisInstance;
22 
23  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
25  InitCommonControlsEx(&icex);
26 
27  if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME) ||
29  {
31  _T("Error loading resource "),
32  NULL,
33  0);
34  return 1;
35  }
36 
37  len = _tcslen(lpAppName) + _tcslen(lpVersion);
39  0,
40  (len + 2) * sizeof(TCHAR));
41 
43  _T("%s %s"),
44  lpAppName,
45  lpVersion);
46 
47  if (InitMainWindowImpl())
48  {
49  if (InitEditWindowImpl())
50  {
52  nCmdShow);
53  if (hMainWnd != NULL)
54  {
55  /* pump the message queue */
56  while((bRet = GetMessage(&Msg,
57  NULL,
58  0,
59  0) != 0))
60  {
61  if (bRet != (BOOL)-1)
62  {
64  &Msg))
65  {
68  }
69  }
70  }
71 
72  Ret = 0;
73  }
74 
76  }
77 
79  }
80 
81  LocalFree((HLOCAL)lpAppName);
82 
83  return Ret;
84 }
VOID UninitEditWindowImpl(VOID)
Definition: editwnd.c:198
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL InitEditWindowImpl(VOID)
Definition: editwnd.c:173
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
struct @1607 Msg[]
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
BOOL MainWndTranslateMDISysAccel(HWND hwnd, LPMSG lpMsg)
Definition: mainwnd.c:1407
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define IDS_VERSION
Definition: resource.h:291
#define _T(x)
Definition: vfdio.h:22
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WINAPI
Definition: msvc.h:6
HINSTANCE hInstance
Definition: wordpad.c:3
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:992
static HWND hMainWnd
Definition: wordpad.c:60
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
GLenum GLsizei len
Definition: glext.h:6722
#define MessageBox
Definition: winuser.h:5797
HANDLE ProcessHeap
Definition: wordpad.c:4
int WINAPI _tWinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
Definition: wordpad.c:7
#define IDS_APPNAME
Definition: resource.h:49
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define GetMessage
Definition: winuser.h:5765
TCHAR lpTitle[80]
Definition: ctm.c:69
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:966
#define wsprintf
Definition: winuser.h:5840
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition: mainwnd.c:925