Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d4e66543
Commit
d4e66543
authored
Feb 25, 2010
by
Vitaly Perov
Committed by
Alexandre Julliard
Feb 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notepad: Implement printing to file.
parent
062628ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
dialog.c
programs/notepad/dialog.c
+28
-0
No files found.
programs/notepad/dialog.c
View file @
d4e66543
...
...
@@ -5,6 +5,7 @@
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
* Copyright 2002 Andriy Palamarchuk
* Copyright 2007 Rolf Kalbermatter
* Copyright 2010 Vitaly Perov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -509,6 +510,26 @@ static ENCODING detect_encoding_of_file(LPCWSTR szFileName)
}
}
static
LPWSTR
dialog_print_to_file
(
HWND
hMainWnd
)
{
OPENFILENAMEW
ofn
;
static
WCHAR
file
[
MAX_PATH
]
=
{
'o'
,
'u'
,
't'
,
'p'
,
'u'
,
't'
,
'.'
,
'p'
,
'r'
,
'n'
,
0
};
static
const
WCHAR
defExt
[]
=
{
'p'
,
'r'
,
'n'
,
0
};
ZeroMemory
(
&
ofn
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
Flags
=
OFN_PATHMUSTEXIST
|
OFN_HIDEREADONLY
|
OFN_OVERWRITEPROMPT
;
ofn
.
hwndOwner
=
hMainWnd
;
ofn
.
lpstrFile
=
file
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
lpstrDefExt
=
defExt
;
if
(
GetSaveFileNameW
(
&
ofn
))
return
file
;
else
return
FALSE
;
}
static
UINT_PTR
CALLBACK
OfnHookProc
(
HWND
hdlg
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
HWND
hEncCombo
;
...
...
@@ -835,6 +856,13 @@ VOID DIALOG_FilePrint(VOID)
di
.
lpszDatatype
=
NULL
;
di
.
fwType
=
0
;
if
(
printer
.
Flags
&
PD_PRINTTOFILE
)
{
di
.
lpszOutput
=
dialog_print_to_file
(
printer
.
hwndOwner
);
if
(
!
di
.
lpszOutput
)
return
;
}
/* Get the file text */
size
=
GetWindowTextLengthW
(
Globals
.
hEdit
)
+
1
;
pTemp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment