From 4e3100e170937adda937810a9a98cc1b4b29d1e8 Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 3 Oct 2024 20:59:55 +0000 Subject: [PATCH] fix vc6 git-svn-id: file:///raid/svn-personal/tewi/trunk@249 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Platform/vc6.mk | 2 +- Server/Makefile | 13 ++++++------- Server/gui.c | 6 +++++- Server/gui.rc | 5 ++--- Server/main.c | 1 + Server/tw_version.h | 1 + Tool/option.c | 2 ++ bcc.sh | 4 +++- vc6.sh | 11 +++++++++++ 9 files changed, 32 insertions(+), 13 deletions(-) diff --git a/Platform/vc6.mk b/Platform/vc6.mk index d080ed4..e6cb675 100644 --- a/Platform/vc6.mk +++ b/Platform/vc6.mk @@ -13,4 +13,4 @@ EXEC = STATIC = lib LIBSUF = .dll OBJ = obj -PREOBJS = tewi_vc6.res gui_vc6.res +PREOBJS = vc6.res diff --git a/Server/Makefile b/Server/Makefile index 3f250f0..7ed2409 100644 --- a/Server/Makefile +++ b/Server/Makefile @@ -48,20 +48,19 @@ tewi.pkg: tewi.self tewi.res: tewi.rc ../Binary/tewi.ico $(WINDRES) tewi.rc -O coff -o $@ -tewi_vc6.res: tewi.rc ../Binary/tewi.ico - rc /fo$@ tewi.rc - tewi_bcc.res: tewi.rc ../Binary/tewi.ico brc32 -r -fo$@ tewi.rc gui.res: gui.rc gui.h $(WINDRES) gui.rc -O coff -o $@ -gui_vc6.res: gui.rc gui.h - rc /fo$@ gui.rc - gui_bcc.res: gui.rc gui.h brc32 -r -fo$@ gui.rc +vc6.res: tewi.rc gui.rc + cat tewi.rc gui.rc > concat.rc + rc /fo$@ concat.rc + rm -f concat.rc + clean: - rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg *.obj + rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg *.obj concat.rc diff --git a/Server/gui.c b/Server/gui.c index 2f7a8e6..84f81a5 100644 --- a/Server/gui.c +++ b/Server/gui.c @@ -59,6 +59,10 @@ LRESULT CALLBACK VersionDialog(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp){ hdc = BeginPaint(hWnd, &ps); ShowBitmapSize(hWnd, hdc, "TEWILOGO", size.left, size.top, WINWIDTH(size), WINWIDTH(size)); EndPaint(hWnd, &ps); + }else if(msg == WM_CTLCOLORDLG || msg == WM_CTLCOLORSTATIC){ + HDC dc = (HDC)wp; + SetBkMode(dc, TRANSPARENT); + return GetSysColorBrush(COLOR_MENU); }else{ return FALSE; } @@ -79,7 +83,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp){ int ev = HIWORD(wp); if(trig == GUI_BUTTON_ABOUT){ if(ev == BN_CLICKED){ - DialogBox(hInst, "VERSIONDLG", hWnd, VersionDialog); + DialogBox(hInst, "VERSIONDLG", hWnd, (DLGPROC)VersionDialog); } }else if(trig == GUI_BUTTON_START){ if(ev == BN_CLICKED){ diff --git a/Server/gui.rc b/Server/gui.rc index 11383d1..41bfc5b 100644 --- a/Server/gui.rc +++ b/Server/gui.rc @@ -4,15 +4,14 @@ #include "gui.h" #include "tw_version.h" -PBTEWI BITMAP "../Binary/pbtewi.bmp" +PBTEWI BITMAP "..\\Binary\\pbtewi.bmp" TEWILOGO BITMAP "../Binary/tewi.bmp" VERSIONDLG DIALOG 0, 0, 200, 50 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Version Information" { - LTEXT "Tewi HTTPd version " TW_VERSION, GUI_TEWI_NAME, 42, 5, 192, 50 + LTEXT TW_VERSION_TEXT, GUI_TEWI_NAME, 42, 5, 192, 50 LTEXT "Original by Nishi ", GUI_TEWI_ORIGINAL, 42, 5 + 8, 192, 50 - LTEXT "Compilation date: " __DATE__ " " __TIME__, GUI_TEWI_DATE, 42, 5 + 8 + 8, 192, 50 DEFPUSHBUTTON "&OK", IDOK, 75, 35, 50, 10 } diff --git a/Server/main.c b/Server/main.c index fcbd0da..9d2965d 100644 --- a/Server/main.c +++ b/Server/main.c @@ -7,6 +7,7 @@ #ifdef __BORLANDC__ #pragma resource "tewi_bcc.res" + #pragma resource "gui_bcc.res" #endif diff --git a/Server/tw_version.h b/Server/tw_version.h index 99b548a..cff9e07 100644 --- a/Server/tw_version.h +++ b/Server/tw_version.h @@ -8,6 +8,7 @@ extern "C" { #endif #define TW_VERSION "2.03D\0" +#define TW_VERSION_TEXT "Tewi HTTPd version 2.03D" const char* tw_get_version(void); const char* tw_get_platform(void); diff --git a/Tool/option.c b/Tool/option.c index 1dc0650..360be81 100644 --- a/Tool/option.c +++ b/Tool/option.c @@ -53,6 +53,7 @@ int main(int argc, char** argv) { #endif #ifdef BUILD_GUI printf(" -lcomctl32"); + printf(" -luser32"); #endif }else if(strcmp(argv[3], "WINDOWS_WATCOM") == 0){ #ifdef USE_WINSOCK1 @@ -62,6 +63,7 @@ int main(int argc, char** argv) { #endif #ifdef BUILD_GUI printf(" comctl32.lib"); + printf(" user32.lib"); #endif } } diff --git a/bcc.sh b/bcc.sh index 7a92a46..a81f8a4 100755 --- a/bcc.sh +++ b/bcc.sh @@ -28,10 +28,12 @@ for i in "$@"; do elif [ "$i" = "-shared" ]; then options="$options -tWD" shared=1 + elif [ "$i" = "-mwindows" ]; then + options="$options -tW" elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then options="$options -`echo "$i" | sed "s/^-//g"`" elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then - if [ ! "$i" = "-lwsock32" ]; then + if [ ! "$i" = "-lwsock32" -a ! "$i" = "-luser32" -a ! "$i" = "-lcomctl32" ]; then libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib" fi elif [ "$dowhat" = "output" ]; then diff --git a/vc6.sh b/vc6.sh index abd3c02..f7cb053 100755 --- a/vc6.sh +++ b/vc6.sh @@ -6,6 +6,7 @@ outfile="a.out" dowhat="" options="/I../VC6Compat" obj=0 +win=0 source="" libraries="" link="" @@ -26,9 +27,14 @@ for i in "$@"; do : elif [ "$i" = "-shared" ]; then options="$options /LD" + elif [ "$i" = "-mwindows" ]; then + win=1 elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then options="$options /`echo "$i" | sed "s/^-//g"`" elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then + if [ "$i" = "-luser32" ]; then + libraries="$libraries gdi32.lib" + fi libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib" elif [ "$dowhat" = "output" ]; then dowhat="" @@ -48,6 +54,11 @@ fi if [ ! "$libraries" = "" ]; then link="/link /nodefaultlib:libc $libraries" fi +if [ "$obj" = "0" ]; then + if [ "$win" = "1" ]; then + link="$link /SUBSYSTEM:windows" + fi +fi construct="cl /nologo $options $source $link" echo "Run: $construct" $construct -- 2.43.0