From e27e5c3b0ac48800ff832e2dcae62bd4352cf2cc Mon Sep 17 00:00:00 2001 From: Martin Payne Date: Mon, 26 Aug 2013 12:01:26 +0100 Subject: [PATCH] Prepare for version 1.1. --- Makefile | 14 +-- Readme.txt | 21 ++++- Win16App.tgt | 192 ++++++++++++++++++++------------------ Win16App.wpj | 16 ++-- callbacks.c => callback.c | 2 +- callbacks.h => callback.h | 0 resource.rc | 62 +++++++++--- winmain.c | 2 +- 8 files changed, 185 insertions(+), 124 deletions(-) rename callbacks.c => callback.c (93%) rename callbacks.h => callback.h (100%) diff --git a/Makefile b/Makefile index ac6b4ba..3201305 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ # This Makefile will build the Win16 test application. -HEADERS = resource.h callbacks.h -OBJS = winmain.obj callbacks.obj -RES = resource.res +HEADERS = Resource.h Callback.h +OBJS = WinMain.obj Callback.obj +RES = Resource.res CC = cl16.exe -CFLAGS = /nologo /c /D WINVER=0x0300 /Gsw /Gf /G2 /Os /W2 /Zp +CFLAGS = /nologo /c /D NDEBUG /D WINVER=0x0300 /G3swf /Os /W3 /Zp /FPi87 LINK = link16.exe RC = rc16.exe EXE = Win16App.exe @@ -15,13 +15,13 @@ all: Win16App.exe Win16App.exe: $(OBJS) $(RES) $(DEF) $(LINK) /nologo /align:16 $(OBJS),$(EXE),,libw.lib slibcew.lib,$(DEF) - $(RC) /nologo -30 $(RES) $(EXE) + $(RC) /nologo /30 $(RES) $(EXE) clean: - del $(OBJS) $(RES) $(EXE) + del $(OBJS) $(RES) $(EXE) Win16App.map %.obj: %.c $(HEADERS) $(CC) $(CFLAGS) $< -resource.res: resource.rc App.ico resource.h +Resource.res: Resource.rc App.ico Resource.h $(RC) /nologo /r resource.rc \ No newline at end of file diff --git a/Readme.txt b/Readme.txt index a581d2a..e6719e8 100644 --- a/Readme.txt +++ b/Readme.txt @@ -4,7 +4,7 @@ This application is an example 16 accompanies an article from my web site, located at http://www.transmissionzero.co.uk/computing/win16-apps-in-c/. -To build the application with Microsoft’s Visual C compilers, simply open a +To build the application with Microsoft’s Visual C++ compilers, simply open a command prompt, change to the directory containing the Makefile, and run “nmake”. Note that you will need the 16 bit C compiler, linker, and resource compiler—it won’t work with 32 bit compilers! Also note that the Makefile may @@ -13,12 +13,14 @@ require some small modifications if you use a make utility other than To build the application in Open Watcom, simply open the project up in the IDE, and choose the “Make” option from the “Targets” menu. + Disclaimer This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + Terms of Use There is no specific license attached to the use this application. You are free @@ -30,6 +32,7 @@ application template, and how you license any applications built with it is entirely up to you. Of course, you must still comply with the licensing conditions of the tools you are using to build the application. + Problems? If you have any problems or questions, please get in contact via @@ -37,5 +40,19 @@ http://www.transmissionzero.co.uk/contact/. Please ensure that you read the article at http://www.transmissionzero.co.uk/computing/win16-apps-in-c/ before sending any questions. + +Changelog + +2013–08–26: Version 1.1 + + • Added a VERSIONINFO resource to the executable, so that version information + can be viewed in File Manager or Windows Explorer. + • Open Watcom build now runs in Windows 3.0 (but not in real mode). + • Ensured all source files are 8.3 characters long. + +2011–07–06: Version 1.0 + + • First release. + Martin Payne -2011–07–06 +2013–08–26 diff --git a/Win16App.tgt b/Win16App.tgt index 7c3bc95..88bb8e8 100644 --- a/Win16App.tgt +++ b/Win16App.tgt @@ -32,242 +32,250 @@ WString WEXE 8 WVList -0 +2 9 +MVState +10 +WString +7 +WINLINK +11 +WString +21 +w????Export names(,): +1 +12 +WString +27 +MainWndProc,AboutDialogProc +0 +13 +MVState +14 +WString +7 +WINLINK +15 +WString +21 +w????Export names(,): +0 +16 +WString +27 +MainWndProc,AboutDialogProc +0 +17 WVList 0 -1 1 1 0 -10 +18 WPickList 10 -11 +19 MItem 3 *.c -12 +20 WString 4 COBJ -13 +21 WVList -4 -14 +2 +22 MRState -15 +23 WString 3 WCC -16 +24 WString 24 ?????Space optimizations 0 1 -17 +25 MRState -18 +26 WString 3 WCC -19 +27 WString 26 ?????Fastest possible code 0 0 -20 -MRState -21 -WString -3 -WCC -22 -WString -9 -??6??8086 -0 -0 -23 -MRState -24 -WString -3 -WCC -25 -WString -10 -??6??80286 -0 -1 -26 +28 WVList 0 -1 1 1 0 -27 +29 MItem -11 -callbacks.c -28 +10 +callback.c +30 WString 4 COBJ -29 +31 WVList 0 -30 +32 WVList 0 -11 +19 1 1 0 -31 +33 MItem 9 winmain.c -32 +34 WString 4 COBJ -33 +35 WVList 0 -34 +36 WVList 0 -11 +19 1 1 0 -35 +37 MItem -5 -*.def -36 +3 +*.h +38 WString 3 NIL -37 +39 WVList 0 -38 +40 WVList 0 -1 1 1 0 -39 +41 MItem -12 -Win16App.def -40 +10 +callback.h +42 WString 3 NIL -41 +43 WVList 0 -42 +44 WVList 0 -35 +37 1 1 0 -43 +45 MItem -3 -*.h -44 +10 +resource.h +46 WString 3 NIL -45 +47 WVList 0 -46 +48 WVList 0 --1 +37 1 1 0 -47 +49 MItem -11 -callbacks.h -48 +5 +*.ico +50 WString 3 NIL -49 +51 WVList 0 -50 +52 WVList 0 -43 +-1 1 1 0 -51 +53 MItem -10 -resource.h -52 +7 +App.ico +54 WString 3 NIL -53 +55 WVList 0 -54 +56 WVList 0 -43 +49 1 1 0 -55 +57 MItem 4 *.rc -56 +58 WString 5 WRESC -57 +59 WVList 0 -58 +60 WVList 0 -1 1 1 0 -59 +61 MItem 11 resource.rc -60 +62 WString 5 WRESC -61 +63 WVList 0 -62 +64 WVList 0 -55 +57 1 1 0 diff --git a/Win16App.wpj b/Win16App.wpj index be18c27..b4b6490 100644 --- a/Win16App.wpj +++ b/Win16App.wpj @@ -4,10 +4,10 @@ projectIdent VpeMain 1 WRect --48 --78 -10337 -10005 +0 +0 +7680 +9134 2 MProject 3 @@ -30,14 +30,14 @@ VComponent WRect 0 0 -5674 -4281 -2 +2499 +7379 +0 0 9 WFileName 12 Win16App.tgt 0 -4 +0 7 diff --git a/callbacks.c b/callback.c similarity index 93% rename from callbacks.c rename to callback.c index 1bc7d0a..de36241 100644 --- a/callbacks.c +++ b/callback.c @@ -1,4 +1,4 @@ -#include "callbacks.h" +#include "callback.h" #include "resource.h" // Window procedure for our main window. diff --git a/callbacks.h b/callback.h similarity index 100% rename from callbacks.h rename to callback.h diff --git a/resource.rc b/resource.rc index 9519d63..583e1f9 100644 --- a/resource.rc +++ b/resource.rc @@ -1,35 +1,71 @@ #include +#include #include "resource.h" // Win16 application icon. -IDI_APPICON ICON DISCARDABLE "App.ico" +IDI_APPICON ICON DISCARDABLE "App.ico" // Our main menu. IDR_MAINMENU MENU DISCARDABLE BEGIN - POPUP "&File" - BEGIN - MENUITEM "E&xit", ID_FILE_EXIT - END - POPUP "&Help" - BEGIN - MENUITEM "&About", ID_HELP_ABOUT + POPUP "&File" + BEGIN + MENUITEM "E&xit", ID_FILE_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About", ID_HELP_ABOUT + END +END + +// Executable version information. +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE +#else + FILEFLAGS 0 +#endif +FILEOS VOS_DOS_WINDOWS16 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904E4" + BEGIN + VALUE "CompanyName", "Transmission Zero\0" + VALUE "FileDescription", "Win16 Test Application\0" + VALUE "FileVersion", "1.0.0.0\0" + VALUE "InternalName", "Win16App\0" + VALUE "LegalCopyright", "©2013 Transmission Zero\0" + VALUE "OriginalFilename","Win16App.exe\0" + VALUE "ProductName", "Win16 Test Application\0" + VALUE "ProductVersion", "1.0.0.0\0" END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1252 + END END // Our "about" dialog. IDD_ABOUTDIALOG DIALOG DISCARDABLE 0, 0, 147, 67 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About" +FONT 8, "MS Sans Serif" BEGIN - ICON IDI_APPICON,IDC_STATIC,7,7,20,20 - LTEXT "Win16 Test Application.",IDC_STATIC,34,7,86,8 - LTEXT "©2011 Martin Payne",IDC_STATIC,34,17,68,8 - DEFPUSHBUTTON "OK",IDOK,90,46,50,14,WS_GROUP + ICON IDI_APPICON,IDC_STATIC,7,7,20,20 + LTEXT "Win16 Test Application.",IDC_STATIC,34,7,86,8 + LTEXT "©2013 Transmission Zero",IDC_STATIC,34,17,86,8 + DEFPUSHBUTTON "OK",IDOK,90,46,50,14,WS_GROUP END // Our accelerators. IDR_ACCELERATOR ACCELERATORS DISCARDABLE BEGIN - "A", ID_HELP_ABOUT, VIRTKEY, ALT, NOINVERT + "A", ID_HELP_ABOUT, VIRTKEY, ALT, NOINVERT END diff --git a/winmain.c b/winmain.c index 5b2f1de..6d0e80d 100644 --- a/winmain.c +++ b/winmain.c @@ -1,6 +1,6 @@ #include #include "resource.h" -#include "callbacks.h" +#include "callback.h" // Our application entry point. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)