ReactOS 0.4.15-dev-7907-g95bf896
editwnd.c File Reference
#include "precomp.h"
Include dependency graph for editwnd.c:

Go to the source code of this file.

Functions

static BOOL InitEditWnd (PEDIT_WND_INFO Info)
 
static LRESULT CALLBACK EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID SetEditorEnvironment (PEDIT_WND_INFO Info, BOOL Setup)
 
BOOL CreateEditWindow (struct _MAIN_WND_INFO *MainWnd, POPEN_EDIT_INFO OpenInfo)
 
BOOL InitEditWindowImpl (VOID)
 
VOID UninitEditWindowImpl (VOID)
 

Variables

static const TCHAR szEditWndClass [] = TEXT("WordPadEditWndClass")
 

Function Documentation

◆ CreateEditWindow()

BOOL CreateEditWindow ( struct _MAIN_WND_INFO MainWnd,
POPEN_EDIT_INFO  OpenInfo 
)

Definition at line 132 of file editwnd.c.

134{
136 HWND hWndEditor;
137
139 0,
140 sizeof(EDIT_WND_INFO));
141 if (Info != NULL)
142 {
144 sizeof(EDIT_WND_INFO));
145 Info->MainWnd = MainWnd;
146 Info->MdiEditorType = metImageEditor;
147 Info->OpenInfo = OpenInfo;
148
149 hWndEditor = CreateMDIWindow(szEditWndClass,
150 OpenInfo->lpDocumentName,
156 MainWnd->hMdiClient,
157 hInstance,
158 (LPARAM)Info);
159
160 if (hWndEditor != NULL)
161 return TRUE;
162
163
165 0,
166 Info);
167 }
168
169 return FALSE;
170}
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static const TCHAR szEditWndClass[]
Definition: editwnd.c:3
@ metImageEditor
Definition: precomp.h:34
#define WS_MAXIMIZE
Definition: pedump.c:623
HWND hMdiClient
Definition: precomp.h:43
LPTSTR lpDocumentName
Definition: precomp.h:52
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateMDIWindow
Definition: winuser.h:5753
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by MainWndCommand().

◆ EditWndProc()

static LRESULT CALLBACK EditWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 50 of file editwnd.c.

54{
56 LRESULT Ret = 0;
57
58 /* Get the window context */
61 if (Info == NULL && uMsg != WM_CREATE)
62 {
63 goto HandleDefaultMessage;
64 }
65
66 switch (uMsg)
67 {
68 case WM_CREATE:
69 {
71 Info->hSelf = hwnd;
72
75 (LONG_PTR)Info);
76
77 if (!InitEditWnd(Info))
78 {
79 Ret = (LRESULT)-1;
80 break;
81 }
82 break;
83 }
84
85 case WM_SIZE:
86 {
87 RECT rcClient;
88
89 if (GetClientRect(Info->hSelf,
90 &rcClient))
91 {
92 SetWindowPos(Info->hEdit,
93 NULL,
94 0,
95 0,
96 rcClient.right,
97 rcClient.bottom,
99 }
100 }
101
102 default:
103HandleDefaultMessage:
104 Ret = DefMDIChildProc(hwnd,
105 uMsg,
106 wParam,
107 lParam);
108 break;
109 }
110
111 return Ret;
112
113}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static BOOL InitEditWnd(PEDIT_WND_INFO Info)
Definition: editwnd.c:7
struct _EDIT_WND_INFO * PEDIT_WND_INFO
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LRESULT
Definition: ole.h:14
#define DefMDIChildProc
Definition: ros2win.h:33
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
CREATESTRUCTA * LPCREATESTRUCT
Definition: winuser.h:5726
#define WM_CREATE
Definition: winuser.h:1608
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1611
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by InitEditWindowImpl().

◆ InitEditWindowImpl()

BOOL InitEditWindowImpl ( VOID  )

Definition at line 173 of file editwnd.c.

174{
175 WNDCLASSEX wc = {0};
176
177 wc.cbSize = sizeof(WNDCLASSEX);
179 wc.hInstance = hInstance;
183 IDC_ARROW);
184 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
185 wc.lpszMenuName = NULL;
190 16,
191 16,
192 LR_SHARED);
193
194 return RegisterClassEx(&wc) != (ATOM)0;
195}
#define IDI_ICON
Definition: resource.h:5
WORD ATOM
Definition: dimm.idl:113
static LRESULT CALLBACK EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editwnd.c:50
static HICON
Definition: imagelist.c:84
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 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
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_ARROW
Definition: winuser.h:687
#define RegisterClassEx
Definition: winuser.h:5837
#define LoadIcon
Definition: winuser.h:5813
#define LoadCursor
Definition: winuser.h:5812
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define LR_SHARED
Definition: winuser.h:1100
#define LoadImage
Definition: winuser.h:5815
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define COLOR_BTNFACE
Definition: winuser.h:928

Referenced by _tWinMain().

◆ InitEditWnd()

static BOOL InitEditWnd ( PEDIT_WND_INFO  Info)
static

Definition at line 7 of file editwnd.c.

8{
9 HANDLE hDLL;
10 HFONT hfDefault;
11
12 hDLL = LoadLibrary(_T("RICHED20.DLL"));
13 if (hDLL == NULL)
14 {
15 GetError(0);
16 return FALSE;
17 }
18
19 Info->hEdit = CreateWindowEx(0, //WS_EX_CLIENTEDGE,
21 NULL,
24 0,
25 0,
26 100,
27 100,
28 Info->hSelf,
29 NULL,
31 NULL);
32 if(Info->hEdit == NULL)
33 {
34 GetError(0);
35
36 return FALSE;
37 }
38
40 SendMessage(Info->hEdit,
42 (WPARAM)hfDefault,
43 MAKELPARAM(FALSE, 0));
44
45 return TRUE;
46}
VOID GetError(VOID)
Definition: misc.c:192
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define WS_CHILD
Definition: pedump.c:617
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define WS_VSCROLL
Definition: pedump.c:627
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
#define ES_MULTILINE
Definition: pedump.c:667
#define RICHEDIT_CLASS
Definition: richedit.h:55
#define _T(x)
Definition: vfdio.h:22
#define LoadLibrary
Definition: winbase.h:3862
UINT_PTR WPARAM
Definition: windef.h:207
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define CreateWindowEx
Definition: winuser.h:5755
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
#define WM_SETFONT
Definition: winuser.h:1650
#define SendMessage
Definition: winuser.h:5843

Referenced by EditWndProc().

◆ SetEditorEnvironment()

VOID SetEditorEnvironment ( PEDIT_WND_INFO  Info,
BOOL  Setup 
)

Definition at line 117 of file editwnd.c.

119{
120 if (Setup)
121 {
122 /* FIXME - setup editor environment (e.g. show toolbars, enable menus etc) */
123 }
124 else
125 {
126 /* FIXME - cleanup editor environment (e.g. hide toolbars, disable menus etc) */
127 }
128}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:834

Referenced by MainWndSwitchEditorContext().

◆ UninitEditWindowImpl()

VOID UninitEditWindowImpl ( VOID  )

Definition at line 198 of file editwnd.c.

199{
201 hInstance);
202}
#define UnregisterClass
Definition: winuser.h:5861

Referenced by _tWinMain().

Variable Documentation

◆ szEditWndClass

const TCHAR szEditWndClass[] = TEXT("WordPadEditWndClass")
static

Definition at line 3 of file editwnd.c.

Referenced by CreateEditWindow(), InitEditWindowImpl(), and UninitEditWindowImpl().