ReactOS 0.4.16-dev-197-g92996da
registry.c File Reference
#include <windows.h>
#include <shlobj.h>
#include <richedit.h>
#include "wordpad.h"
Include dependency graph for registry.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define WIN32_LEAN_AND_MEAN
 

Functions

static LRESULT registry_get_handle (HKEY *hKey, LPDWORD action, LPCWSTR subKey)
 
void registry_set_options (HWND hMainWnd)
 
void registry_read_winrect (RECT *rc)
 
void registry_read_maximized (DWORD *bMaximized)
 
static void truncate_path (LPWSTR file, LPWSTR out, LPWSTR pos1, LPWSTR pos2)
 
static void format_filelist_filename (LPWSTR file, LPWSTR out)
 
void registry_read_filelist (HWND hMainWnd)
 
void registry_set_filelist (LPCWSTR newFile, HWND hMainWnd)
 
int reg_formatindex (WPARAM format)
 
void registry_read_options (void)
 
static void registry_read_formatopts (int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
 
void registry_read_formatopts_all (DWORD barState[], DWORD wordWrap[])
 
static void registry_set_formatopts (int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
 
void registry_set_formatopts_all (DWORD barState[], DWORD wordWrap[])
 

Variables

static const WCHAR key_recentfiles []
 
static const WCHAR key_options [] = {'O','p','t','i','o','n','s',0}
 
static const WCHAR key_settings [] = {'S','e','t','t','i','n','g','s',0}
 
static const WCHAR key_rtf [] = {'R','T','F',0}
 
static const WCHAR key_text [] = {'T','e','x','t',0}
 
static const WCHAR var_file [] = {'F','i','l','e','%','d',0}
 
static const WCHAR var_framerect [] = {'F','r','a','m','e','R','e','c','t',0}
 
static const WCHAR var_barstate0 [] = {'B','a','r','S','t','a','t','e','0',0}
 
static const WCHAR var_wrap [] = {'W','r','a','p',0}
 
static const WCHAR var_maximized [] = {'M','a','x','i','m','i','z','e','d',0}
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 22 of file registry.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 21 of file registry.c.

Function Documentation

◆ format_filelist_filename()

static void format_filelist_filename ( LPWSTR  file,
LPWSTR  out 
)
static

Definition at line 150 of file registry.c.

151{
152 LPWSTR pos_basename;
153 LPWSTR truncpos1, truncpos2;
154 WCHAR myDocs[MAX_PATH];
155
157 pos_basename = file_basename(file);
158 truncpos1 = NULL;
159 truncpos2 = NULL;
160
161 *(pos_basename-1) = 0;
162 if(!lstrcmpiW(file, myDocs) || (lstrlenW(pos_basename) > FILELIST_ENTRY_LENGTH))
163 {
164 truncpos1 = pos_basename;
165 *(pos_basename-1) = '\\';
166 } else
167 {
168 LPWSTR pos;
169 BOOL morespace = FALSE;
170
171 *(pos_basename-1) = '\\';
172
173 for(pos = file; pos < pos_basename; pos++)
174 {
175 if(*pos == '\\' || *pos == '/')
176 {
177 if(truncpos1)
178 {
179 if((pos - file + lstrlenW(pos_basename)) > FILELIST_ENTRY_LENGTH)
180 break;
181
182 truncpos1 = pos;
183 morespace = TRUE;
184 break;
185 }
186
187 if((pos - file + lstrlenW(pos_basename)) > FILELIST_ENTRY_LENGTH)
188 break;
189
190 truncpos1 = pos;
191 }
192 }
193
194 if(morespace)
195 {
196 for(pos = pos_basename; pos >= truncpos1; pos--)
197 {
198 if(*pos == '\\' || *pos == '/')
199 {
200 if((truncpos1 - file + lstrlenW(pos_basename) + pos_basename - pos) > FILELIST_ENTRY_LENGTH)
201 break;
202
203 truncpos2 = pos;
204 }
205 }
206 }
207 }
208
209 if(truncpos1 == pos_basename)
210 lstrcatW(out, pos_basename);
211 else if(truncpos1 == truncpos2 || !truncpos2)
212 lstrcatW(out, file);
213 else
214 truncate_path(file, out, truncpos1, truncpos2);
215}
static void truncate_path(LPWSTR file, LPWSTR out, LPWSTR pos1, LPWSTR pos2)
Definition: registry.c:139
LPWSTR file_basename(LPWSTR path)
Definition: wordpad.c:212
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
unsigned int BOOL
Definition: ntddk_ex.h:94
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static FILE * out
Definition: regtests2xml.c:44
@ SHGFP_TYPE_CURRENT
Definition: shlobj.h:2149
#define CSIDL_PERSONAL
Definition: shlobj.h:2178
Definition: fci.c:127
#define FILELIST_ENTRY_LENGTH
Definition: wordpad.h:92
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by registry_read_filelist().

◆ reg_formatindex()

int reg_formatindex ( WPARAM  format)

◆ registry_get_handle()

static LRESULT registry_get_handle ( HKEY hKey,
LPDWORD  action,
LPCWSTR  subKey 
)
static

Definition at line 42 of file registry.c.

43{
44 LONG ret;
45 static const WCHAR wszProgramKey[] = {'S','o','f','t','w','a','r','e','\\',
46 'M','i','c','r','o','s','o','f','t','\\',
47 'W','i','n','d','o','w','s','\\',
48 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
49 'A','p','p','l','e','t','s','\\',
50 'W','o','r','d','p','a','d',0};
51 LPWSTR key = (LPWSTR)wszProgramKey;
52
53 if(subKey)
54 {
55 WCHAR backslash[] = {'\\',0};
57 (lstrlenW(wszProgramKey)+lstrlenW(subKey)+lstrlenW(backslash)+1)
58 *sizeof(WCHAR));
59
60 if(!key)
61 return 1;
62
63 lstrcpyW(key, wszProgramKey);
64 lstrcatW(key, backslash);
65 lstrcatW(key, subKey);
66 }
67
68 if(action)
69 {
72 } else
73 {
75 }
76
77 if(subKey)
79
80 return ret;
81}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define lstrcpyW
Definition: compat.h:749
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
const WCHAR * action
Definition: action.c:7509
FxAutoRegKey hKey
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
long LONG
Definition: pedump.c:60
Definition: copy.c:22
int ret
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by registry_read_filelist(), registry_read_formatopts(), registry_read_maximized(), registry_read_options(), registry_read_winrect(), registry_set_filelist(), registry_set_formatopts(), and registry_set_options().

◆ registry_read_filelist()

void registry_read_filelist ( HWND  hMainWnd)

Definition at line 217 of file registry.c.

218{
219 HKEY hFileKey;
220
222 {
223 WCHAR itemText[MAX_PATH+3], buffer[MAX_PATH];
224 /* The menu item name is not the same as the file name, so we need to store
225 the file name here */
226 static WCHAR file1[MAX_PATH], file2[MAX_PATH], file3[MAX_PATH], file4[MAX_PATH];
227 WCHAR numFormat[] = {'&','%','d',' ',0};
228 LPWSTR pFile[] = {file1, file2, file3, file4};
229 DWORD pathSize = MAX_PATH*sizeof(WCHAR);
230 int i;
231 WCHAR key[6];
233 HMENU hMenu = GetMenu(hMainWnd);
234
235 mi.cbSize = sizeof(MENUITEMINFOW);
237 mi.fType = MFT_STRING;
238 mi.dwTypeData = itemText;
239 mi.wID = ID_FILE_RECENT1;
240
242 for(i = 0; i < FILELIST_ENTRIES; i++)
243 {
244 wsprintfW(key, var_file, i+1);
246 if(RegQueryValueExW(hFileKey, (LPWSTR)key, 0, NULL, (LPBYTE)pFile[i], &pathSize)
247 != ERROR_SUCCESS)
248 break;
249
250 mi.dwItemData = (ULONG_PTR)pFile[i];
251 wsprintfW(itemText, numFormat, i+1);
252
254
256
258 mi.wID++;
259 pathSize = MAX_PATH*sizeof(WCHAR);
260 }
261 mi.fType = MFT_SEPARATOR;
262 mi.fMask = MIIM_FTYPE | MIIM_ID;
264
265 RegCloseKey(hFileKey);
266 }
267}
#define ID_FILE_EXIT
Definition: resource.h:46
static const WCHAR var_file[]
Definition: registry.c:36
static const WCHAR key_recentfiles[]
Definition: registry.c:29
static void format_filelist_filename(LPWSTR file, LPWSTR out)
Definition: registry.c:150
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define ULONG_PTR
Definition: config.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
MdFileObject pFile
GLuint buffer
Definition: glext.h:5915
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
HWND hMainWnd
Definition: magnifier.c:32
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
DWORD cbSize
Definition: winuser.h:3787
unsigned char * LPBYTE
Definition: typedefs.h:53
static MONITORINFO mi
Definition: win.c:7338
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MIIM_STRING
Definition: winuser.h:730
#define MIIM_ID
Definition: winuser.h:725
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define MIIM_FTYPE
Definition: winuser.h:732
#define MFT_SEPARATOR
Definition: winuser.h:747
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MFT_STRING
Definition: winuser.h:749
#define MIIM_DATA
Definition: winuser.h:729
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
struct tagMENUITEMINFOW MENUITEMINFOW
#define FILELIST_ENTRIES
Definition: wordpad.h:91
#define ID_FILE_RECENT1
Definition: wordpad.h:33
#define ID_FILE_RECENT_SEPARATOR
Definition: wordpad.h:37

Referenced by OnCreate(), preview_exit(), and registry_set_filelist().

◆ registry_read_formatopts()

static void registry_read_formatopts ( int  index,
LPCWSTR  key,
DWORD  barState[],
DWORD  wordWrap[] 
)
static

Definition at line 355 of file registry.c.

356{
357 HKEY hKey;
358 DWORD action = 0;
359 BOOL fetched = FALSE;
360 barState[index] = 0;
361 wordWrap[index] = 0;
362
364 return;
365
367 {
368 DWORD size = sizeof(DWORD);
369
371 &size) == ERROR_SUCCESS)
372 fetched = TRUE;
373 }
374
375 if(!fetched)
376 barState[index] = (1 << BANDID_TOOLBAR) | (1 << BANDID_FORMATBAR) | (1 << BANDID_RULER) | (1 << BANDID_STATUSBAR);
377
378 fetched = FALSE;
380 {
381 DWORD size = sizeof(DWORD);
383 &size) == ERROR_SUCCESS)
384 fetched = TRUE;
385 }
386
387 if (!fetched)
388 {
391 else if(index == reg_formatindex(SF_TEXT))
393 }
394
396}
#define index(s, c)
Definition: various.h:29
int reg_formatindex(WPARAM format)
Definition: registry.c:330
static const WCHAR var_wrap[]
Definition: registry.c:39
static const WCHAR var_barstate0[]
Definition: registry.c:38
static DWORD wordWrap[2]
Definition: wordpad.c:67
static DWORD barState[2]
Definition: wordpad.c:68
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
#define DWORD
Definition: nt_native.h:44
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
#define SF_RTF
Definition: richedit.h:721
#define ID_WORDWRAP_NONE
Definition: wordpad.h:110
#define BANDID_FORMATBAR
Definition: wordpad.h:95
#define BANDID_STATUSBAR
Definition: wordpad.h:97
#define BANDID_TOOLBAR
Definition: wordpad.h:94
#define ID_WORDWRAP_WINDOW
Definition: wordpad.h:111
#define BANDID_RULER
Definition: wordpad.h:96

Referenced by registry_read_formatopts_all().

◆ registry_read_formatopts_all()

void registry_read_formatopts_all ( DWORD  barState[],
DWORD  wordWrap[] 
)

Definition at line 398 of file registry.c.

399{
402}
static const WCHAR key_text[]
Definition: registry.c:34
static void registry_read_formatopts(int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
Definition: registry.c:355
static const WCHAR key_rtf[]
Definition: registry.c:33

Referenced by OnCreate().

◆ registry_read_maximized()

void registry_read_maximized ( DWORD bMaximized)

Definition at line 124 of file registry.c.

125{
126 HKEY hKey = 0;
127 DWORD size = sizeof(DWORD);
128
130 RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) !=
131 ERROR_SUCCESS || size != sizeof(DWORD))
132 {
133 *bMaximized = FALSE;
134 }
135
137}
static const WCHAR var_maximized[]
Definition: registry.c:40
static const WCHAR key_options[]
Definition: registry.c:31

Referenced by WinMain().

◆ registry_read_options()

void registry_read_options ( void  )

Definition at line 335 of file registry.c.

336{
337 HKEY hKey;
338
341 else
342 {
345 }
346
349 } else {
352 }
353}
void registry_read_previewpages(HKEY hKey)
Definition: print.c:105
void registry_read_pagemargins(HKEY hKey)
Definition: print.c:90
static const WCHAR key_settings[]
Definition: registry.c:32

Referenced by OnCreate().

◆ registry_read_winrect()

void registry_read_winrect ( RECT rc)

Definition at line 111 of file registry.c.

112{
113 HKEY hKey = 0;
114 DWORD size = sizeof(RECT);
115
118 ERROR_SUCCESS || size != sizeof(RECT))
119 SetRect(rc, 0, 0, 600, 300);
120
122}
static const WCHAR var_framerect[]
Definition: registry.c:37
#define RECT
Definition: precomp.h:26
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by WinMain().

◆ registry_set_filelist()

void registry_set_filelist ( LPCWSTR  newFile,
HWND  hMainWnd 
)

Definition at line 269 of file registry.c.

270{
271 HKEY hKey;
273
275 {
277 int i;
278 HMENU hMenu = GetMenu(hMainWnd);
280 WCHAR buffer[6];
281
282 mi.cbSize = sizeof(MENUITEMINFOW);
283 mi.fMask = MIIM_DATA;
284
285 for(i = 0; i < FILELIST_ENTRIES; i++)
286 pFiles[i] = NULL;
287
288 for(i = 0; GetMenuItemInfoW(hMenu, ID_FILE_RECENT1+i, FALSE, &mi); i++)
289 pFiles[i] = (LPWSTR)mi.dwItemData;
290
291 if(lstrcmpiW(newFile, pFiles[0]))
292 {
293 for(i = 0; i < FILELIST_ENTRIES && pFiles[i]; i++)
294 {
295 if(!lstrcmpiW(pFiles[i], newFile))
296 {
297 int j;
298 for(j = 0; j < i; j++)
299 {
300 pFiles[i-j] = pFiles[i-j-1];
301 }
302 pFiles[0] = NULL;
303 break;
304 }
305 }
306
307 if(!pFiles[0])
308 {
309 pFiles[0] = newFile;
310 } else
311 {
312 for(i = 0; i < FILELIST_ENTRIES-1; i++)
313 pFiles[FILELIST_ENTRIES-1-i] = pFiles[FILELIST_ENTRIES-2-i];
314
315 pFiles[0] = newFile;
316 }
317
318 for(i = 0; i < FILELIST_ENTRIES && pFiles[i]; i++)
319 {
321 RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],
322 (lstrlenW(pFiles[i])+1)*sizeof(WCHAR));
323 }
324 }
326 }
328}
void registry_read_filelist(HWND hMainWnd)
Definition: registry.c:217
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
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 REG_SZ
Definition: layer.c:22
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193

Referenced by DoOpenFile().

◆ registry_set_formatopts()

static void registry_set_formatopts ( int  index,
LPCWSTR  key,
DWORD  barState[],
DWORD  wordWrap[] 
)
static

Definition at line 404 of file registry.c.

405{
406 HKEY hKey;
407 DWORD action = 0;
408
410 {
412 sizeof(DWORD));
414 sizeof(DWORD));
416 }
417}
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by registry_set_formatopts_all().

◆ registry_set_formatopts_all()

void registry_set_formatopts_all ( DWORD  barState[],
DWORD  wordWrap[] 
)

Definition at line 419 of file registry.c.

420{
423}
static void registry_set_formatopts(int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
Definition: registry.c:404

Referenced by WndProc().

◆ registry_set_options()

void registry_set_options ( HWND  hMainWnd)

Definition at line 83 of file registry.c.

84{
85 HKEY hKey = 0;
87
89 {
91 DWORD isMaximized;
92
93 wp.length = sizeof(WINDOWPLACEMENT);
95 isMaximized = (wp.showCmd == SW_SHOWMAXIMIZED);
96
98 RegSetValueExW(hKey, var_maximized, 0, REG_DWORD, (LPBYTE)&isMaximized, sizeof(DWORD));
99
102 }
103
105 {
108 }
109}
void registry_set_previewpages(HKEY hKey)
Definition: print.c:99
void registry_set_pagemargins(HKEY hKey)
Definition: print.c:85
#define REG_BINARY
Definition: nt_native.h:1496
RECT rcNormalPosition
Definition: winuser.h:3298
#define SW_SHOWMAXIMIZED
Definition: winuser.h:776
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
struct _WINDOWPLACEMENT WINDOWPLACEMENT

Referenced by WndProc().

◆ truncate_path()

static void truncate_path ( LPWSTR  file,
LPWSTR  out,
LPWSTR  pos1,
LPWSTR  pos2 
)
static

Definition at line 139 of file registry.c.

140{
141 static const WCHAR dots[] = {'.','.','.',0};
142
143 *++pos1 = 0;
144
145 lstrcatW(out, file);
146 lstrcatW(out, dots);
147 lstrcatW(out, pos2);
148}

Referenced by format_filelist_filename().

Variable Documentation

◆ key_options

const WCHAR key_options[] = {'O','p','t','i','o','n','s',0}
static

◆ key_recentfiles

const WCHAR key_recentfiles[]
static
Initial value:
= {'R','e','c','e','n','t',' ','f','i','l','e',
' ','l','i','s','t',0}

Definition at line 29 of file registry.c.

Referenced by registry_read_filelist(), and registry_set_filelist().

◆ key_rtf

const WCHAR key_rtf[] = {'R','T','F',0}
static

Definition at line 33 of file registry.c.

Referenced by registry_read_formatopts_all(), and registry_set_formatopts_all().

◆ key_settings

const WCHAR key_settings[] = {'S','e','t','t','i','n','g','s',0}
static

Definition at line 32 of file registry.c.

Referenced by registry_read_options(), and registry_set_options().

◆ key_text

const WCHAR key_text[] = {'T','e','x','t',0}
static

Definition at line 34 of file registry.c.

Referenced by registry_read_formatopts_all(), and registry_set_formatopts_all().

◆ var_barstate0

const WCHAR var_barstate0[] = {'B','a','r','S','t','a','t','e','0',0}
static

Definition at line 38 of file registry.c.

Referenced by registry_read_formatopts(), and registry_set_formatopts().

◆ var_file

const WCHAR var_file[] = {'F','i','l','e','%','d',0}
static

Definition at line 36 of file registry.c.

Referenced by registry_read_filelist(), and registry_set_filelist().

◆ var_framerect

const WCHAR var_framerect[] = {'F','r','a','m','e','R','e','c','t',0}
static

Definition at line 37 of file registry.c.

Referenced by registry_read_winrect(), and registry_set_options().

◆ var_maximized

const WCHAR var_maximized[] = {'M','a','x','i','m','i','z','e','d',0}
static

Definition at line 40 of file registry.c.

Referenced by registry_read_maximized(), and registry_set_options().

◆ var_wrap

const WCHAR var_wrap[] = {'W','r','a','p',0}
static

Definition at line 39 of file registry.c.

Referenced by registry_read_formatopts(), and registry_set_formatopts().