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
205721e7
Commit
205721e7
authored
Mar 24, 2000
by
Patrik Stridvall
Committed by
Alexandre Julliard
Mar 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ANSI C related compile problems.
parent
4bb532e7
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
278 additions
and
217 deletions
+278
-217
aviplay.c
programs/avitools/aviplay.c
+3
-3
cmdlgtst.c
programs/cmdlgtst/cmdlgtst.c
+198
-143
Da.rc
programs/notepad/Da.rc
+8
-8
De.rc
programs/notepad/De.rc
+2
-5
dialog.c
programs/notepad/dialog.c
+1
-1
regapi.c
programs/regapi/regapi.c
+54
-54
regtest.c
programs/regtest/regtest.c
+4
-0
view.c
programs/view/view.c
+2
-1
directory.c
programs/wcmd/directory.c
+3
-1
wcmdmain.c
programs/wcmd/wcmdmain.c
+3
-1
No files found.
programs/avitools/aviplay.c
View file @
205721e7
...
...
@@ -217,7 +217,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
int
i
,
palchanged
;
/* skip used colorentries. */
decodedbits
+=
bmi
->
biClrUsed
*
sizeof
(
RGBQUAD
);
decodedbits
=
(
char
*
)
decodedbits
+
bmi
->
biClrUsed
*
sizeof
(
RGBQUAD
);
palchanged
=
0
;
for
(
i
=
0
;
i
<
bmi
->
biClrUsed
;
i
++
)
{
if
(
(
palent
[
i
].
peRed
!=
rgb
[
i
].
rgbRed
)
||
...
...
@@ -245,8 +245,8 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg);
}
/* Argh. AVIs are upside down. */
for
(
i
=
0
;
i
<
dsdesc
.
dwHeight
;
i
++
)
{
memcpy
(
dsdesc
.
u1
.
lpSurface
+
(
i
*
dsdesc
.
lPitch
),
decodedbits
+
bytesline
*
(
dsdesc
.
dwHeight
-
i
-
1
),
memcpy
(
(
char
*
)
dsdesc
.
u1
.
lpSurface
+
(
i
*
dsdesc
.
lPitch
),
(
char
*
)
decodedbits
+
bytesline
*
(
dsdesc
.
dwHeight
-
i
-
1
),
bytesline
);
}
...
...
programs/cmdlgtst/cmdlgtst.c
View file @
205721e7
// (c) 1999-2000 Eric Williams. Rights as specified under the WINE
// License. Don't hoard code; share it!
//
// One might call this a Commdlg test jig. Its sole function in life
// is to call the Commdlg Common Dialogs. The results of a call to
// File Open or File Save are printed in the upper left corner;
// Font adjusts the font of the printout, and Color adjusts the color
// of the background.
// Ideally it would also do event logging and be a bit less stupid
// about displaying the results of the various requesters. But hey,
// it's only a first step. :-)
/*
* (c) 1999-2000 Eric Williams. Rights as specified under the WINE
* License. Don't hoard code; share it!
*/
/*
* One might call this a Commdlg test jig. Its sole function in life
* is to call the Commdlg Common Dialogs. The results of a call to
* File Open or File Save are printed in the upper left corner;
* Font adjusts the font of the printout, and Color adjusts the color
* of the background.
*/
/*
* Ideally it would also do event logging and be a bit less stupid
* about displaying the results of the various requesters. But hey,
* it's only a first step. :-)
*/
#include <windows.h>
#include <commdlg.h>
...
...
@@ -18,37 +23,47 @@
#include <string.h>
#include "cmdlgtst.h"
// This structure is to set up flag / control associations for the custom
// requesters. The ft_id is the id for the control (usually generated
// by the system) and the ft_bit is the flag bit which goes into the
// settings longword for the various Commdlg structures. It is assumed
// that all flags fit in an unsigned long and that all bits are in fact
// one bit.
// The array of entries is terminated by {IDOK, 0}; the assumption is that
// IDOK would never be associated with a dialogbox control (since it's
// usually the ID of the OK button}.
/*
* This structure is to set up flag / control associations for the custom
* requesters. The ft_id is the id for the control (usually generated
* by the system) and the ft_bit is the flag bit which goes into the
* settings longword for the various Commdlg structures. It is assumed
* that all flags fit in an unsigned long and that all bits are in fact
* one bit.
*/
/*
* The array of entries is terminated by {IDOK, 0}; the assumption is that
* IDOK would never be associated with a dialogbox control (since it's
* usually the ID of the OK button}.
*/
struct
FlagTableEntry
{
int
ft_id
;
unsigned
long
ft_bit
;
};
//#define FAR
#if 0
#define FAR
#endif
#define EXPORT
static
char
menuName
[]
=
"CmdlgtstMenu"
;
static
char
className
[]
=
"CmdlgtstClass"
;
static
char
windowName
[]
=
"Cmdlgtst Window"
;
// global hInstance variable. This makes the code non-threadable,
// but wotthehell; this is Win32 anyway! (Though it does work
// under Win16, if one doesn't run more than one copy at a time.)
/*
* global hInstance variable. This makes the code non-threadable,
* but wotthehell; this is Win32 anyway! (Though it does work
* under Win16, if one doesn't run more than one copy at a time.)
*/
static
HINSTANCE
g_hInstance
;
// global CommDlg data structures for modals. These are placed here
// so that the custom dialog boxes can get at them.
/*
* global CommDlg data structures for modals. These are placed here
* so that the custom dialog boxes can get at them.
*/
static
PRINTDLG
pd
;
static
COLORREF
cc_cr
[
16
];
...
...
@@ -60,7 +75,7 @@ static char ofn_result[1024];
static
char
ofn_titleresult
[
128
];
static
OPENFILENAME
ofn
;
/
/ Stuff for find and replace. These are modeless, so I have to put them here.
/
* Stuff for find and replace. These are modeless, so I have to put them here. */
static
HWND
findDialogBox
=
0
;
static
UINT
findMessageId
=
0
;
...
...
@@ -68,39 +83,43 @@ static UINT findMessageId = 0;
static
FINDREPLACE
frS
;
static
char
fromstring
[
1024
],
tostring
[
1024
];
/
/ Stuff for the drawing of the window(s). I put them here for convenience.
/
* Stuff for the drawing of the window(s). I put them here for convenience. */
static
COLORREF
fgColor
=
RGB
(
0
,
0
,
0
);
/
/ not settable
static
COLORREF
bgColor
=
RGB
(
255
,
255
,
255
);
/
/ COLOR dialog
static
COLORREF
txtColor
=
RGB
(
0
,
0
,
0
);
/
/ settable if one enables CF_EFFECTS
static
COLORREF
fgColor
=
RGB
(
0
,
0
,
0
);
/
* not settable */
static
COLORREF
bgColor
=
RGB
(
255
,
255
,
255
);
/
* COLOR dialog */
static
COLORREF
txtColor
=
RGB
(
0
,
0
,
0
);
/
* settable if one enables CF_EFFECTS */
/
/ Utility routines.
/
* Utility routines. */
void
nyi
(
HWND
hWnd
)
{
/
/ "Hi there! I'm not yet implemented!"
/
* "Hi there! I'm not yet implemented!" */
MessageBox
(
hWnd
,
"Not yet implemented!"
,
"NYI"
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
UINT
CALLBACK
dummyfnHook
(
HWND
hWnd
,
UINT
msg
,
UINT
wParam
,
UINT
lParam
)
{
// If the user specifies something that needs an awfully stupid hook function,
// this is the one to use. It's a no-op, and says "I didn't do anything."
/*
* If the user specifies something that needs an awfully stupid hook function,
* this is the one to use. It's a no-op, and says "I didn't do anything."
*/
(
void
)
hWnd
;
(
void
)
msg
;
(
void
)
wParam
;
(
void
)
lParam
;
printf
(
"dummyfnhook
\n
"
);
/
/ visible under Wine, but Windows probably won't see it!
printf
(
"dummyfnhook
\n
"
);
/
* visible under Wine, but Windows probably won't see it! */
return
0
;
}
// Initialization code. This code simply shoves in predefined
// data into the COMMDLG data structures; in the future, I might use
// a series of loadable resources, or static initializers; of course,
// if Microsoft decides to change the field ordering, I'd be screwed.
/*
* Initialization code. This code simply shoves in predefined
* data into the COMMDLG data structures; in the future, I might use
* a series of loadable resources, or static initializers; of course,
* if Microsoft decides to change the field ordering, I'd be screwed.
*/
void
mwi_Print
(
HWND
hWnd
)
{
...
...
@@ -126,7 +145,7 @@ void mwi_Color(HWND hWnd)
{
int
i
;
/
/ there's probably an init call for this, somewhere.
/
* there's probably an init call for this, somewhere. */
for
(
i
=
0
;
i
<
16
;
i
++
)
cc_cr
[
i
]
=
RGB
(
0
,
0
,
0
);
...
...
@@ -148,8 +167,8 @@ void mwi_Font(HWND hWnd)
cf
.
hwndOwner
=
hWnd
;
cf
.
hDC
=
0
;
cf
.
lpLogFont
=
&
cf_lf
;
cf
.
Flags
=
CF_SCREENFONTS
;
/
/ something's needed for display; otherwise it craps out with an error
cf
.
rgbColors
=
RGB
(
0
,
0
,
0
);
/
/ what is *this* doing here??
cf
.
Flags
=
CF_SCREENFONTS
;
/
* something's needed for display; otherwise it craps out with an error */
cf
.
rgbColors
=
RGB
(
0
,
0
,
0
);
/
* what is *this* doing here?? */
cf
.
lCustData
=
0
;
cf
.
lpfnHook
=
0
;
cf
.
lpTemplateName
=
0
;
...
...
@@ -159,7 +178,7 @@ void mwi_Font(HWND hWnd)
cf
.
nSizeMin
=
8
;
cf
.
nSizeMax
=
72
;
cf_lf
.
lfHeight
=
-
18
;
/
/ this can be positive or negative, but negative is usually used.
cf_lf
.
lfHeight
=
-
18
;
/
* this can be positive or negative, but negative is usually used. */
}
void
mwi_File
(
HWND
hWnd
)
...
...
@@ -216,12 +235,14 @@ void mwi_InitAll(HWND hWnd)
mwi_FindReplace
(
hWnd
);
}
// Various configurations for the window. Ideally, this
// would be stored with the window itself, but then, this
// isn't the brightest of apps. Wouldn't be hard to set up,
// though -- one of the neater functions of Windows, but if
// someone decides to load the windows themselves from resources,
// there might be a problem.
/*
* Various configurations for the window. Ideally, this
* would be stored with the window itself, but then, this
* isn't the brightest of apps. Wouldn't be hard to set up,
* though -- one of the neater functions of Windows, but if
* someone decides to load the windows themselves from resources,
* there might be a problem.
*/
void
paintMainWindow
(
HWND
hWnd
,
UINT
iMessage
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -235,7 +256,7 @@ void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
(
void
)
wParam
;
(
void
)
lParam
;
/
/ Commence painting!
/
* Commence painting! */
BeginPaint
(
hWnd
,
&
ps
);
GetClientRect
(
hWnd
,
(
LPRECT
)
&
rect
);
...
...
@@ -244,20 +265,22 @@ void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
brush
=
(
HBRUSH
)
SelectObject
(
ps
.
hdc
,
CreateSolidBrush
(
bgColor
));
font
=
(
HFONT
)
SelectObject
(
ps
.
hdc
,
CreateFontIndirect
(
&
cf_lf
));
// Ideally, we'd only need to draw the exposed bit.
// But something in BeginPaint is screwing up the rectangle.
// Either that, or Windows is drawing it wrong. AARGH!
// Rectangle(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom);
/*
* Ideally, we'd only need to draw the exposed bit.
* But something in BeginPaint is screwing up the rectangle.
* Either that, or Windows is drawing it wrong. AARGH!
* Rectangle(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom);
*/
Rectangle
(
ps
.
hdc
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
/
/ now draw a couple of lines, just for giggles.
/
* now draw a couple of lines, just for giggles. */
MoveToEx
(
ps
.
hdc
,
rect
.
left
,
rect
.
top
,
(
POINT
FAR
*
)
0
);
LineTo
(
ps
.
hdc
,
rect
.
right
,
rect
.
bottom
);
MoveToEx
(
ps
.
hdc
,
rect
.
left
,
rect
.
bottom
,
(
POINT
FAR
*
)
0
);
LineTo
(
ps
.
hdc
,
rect
.
right
,
rect
.
top
);
/
/ draw some text
/
* draw some text */
SetTextAlign
(
ps
.
hdc
,
TA_CENTER
|
TA_BASELINE
);
SetTextColor
(
ps
.
hdc
,
txtColor
);
...
...
@@ -267,8 +290,10 @@ void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
TextOut
(
ps
.
hdc
,
rect
.
left
+
10
,
rect
.
top
+
10
,
ofn_result
,
strlen
(
ofn_result
));
TextOut
(
ps
.
hdc
,
rect
.
left
+
10
,
rect
.
top
-
cf_lf
.
lfHeight
+
10
,
ofn_titleresult
,
strlen
(
ofn_titleresult
));
// set the HDC back to the old pen and brush,
// and delete the newly created objects.
/*
* set the HDC back to the old pen and brush,
* and delete the newly created objects.
*/
pen
=
(
HPEN
)
SelectObject
(
ps
.
hdc
,
pen
);
DeleteObject
(
pen
);
...
...
@@ -280,10 +305,12 @@ void paintMainWindow(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
EndPaint
(
hWnd
,
&
ps
);
}
// This function simply returns an error indication. Naturally,
// I do not (yet) see an elegant method by which one can convert
// the CDERR_xxx return values into something resembling usable text;
// consult cderr.h to see what was returned.
/*
* This function simply returns an error indication. Naturally,
* I do not (yet) see an elegant method by which one can convert
* the CDERR_xxx return values into something resembling usable text;
* consult cderr.h to see what was returned.
*/
void
mw_checkError
(
HWND
hWnd
,
BOOL
explicitcancel
)
{
...
...
@@ -299,10 +326,12 @@ void mw_checkError(HWND hWnd, BOOL explicitcancel)
}
}
// The actual dialog function calls. These merely wrap the Commdlg
// calls, and do something (not so) intelligent with the result.
// Ideally, the main window would refresh and take into account the
// various values specified in the dialog.
/*
* The actual dialog function calls. These merely wrap the Commdlg
* calls, and do something (not so) intelligent with the result.
* Ideally, the main window would refresh and take into account the
* various values specified in the dialog.
*/
void
mw_ColorSetup
(
HWND
hWnd
)
{
...
...
@@ -363,8 +392,10 @@ void mw_SaveSetup(HWND hWnd)
else
mw_checkError
(
hWnd
,
FALSE
);
}
// Can't find documentation in Borland for this one. Does it
// exist at all, or is it merely a subdialog of Print?
/*
* Can't find documentation in Borland for this one. Does it
* exist at all, or is it merely a subdialog of Print?
*/
void
mw_PSetupSetup
(
HWND
hWnd
)
{
...
...
@@ -374,20 +405,26 @@ void mw_PSetupSetup(HWND hWnd)
void
mw_PrintSetup
(
HWND
hWnd
)
{
if
(
PrintDlg
(
&
pd
))
{
// the following are suggested in the Borland documentation,
// but aren't that useful until WinE starts to actually
// function with respect to printing.
/*
* the following are suggested in the Borland documentation,
* but aren't that useful until WinE starts to actually
* function with respect to printing.
*/
// Escape(tmp.hDC, STARTDOC, 8, "Test-Doc", NULL);
#if 0
Escape(tmp.hDC, STARTDOC, 8, "Test-Doc", NULL);
#endif
/* Print text and rectangle */
// TextOut(tmp.hDC, 50, 50, "Common Dialog Test Page", 23);
#if 0
TextOut(tmp.hDC, 50, 50, "Common Dialog Test Page", 23);
// Rectangle(tmp.hDC, 50, 90, 625, 105);
// Escape(tmp.hDC, NEWFRAME, 0, NULL, NULL);
// Escape(tmp.hDC, ENDDOC, 0, NULL, NULL);
// DeleteDC(tmp.hDC);
Rectangle(tmp.hDC, 50, 90, 625, 105);
Escape(tmp.hDC, NEWFRAME, 0, NULL, NULL);
Escape(tmp.hDC, ENDDOC, 0, NULL, NULL);
DeleteDC(tmp.hDC);
#endif
if
(
pd
.
hDevMode
!=
0
)
GlobalFree
(
pd
.
hDevMode
);
if
(
pd
.
hDevNames
!=
0
)
...
...
@@ -401,8 +438,10 @@ void mw_PrintSetup(HWND hWnd)
else
mw_checkError
(
hWnd
,
TRUE
);
}
// Some support functions for the custom dialog box handlers.
// In particular, we have to set things properly, and get the flags back.
/*
* Some support functions for the custom dialog box handlers.
* In particular, we have to set things properly, and get the flags back.
*/
void
mwcd_SetFlags
(
HWND
hWnd
,
struct
FlagTableEntry
*
table
,
unsigned
long
flags
)
{
...
...
@@ -428,10 +467,12 @@ unsigned long mwcd_GetFlags(HWND hWnd, struct FlagTableEntry * table)
return
l
;
}
// These functions are the custom dialog box handlers.
// The division of labor may be a tad peculiar; in particular,
// the flag tables should probably be in the main functions,
// not the handlers. I'll fix that later; this works as of right now.
/*
* These functions are the custom dialog box handlers.
* The division of labor may be a tad peculiar; in particular,
* the flag tables should probably be in the main functions,
* not the handlers. I'll fix that later; this works as of right now.
*/
BOOL
mwcd_Setup
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
struct
FlagTableEntry
*
table
,
unsigned
long
*
flags
)
...
...
@@ -441,12 +482,12 @@ BOOL mwcd_Setup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
switch
(
uMsg
)
{
case
WM_INITDIALOG
:
/
/ Set the controls properly.
/
* Set the controls properly. */
mwcd_SetFlags
(
hWnd
,
table
,
*
flags
);
return
TRUE
;
/
/ I would return FALSE if I explicitly called SetFocus().
// As usual, Windows is weird.
return
TRUE
;
/
* I would return FALSE if I explicitly called SetFocus(). */
/* As usual, Windows is weird. */
case
WM_COMMAND
:
switch
(
wParam
)
{
...
...
@@ -460,15 +501,15 @@ BOOL mwcd_Setup(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
break
;
case
CM_R_HELP
:
break
;
/
/ help? We don't need no steenkin help!
break
;
/
* help? We don't need no steenkin help! */
default:
break
;
/
/ eat the message
break
;
/
* eat the message */
}
return
TRUE
;
default:
return
FALSE
;
/
/ since I don't process this particular message
return
FALSE
;
/
* since I don't process this particular message */
}
}
...
...
@@ -609,17 +650,18 @@ BOOL CALLBACK mwcd_About(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
(
void
)
lParam
;
switch
(
uMsg
)
{
case
WM_INITDIALOG
:
return
TRUE
;
/
/ let WINDOWS set the focus.
case
WM_COMMAND
:
EndDialog
(
hWnd
,
0
);
return
TRUE
;
/
/ it's our OK button.
default:
return
FALSE
;
/
/ it's something else, let Windows worry about it
case
WM_INITDIALOG
:
return
TRUE
;
/
* let WINDOWS set the focus. */
case
WM_COMMAND
:
EndDialog
(
hWnd
,
0
);
return
TRUE
;
/
* it's our OK button. */
default:
return
FALSE
;
/
* it's something else, let Windows worry about it */
}
}
// These functions call custom dialog boxes (resource-loaded, if I do this right).
// Right now they don't do a heck of a lot, but at some future time
// they will muck about with the flags (and be loaded from the flags) of
// the CommDlg structures initialized by the mwi_xxx() routines.
/*
* These functions call custom dialog boxes (resource-loaded, if I do this right).
* Right now they don't do a heck of a lot, but at some future time
* they will muck about with the flags (and be loaded from the flags) of
* the CommDlg structures initialized by the mwi_xxx() routines.
*/
void
mwc_ColorSetup
(
HWND
hWnd
)
{
...
...
@@ -651,10 +693,12 @@ void mwc_FileSetup(HWND hWnd)
if
(
r
<
0
)
{
MessageBox
(
hWnd
,
"Failure opening File_Flags_Dialog box"
,
"Error"
,
MB_ICONASTERISK
|
MB_OK
);
}
}
// Main window message dispatcher. Here the messages get chewed up
// and spit out. Note the ugly hack for the modeless Find/Replace box;
// this looks like it was bolted on with hexhead screws and is now
// dangling from Windows like a loose muffler. Sigh.
/*
* Main window message dispatcher. Here the messages get chewed up
* and spit out. Note the ugly hack for the modeless Find/Replace box;
* this looks like it was bolted on with hexhead screws and is now
* dangling from Windows like a loose muffler. Sigh.
*/
LRESULT
CALLBACK
EXPORT
mainWindowDispatcher
(
HWND
hWnd
,
...
...
@@ -686,31 +730,33 @@ LRESULT CALLBACK EXPORT mainWindowDispatcher(
}
else
switch
(
uMsg
)
{
case
WM_CREATE
:
// this is always the first message...at least as far as
// we are concerned.
/*
* this is always the first message...at least as far as
* we are concerned.
*/
mwi_InitAll
(
hWnd
);
break
;
case
WM_PAINT
:
/
/ Well, draw something!
/
* Well, draw something! */
paintMainWindow
(
hWnd
,
uMsg
,
wParam
,
lParam
);
break
;
case
WM_DESTROY
:
/
/ Uh oh. Eject! Eject! Eject!
/
* Uh oh. Eject! Eject! Eject! */
PostQuitMessage
(
0
);
break
;
case
WM_COMMAND
:
/
/ menu or accelerator pressed; do something.
/
* menu or accelerator pressed; do something. */
switch
(
wParam
)
{
case
CM_U_EXIT
:
/
/ Uh oh. Eject! Eject! Eject!
/
* Uh oh. Eject! Eject! Eject! */
PostQuitMessage
(
0
);
break
;
/
/ these actually call the Common Dialogs.
/
* these actually call the Common Dialogs. */
case
CM_U_COLOR
:
mw_ColorSetup
(
hWnd
);
return
1
;
...
...
@@ -736,9 +782,11 @@ LRESULT CALLBACK EXPORT mainWindowDispatcher(
case
CM_U_PRINT
:
mw_PrintSetup
(
hWnd
);
return
1
;
// these set up various flags and values in the Common Dialog
// data structures, which are currently stored in static memory.
// The control dialogs themselves are resources as well.
/*
* these set up various flags and values in the Common Dialog
* data structures, which are currently stored in static memory.
* The control dialogs themselves are resources as well.
*/
case
CM_F_FILE
:
mwc_FileSetup
(
hWnd
);
return
1
;
...
...
@@ -760,7 +808,7 @@ LRESULT CALLBACK EXPORT mainWindowDispatcher(
return
1
;
case
CM_H_USAGE
:
DialogBox
(
g_hInstance
,
"UsageDialog"
,
hWnd
,
(
DLGPROC
)
mwcd_About
);
/
/ return value? *What* return value?
/
* return value? *What* return value? */
return
1
;
default:
...
...
@@ -774,7 +822,7 @@ LRESULT CALLBACK EXPORT mainWindowDispatcher(
return
0
;
}
/
/ Class registration. One might call this a Windowsism.
/
* Class registration. One might call this a Windowsism. */
int
registerMainWindowClass
(
HINSTANCE
hInstance
)
{
...
...
@@ -785,8 +833,10 @@ int registerMainWindowClass(HINSTANCE hInstance)
wndClass
.
cbClsExtra
=
0
;
wndClass
.
cbWndExtra
=
0
;
wndClass
.
hInstance
=
hInstance
;
//wndClass.hIcon = LoadIcon(hInstance, "whello");
//wndClass.hCursor = LoadCursor(hInstance, IDC_ARROW);
#if 0
wndClass.hIcon = LoadIcon(hInstance, "whello");
wndClass.hCursor = LoadCursor(hInstance, IDC_ARROW);
#endif
wndClass
.
hIcon
=
0
;
wndClass
.
hCursor
=
0
;
wndClass
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
WHITE_BRUSH
);
...
...
@@ -796,26 +846,28 @@ int registerMainWindowClass(HINSTANCE hInstance)
return
RegisterClass
(
&
wndClass
);
}
// Another Windowsism; this one's not too bad, as it compares
// favorably with CreateWindow() in X (mucking about with X Visuals
// can get messy; at least here we don't have to worry about that).
/*
* Another Windowsism; this one's not too bad, as it compares
* favorably with CreateWindow() in X (mucking about with X Visuals
* can get messy; at least here we don't have to worry about that).
*/
HWND
createMainWindow
(
HINSTANCE
hInstance
,
int
show
)
{
HWND
hWnd
;
hWnd
=
CreateWindow
(
className
,
/
/ classname
windowName
,
/
/ windowname/title
WS_OVERLAPPEDWINDOW
,
/
/ dwStyle
0
,
/
/x
0
,
/
/y
CW_USEDEFAULT
,
/
/width
CW_USEDEFAULT
,
/
/height
0
,
/
/ parent window
0
,
/
/ menu
hInstance
,
/
/ instance
0
/
/ passthrough for MDI
className
,
/
* classname */
windowName
,
/
* windowname/title */
WS_OVERLAPPEDWINDOW
,
/
* dwStyle */
0
,
/
* x */
0
,
/
* y */
CW_USEDEFAULT
,
/
* width */
CW_USEDEFAULT
,
/
* height */
0
,
/
* parent window */
0
,
/
* menu */
hInstance
,
/
* instance */
0
/
* passthrough for MDI */
);
if
(
hWnd
==
0
)
return
0
;
...
...
@@ -841,12 +893,14 @@ int messageLoop(HINSTANCE hInstance, HWND hWnd)
return
msg
.
wParam
;
}
// Oh, did we tell you that main() isn't the name of the
// thing called in a Win16/Win32 app? And then there are
// the lack of argument lists, the necessity (at least in Win16)
// of having to deal with class registration exactly once (as the
// app may be run again), and some other bizarre holdovers from
// Windows 3.x days. But hey, Solitaire still works.
/*
* Oh, did we tell you that main() isn't the name of the
* thing called in a Win16/Win32 app? And then there are
* the lack of argument lists, the necessity (at least in Win16)
* of having to deal with class registration exactly once (as the
* app may be run again), and some other bizarre holdovers from
* Windows 3.x days. But hey, Solitaire still works.
*/
int
PASCAL
WinMain
(
HINSTANCE
hInstance
,
HINSTANCE
hPrevInstance
,
...
...
@@ -873,8 +927,9 @@ int PASCAL WinMain(
return
messageLoop
(
hInstance
,
hWnd
);
}
// And now the end of the program. Enjoy.
// (c) 1999-2000 Eric Williams. Rights as specified under the WINE
// License. Don't hoard code; share it!
/* And now the end of the program. Enjoy. */
/*
* (c) 1999-2000 Eric Williams. Rights as specified under the WINE
* License. Don't hoard code; share it!
*/
programs/notepad/Da.rc
View file @
205721e7
...
...
@@ -64,14 +64,14 @@
#define DIALOG_PAGESETUP_BOTTOM "&Bund:"
/* Strings */
#define STRING_PAGESETUP_HEADERVALUE "&n" /* FIXME */
#define STRING_PAGESETUP_FOOTERVALUE "Page &s" /* FIXME */
#define STRING_PAGESETUP_LEFTVALUE "20 mm" /* FIXME */
#define STRING_PAGESETUP_RIGHTVALUE "20 mm" /* FIXME */
#define STRING_PAGESETUP_TOPVALUE "25 mm" /* FIXME */
#define STRING_PAGESETUP_BOTTOMVALUE "25 mm" /* FIXME */
/* Strings */
#define STRING_PAGESETUP_HEADERVALUE "&n" /* FIXME */
#define STRING_PAGESETUP_FOOTERVALUE "Page &s" /* FIXME */
#define STRING_PAGESETUP_LEFTVALUE "20 mm" /* FIXME */
#define STRING_PAGESETUP_RIGHTVALUE "20 mm" /* FIXME */
#define STRING_PAGESETUP_TOPVALUE "25 mm" /* FIXME */
#define STRING_PAGESETUP_BOTTOMVALUE "25 mm" /* FIXME */
#define STRING_NOTEPAD "Notesblok"
#define STRING_ERROR "FEJL"
...
...
programs/notepad/De.rc
View file @
205721e7
...
...
@@ -67,14 +67,14 @@
/* Strings */
#define STRING_PAGESETUP_HEADERVALUE "&n"
#define STRING_PAGESETUP_FOOTERVALUE "Page &s"
#define STRING_PAGESETUP_LEFTVALUE "20 mm"
#define STRING_PAGESETUP_RIGHTVALUE "20 mm"
#define STRING_PAGESETUP_TOPVALUE "25 mm"
#define STRING_PAGESETUP_BOTTOMVALUE "25 mm"
#define STRING_NOTEPAD "Editor"
#define STRING_ERROR "FEHLER"
#define STRING_WARNING "ACHTUNG"
...
...
@@ -102,5 +102,3 @@ um diese Funktion \nabzuschließen. Beenden Sie eine oder mehrere \
\nAnwendungen, um den verfügbaren Arbeitsspeicher zu \nerhöhen."
#include "notepad.rc"
\ No newline at end of file
programs/notepad/dialog.c
View file @
205721e7
...
...
@@ -150,7 +150,7 @@ void DoOpenFile(LPCSTR szFileName) {
WORD
nResult
;
/* Close any files and prompt to save changes */
if
(
DoCloseFile
)
{
if
(
DoCloseFile
()
)
{
GetFileTitle
(
szFileName
,
Globals
.
szFileName
,
sizeof
(
Globals
.
szFileName
));
LANGUAGE_UpdateWindowCaption
();
hFile
=
_lopen
(
szFileName
,
OF_READ
);
...
...
programs/regapi/regapi.c
View file @
205721e7
...
...
@@ -160,60 +160,60 @@ static void processQueryValue(LPSTR cmdline);
/*
* Help Text displayed when invalid parameters are provided
*/
static
char
helpText
[]
=
"
NAME
regapi - provide a command line interface to the wine registry.
SYNOPSIS
regapi commandName [-force] < file
DESCRIPTION
regapi allows editing the wine registry. It processes the given
commandName for every line in the stdin data stream. Input data
format may vary depending on the commandName see INPUT FILE FORMAT.
OPTIONS
commandName
Instruct regapi about what action to perform on the data stream.
Currently, only setValue and queryValue are supported and
implemented.
-force
When provided the action will be performed anyway. This may
have a different meaning depending on the context. For example,
when providing -force to setValue, the value is set even if it
was previously set to another value.
< file
STDIN channel, provide a file name with line of the appropriate
format.
INPUT FILE FORMAT
setValue
The input file format required by the setValue command is similar
to the one obtained from regedit.exe export option. The only
difference is that multi line values are not supported, the
value data must be on a single line.
[KEY_CLASS
\\
Some
\\
Path
\\
For
\\
A
\\
Key]
\"
Value1
\"
=
\"
Data1
\
"
\"
Value2
\"
=
\"
Data2
\
"
\"
Valuen
\"
=
\"
Datan
\
"
...
queryValue
The input file format required by the queryValue command is
similar to the one required by setValue. The only
difference is that you only provide the value name.
[KEY_CLASS
\\
Some
\\
Path
\\
For
\\
A
\\
Key]
\"
Value1
\
"
\"
Value2
\
"
\"
Valuen
\
"
...
February 1999.
"
;
static
char
helpText
[]
=
"NAME
\n
"
" regapi - provide a command line interface to the wine registry.
\n
"
"
\n
"
"SYNOPSIS
\n
"
" regapi commandName [-force] < file
\n
"
"
\n
"
"DESCRIPTION
\n
"
" regapi allows editing the wine registry. It processes the given
\n
"
" commandName for every line in the stdin data stream. Input data
\n
"
" format may vary depending on the commandName see INPUT FILE FORMAT.
\n
"
"
\n
"
"OPTIONS
\n
"
" commandName
\n
"
" Instruct regapi about what action to perform on the data stream.
\n
"
" Currently, only setValue and queryValue are supported and
\n
"
" implemented.
\n
"
"
\n
"
" -force
\n
"
" When provided the action will be performed anyway. This may
\n
"
" have a different meaning depending on the context. For example,
\n
"
" when providing -force to setValue, the value is set even if it
\n
"
" was previously set to another value.
\n
"
"
\n
"
" < file
\n
"
" STDIN channel, provide a file name with line of the appropriate
\n
"
" format.
\n
"
"
\n
"
"INPUT FILE FORMAT
\n
"
"
\n
"
" setValue
\n
"
" The input file format required by the setValue command is similar
\n
"
" to the one obtained from regedit.exe export option. The only
\n
"
" difference is that multi line values are not supported, the
\n
"
" value data must be on a single line.
\n
"
"
\n
"
" [KEY_CLASS
\\
Some
\\
Path
\\
For
\\
A
\\
Key]
\n
"
"
\"
Value1
\"
=
\"
Data1
\"\n
"
"
\"
Value2
\"
=
\"
Data2
\"\n
"
"
\"
Valuen
\"
=
\"
Datan
\"\n
"
" ...
\n
"
"
\n
"
" queryValue
\n
"
" The input file format required by the queryValue command is
\n
"
" similar to the one required by setValue. The only
\n
"
" difference is that you only provide the value name.
\n
"
"
\n
"
" [KEY_CLASS
\\
Some
\\
Path
\\
For
\\
A
\\
Key]
\n
"
"
\"
Value1
\"\n
"
"
\"
Value2
\"\n
"
"
\"
Valuen
\"\n
"
" ...
\n
"
" February 1999.
\n
"
;
/******************************************************************************
...
...
programs/regtest/regtest.c
View file @
205721e7
...
...
@@ -20,6 +20,10 @@
#include <winerror.h>
#include <winnt.h>
#ifndef __GNUC__
#define __FUNCTION__ "<function>"
#endif
/* True this when security is implemented */
#define CHECK_SAM FALSE
...
...
programs/view/view.c
View file @
205721e7
...
...
@@ -26,9 +26,10 @@ BOOL isAldus;
BOOL
FileOpen
(
HWND
hWnd
,
char
*
fn
)
{
OPENFILENAME
ofn
=
{
sizeof
(
OPENFILENAME
),
0
,
0
,
"Metafiles
\0
*.wmf
\0
"
,
NULL
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
,
FN_LENGTH
,
NULL
,
0
,
NULL
,
NULL
,
OFN_CREATEPROMPT
|
OFN_SHOWHELP
,
0
,
0
,
NULL
,
0
,
NULL
};
ofn
.
lpstrFilter
=
"Metafiles
\0
*.wmf
\0
"
;
ofn
.
hwndOwner
=
hWnd
;
ofn
.
lpstrFile
=
fn
;
return
GetOpenFileName
(
&
ofn
);
...
...
programs/wcmd/directory.c
View file @
205721e7
...
...
@@ -202,7 +202,9 @@ __int64 byte_count;
if
((
recurse
)
&&
((
fd
+
i
)
->
cFileName
[
0
]
!=
'.'
)
&&
((
fd
+
i
)
->
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
// GetFullPathName ((fd+i)->cFileName, sizeof(string), string, NULL);
#if 0
GetFullPathName ((fd+i)->cFileName, sizeof(string), string, NULL);
#endif
p
=
strrchr
(
search_path
,
'\\'
);
lstrcpyn
(
string
,
search_path
,
(
p
-
search_path
+
2
));
lstrcat
(
string
,
(
fd
+
i
)
->
cFileName
);
...
...
programs/wcmd/wcmdmain.c
View file @
205721e7
...
...
@@ -106,7 +106,9 @@ HANDLE h;
h
=
CreateFile
(
string
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
h
);
// WCMD_batch (string, " ");
#if 0
WCMD_batch (string, " ");
#endif
}
/*
...
...
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