Skip to content

Commit 287de6f

Browse files
committed
Updated project so that it builds with MSC 5 and Window 2 SDK.
* Always define MINMAXINFO struct as it doesn't exist in the Windows 2 SDK. * Tidied up Makefile and prevent excessive warning with MSC 5. * Updated Readme.md.
1 parent 62f72a6 commit 287de6f

3 files changed

Lines changed: 32 additions & 28 deletions

File tree

MainWnd.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ HWND CreateMainWindow();
1212

1313
/* Minimum and maximum window sizing */
1414
#ifndef WM_GETMINMAXINFO
15-
#define WM_GETMINMAXINFO 0x0024
16-
17-
typedef struct tagMINMAXINFO
18-
{
19-
POINT ptReserved;
20-
POINT ptMaxSize;
21-
POINT ptMaxPosition;
22-
POINT ptMinTrackSize;
23-
POINT ptMaxTrackSize;
24-
} MINMAXINFO;
15+
#define WM_GETMINMAXINFO 0x0024
2516
#endif
2617

18+
typedef struct tagMINMAXINFO
19+
{
20+
POINT ptReserved;
21+
POINT ptMaxSize;
22+
POINT ptMaxPosition;
23+
POINT ptMinTrackSize;
24+
POINT ptMaxTrackSize;
25+
} MINMAXINFO;
26+
2727
/* Button colour */
2828
#ifndef COLOR_BTNFACE
2929
#define COLOR_BTNFACE 15

Readme.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ accompanies the
1515
[Building Win16 GUI Applications in C](http://www.transmissionzero.co.uk/computing/win16-apps-in-c/)
1616
article on [Transmission Zero](http://www.transmissionzero.co.uk/).
1717

18-
The application is a little anarchronistic, since it makes use of functionality
18+
The application is a little anachronistic, since it makes use of functionality
1919
which didn't exist in Windows 1. An example is overlapped windows, which didn't
2020
exist until Windows 2 (Windows 1 only supported tiled windows). That doesn't
2121
magically make the functionality work on Windows 1, but means it works on the
@@ -36,13 +36,17 @@ Windows 3.1.
3636

3737
## Building the Application
3838

39-
To build the application with Microsoft C, open a command prompt, change to the
40-
directory containing the Makefile, and run "make Win1App". Note that you will
41-
need a very old version of the C compiler and Windows SDK to build the
42-
application. I built it with Microsoft C 4 (not to be confused with Visual C++
43-
4), but I believe it will compile with Microsoft C 5 as well. It cannot be built
44-
with newer tools, e.g. Visual C++ 1.52, and I'm not aware of any freely
45-
available tools you can use to build it.
39+
To build the application you will either need Microsoft C 4 with a Windows 1 SDK
40+
or Microsoft C 5 with a Windows 2 SDK. To perform the build, open a command
41+
prompt (with the relevant environment variables set that Microsoft C needs),
42+
change to the directory containing the Makefile, and run "make Win1App".
43+
44+
Note that Microsoft C should not be confused with Visual C++, as Visual C++ 4.0
45+
arrived on the scene nearly 10 years after Visual C 4.0. Even Visual C++ 1.0 is
46+
too new to build Windows 1 and 2 applications with.
47+
48+
I'm not aware of any freely available tools you can use to build the
49+
application.
4650

4751
## Terms of Use
4852

Win1App

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# This Makefile will build the Win1 Example application
22

33
CC = cl
4-
CFLAGS = /D NDEBUG /G2swf /Os /W3 /Zp /FPi87
4+
CFLAGS = /c /D NDEBUG /G2swf /Os /W2 /Zp /FPi87
55
LINK = link4
66
RC = rc
77
MAPSYM = mapsym
88
MARK = mark
9+
EXE = Win1App.exe
910

11+
.c.obj:
12+
$(CC) $(CFLAGS) $*.c
1013

1114
aboutdlg.obj: aboutdlg.c aboutdlg.h resource.h globals.h
12-
$(CC) $(CFLAGS) aboutdlg.c;
1315

1416
mainwnd.obj: mainwnd.c mainwnd.h aboutdlg.h resource.h globals.h
15-
$(CC) $(CFLAGS) mainwnd.c;
1617

1718
winmain.obj: winmain.c mainwnd.h resource.h globals.h
18-
$(CC) $(CFLAGS) winmain.c;
1919

2020
resource.res: resource.rc App.ico resource.h
21-
$(RC) /r resource.rc
21+
$(RC) /r resource.rc
2222

23-
Win1App.exe: winmain.obj mainwnd.obj aboutdlg.obj resource.res App.ico Win1App.def
24-
$(LINK) winmain.obj mainwnd.obj aboutdlg.obj,Win1App.exe /align:16,/map,slibw.lib,Win1App.def
25-
$(MAPSYM) Win1App.map
26-
$(RC) resource.res Win1App.exe
27-
$(MARK) FONT MEMORY Win1App.exe
23+
$(EXE): winmain.obj mainwnd.obj aboutdlg.obj resource.res App.ico Win1App.def
24+
$(LINK) winmain.obj mainwnd.obj aboutdlg.obj,$(EXE) /align:16,/map,slibw.lib,Win1App.def
25+
$(MAPSYM) Win1App.map
26+
$(RC) resource.res $(EXE)
27+
$(MARK) FONT MEMORY $(EXE)

0 commit comments

Comments
 (0)