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
b0905acb
Commit
b0905acb
authored
Oct 22, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Oct 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notepad: Add a generic function for message boxes with a string parameter.
parent
10c1faa7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
Makefile.in
programs/notepad/Makefile.in
+1
-1
dialog.c
programs/notepad/dialog.c
+18
-17
dialog.h
programs/notepad/dialog.h
+1
-0
No files found.
programs/notepad/Makefile.in
View file @
b0905acb
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
notepad.exe
APPMODE
=
-mwindows
IMPORTS
=
comdlg32 shell32 user32 gdi32 msvcrt advapi32 kernel32
IMPORTS
=
comdlg32 shell32
shlwapi
user32 gdi32 msvcrt advapi32 kernel32
EXTRAINCL
=
-I
$(TOPSRCDIR)
/include/msvcrt
MODCFLAGS
=
@BUILTINFLAG@
EXTRADEFS
=
-DNO_LIBWINE_PORT
...
...
programs/notepad/dialog.c
View file @
b0905acb
...
...
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <windows.h>
#include <commdlg.h>
#include <shlwapi.h>
#include "main.h"
#include "dialog.h"
...
...
@@ -78,39 +79,39 @@ static void UpdateWindowCaption(void)
SetWindowText
(
Globals
.
hMainWnd
,
szCaption
);
}
static
void
AlertFileNotFound
(
LPCWSTR
szFileName
)
int
DIALOG_StringMsgBox
(
HWND
hParent
,
int
formatId
,
LPCWSTR
szString
,
DWORD
dwFlags
)
{
WCHAR
szMessage
[
MAX_STRING_LEN
];
WCHAR
szResource
[
MAX_STRING_LEN
];
/* Load and format szMessage */
LoadString
(
Globals
.
hInstance
,
STRING_NOTFOUND
,
szResource
,
SIZEOF
(
szResource
));
w
sprintf
(
szMessage
,
szResource
,
szFileName
);
LoadString
(
Globals
.
hInstance
,
formatId
,
szResource
,
SIZEOF
(
szResource
));
w
nsprintf
(
szMessage
,
SIZEOF
(
szMessage
),
szResource
,
szString
);
/* Load szCaption */
LoadString
(
Globals
.
hInstance
,
STRING_ERROR
,
szResource
,
SIZEOF
(
szResource
));
if
((
dwFlags
&
MB_ICONMASK
)
==
MB_ICONEXCLAMATION
)
LoadString
(
Globals
.
hInstance
,
STRING_ERROR
,
szResource
,
SIZEOF
(
szResource
));
else
LoadString
(
Globals
.
hInstance
,
STRING_NOTEPAD
,
szResource
,
SIZEOF
(
szResource
));
/* Display Modal Dialog */
MessageBox
(
Globals
.
hMainWnd
,
szMessage
,
szResource
,
MB_ICONEXCLAMATION
);
if
(
hParent
==
NULL
)
hParent
=
Globals
.
hMainWnd
;
return
MessageBox
(
hParent
,
szMessage
,
szResource
,
dwFlags
);
}
static
void
AlertFileNotFound
(
LPCWSTR
szFileName
)
{
DIALOG_StringMsgBox
(
NULL
,
STRING_NOTFOUND
,
szFileName
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
static
int
AlertFileNotSaved
(
LPCWSTR
szFileName
)
{
WCHAR
szMessage
[
MAX_STRING_LEN
];
WCHAR
szResource
[
MAX_STRING_LEN
];
WCHAR
szUntitled
[
MAX_STRING_LEN
];
LoadString
(
Globals
.
hInstance
,
STRING_UNTITLED
,
szUntitled
,
SIZEOF
(
szUntitled
));
/* Load and format Message */
LoadString
(
Globals
.
hInstance
,
STRING_NOTSAVED
,
szResource
,
SIZEOF
(
szResource
));
wsprintf
(
szMessage
,
szResource
,
szFileName
[
0
]
?
szFileName
:
szUntitled
);
/* Load Caption */
LoadString
(
Globals
.
hInstance
,
STRING_NOTEPAD
,
szResource
,
SIZEOF
(
szResource
));
/* Display modal */
return
MessageBox
(
Globals
.
hMainWnd
,
szMessage
,
szResource
,
MB_ICONEXCLAMATION
|
MB_YESNOCANCEL
);
return
DIALOG_StringMsgBox
(
NULL
,
STRING_NOTSAVED
,
szFileName
[
0
]
?
szFileName
:
szUntitled
,
MB_ICONQUESTION
|
MB_YESNOCANCEL
);
}
/**
...
...
programs/notepad/dialog.h
View file @
b0905acb
...
...
@@ -49,6 +49,7 @@ VOID DIALOG_HelpNoWarranty(VOID);
VOID
DIALOG_HelpAboutWine
(
VOID
);
VOID
DIALOG_TimeDate
(
VOID
);
int
DIALOG_StringMsgBox
(
HWND
hParent
,
int
formatId
,
LPCWSTR
szString
,
DWORD
dwFlags
);
/* utility functions */
VOID
ShowLastError
(
void
);
...
...
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