ReactOS  0.4.11-dev-946-g431643b
wordpad.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_STRING_LEN   255
 
#define TWIPS_PER_INCH   1440
 
#define CENTMM_PER_INCH   2540
 
#define ID_FILE_EXIT   1000
 
#define ID_FILE_OPEN   1001
 
#define ID_FILE_SAVE   1002
 
#define ID_FILE_NEW   1003
 
#define ID_FILE_SAVEAS   1004
 
#define ID_FILE_RECENT1   1005
 
#define ID_FILE_RECENT2   1006
 
#define ID_FILE_RECENT3   1007
 
#define ID_FILE_RECENT4   1008
 
#define ID_FILE_RECENT_SEPARATOR   1009
 
#define ID_PRINT   1010
 
#define ID_PREVIEW   1011
 
#define ID_PRINTSETUP   1012
 
#define ID_PRINT_QUICK   1013
 
#define ID_FIND   1014
 
#define ID_FIND_NEXT   1015
 
#define ID_REPLACE   1016
 
#define ID_PREVIEW_NEXTPAGE   1017
 
#define ID_PREVIEW_PREVPAGE   1018
 
#define ID_PREVIEW_NUMPAGES   1019
 
#define ID_PREVIEW_ZOOMIN   1020
 
#define ID_PREVIEW_ZOOMOUT   1021
 
#define ID_ALIGN_LEFT   1100
 
#define ID_ALIGN_CENTER   1101
 
#define ID_ALIGN_RIGHT   1102
 
#define ID_BACK_1   1200
 
#define ID_BACK_2   1201
 
#define ID_EDIT_SELECTALL   1300
 
#define ID_EDIT_SELECTIONINFO   1301
 
#define ID_EDIT_READONLY   1302
 
#define ID_EDIT_MODIFIED   1303
 
#define ID_EDIT_CHARFORMAT   1304
 
#define ID_EDIT_PARAFORMAT   1305
 
#define ID_EDIT_DEFCHARFORMAT   1306
 
#define ID_EDIT_UNDO   1307
 
#define ID_EDIT_REDO   1308
 
#define ID_EDIT_GETTEXT   1309
 
#define ID_EDIT_COPY   1310
 
#define ID_EDIT_CUT   1311
 
#define ID_EDIT_PASTE   1312
 
#define ID_EDIT_CLEAR   1313
 
#define ID_BULLET   1314
 
#define ID_FONTSETTINGS   1315
 
#define ID_FORMAT_BOLD   1400
 
#define ID_FORMAT_ITALIC   1401
 
#define ID_FORMAT_UNDERLINE   1402
 
#define ID_FORMAT_COLOR   1403
 
#define ID_TOGGLE_TOOLBAR   1500
 
#define ID_TOGGLE_FORMATBAR   1501
 
#define ID_TOGGLE_STATUSBAR   1502
 
#define ID_TOGGLE_RULER   1503
 
#define PREVIEW_BUTTONS   7
 
#define FILELIST_ENTRIES   4
 
#define FILELIST_ENTRY_LENGTH   33
 
#define BANDID_TOOLBAR   2
 
#define BANDID_FORMATBAR   3
 
#define BANDID_RULER   0
 
#define BANDID_STATUSBAR   1
 
#define BANDID_FONTLIST   4
 
#define BANDID_SIZELIST   5
 
#define BANDID_PREVIEW_BTN1   6
 
#define BANDID_PREVIEW_BTN2   7
 
#define BANDID_PREVIEW_BTN3   8
 
#define BANDID_PREVIEW_BTN4   9
 
#define BANDID_PREVIEW_BTN5   10
 
#define BANDID_PREVIEW_BTN6   11
 
#define BANDID_PREVIEW_BTN7   12
 
#define BANDID_PREVIEW_BUFFER   13
 
#define ID_WORDWRAP_NONE   0
 
#define ID_WORDWRAP_WINDOW   1
 
#define ID_WORDWRAP_MARGIN   2
 
#define ID_NEWFILE_ABORT   100
 
#define ID_TAB_ADD   100
 
#define ID_TAB_DEL   101
 
#define ID_TAB_EMPTY   102
 
#define IDC_PAGEFMT_TB   100
 
#define IDC_PAGEFMT_FB   101
 
#define IDC_PAGEFMT_RU   102
 
#define IDC_PAGEFMT_SB   103
 
#define IDC_PAGEFMT_WN   104
 
#define IDC_PAGEFMT_WW   105
 
#define IDC_PAGEFMT_WM   106
 
#define IDC_PAGEFMT_ID   107
 
#define ID_DATETIME   1600
 
#define ID_PARAFORMAT   1601
 
#define ID_TABSTOPS   1602
 
#define ID_ABOUT   1603
 
#define ID_VIEWPROPERTIES   1604
 
#define ID_COLOR_FIRST   1800
 
#define ID_COLOR_BLACK   1800
 
#define ID_COLOR_MAROON   1801
 
#define ID_COLOR_GREEN   1802
 
#define ID_COLOR_OLIVE   1803
 
#define ID_COLOR_NAVY   1804
 
#define ID_COLOR_PURPLE   1805
 
#define ID_COLOR_TEAL   1806
 
#define ID_COLOR_GRAY   1807
 
#define ID_COLOR_SILVER   1808
 
#define ID_COLOR_RED   1809
 
#define ID_COLOR_LIME   1810
 
#define ID_COLOR_YELLOW   1811
 
#define ID_COLOR_BLUE   1812
 
#define ID_COLOR_FUCHSIA   1813
 
#define ID_COLOR_AQUA   1814
 
#define ID_COLOR_WHITE   1815
 
#define ID_COLOR_AUTOMATIC   1816
 
#define IDC_STATUSBAR   2000
 
#define IDC_EDITOR   2001
 
#define IDC_TOOLBAR   2002
 
#define IDC_FORMATBAR   2003
 
#define IDC_REBAR   2004
 
#define IDC_COMBO   2005
 
#define IDC_DATETIME   2006
 
#define IDC_NEWFILE   2007
 
#define IDC_PARA_LEFT   2008
 
#define IDC_PARA_RIGHT   2009
 
#define IDC_PARA_FIRST   2010
 
#define IDC_PARA_ALIGN   2011
 
#define IDC_TABSTOPS   2012
 
#define IDC_FONTLIST   2013
 
#define IDC_SIZELIST   2014
 
#define IDC_RULER   2015
 
#define IDC_PREVIEW   2016
 
#define IDD_DATETIME   2100
 
#define IDD_NEWFILE   2101
 
#define IDD_PARAFORMAT   2102
 
#define IDD_TABSTOPS   2103
 
#define IDD_FORMATOPTS   2104
 
#define IDM_MAINMENU   2200
 
#define IDM_POPUP   2201
 
#define IDM_COLOR_POPUP   2202
 
#define IDB_TOOLBAR   100
 
#define IDB_FORMATBAR   101
 
#define IDI_WORDPAD   102
 
#define IDC_ZOOM   103
 
#define STRING_ALL_FILES   1400
 
#define STRING_TEXT_FILES_TXT   1401
 
#define STRING_TEXT_FILES_UNICODE_TXT   1402
 
#define STRING_RICHTEXT_FILES_RTF   1403
 
#define STRING_NEWFILE_RICHTEXT   1404
 
#define STRING_NEWFILE_TXT   1405
 
#define STRING_NEWFILE_TXT_UNICODE   1406
 
#define STRING_PRINTER_FILES_PRN   1407
 
#define STRING_ALIGN_LEFT   1416
 
#define STRING_ALIGN_RIGHT   1417
 
#define STRING_ALIGN_CENTER   1418
 
#define STRING_VIEWPROPS_TITLE   1432
 
#define STRING_VIEWPROPS_TEXT   1433
 
#define STRING_VIEWPROPS_RICHTEXT   1434
 
#define STRING_PREVIEW_PRINT   1448
 
#define STRING_PREVIEW_NEXTPAGE   1449
 
#define STRING_PREVIEW_PREVPAGE   1450
 
#define STRING_PREVIEW_TWOPAGES   1451
 
#define STRING_PREVIEW_ONEPAGE   1452
 
#define STRING_PREVIEW_ZOOMIN   1453
 
#define STRING_PREVIEW_ZOOMOUT   1454
 
#define STRING_PREVIEW_CLOSE   1455
 
#define STRING_PREVIEW_PAGE   1456
 
#define STRING_PREVIEW_PAGES   1457
 
#define STRING_UNITS_CM   1458
 
#define STRING_UNITS_IN   1459
 
#define STRING_UNITS_INCH   1460
 
#define STRING_UNITS_PT   1461
 
#define STRING_DEFAULT_FILENAME   1700
 
#define STRING_PROMPT_SAVE_CHANGES   1701
 
#define STRING_SEARCH_FINISHED   1702
 
#define STRING_LOAD_RICHED_FAILED   1703
 
#define STRING_SAVE_LOSEFORMATTING   1704
 
#define STRING_INVALID_NUMBER   1705
 
#define STRING_OLE_STORAGE_NOT_SUPPORTED   1706
 
#define STRING_WRITE_FAILED   1707
 
#define STRING_WRITE_ACCESS_DENIED   1708
 
#define STRING_OPEN_FAILED   1709
 
#define STRING_OPEN_ACCESS_DENIED   1710
 
#define STRING_PRINTING_NOT_IMPLEMENTED   1711
 
#define STRING_MAX_TAB_STOPS   1712
 

Functions

LPWSTR file_basename (LPWSTR)
 
void dialog_printsetup (HWND)
 
void dialog_print (HWND, LPWSTR)
 
void target_device (HWND, DWORD)
 
void print_quick (HWND, LPWSTR)
 
LRESULT preview_command (HWND, WPARAM)
 
void init_preview (HWND, LPWSTR)
 
void close_preview (HWND)
 
BOOL preview_isactive (void)
 
void get_default_printer_opts (void)
 
void registry_set_pagemargins (HKEY)
 
void registry_read_pagemargins (HKEY)
 
void registry_set_previewpages (HKEY hKey)
 
void registry_read_previewpages (HKEY hKey)
 
LRESULT CALLBACK ruler_proc (HWND, UINT, WPARAM, LPARAM)
 
void redraw_ruler (HWND)
 
int reg_formatindex (WPARAM)
 
void registry_read_filelist (HWND)
 
void registry_read_options (void)
 
void registry_read_formatopts_all (DWORD[], DWORD[])
 
void registry_read_winrect (RECT *)
 
void registry_read_maximized (DWORD *)
 
void registry_set_filelist (LPCWSTR, HWND)
 
void registry_set_formatopts_all (DWORD[], DWORD[])
 
void registry_set_options (HWND)
 
HRESULT setup_richedit_olecallback (HWND hEditorWnd)
 

Macro Definition Documentation

◆ BANDID_FONTLIST

#define BANDID_FONTLIST   4

Definition at line 98 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), set_bar_states(), and set_toolbar_state().

◆ BANDID_FORMATBAR

#define BANDID_FORMATBAR   3

◆ BANDID_PREVIEW_BTN1

#define BANDID_PREVIEW_BTN1   6

Definition at line 101 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN2

#define BANDID_PREVIEW_BTN2   7

Definition at line 102 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN3

#define BANDID_PREVIEW_BTN3   8

Definition at line 103 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN4

#define BANDID_PREVIEW_BTN4   9

Definition at line 104 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN5

#define BANDID_PREVIEW_BTN5   10

Definition at line 105 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN6

#define BANDID_PREVIEW_BTN6   11

Definition at line 106 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BTN7

#define BANDID_PREVIEW_BTN7   12

Definition at line 107 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_PREVIEW_BUFFER

#define BANDID_PREVIEW_BUFFER   13

Definition at line 108 of file wordpad.h.

Referenced by preview_bar_show().

◆ BANDID_RULER

◆ BANDID_SIZELIST

#define BANDID_SIZELIST   5

Definition at line 99 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), and set_bar_states().

◆ BANDID_STATUSBAR

#define BANDID_STATUSBAR   1

◆ BANDID_TOOLBAR

◆ CENTMM_PER_INCH

#define CENTMM_PER_INCH   2540

Definition at line 25 of file wordpad.h.

Referenced by centmm_to_twips(), number_with_units(), twips_to_centmm(), and units_to_twips().

◆ FILELIST_ENTRIES

#define FILELIST_ENTRIES   4

Definition at line 91 of file wordpad.h.

Referenced by registry_read_filelist(), and registry_set_filelist().

◆ FILELIST_ENTRY_LENGTH

#define FILELIST_ENTRY_LENGTH   33

Definition at line 92 of file wordpad.h.

Referenced by format_filelist_filename().

◆ ID_ABOUT

#define ID_ABOUT   1603

Definition at line 133 of file wordpad.h.

◆ ID_ALIGN_CENTER

#define ID_ALIGN_CENTER   1101

Definition at line 55 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_ALIGN_LEFT

#define ID_ALIGN_LEFT   1100

Definition at line 54 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_ALIGN_RIGHT

#define ID_ALIGN_RIGHT   1102

Definition at line 56 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_BACK_1

#define ID_BACK_1   1200

Definition at line 58 of file wordpad.h.

Referenced by OnCommand().

◆ ID_BACK_2

#define ID_BACK_2   1201

Definition at line 59 of file wordpad.h.

Referenced by OnCommand().

◆ ID_BULLET

#define ID_BULLET   1314

Definition at line 75 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_COLOR_AQUA

#define ID_COLOR_AQUA   1814

Definition at line 151 of file wordpad.h.

◆ ID_COLOR_AUTOMATIC

#define ID_COLOR_AUTOMATIC   1816

Definition at line 153 of file wordpad.h.

Referenced by OnCommand().

◆ ID_COLOR_BLACK

#define ID_COLOR_BLACK   1800

Definition at line 137 of file wordpad.h.

◆ ID_COLOR_BLUE

#define ID_COLOR_BLUE   1812

Definition at line 149 of file wordpad.h.

◆ ID_COLOR_FIRST

#define ID_COLOR_FIRST   1800

Definition at line 136 of file wordpad.h.

Referenced by OnCommand().

◆ ID_COLOR_FUCHSIA

#define ID_COLOR_FUCHSIA   1813

Definition at line 150 of file wordpad.h.

◆ ID_COLOR_GRAY

#define ID_COLOR_GRAY   1807

Definition at line 144 of file wordpad.h.

◆ ID_COLOR_GREEN

#define ID_COLOR_GREEN   1802

Definition at line 139 of file wordpad.h.

◆ ID_COLOR_LIME

#define ID_COLOR_LIME   1810

Definition at line 147 of file wordpad.h.

◆ ID_COLOR_MAROON

#define ID_COLOR_MAROON   1801

Definition at line 138 of file wordpad.h.

◆ ID_COLOR_NAVY

#define ID_COLOR_NAVY   1804

Definition at line 141 of file wordpad.h.

◆ ID_COLOR_OLIVE

#define ID_COLOR_OLIVE   1803

Definition at line 140 of file wordpad.h.

◆ ID_COLOR_PURPLE

#define ID_COLOR_PURPLE   1805

Definition at line 142 of file wordpad.h.

◆ ID_COLOR_RED

#define ID_COLOR_RED   1809

Definition at line 146 of file wordpad.h.

◆ ID_COLOR_SILVER

#define ID_COLOR_SILVER   1808

Definition at line 145 of file wordpad.h.

◆ ID_COLOR_TEAL

#define ID_COLOR_TEAL   1806

Definition at line 143 of file wordpad.h.

◆ ID_COLOR_WHITE

#define ID_COLOR_WHITE   1815

Definition at line 152 of file wordpad.h.

◆ ID_COLOR_YELLOW

#define ID_COLOR_YELLOW   1811

Definition at line 148 of file wordpad.h.

◆ ID_DATETIME

#define ID_DATETIME   1600

Definition at line 129 of file wordpad.h.

Referenced by OnCommand(), and OnCreate().

◆ ID_EDIT_CHARFORMAT

#define ID_EDIT_CHARFORMAT   1304

Definition at line 65 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_CLEAR

#define ID_EDIT_CLEAR   1313

Definition at line 74 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_COPY

#define ID_EDIT_COPY   1310

Definition at line 71 of file wordpad.h.

◆ ID_EDIT_CUT

#define ID_EDIT_CUT   1311

Definition at line 72 of file wordpad.h.

Referenced by MDIChildWndProc(), OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_EDIT_DEFCHARFORMAT

#define ID_EDIT_DEFCHARFORMAT   1306

Definition at line 67 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_GETTEXT

#define ID_EDIT_GETTEXT   1309

Definition at line 70 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_MODIFIED

#define ID_EDIT_MODIFIED   1303

Definition at line 64 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_EDIT_PARAFORMAT

#define ID_EDIT_PARAFORMAT   1305

Definition at line 66 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_PASTE

#define ID_EDIT_PASTE   1312

Definition at line 73 of file wordpad.h.

◆ ID_EDIT_READONLY

#define ID_EDIT_READONLY   1302

Definition at line 63 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_EDIT_REDO

#define ID_EDIT_REDO   1308

Definition at line 69 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_EDIT_SELECTALL

#define ID_EDIT_SELECTALL   1300

Definition at line 61 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_SELECTIONINFO

#define ID_EDIT_SELECTIONINFO   1301

Definition at line 62 of file wordpad.h.

Referenced by OnCommand().

◆ ID_EDIT_UNDO

#define ID_EDIT_UNDO   1307

Definition at line 68 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_FILE_EXIT

#define ID_FILE_EXIT   1000

Definition at line 27 of file wordpad.h.

◆ ID_FILE_NEW

#define ID_FILE_NEW   1003

Definition at line 30 of file wordpad.h.

◆ ID_FILE_OPEN

#define ID_FILE_OPEN   1001

Definition at line 28 of file wordpad.h.

◆ ID_FILE_RECENT1

#define ID_FILE_RECENT1   1005

Definition at line 33 of file wordpad.h.

Referenced by OnCommand(), registry_read_filelist(), and registry_set_filelist().

◆ ID_FILE_RECENT2

#define ID_FILE_RECENT2   1006

Definition at line 34 of file wordpad.h.

Referenced by OnCommand().

◆ ID_FILE_RECENT3

#define ID_FILE_RECENT3   1007

Definition at line 35 of file wordpad.h.

Referenced by OnCommand().

◆ ID_FILE_RECENT4

#define ID_FILE_RECENT4   1008

Definition at line 36 of file wordpad.h.

Referenced by OnCommand().

◆ ID_FILE_RECENT_SEPARATOR

#define ID_FILE_RECENT_SEPARATOR   1009

Definition at line 37 of file wordpad.h.

Referenced by registry_read_filelist().

◆ ID_FILE_SAVE

#define ID_FILE_SAVE   1002

Definition at line 29 of file wordpad.h.

◆ ID_FILE_SAVEAS

#define ID_FILE_SAVEAS   1004

Definition at line 31 of file wordpad.h.

◆ ID_FIND

#define ID_FIND   1014

Definition at line 44 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnInitPopupMenu(), and OnUser().

◆ ID_FIND_NEXT

#define ID_FIND_NEXT   1015

Definition at line 45 of file wordpad.h.

Referenced by handle_findmsg(), OnCommand(), and OnInitPopupMenu().

◆ ID_FONTSETTINGS

#define ID_FONTSETTINGS   1315

Definition at line 77 of file wordpad.h.

Referenced by OnCommand().

◆ ID_FORMAT_BOLD

#define ID_FORMAT_BOLD   1400

Definition at line 79 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), and OnUser().

◆ ID_FORMAT_COLOR

#define ID_FORMAT_COLOR   1403

Definition at line 82 of file wordpad.h.

Referenced by OnCommand(), and OnCreate().

◆ ID_FORMAT_ITALIC

#define ID_FORMAT_ITALIC   1401

Definition at line 80 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), and OnUser().

◆ ID_FORMAT_UNDERLINE

#define ID_FORMAT_UNDERLINE   1402

Definition at line 81 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), and OnUser().

◆ ID_NEWFILE_ABORT

#define ID_NEWFILE_ABORT   100

Definition at line 114 of file wordpad.h.

Referenced by newfile_proc(), and OnCommand().

◆ ID_PARAFORMAT

#define ID_PARAFORMAT   1601

Definition at line 130 of file wordpad.h.

Referenced by OnCommand().

◆ ID_PREVIEW

#define ID_PREVIEW   1011

Definition at line 40 of file wordpad.h.

Referenced by OnCommand(), and OnCreate().

◆ ID_PREVIEW_NEXTPAGE

#define ID_PREVIEW_NEXTPAGE   1017

Definition at line 48 of file wordpad.h.

Referenced by preview_bar_show(), preview_command(), and update_preview_buttons().

◆ ID_PREVIEW_NUMPAGES

#define ID_PREVIEW_NUMPAGES   1019

◆ ID_PREVIEW_PREVPAGE

#define ID_PREVIEW_PREVPAGE   1018

Definition at line 49 of file wordpad.h.

Referenced by preview_bar_show(), preview_command(), and update_preview_buttons().

◆ ID_PREVIEW_ZOOMIN

#define ID_PREVIEW_ZOOMIN   1020

Definition at line 51 of file wordpad.h.

Referenced by preview_bar_show(), preview_command(), and update_preview_buttons().

◆ ID_PREVIEW_ZOOMOUT

#define ID_PREVIEW_ZOOMOUT   1021

Definition at line 52 of file wordpad.h.

Referenced by preview_bar_show(), preview_command(), and update_preview_buttons().

◆ ID_PRINT

#define ID_PRINT   1010

Definition at line 39 of file wordpad.h.

Referenced by OnCommand(), preview_bar_show(), and preview_command().

◆ ID_PRINT_QUICK

#define ID_PRINT_QUICK   1013

Definition at line 42 of file wordpad.h.

Referenced by OnCommand(), and OnCreate().

◆ ID_PRINTSETUP

#define ID_PRINTSETUP   1012

Definition at line 41 of file wordpad.h.

Referenced by OnCommand().

◆ ID_REPLACE

#define ID_REPLACE   1016

Definition at line 46 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_TAB_ADD

#define ID_TAB_ADD   100

Definition at line 116 of file wordpad.h.

Referenced by tabstops_proc().

◆ ID_TAB_DEL

#define ID_TAB_DEL   101

Definition at line 117 of file wordpad.h.

Referenced by tabstops_proc().

◆ ID_TAB_EMPTY

#define ID_TAB_EMPTY   102

Definition at line 118 of file wordpad.h.

Referenced by tabstops_proc().

◆ ID_TABSTOPS

#define ID_TABSTOPS   1602

Definition at line 131 of file wordpad.h.

Referenced by OnCommand().

◆ ID_TOGGLE_FORMATBAR

#define ID_TOGGLE_FORMATBAR   1501

Definition at line 85 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_TOGGLE_RULER

#define ID_TOGGLE_RULER   1503

Definition at line 87 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_TOGGLE_STATUSBAR

#define ID_TOGGLE_STATUSBAR   1502

Definition at line 86 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_TOGGLE_TOOLBAR

#define ID_TOGGLE_TOOLBAR   1500

Definition at line 84 of file wordpad.h.

Referenced by OnCommand(), and OnInitPopupMenu().

◆ ID_VIEWPROPERTIES

#define ID_VIEWPROPERTIES   1604

Definition at line 134 of file wordpad.h.

Referenced by OnCommand().

◆ ID_WORDWRAP_MARGIN

#define ID_WORDWRAP_MARGIN   2

Definition at line 112 of file wordpad.h.

Referenced by formatopts_proc(), and target_device().

◆ ID_WORDWRAP_NONE

#define ID_WORDWRAP_NONE   0

Definition at line 110 of file wordpad.h.

Referenced by formatopts_proc(), registry_read_formatopts(), and target_device().

◆ ID_WORDWRAP_WINDOW

#define ID_WORDWRAP_WINDOW   1

Definition at line 111 of file wordpad.h.

Referenced by formatopts_proc(), and registry_read_formatopts().

◆ IDB_FORMATBAR

#define IDB_FORMATBAR   101

Definition at line 184 of file wordpad.h.

Referenced by OnCreate().

◆ IDB_TOOLBAR

#define IDB_TOOLBAR   100

◆ IDC_COMBO

#define IDC_COMBO   2005

Definition at line 160 of file wordpad.h.

◆ IDC_DATETIME

#define IDC_DATETIME   2006

Definition at line 161 of file wordpad.h.

Referenced by datetime_proc().

◆ IDC_EDITOR

◆ IDC_FONTLIST

#define IDC_FONTLIST   2013

Definition at line 168 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnNotify(), populate_size_list(), set_font(), and update_font_list().

◆ IDC_FORMATBAR

#define IDC_FORMATBAR   2003

Definition at line 158 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), and OnUser().

◆ IDC_NEWFILE

#define IDC_NEWFILE   2007

Definition at line 162 of file wordpad.h.

Referenced by newfile_proc().

◆ IDC_PAGEFMT_FB

#define IDC_PAGEFMT_FB   101

Definition at line 121 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_ID

#define IDC_PAGEFMT_ID   107

Definition at line 127 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_RU

#define IDC_PAGEFMT_RU   102

Definition at line 122 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_SB

#define IDC_PAGEFMT_SB   103

Definition at line 123 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_TB

#define IDC_PAGEFMT_TB   100

Definition at line 120 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_WM

#define IDC_PAGEFMT_WM   106

Definition at line 126 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_WN

#define IDC_PAGEFMT_WN   104

Definition at line 124 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PAGEFMT_WW

#define IDC_PAGEFMT_WW   105

Definition at line 125 of file wordpad.h.

Referenced by formatopts_proc().

◆ IDC_PARA_ALIGN

#define IDC_PARA_ALIGN   2011

Definition at line 166 of file wordpad.h.

Referenced by paraformat_proc().

◆ IDC_PARA_FIRST

#define IDC_PARA_FIRST   2010

Definition at line 165 of file wordpad.h.

Referenced by paraformat_proc().

◆ IDC_PARA_LEFT

#define IDC_PARA_LEFT   2008

Definition at line 163 of file wordpad.h.

Referenced by paraformat_proc().

◆ IDC_PARA_RIGHT

#define IDC_PARA_RIGHT   2009

Definition at line 164 of file wordpad.h.

Referenced by paraformat_proc().

◆ IDC_PREVIEW

◆ IDC_REBAR

◆ IDC_RULER

#define IDC_RULER   2015

Definition at line 170 of file wordpad.h.

Referenced by get_ruler_wnd(), OnCreate(), OnSize(), and WinMain().

◆ IDC_SIZELIST

#define IDC_SIZELIST   2014

Definition at line 169 of file wordpad.h.

Referenced by OnCommand(), OnCreate(), OnNotify(), set_font(), update_font_list(), and update_size_list().

◆ IDC_STATUSBAR

#define IDC_STATUSBAR   2000

Definition at line 155 of file wordpad.h.

◆ IDC_TABSTOPS

#define IDC_TABSTOPS   2012

Definition at line 167 of file wordpad.h.

Referenced by tabstops_proc().

◆ IDC_TOOLBAR

◆ IDC_ZOOM

#define IDC_ZOOM   103

Definition at line 195 of file wordpad.h.

◆ IDD_DATETIME

#define IDD_DATETIME   2100

Definition at line 173 of file wordpad.h.

Referenced by OnCommand().

◆ IDD_FORMATOPTS

#define IDD_FORMATOPTS   2104

Definition at line 177 of file wordpad.h.

Referenced by dialog_viewproperties().

◆ IDD_NEWFILE

#define IDD_NEWFILE   2101

Definition at line 174 of file wordpad.h.

Referenced by OnCommand().

◆ IDD_PARAFORMAT

#define IDD_PARAFORMAT   2102

Definition at line 175 of file wordpad.h.

Referenced by OnCommand().

◆ IDD_TABSTOPS

#define IDD_TABSTOPS   2103

Definition at line 176 of file wordpad.h.

Referenced by OnCommand().

◆ IDI_WORDPAD

#define IDI_WORDPAD   102

Definition at line 186 of file wordpad.h.

Referenced by dialog_about(), dialog_viewproperties(), and WinMain().

◆ IDM_COLOR_POPUP

#define IDM_COLOR_POPUP   2202

Definition at line 181 of file wordpad.h.

Referenced by WinMain().

◆ IDM_MAINMENU

#define IDM_MAINMENU   2200

Definition at line 179 of file wordpad.h.

◆ IDM_POPUP

#define IDM_POPUP   2201

Definition at line 180 of file wordpad.h.

Referenced by RichEditOleCallback_GetContextMenu().

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   255

Definition at line 22 of file wordpad.h.

◆ PREVIEW_BUTTONS

#define PREVIEW_BUTTONS   7

Definition at line 89 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_ALIGN_CENTER

#define STRING_ALIGN_CENTER   1418

Definition at line 212 of file wordpad.h.

Referenced by paraformat_proc().

◆ STRING_ALIGN_LEFT

#define STRING_ALIGN_LEFT   1416

Definition at line 210 of file wordpad.h.

Referenced by paraformat_proc().

◆ STRING_ALIGN_RIGHT

#define STRING_ALIGN_RIGHT   1417

Definition at line 211 of file wordpad.h.

Referenced by paraformat_proc().

◆ STRING_ALL_FILES

#define STRING_ALL_FILES   1400

Definition at line 199 of file wordpad.h.

◆ STRING_DEFAULT_FILENAME

#define STRING_DEFAULT_FILENAME   1700

Definition at line 234 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_INVALID_NUMBER

#define STRING_INVALID_NUMBER   1705

Definition at line 239 of file wordpad.h.

Referenced by on_sizelist_modified(), paraformat_proc(), and tabstops_proc().

◆ STRING_LOAD_RICHED_FAILED

#define STRING_LOAD_RICHED_FAILED   1703

Definition at line 237 of file wordpad.h.

Referenced by OnCreate().

◆ STRING_MAX_TAB_STOPS

#define STRING_MAX_TAB_STOPS   1712

Definition at line 246 of file wordpad.h.

Referenced by tabstops_proc().

◆ STRING_NEWFILE_RICHTEXT

#define STRING_NEWFILE_RICHTEXT   1404

Definition at line 204 of file wordpad.h.

Referenced by newfile_proc().

◆ STRING_NEWFILE_TXT

#define STRING_NEWFILE_TXT   1405

Definition at line 205 of file wordpad.h.

Referenced by newfile_proc().

◆ STRING_NEWFILE_TXT_UNICODE

#define STRING_NEWFILE_TXT_UNICODE   1406

Definition at line 206 of file wordpad.h.

Referenced by newfile_proc().

◆ STRING_OLE_STORAGE_NOT_SUPPORTED

#define STRING_OLE_STORAGE_NOT_SUPPORTED   1706

Definition at line 240 of file wordpad.h.

Referenced by DoOpenFile().

◆ STRING_OPEN_ACCESS_DENIED

#define STRING_OPEN_ACCESS_DENIED   1710

Definition at line 244 of file wordpad.h.

Referenced by ShowOpenError().

◆ STRING_OPEN_FAILED

#define STRING_OPEN_FAILED   1709

Definition at line 243 of file wordpad.h.

Referenced by ShowOpenError().

◆ STRING_PREVIEW_CLOSE

#define STRING_PREVIEW_CLOSE   1455

Definition at line 225 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PREVIEW_NEXTPAGE

#define STRING_PREVIEW_NEXTPAGE   1449

Definition at line 219 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PREVIEW_ONEPAGE

#define STRING_PREVIEW_ONEPAGE   1452

Definition at line 222 of file wordpad.h.

Referenced by preview_bar_show(), and toggle_num_pages().

◆ STRING_PREVIEW_PAGE

#define STRING_PREVIEW_PAGE   1456

Definition at line 226 of file wordpad.h.

Referenced by update_preview_statusbar().

◆ STRING_PREVIEW_PAGES

#define STRING_PREVIEW_PAGES   1457

Definition at line 227 of file wordpad.h.

Referenced by update_preview_statusbar().

◆ STRING_PREVIEW_PREVPAGE

#define STRING_PREVIEW_PREVPAGE   1450

Definition at line 220 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PREVIEW_PRINT

#define STRING_PREVIEW_PRINT   1448

Definition at line 218 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PREVIEW_TWOPAGES

#define STRING_PREVIEW_TWOPAGES   1451

Definition at line 221 of file wordpad.h.

Referenced by preview_bar_show(), and toggle_num_pages().

◆ STRING_PREVIEW_ZOOMIN

#define STRING_PREVIEW_ZOOMIN   1453

Definition at line 223 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PREVIEW_ZOOMOUT

#define STRING_PREVIEW_ZOOMOUT   1454

Definition at line 224 of file wordpad.h.

Referenced by preview_bar_show().

◆ STRING_PRINTER_FILES_PRN

#define STRING_PRINTER_FILES_PRN   1407

Definition at line 208 of file wordpad.h.

Referenced by get_print_file_filter().

◆ STRING_PRINTING_NOT_IMPLEMENTED

#define STRING_PRINTING_NOT_IMPLEMENTED   1711

Definition at line 245 of file wordpad.h.

Referenced by HandleCommandLine().

◆ STRING_PROMPT_SAVE_CHANGES

#define STRING_PROMPT_SAVE_CHANGES   1701

Definition at line 235 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_RICHTEXT_FILES_RTF

#define STRING_RICHTEXT_FILES_RTF   1403

Definition at line 202 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_SAVE_LOSEFORMATTING

#define STRING_SAVE_LOSEFORMATTING   1704

Definition at line 238 of file wordpad.h.

Referenced by DialogSaveFile().

◆ STRING_SEARCH_FINISHED

#define STRING_SEARCH_FINISHED   1702

Definition at line 236 of file wordpad.h.

Referenced by handle_findmsg().

◆ STRING_TEXT_FILES_TXT

#define STRING_TEXT_FILES_TXT   1401

Definition at line 200 of file wordpad.h.

◆ STRING_TEXT_FILES_UNICODE_TXT

#define STRING_TEXT_FILES_UNICODE_TXT   1402

Definition at line 201 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_UNITS_CM

#define STRING_UNITS_CM   1458

Definition at line 229 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_UNITS_IN

#define STRING_UNITS_IN   1459

Definition at line 230 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_UNITS_INCH

#define STRING_UNITS_INCH   1460

Definition at line 231 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_UNITS_PT

#define STRING_UNITS_PT   1461

Definition at line 232 of file wordpad.h.

Referenced by DoLoadStrings().

◆ STRING_VIEWPROPS_RICHTEXT

#define STRING_VIEWPROPS_RICHTEXT   1434

Definition at line 216 of file wordpad.h.

Referenced by dialog_viewproperties().

◆ STRING_VIEWPROPS_TEXT

#define STRING_VIEWPROPS_TEXT   1433

Definition at line 215 of file wordpad.h.

Referenced by dialog_viewproperties().

◆ STRING_VIEWPROPS_TITLE

#define STRING_VIEWPROPS_TITLE   1432

Definition at line 214 of file wordpad.h.

Referenced by dialog_viewproperties().

◆ STRING_WRITE_ACCESS_DENIED

#define STRING_WRITE_ACCESS_DENIED   1708

Definition at line 242 of file wordpad.h.

Referenced by ShowWriteError().

◆ STRING_WRITE_FAILED

#define STRING_WRITE_FAILED   1707

Definition at line 241 of file wordpad.h.

Referenced by ShowWriteError().

◆ TWIPS_PER_INCH

#define TWIPS_PER_INCH   1440

Function Documentation

◆ close_preview()

void close_preview ( HWND  )

Definition at line 753 of file print.c.

Referenced by preview_exit().

754 {
755  HWND hwndPreview = GetDlgItem(hMainWnd, IDC_PREVIEW);
756  preview.window.right = 0;
757  preview.window.bottom = 0;
758  preview.page = 0;
761  preview.pageCapacity = 0;
762  if (preview.zoomlevel > 0)
764  if(preview.hdc) {
767  DeleteObject(oldbm);
768  preview.hdc = NULL;
769  }
770  if(preview.hdc2) {
773  DeleteObject(oldbm);
774  preview.hdc2 = NULL;
775  }
776 
778  DestroyWindow(hwndPreview);
779 }
HDC hdc2
Definition: print.c:41
static void preview_bar_show(HWND hMainWnd, BOOL show)
Definition: print.c:580
#define HBITMAP
Definition: msvc.h:28
int * pageEnds
Definition: print.c:38
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
int zoomlevel
Definition: print.c:48
LONG right
Definition: windef.h:298
BOOL WINAPI DestroyWindow(_In_ HWND)
smooth NULL
Definition: ftsmooth.c:416
int pages_shown
Definition: print.c:36
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
int page
Definition: print.c:35
HWND hMainWnd
Definition: magnifier.c:33
HDC hdc
Definition: print.c:40
int saved_pages_shown
Definition: print.c:37
#define IDC_PREVIEW
Definition: wordpad.h:171
RECT window
Definition: print.c:42
BOOL WINAPI DeleteDC(_In_ HDC)
static previewinfo preview
Definition: print.c:56
int pageCapacity
Definition: print.c:38
LONG bottom
Definition: windef.h:299
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define HeapFree(x, y, z)
Definition: compat.h:394
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439

◆ dialog_print()

void dialog_print ( HWND  ,
LPWSTR   
)

Definition at line 551 of file print.c.

Referenced by OnCommand(), and preview_command().

552 {
553  PRINTDLGW pd;
555  int from = 0;
556  int to = 0;
557 
558  ZeroMemory(&pd, sizeof(pd));
559  pd.lStructSize = sizeof(pd);
560  pd.hwndOwner = hMainWnd;
562  pd.nMinPage = 1;
563  pd.nMaxPage = -1;
564  pd.hDevMode = devMode;
565  pd.hDevNames = devNames;
566 
567  SendMessageW(hEditorWnd, EM_GETSEL, (WPARAM)&from, (LPARAM)&to);
568  if(from == to)
569  pd.Flags |= PD_NOSELECTION;
570 
571  if(PrintDlgW(&pd))
572  {
573  devMode = pd.hDevMode;
574  devNames = pd.hDevNames;
575  print(&pd, wszFileName);
577  }
578 }
static WCHAR wszFileName[MAX_PATH]
Definition: wordpad.c:70
#define PD_NOSELECTION
Definition: commdlg.h:149
HWND hwndOwner
Definition: commdlg.h:487
static HGLOBAL devMode
Definition: print.c:52
#define ZeroMemory
Definition: winbase.h:1635
static HWND hEditorWnd
Definition: wordpad.c:60
DWORD Flags
Definition: commdlg.h:491
UINT_PTR WPARAM
Definition: windef.h:207
HANDLE hDevNames
Definition: commdlg.h:489
#define EM_GETSEL
Definition: winuser.h:1958
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
LONG_PTR LPARAM
Definition: windef.h:208
WORD nMinPage
Definition: commdlg.h:494
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
Definition: printdlg.c:2391
#define PD_RETURNDC
Definition: commdlg.h:155
DWORD lStructSize
Definition: commdlg.h:486
static HGLOBAL devNames
Definition: print.c:53
static void update_ruler(HWND hRulerWnd)
Definition: print.c:296
#define IDC_EDITOR
Definition: wordpad.h:156
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HWND hMainWnd
Definition: magnifier.c:33
HANDLE hDevMode
Definition: commdlg.h:488
WORD nMaxPage
Definition: commdlg.h:495
static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
Definition: print.c:440
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
CardRegion * from
Definition: spigame.cpp:19
static HWND get_ruler_wnd(HWND hMainWnd)
Definition: print.c:283

◆ dialog_printsetup()

void dialog_printsetup ( HWND  )

Definition at line 500 of file print.c.

Referenced by OnCommand().

501 {
502  PAGESETUPDLGW ps;
503 
504  ZeroMemory(&ps, sizeof(ps));
505  ps.lStructSize = sizeof(ps);
506  ps.hwndOwner = hMainWnd;
510  ps.hDevMode = devMode;
511  ps.hDevNames = devNames;
512 
513  if(PageSetupDlgW(&ps))
514  {
517  devMode = ps.hDevMode;
518  devNames = ps.hDevNames;
520  }
521 }
static LONG twips_to_centmm(int twips)
Definition: print.c:166
#define PSD_INHUNDREDTHSOFMILLIMETERS
Definition: commdlg.h:175
static HGLOBAL devMode
Definition: print.c:52
#define PSD_MARGINS
Definition: commdlg.h:173
LONG top
Definition: windef.h:297
#define ZeroMemory
Definition: winbase.h:1635
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
RECT rtMargin
Definition: commdlg.h:456
HGLOBAL hDevNames
Definition: commdlg.h:452
DWORD lStructSize
Definition: commdlg.h:449
static HGLOBAL devNames
Definition: print.c:53
static LONG centmm_to_twips(int mm)
Definition: print.c:171
BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg)
Definition: printdlg.c:3926
static void update_ruler(HWND hRulerWnd)
Definition: print.c:296
HWND hwndOwner
Definition: commdlg.h:450
HWND hMainWnd
Definition: magnifier.c:33
HGLOBAL hDevMode
Definition: commdlg.h:451
static RECT margins
Definition: print.c:55
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
DWORD Flags
Definition: commdlg.h:453
LONG bottom
Definition: windef.h:299
static HWND get_ruler_wnd(HWND hMainWnd)
Definition: print.c:283

◆ file_basename()

LPWSTR file_basename ( LPWSTR  )

Definition at line 211 of file wordpad.c.

Referenced by format_filelist_filename(), prompt_save_changes(), and set_caption().

212 {
213  LPWSTR pos = path + lstrlenW(path);
214 
215  while(pos > path)
216  {
217  if(*pos == '\\' || *pos == '/')
218  {
219  pos++;
220  break;
221  }
222  pos--;
223  }
224  return pos;
225 }
#define lstrlenW
Definition: compat.h:407
Definition: services.c:325
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ get_default_printer_opts()

void get_default_printer_opts ( void  )

Definition at line 523 of file print.c.

Referenced by WinMain().

524 {
525  PRINTDLGW pd;
526  ZeroMemory(&pd, sizeof(pd));
527 
528  ZeroMemory(&pd, sizeof(pd));
529  pd.lStructSize = sizeof(pd);
531  pd.hDevMode = devMode;
532 
533  PrintDlgW(&pd);
534 
535  devMode = pd.hDevMode;
536  devNames = pd.hDevNames;
537 }
static HGLOBAL devMode
Definition: print.c:52
#define ZeroMemory
Definition: winbase.h:1635
DWORD Flags
Definition: commdlg.h:491
HANDLE hDevNames
Definition: commdlg.h:489
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
Definition: printdlg.c:2391
#define PD_RETURNDC
Definition: commdlg.h:155
DWORD lStructSize
Definition: commdlg.h:486
static HGLOBAL devNames
Definition: print.c:53
HANDLE hDevMode
Definition: commdlg.h:488
#define PD_RETURNDEFAULT
Definition: commdlg.h:157

◆ init_preview()

void init_preview ( HWND  ,
LPWSTR   
)

Definition at line 737 of file print.c.

Referenced by OnCommand().

738 {
740  preview.page = 1;
741  preview.hdc = 0;
742  preview.hdc2 = 0;
744  preview.zoomratio = 0;
745  preview.zoomlevel = 0;
747 
750  0, 0, 200, 10, hMainWnd, (HMENU)IDC_PREVIEW, hInstance, NULL);
751 }
HDC hdc2
Definition: print.c:41
static WCHAR wszFileName[MAX_PATH]
Definition: wordpad.c:70
static void preview_bar_show(HWND hMainWnd, BOOL show)
Definition: print.c:580
#define TRUE
Definition: types.h:120
int zoomlevel
Definition: print.c:48
#define WS_CHILD
Definition: pedump.c:617
HINSTANCE hInstance
Definition: charmap.c:20
float zoomratio
Definition: print.c:47
smooth NULL
Definition: ftsmooth.c:416
const WCHAR wszPreviewWndClass[]
Definition: wordpad.c:56
int page
Definition: print.c:35
#define WS_HSCROLL
Definition: pedump.c:628
HWND hMainWnd
Definition: magnifier.c:33
LPWSTR wszFileName
Definition: print.c:49
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)
HDC hdc
Definition: print.c:40
#define IDC_PREVIEW
Definition: wordpad.h:171
static previewinfo preview
Definition: print.c:56
#define WS_VSCROLL
Definition: pedump.c:627
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ preview_command()

LRESULT preview_command ( HWND  ,
WPARAM   
)

Definition at line 1205 of file print.c.

Referenced by WndProc().

1206 {
1207  switch(LOWORD(wParam))
1208  {
1209  case ID_FILE_EXIT:
1210  PostMessageW(hWnd, WM_CLOSE, 0, 0);
1211  break;
1212 
1213  case ID_PREVIEW_NEXTPAGE:
1214  case ID_PREVIEW_PREVPAGE:
1215  {
1217  preview.page++;
1218  else
1219  preview.page--;
1220 
1222  }
1223  break;
1224 
1225  case ID_PREVIEW_NUMPAGES:
1227  break;
1228 
1229  case ID_PREVIEW_ZOOMIN:
1230  if (preview.zoomlevel < 2)
1231  {
1232  if (preview.zoomlevel == 0)
1234  preview.zoomlevel++;
1235  preview.zoomratio = 0;
1236  if (preview.pages_shown > 1)
1237  {
1238  /* Forced switch to one page when zooming in. */
1240  } else {
1241  HWND hwndPreview = GetDlgItem(hWnd, IDC_PREVIEW);
1242  update_preview_sizes(hwndPreview, TRUE);
1243  InvalidateRect(hwndPreview, NULL, FALSE);
1245  }
1246  }
1247  break;
1248 
1249  case ID_PREVIEW_ZOOMOUT:
1250  if (preview.zoomlevel > 0)
1251  {
1252  HWND hwndPreview = GetDlgItem(hWnd, IDC_PREVIEW);
1253  preview.zoomlevel--;
1254  preview.zoomratio = 0;
1255  if (preview.zoomlevel == 0 && preview.saved_pages_shown > 1) {
1257  } else {
1258  update_preview_sizes(hwndPreview, TRUE);
1259  InvalidateRect(hwndPreview, NULL, FALSE);
1261  }
1262  }
1263  break;
1264 
1265  case ID_PRINT:
1267  SendMessageW(hWnd, WM_CLOSE, 0, 0);
1268  break;
1269  }
1270 
1271  return 0;
1272 }
#define TRUE
Definition: types.h:120
void dialog_print(HWND hMainWnd, LPWSTR wszFileName)
Definition: print.c:551
HWND hWnd
Definition: settings.c:17
int zoomlevel
Definition: print.c:48
WPARAM wParam
Definition: combotst.c:138
float zoomratio
Definition: print.c:47
#define ID_FILE_EXIT
Definition: resource.h:47
smooth NULL
Definition: ftsmooth.c:416
#define ID_PREVIEW_NUMPAGES
Definition: wordpad.h:50
static void update_preview(HWND hMainWnd)
Definition: print.c:922
int pages_shown
Definition: print.c:36
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
int page
Definition: print.c:35
#define WM_CLOSE
Definition: winuser.h:1603
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LPWSTR wszFileName
Definition: print.c:49
int saved_pages_shown
Definition: print.c:37
#define IDC_PREVIEW
Definition: wordpad.h:171
static void toggle_num_pages(HWND hMainWnd)
Definition: print.c:974
#define ID_PRINT
Definition: wordpad.h:39
#define ID_PREVIEW_ZOOMOUT
Definition: wordpad.h:52
static previewinfo preview
Definition: print.c:56
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ID_PREVIEW_ZOOMIN
Definition: wordpad.h:51
#define ID_PREVIEW_NEXTPAGE
Definition: wordpad.h:48
#define ID_PREVIEW_PREVPAGE
Definition: wordpad.h:49
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void update_preview_buttons(HWND hMainWnd)
Definition: print.c:817
static void update_preview_sizes(HWND hwndPreview, BOOL zoomLevelUpdated)
Definition: print.c:651
#define LOWORD(l)
Definition: pedump.c:82

◆ preview_isactive()

BOOL preview_isactive ( void  )

Definition at line 781 of file print.c.

Referenced by OnSize(), and WndProc().

782 {
783  return preview.page != 0;
784 }
int page
Definition: print.c:35
static previewinfo preview
Definition: print.c:56

◆ print_quick()

void print_quick ( HWND  ,
LPWSTR   
)

Definition at line 539 of file print.c.

Referenced by OnCommand().

540 {
541  PRINTDLGW pd;
542 
543  ZeroMemory(&pd, sizeof(pd));
544  pd.hwndOwner = hMainWnd;
545  pd.hDC = make_dc();
546 
547  print(&pd, wszFileName);
548  DeleteDC(pd.hDC);
549 }
static WCHAR wszFileName[MAX_PATH]
Definition: wordpad.c:70
HWND hwndOwner
Definition: commdlg.h:487
#define ZeroMemory
Definition: winbase.h:1635
HDC hDC
Definition: commdlg.h:490
HWND hMainWnd
Definition: magnifier.c:33
static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
Definition: print.c:440
BOOL WINAPI DeleteDC(_In_ HDC)
static HDC make_dc(void)
Definition: print.c:145

◆ redraw_ruler()

void redraw_ruler ( HWND  )

Definition at line 288 of file print.c.

Referenced by OnSize(), and update_ruler().

289 {
290  RECT rc;
291 
292  GetClientRect(hRulerWnd, &rc);
293  InvalidateRect(hRulerWnd, &rc, TRUE);
294 }
#define TRUE
Definition: types.h:120
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ reg_formatindex()

int reg_formatindex ( WPARAM  )

Definition at line 330 of file registry.c.

Referenced by dialog_viewproperties(), is_bar_visible(), OnCommand(), registry_read_formatopts(), registry_read_formatopts_all(), registry_set_formatopts_all(), set_fileformat(), store_bar_state(), and WinMain().

331 {
332  return (format & SF_TEXT) ? 1 : 0;
333 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define SF_TEXT
Definition: richedit.h:720

◆ registry_read_filelist()

void registry_read_filelist ( HWND  )

Definition at line 217 of file registry.c.

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

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 
253  lstrcpyW(buffer, pFile[i]);
254 
255  format_filelist_filename(buffer, itemText);
256 
257  InsertMenuItemW(hMenu, ID_FILE_EXIT, FALSE, &mi);
258  mi.wID++;
259  pathSize = MAX_PATH*sizeof(WCHAR);
260  }
261  mi.fType = MFT_SEPARATOR;
262  mi.fMask = MIIM_FTYPE | MIIM_ID;
263  InsertMenuItemW(hMenu, ID_FILE_EXIT, FALSE, &mi);
264 
265  RegCloseKey(hFileKey);
266  }
267 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
#define ID_FILE_RECENT1
Definition: wordpad.h:33
#define MFT_STRING
Definition: winuser.h:741
#define MIIM_FTYPE
Definition: winuser.h:724
#define MF_BYCOMMAND
Definition: winuser.h:202
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR key_recentfiles[]
Definition: registry.c:29
GLuint buffer
Definition: glext.h:5915
LPWSTR dwTypeData
Definition: winuser.h:3211
static MONITORINFO mi
Definition: win.c:7331
static void format_filelist_filename(LPWSTR file, LPWSTR out)
Definition: registry.c:150
#define WCHAR
Definition: msvc.h:43
GLenum GLclampf GLint i
Definition: glfuncs.h:14
unsigned char * LPBYTE
Definition: typedefs.h:52
#define ID_FILE_EXIT
Definition: resource.h:47
smooth NULL
Definition: ftsmooth.c:416
#define MIIM_ID
Definition: winuser.h:717
#define FILELIST_ENTRIES
Definition: wordpad.h:91
#define ID_FILE_RECENT_SEPARATOR
Definition: wordpad.h:37
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MFT_SEPARATOR
Definition: winuser.h:739
HWND hMainWnd
Definition: magnifier.c:33
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
LONG WINAPI RegQueryValueExW(IN HKEY hKey, IN LPCWSTR lpValueName, IN PULONG lpReserved, OUT PULONG lpType OPTIONAL, OUT PUCHAR lpData OPTIONAL, IN OUT PULONG lpcbData OPTIONAL)
Definition: registry.c:862
#define MIIM_STRING
Definition: winuser.h:722
#define lstrcpyW
Definition: compat.h:406
static const WCHAR var_file[]
Definition: registry.c:36
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define ULONG_PTR
Definition: config.h:101
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define MIIM_DATA
Definition: winuser.h:721
HMENU WINAPI GetMenu(_In_ HWND)
ULONG_PTR dwItemData
Definition: winuser.h:3210
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
struct tagMENUITEMINFOW MENUITEMINFOW
Definition: path.c:42

◆ registry_read_formatopts_all()

void registry_read_formatopts_all ( DWORD  [],
DWORD  [] 
)

Definition at line 398 of file registry.c.

Referenced by OnCreate().

399 {
402 }
#define SF_RTF
Definition: richedit.h:721
static DWORD wordWrap[2]
Definition: wordpad.c:66
static DWORD barState[2]
Definition: wordpad.c:67
static const WCHAR key_rtf[]
Definition: registry.c:33
#define SF_TEXT
Definition: richedit.h:720
static void registry_read_formatopts(int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
Definition: registry.c:355
static const WCHAR key_text[]
Definition: registry.c:34
int reg_formatindex(WPARAM format)
Definition: registry.c:330

◆ registry_read_maximized()

void registry_read_maximized ( DWORD )

Definition at line 124 of file registry.c.

Referenced by WinMain().

125 {
126  HKEY hKey = 0;
127  DWORD size = sizeof(DWORD);
128 
129  if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
130  RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) !=
131  ERROR_SUCCESS || size != sizeof(DWORD))
132  {
133  *bMaximized = FALSE;
134  }
135 
136  RegCloseKey(hKey);
137 }
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
static DWORD
Definition: registry.c:44
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR key_options[]
Definition: registry.c:31
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR var_maximized[]
Definition: registry.c:40
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
LONG WINAPI RegQueryValueExW(IN HKEY hKey, IN LPCWSTR lpValueName, IN PULONG lpReserved, OUT PULONG lpType OPTIONAL, OUT PUCHAR lpData OPTIONAL, IN OUT PULONG lpcbData OPTIONAL)
Definition: registry.c:862

◆ registry_read_options()

void registry_read_options ( void  )

Definition at line 335 of file registry.c.

Referenced by OnCreate().

336 {
337  HKEY hKey;
338 
341  else
342  {
344  RegCloseKey(hKey);
345  }
346 
349  } else {
351  RegCloseKey(hKey);
352  }
353 }
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR key_options[]
Definition: registry.c:31
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR key_settings[]
Definition: registry.c:32
void registry_read_previewpages(HKEY hKey)
Definition: print.c:105
void registry_read_pagemargins(HKEY hKey)
Definition: print.c:90
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42

◆ registry_read_pagemargins()

void registry_read_pagemargins ( HKEY  )

Definition at line 90 of file print.c.

Referenced by registry_read_options().

91 {
92  DWORD size = sizeof(RECT);
93 
94  if(!hKey || RegQueryValueExW(hKey, var_pagemargin, 0, NULL, (LPBYTE)&margins,
95  &size) != ERROR_SUCCESS || size != sizeof(RECT))
96  SetRect(&margins, 1757, 1417, 1757, 1417);
97 }
#define ERROR_SUCCESS
Definition: deptool.c:10
struct tagRECT RECT
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
unsigned long DWORD
Definition: ntddk_ex.h:95
static RECT margins
Definition: print.c:55
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static const WCHAR var_pagemargin[]
Definition: print.c:60

◆ registry_read_previewpages()

void registry_read_previewpages ( HKEY  hKey)

Definition at line 105 of file print.c.

Referenced by registry_read_options().

106 {
107  DWORD size = sizeof(DWORD);
108  if(!hKey ||
110  (LPBYTE)&preview.pages_shown, &size) != ERROR_SUCCESS ||
111  size != sizeof(DWORD))
112  {
113  preview.pages_shown = 1;
114  } else {
115  if (preview.pages_shown < 1) preview.pages_shown = 1;
116  else if (preview.pages_shown > 2) preview.pages_shown = 2;
117  }
118 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD
Definition: msvc.h:34
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
int pages_shown
Definition: print.c:36
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
static const WCHAR var_previewpages[]
Definition: print.c:61
unsigned long DWORD
Definition: ntddk_ex.h:95
static previewinfo preview
Definition: print.c:56

◆ registry_read_winrect()

void registry_read_winrect ( RECT )

Definition at line 111 of file registry.c.

Referenced by WinMain().

112 {
113  HKEY hKey = 0;
114  DWORD size = sizeof(RECT);
115 
116  if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
117  RegQueryValueExW(hKey, var_framerect, 0, NULL, (LPBYTE)rc, &size) !=
118  ERROR_SUCCESS || size != sizeof(RECT))
119  SetRect(rc, 0, 0, 600, 300);
120 
121  RegCloseKey(hKey);
122 }
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR key_options[]
Definition: registry.c:31
struct tagRECT RECT
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR var_framerect[]
Definition: registry.c:37
unsigned long DWORD
Definition: ntddk_ex.h:95
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
LONG WINAPI RegQueryValueExW(IN HKEY hKey, IN LPCWSTR lpValueName, IN PULONG lpReserved, OUT PULONG lpType OPTIONAL, OUT PUCHAR lpData OPTIONAL, IN OUT PULONG lpcbData OPTIONAL)
Definition: registry.c:862
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ registry_set_filelist()

void registry_set_filelist ( LPCWSTR  ,
HWND   
)

Definition at line 269 of file registry.c.

Referenced by DoOpenFile().

270 {
271  HKEY hKey;
272  DWORD action;
273 
274  if(registry_get_handle(&hKey, &action, key_recentfiles) == ERROR_SUCCESS)
275  {
276  LPCWSTR pFiles[FILELIST_ENTRIES];
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  {
320  wsprintfW(buffer, var_file, i+1);
321  RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],
322  (lstrlenW(pFiles[i])+1)*sizeof(WCHAR));
323  }
324  }
325  RegCloseKey(hKey);
326  }
328 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
#define ID_FILE_RECENT1
Definition: wordpad.h:33
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR key_recentfiles[]
Definition: registry.c:29
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLuint buffer
Definition: glext.h:5915
static MONITORINFO mi
Definition: win.c:7331
#define lstrlenW
Definition: compat.h:407
LONG WINAPI RegSetValueExW(IN HKEY hKey, IN LPCWSTR lpValueName OPTIONAL, IN ULONG Reserved, IN ULONG dwType, IN const UCHAR *lpData, IN ULONG cbData)
Definition: registry.c:656
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define FILELIST_ENTRIES
Definition: wordpad.h:91
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hMainWnd
Definition: magnifier.c:33
unsigned char BYTE
Definition: ntddk_ex.h:96
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
const WCHAR * action
Definition: action.c:7779
static const WCHAR var_file[]
Definition: registry.c:36
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define MIIM_DATA
Definition: winuser.h:721
void registry_read_filelist(HWND hMainWnd)
Definition: registry.c:217
HMENU WINAPI GetMenu(_In_ HWND)
ULONG_PTR dwItemData
Definition: winuser.h:3210
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
struct tagMENUITEMINFOW MENUITEMINFOW
#define REG_SZ
Definition: layer.c:22

◆ registry_set_formatopts_all()

void registry_set_formatopts_all ( DWORD  [],
DWORD  [] 
)

Definition at line 419 of file registry.c.

Referenced by WndProc().

420 {
423 }
#define SF_RTF
Definition: richedit.h:721
static DWORD wordWrap[2]
Definition: wordpad.c:66
static DWORD barState[2]
Definition: wordpad.c:67
static const WCHAR key_rtf[]
Definition: registry.c:33
#define SF_TEXT
Definition: richedit.h:720
static void registry_set_formatopts(int index, LPCWSTR key, DWORD barState[], DWORD wordWrap[])
Definition: registry.c:404
static const WCHAR key_text[]
Definition: registry.c:34
int reg_formatindex(WPARAM format)
Definition: registry.c:330

◆ registry_set_options()

void registry_set_options ( HWND  )

Definition at line 83 of file registry.c.

Referenced by WndProc().

84 {
85  HKEY hKey = 0;
86  DWORD action;
87 
88  if(registry_get_handle(&hKey, &action, key_options) == ERROR_SUCCESS)
89  {
90  WINDOWPLACEMENT wp;
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 
101  RegCloseKey(hKey);
102  }
103 
104  if(registry_get_handle(&hKey, &action, key_settings) == ERROR_SUCCESS)
105  {
107  RegCloseKey(hKey);
108  }
109 }
LONG WINAPI RegCloseKey(IN HKEY hKey)
Definition: registry.c:512
struct _WINDOWPLACEMENT WINDOWPLACEMENT
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define SW_SHOWMAXIMIZED
Definition: winuser.h:767
static const WCHAR key_options[]
Definition: registry.c:31
LONG WINAPI RegSetValueExW(IN HKEY hKey, IN LPCWSTR lpValueName OPTIONAL, IN ULONG Reserved, IN ULONG dwType, IN const UCHAR *lpData, IN ULONG cbData)
Definition: registry.c:656
unsigned char * LPBYTE
Definition: typedefs.h:52
void registry_set_previewpages(HKEY hKey)
Definition: print.c:99
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
static const WCHAR key_settings[]
Definition: registry.c:32
static const WCHAR var_framerect[]
Definition: registry.c:37
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hMainWnd
Definition: magnifier.c:33
static const WCHAR var_maximized[]
Definition: registry.c:40
static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey)
Definition: registry.c:42
const WCHAR * action
Definition: action.c:7779
RECT rcNormalPosition
Definition: winuser.h:3237
void registry_set_pagemargins(HKEY hKey)
Definition: print.c:85
#define REG_DWORD
Definition: sdbapi.c:539

◆ registry_set_pagemargins()

void registry_set_pagemargins ( HKEY  )

Definition at line 85 of file print.c.

Referenced by registry_set_options().

86 {
88 }
#define REG_BINARY
Definition: nt_native.h:1496
unsigned char * LPBYTE
Definition: typedefs.h:52
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:4917
static RECT margins
Definition: print.c:55
static const WCHAR var_pagemargin[]
Definition: print.c:60

◆ registry_set_previewpages()

void registry_set_previewpages ( HKEY  hKey)

Definition at line 99 of file print.c.

Referenced by registry_set_options().

100 {
102  (LPBYTE)&preview.pages_shown, sizeof(DWORD));
103 }
unsigned char * LPBYTE
Definition: typedefs.h:52
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:4917
int pages_shown
Definition: print.c:36
static const WCHAR var_previewpages[]
Definition: print.c:61
unsigned long DWORD
Definition: ntddk_ex.h:95
static previewinfo preview
Definition: print.c:56
#define REG_DWORD
Definition: sdbapi.c:539

◆ ruler_proc()

LRESULT CALLBACK ruler_proc ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 412 of file print.c.

Referenced by WinMain().

413 {
414  static WNDPROC pPrevRulerProc;
415  static LONG EditLeftmost;
416  static BOOL NewMetrics;
417 
418  switch(msg)
419  {
420  case WM_USER:
421  if(wParam)
422  {
423  EditLeftmost = ((POINTL*)wParam)->x;
424  pPrevRulerProc = (WNDPROC)lParam;
425  }
426  NewMetrics = TRUE;
427  break;
428 
429  case WM_PAINT:
430  paint_ruler(hWnd, EditLeftmost, NewMetrics);
431  break;
432 
433  default:
434  return CallWindowProcW(pPrevRulerProc, hWnd, msg, wParam, lParam);
435  }
436 
437  return 0;
438 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
long LONG
Definition: pedump.c:60
UINT msg
Definition: msvc.h:92
unsigned int BOOL
Definition: ntddk_ex.h:94
static void paint_ruler(HWND hWnd, LONG EditLeftmost, BOOL NewMetrics)
Definition: print.c:377
#define WM_PAINT
Definition: winuser.h:1602
#define WM_USER
Definition: winuser.h:1856
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ setup_richedit_olecallback()

HRESULT setup_richedit_olecallback ( HWND  hEditorWnd)

Definition at line 203 of file olecallback.c.

Referenced by OnCreate().

204 {
207  0, &olecallback.stg);
208 
210  return hr;
211 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
LONG_PTR LPARAM
Definition: windef.h:208
smooth NULL
Definition: ftsmooth.c:416
#define STGM_DELETEONRELEASE
Definition: objbase.h:924
LONG HRESULT
Definition: typedefs.h:77
#define EM_SETOLECALLBACK
Definition: richedit.h:103
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8637
#define STGM_READWRITE
Definition: objbase.h:918
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct IRichEditOleCallbackImpl olecallback
Definition: olecallback.c:40

◆ target_device()

void target_device ( HWND  ,
DWORD   
)

Definition at line 209 of file print.c.

Referenced by dialog_viewproperties(), OnCommand(), set_fileformat(), and WinMain().

210 {
212 
214  {
215  int width = 0;
216  LRESULT result;
217  HDC hdc = make_dc();
218  RECT rc = get_print_rect(hdc);
219 
220  width = rc.right - rc.left;
221  if(!hdc)
222  {
223  HDC hMaindc = GetDC(hMainWnd);
224  hdc = CreateCompatibleDC(hMaindc);
225  ReleaseDC(hMainWnd, hMaindc);
226  }
227  result = SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, (WPARAM)hdc, width);
228  DeleteDC(hdc);
229  if (result)
230  return;
231  /* otherwise EM_SETTARGETDEVICE failed, so fall back on wrapping
232  * to window using the NULL DC. */
233  }
234 
235  if (wordWrap != ID_WORDWRAP_NONE) {
236  SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, 0, 0);
237  } else {
238  SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, 0, 1);
239  }
240 
241 }
#define ID_WORDWRAP_MARGIN
Definition: wordpad.h:112
#define HDC
Definition: msvc.h:22
GLint GLint GLsizei width
Definition: gl.h:1546
#define ID_WORDWRAP_NONE
Definition: wordpad.h:110
static RECT get_print_rect(HDC hdc)
Definition: print.c:187
HDC WINAPI GetDC(_In_opt_ HWND)
static DWORD wordWrap[2]
Definition: wordpad.c:66
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static HWND hEditorWnd
Definition: wordpad.c:60
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
#define EM_SETTARGETDEVICE
Definition: richedit.h:105
#define IDC_EDITOR
Definition: wordpad.h:156
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HWND hMainWnd
Definition: magnifier.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG_PTR LRESULT
Definition: windef.h:209
static HDC make_dc(void)
Definition: print.c:145
GLuint64EXT * result
Definition: glext.h:11304