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
27c8839f
Commit
27c8839f
authored
May 18, 2009
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notepad: Use the explicit W-form of the functions.
parent
f706c68c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
29 deletions
+28
-29
dialog.c
programs/notepad/dialog.c
+0
-0
main.c
programs/notepad/main.c
+28
-29
No files found.
programs/notepad/dialog.c
View file @
27c8839f
This diff is collapsed.
Click to expand it.
programs/notepad/main.c
View file @
27c8839f
...
...
@@ -74,7 +74,7 @@ VOID SetFileName(LPCWSTR szFileName)
{
lstrcpyW
(
Globals
.
szFileName
,
szFileName
);
Globals
.
szFileTitle
[
0
]
=
0
;
GetFileTitle
(
szFileName
,
Globals
.
szFileTitle
,
sizeof
(
Globals
.
szFileTitle
));
GetFileTitle
W
(
szFileName
,
Globals
.
szFileTitle
,
sizeof
(
Globals
.
szFileTitle
));
}
/******************************************************************************
...
...
@@ -205,9 +205,9 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
Globals
.
lfFont
.
lfPitchAndFamily
=
FIXED_PITCH
|
FF_DONTCARE
;
lstrcpyW
(
Globals
.
lfFont
.
lfFaceName
,
systemW
);
LoadString
(
Globals
.
hInstance
,
STRING_PAGESETUP_HEADERVALUE
,
Globals
.
szHeader
,
LoadString
W
(
Globals
.
hInstance
,
STRING_PAGESETUP_HEADERVALUE
,
Globals
.
szHeader
,
sizeof
(
Globals
.
szHeader
)
/
sizeof
(
Globals
.
szHeader
[
0
]));
LoadString
(
Globals
.
hInstance
,
STRING_PAGESETUP_FOOTERVALUE
,
Globals
.
szFooter
,
LoadString
W
(
Globals
.
hInstance
,
STRING_PAGESETUP_FOOTERVALUE
,
Globals
.
szFooter
,
sizeof
(
Globals
.
szFooter
)
/
sizeof
(
Globals
.
szFooter
[
0
]));
if
(
RegOpenKeyW
(
HKEY_CURRENT_USER
,
notepad_reg_key
,
&
hkey
)
==
ERROR_SUCCESS
)
...
...
@@ -319,11 +319,11 @@ static VOID NOTEPAD_InitData(VOID)
static
const
WCHAR
txt_files
[]
=
{
'*'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
all_files
[]
=
{
'*'
,
'.'
,
'*'
,
0
};
LoadString
(
Globals
.
hInstance
,
STRING_TEXT_FILES_TXT
,
p
,
MAX_STRING_LEN
);
LoadString
W
(
Globals
.
hInstance
,
STRING_TEXT_FILES_TXT
,
p
,
MAX_STRING_LEN
);
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpyW
(
p
,
txt_files
);
p
+=
lstrlenW
(
p
)
+
1
;
LoadString
(
Globals
.
hInstance
,
STRING_ALL_FILES
,
p
,
MAX_STRING_LEN
);
LoadString
W
(
Globals
.
hInstance
,
STRING_ALL_FILES
,
p
,
MAX_STRING_LEN
);
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpyW
(
p
,
all_files
);
p
+=
lstrlenW
(
p
)
+
1
;
...
...
@@ -353,7 +353,7 @@ static VOID NOTEPAD_InitMenuPopup(HMENU menu, int index)
EnableMenuItem
(
menu
,
CMD_DELETE
,
enable
);
EnableMenuItem
(
menu
,
CMD_SELECT_ALL
,
GetWindowTextLength
(
Globals
.
hEdit
)
?
MF_ENABLED
:
MF_GRAYED
);
GetWindowTextLength
W
(
Globals
.
hEdit
)
?
MF_ENABLED
:
MF_GRAYED
);
}
static
LPWSTR
NOTEPAD_StrRStr
(
LPWSTR
pszSource
,
LPWSTR
pszLast
,
LPWSTR
pszSrch
)
...
...
@@ -380,10 +380,10 @@ void NOTEPAD_DoFind(FINDREPLACEW *fr)
int
fileLen
;
DWORD
pos
;
fileLen
=
GetWindowTextLength
(
Globals
.
hEdit
)
+
1
;
fileLen
=
GetWindowTextLength
W
(
Globals
.
hEdit
)
+
1
;
content
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fileLen
*
sizeof
(
WCHAR
));
if
(
!
content
)
return
;
GetWindowText
(
Globals
.
hEdit
,
content
,
fileLen
);
GetWindowText
W
(
Globals
.
hEdit
,
content
,
fileLen
);
SendMessageW
(
Globals
.
hEdit
,
EM_GETSEL
,
0
,
(
LPARAM
)
&
pos
);
switch
(
fr
->
Flags
&
(
FR_DOWN
|
FR_MATCHCASE
))
...
...
@@ -423,10 +423,10 @@ static void NOTEPAD_DoReplace(FINDREPLACEW *fr)
DWORD
pos
;
DWORD
pos_start
;
fileLen
=
GetWindowTextLength
(
Globals
.
hEdit
)
+
1
;
fileLen
=
GetWindowTextLength
W
(
Globals
.
hEdit
)
+
1
;
content
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fileLen
*
sizeof
(
WCHAR
));
if
(
!
content
)
return
;
GetWindowText
(
Globals
.
hEdit
,
content
,
fileLen
);
GetWindowText
W
(
Globals
.
hEdit
,
content
,
fileLen
);
SendMessageW
(
Globals
.
hEdit
,
EM_GETSEL
,
(
WPARAM
)
&
pos_start
,
(
LPARAM
)
&
pos
);
switch
(
fr
->
Flags
&
(
FR_DOWN
|
FR_MATCHCASE
))
...
...
@@ -457,10 +457,10 @@ static void NOTEPAD_DoReplaceAll(FINDREPLACEW *fr)
SendMessageW
(
Globals
.
hEdit
,
EM_SETSEL
,
0
,
0
);
while
(
TRUE
){
fileLen
=
GetWindowTextLength
(
Globals
.
hEdit
)
+
1
;
fileLen
=
GetWindowTextLength
W
(
Globals
.
hEdit
)
+
1
;
content
=
HeapAlloc
(
GetProcessHeap
(),
0
,
fileLen
*
sizeof
(
WCHAR
));
if
(
!
content
)
return
;
GetWindowText
(
Globals
.
hEdit
,
content
,
fileLen
);
GetWindowText
W
(
Globals
.
hEdit
,
content
,
fileLen
);
SendMessageW
(
Globals
.
hEdit
,
EM_GETSEL
,
0
,
(
LPARAM
)
&
pos
);
switch
(
fr
->
Flags
&
(
FR_DOWN
|
FR_MATCHCASE
))
...
...
@@ -529,12 +529,11 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
if
(
!
Globals
.
bWrapLongLines
)
dwStyle
|=
WS_HSCROLL
|
ES_AUTOHSCROLL
;
Globals
.
hEdit
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
editW
,
NULL
,
dwStyle
,
0
,
0
,
rc
.
right
,
rc
.
bottom
,
hWnd
,
Globals
.
hEdit
=
CreateWindowExW
(
WS_EX_CLIENTEDGE
,
editW
,
NULL
,
dwStyle
,
0
,
0
,
rc
.
right
,
rc
.
bottom
,
hWnd
,
NULL
,
Globals
.
hInstance
,
NULL
);
Globals
.
hFont
=
CreateFontIndirect
(
&
Globals
.
lfFont
);
Globals
.
hFont
=
CreateFontIndirect
W
(
&
Globals
.
lfFont
);
SendMessageW
(
Globals
.
hEdit
,
WM_SETFONT
,
(
WPARAM
)
Globals
.
hFont
,
FALSE
);
break
;
}
...
...
@@ -544,7 +543,7 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_DESTROYCLIPBOARD
:
/*MessageBox(Globals.hMainWnd, "Empty clipboard", "Debug", MB_ICONEXCLAMATION);*/
/*MessageBox
W
(Globals.hMainWnd, "Empty clipboard", "Debug", MB_ICONEXCLAMATION);*/
break
;
case
WM_CLOSE
:
...
...
@@ -579,7 +578,7 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
WCHAR
szFileName
[
MAX_PATH
];
HANDLE
hDrop
=
(
HANDLE
)
wParam
;
DragQueryFile
(
hDrop
,
0
,
szFileName
,
SIZEOF
(
szFileName
));
DragQueryFile
W
(
hDrop
,
0
,
szFileName
,
SIZEOF
(
szFileName
));
DragFinish
(
hDrop
);
DoOpenFile
(
szFileName
);
break
;
...
...
@@ -590,7 +589,7 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
default:
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0
;
}
...
...
@@ -601,12 +600,12 @@ static int AlertFileDoesNotExist(LPCWSTR szFileName)
WCHAR
szMessage
[
MAX_STRING_LEN
];
WCHAR
szResource
[
MAX_STRING_LEN
];
LoadString
(
Globals
.
hInstance
,
STRING_DOESNOTEXIST
,
szResource
,
SIZEOF
(
szResource
));
LoadString
W
(
Globals
.
hInstance
,
STRING_DOESNOTEXIST
,
szResource
,
SIZEOF
(
szResource
));
wsprintfW
(
szMessage
,
szResource
,
szFileName
);
LoadString
(
Globals
.
hInstance
,
STRING_ERROR
,
szResource
,
SIZEOF
(
szResource
));
LoadString
W
(
Globals
.
hInstance
,
STRING_ERROR
,
szResource
,
SIZEOF
(
szResource
));
nResult
=
MessageBox
(
Globals
.
hMainWnd
,
szMessage
,
szResource
,
nResult
=
MessageBox
W
(
Globals
.
hMainWnd
,
szMessage
,
szResource
,
MB_ICONEXCLAMATION
|
MB_YESNO
);
return
(
nResult
);
...
...
@@ -726,7 +725,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
static
const
WCHAR
className
[]
=
{
'N'
,
'o'
,
't'
,
'e'
,
'p'
,
'a'
,
'd'
,
0
};
static
const
WCHAR
winName
[]
=
{
'N'
,
'o'
,
't'
,
'e'
,
'p'
,
'a'
,
'd'
,
0
};
aFINDMSGSTRING
=
RegisterWindowMessage
(
FINDMSGSTRING
);
aFINDMSGSTRING
=
RegisterWindowMessage
W
(
FINDMSGSTRINGW
);
ZeroMemory
(
&
Globals
,
sizeof
(
Globals
));
Globals
.
hInstance
=
hInstance
;
...
...
@@ -742,7 +741,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
class
.
lpszMenuName
=
MAKEINTRESOURCEW
(
MAIN_MENU
);
class
.
lpszClassName
=
className
;
if
(
!
RegisterClassEx
(
&
class
))
return
FALSE
;
if
(
!
RegisterClassEx
W
(
&
class
))
return
FALSE
;
/* Setup windows */
...
...
@@ -759,7 +758,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
x
=
y
=
CW_USEDEFAULT
;
Globals
.
hMainWnd
=
CreateWindow
(
className
,
winName
,
WS_OVERLAPPEDWINDOW
,
x
,
y
,
CreateWindow
W
(
className
,
winName
,
WS_OVERLAPPEDWINDOW
,
x
,
y
,
main_rect
.
right
-
main_rect
.
left
,
main_rect
.
bottom
-
main_rect
.
top
,
NULL
,
NULL
,
Globals
.
hInstance
,
NULL
);
if
(
!
Globals
.
hMainWnd
)
...
...
@@ -775,16 +774,16 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
UpdateWindow
(
Globals
.
hMainWnd
);
DragAcceptFiles
(
Globals
.
hMainWnd
,
TRUE
);
HandleCommandLine
(
GetCommandLine
());
HandleCommandLine
(
GetCommandLine
W
());
hAccel
=
LoadAcceleratorsW
(
hInstance
,
MAKEINTRESOURCEW
(
ID_ACCEL
));
while
(
GetMessage
(
&
msg
,
0
,
0
,
0
))
while
(
GetMessage
W
(
&
msg
,
0
,
0
,
0
))
{
if
(
!
TranslateAccelerator
(
Globals
.
hMainWnd
,
hAccel
,
&
msg
)
&&
!
IsDialogMessage
(
Globals
.
hFindReplaceDlg
,
&
msg
))
if
(
!
TranslateAcceleratorW
(
Globals
.
hMainWnd
,
hAccel
,
&
msg
)
&&
!
IsDialogMessageW
(
Globals
.
hFindReplaceDlg
,
&
msg
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
}
}
return
msg
.
wParam
;
...
...
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