Commit acfda14a authored by Alexandre Julliard's avatar Alexandre Julliard

Moved expand.c from libtest to programs/expand.

Removed the rest of the libtest directory.
parent 67e8dc68
......@@ -50,19 +50,14 @@ LIBSYMLINKS = \
libwine_unicode.$(LIBEXT) \
libwine_uuid.a
# Sub-directories to run make depend/clean into
# Sub-directories to run make depend/clean/install into
SUBDIRS = \
$(INSTALLSUBDIRS) \
libtest \
miscemu
# Sub-directories to run make install into
INSTALLSUBDIRS = \
debugger \
dlls \
documentation \
include \
library \
miscemu \
ole \
programs \
server \
......@@ -96,10 +91,10 @@ install_wine: dummy
$(MKINSTALLDIRS) $(bindir)
$(INSTALL_PROGRAM) wine $(bindir)/wine
install:: all install_wine $(INSTALLSUBDIRS:%=%/__install__)
install:: all install_wine $(SUBDIRS:%=%/__install__)
-$(LDCONFIG)
uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
uninstall:: $(SUBDIRS:%=%/__uninstall__)
$(RM) $(bindir)/wine
$(EMUOBJS) $(PROGRAMS) $(LIBRARIES): dummy
......
......@@ -13194,7 +13194,7 @@ MAKE_DLL_RULES=dlls/Makedll.rules
MAKE_PROG_RULES=programs/Makeprog.rules
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules programs/Makeprog.rules Makefile debugger/Makefile dlls/Makefile dlls/advapi32/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/gdi/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msg711/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/netapi32/Makefile dlls/ntdll/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/user/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winspool/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile libtest/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineconsole/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wrc/Makefile tsx11/Makefile unicode/Makefile"
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules programs/Makeprog.rules Makefile debugger/Makefile dlls/Makefile dlls/advapi32/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/gdi/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msg711/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/netapi32/Makefile dlls/ntdll/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/user/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winspool/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineconsole/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wrc/Makefile tsx11/Makefile unicode/Makefile"
cat >confcache <<\_ACEOF
......@@ -13769,7 +13769,6 @@ do
"documentation/Makefile" ) CONFIG_FILES="$CONFIG_FILES documentation/Makefile" ;;
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"library/Makefile" ) CONFIG_FILES="$CONFIG_FILES library/Makefile" ;;
"libtest/Makefile" ) CONFIG_FILES="$CONFIG_FILES libtest/Makefile" ;;
"miscemu/Makefile" ) CONFIG_FILES="$CONFIG_FILES miscemu/Makefile" ;;
"ole/Makefile" ) CONFIG_FILES="$CONFIG_FILES ole/Makefile" ;;
"programs/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/Makefile" ;;
......@@ -13777,6 +13776,7 @@ do
"programs/clock/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/clock/Makefile" ;;
"programs/cmdlgtst/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/cmdlgtst/Makefile" ;;
"programs/control/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/control/Makefile" ;;
"programs/expand/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/expand/Makefile" ;;
"programs/notepad/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/notepad/Makefile" ;;
"programs/osversioncheck/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/osversioncheck/Makefile" ;;
"programs/progman/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/progman/Makefile" ;;
......
......@@ -1332,7 +1332,6 @@ dlls/x11drv/Makefile
documentation/Makefile
include/Makefile
library/Makefile
libtest/Makefile
miscemu/Makefile
ole/Makefile
programs/Makefile
......@@ -1340,6 +1339,7 @@ programs/avitools/Makefile
programs/clock/Makefile
programs/cmdlgtst/Makefile
programs/control/Makefile
programs/expand/Makefile
programs/notepad/Makefile
programs/osversioncheck/Makefile
programs/progman/Makefile
......
Makefile
expand
expand.spec.c
hello
hello.spec.c
hello2
hello2.spec.c
hello3
hello3.spec.c
hello3res.res
hello4
hello4.spec.c
hello5
hello5.spec.c
new
new.spec.c
rolex
rolex.spec.c
vartest
vartest.spec.c
volinfo
volinfo.spec.c
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
LDDLLFLAGS = @LDDLLFLAGS@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = none
PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex volinfo
ALL_LIBS = $(LIBWINE) $(LIBS)
C_SRCS = \
expand.c \
hello.c \
hello2.c \
hello3.c \
hello4.c \
hello5.c \
new.c \
rolex.c \
volinfo.c
SPEC_SRCS = \
expand.spec \
hello.spec \
hello2.spec \
hello3.spec \
hello4.spec \
hello5.spec \
new.spec \
rolex.spec \
volinfo.spec
RC_SRCS = \
hello3res.rc
all: $(PROGRAMS) $(PROGRAMS:%=%.so)
@MAKE_RULES@
expand.spec.c: expand.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym expand.o -o expand.spec.c -exe expand -mgui -L$(DLLDIR) -llz32 -lkernel32
expand.so: expand.o expand.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o expand.so $+ $(ALL_LIBS)
hello.spec.c: hello.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello.o -o hello.spec.c -exe hello -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32
hello.so: hello.o hello.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello.so $+ $(ALL_LIBS)
hello2.spec.c: hello2.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello2.o -o hello2.spec.c -exe hello2 -mgui -L$(DLLDIR) -luser32 -lkernel32
hello2.so: hello2.o hello2.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello2.so $+ $(ALL_LIBS)
hello3.spec.c: hello3.o hello3res.res $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello3.o -res hello3res.res -o hello3.spec.c -exe hello3 -mgui -L$(DLLDIR) -lcomdlg32 -luser32 -lgdi32 -lkernel32
hello3.so: hello3.o hello3.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello3.so $+ $(ALL_LIBS)
hello4.spec.c: hello4.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello4.o -o hello4.spec.c -exe hello4 -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32
hello4.so: hello4.o hello4.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello4.so $+ $(ALL_LIBS)
hello5.spec.c: hello5.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello5.o -o hello5.spec.c -exe hello5 -mgui -L$(DLLDIR) -lkernel32
hello5.so: hello5.o hello5.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello5.so $+ $(ALL_LIBS)
new.spec.c: new.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym new.o -o new.spec.c -exe new -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32
new.so: new.o new.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o new.so $+ $(ALL_LIBS)
rolex.spec.c: rolex.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym rolex.o -o rolex.spec.c -exe rolex -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32
rolex.so: rolex.o rolex.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o rolex.so $+ $(ALL_LIBS)
volinfo.spec.c: volinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym volinfo.o -o volinfo.spec.c -exe volinfo -mgui -L$(DLLDIR) -lkernel32
volinfo.so: volinfo.o volinfo.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o volinfo.so $+ $(ALL_LIBS)
$(PROGRAMS):
$(RM) $@ && $(LN_S) $(TOPOBJDIR)/wine $@
$(PROGRAMS:%=%.so/_checklink_): $(PROGRAMS:%=%.so)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c `dirname $@` && $(RM) checklink
checklink:: $(PROGRAMS:%=%.so/_checklink_)
### Dependencies:
/****************************************************************************
* GUITEST.RC
*
* produced by Borland Resource Workshop
*
* Copyright 1999 Ove Kven
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
#include "guitest.rh"
1 ICON
{
'00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
'00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 80 80'
'80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A'
'A0 00 00 00 00 00 AA A0 00 00 00 00 00 00 00 00'
'A0 0A AA A0 00 AA 00 0A 00 00 00 A0 A0 00 00 00'
'A0 0A 00 00 0A A0 00 0A 00 00 00 A0 00 00 00 00'
'A0 0A 00 00 AA 00 00 0A 00 00 0A A0 0A 00 00 00'
'A0 0A 00 00 00 00 00 A0 00 00 0A 00 0A 00 22 22'
'A2 2A 22 22 22 2A AA 22 22 22 2A 22 2A 22 22 22'
'AA 2A AA A2 22 A2 22 22 22 22 2A 22 2A 22 00 00'
'0A 0A 00 00 00 A0 00 00 00 00 0A 00 0A 00 00 00'
'0A 0A 00 00 00 A0 00 00 00 00 0A 00 0A 00 00 00'
'0A 00 A0 00 00 AA 00 00 00 00 0A 00 0A 00 00 00'
'0A 00 AA A0 00 0A AA A0 0A AA AA AA 00 00 0A AA'
'AA AA A0 00 00 00 00 00 00 00 00 0A A0 00 0A 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 77 70 70 00 77 77 00 07 00 00 00 00 00 00'
'00 07 00 07 07 07 00 00 70 70 70 00 00 00 00 00'
'00 70 77 70 07 70 77 77 07 70 70 00 00 00 00 00'
'00 70 70 07 07 70 70 07 07 70 70 00 00 00 00 00'
'00 70 70 77 07 70 70 07 07 70 70 00 00 00 00 00'
'00 70 77 00 07 70 70 07 07 70 70 00 00 00 00 00'
'00 70 70 77 70 70 70 07 07 70 70 00 00 00 00 00'
'00 70 70 00 70 70 70 07 07 70 70 00 00 00 00 00'
'00 70 77 77 07 70 70 07 07 70 70 00 00 00 00 00'
'00 07 00 00 70 70 70 07 07 70 70 00 00 00 00 00'
'00 00 77 77 00 07 00 00 70 07 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
'FF FF E7 FF 1F FF F6 1C EF D7 F6 F9 EF DF F6 F3'
'EF 9B F6 FF DF BB 00 00 00 00 00 00 00 00 FA FD'
'FF BB FA FD FF BB FB 7C FF BB FB 1E 18 0F 80 7F'
'FF E7 BF FF FF FF FF 17 0E FF FE 02 04 7F FC 00'
'00 7F FC 60 60 7F FC 40 60 7F FC 00 60 7F FC 44'
'60 7F FC 74 60 7F FC 00 60 7F FE 04 60 7F FF 0E'
'F6 FF FF FF FF FF FF FF FF FF FF FF FF FF'
}
1 DIALOG 6, 15, 196, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test Dialog"
FONT 8, "MS Sans Serif"
{
DEFPUSHBUTTON "OK", IDOK, 12, 96, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 72, 96, 50, 14
PUSHBUTTON "Help", IDHELP, 132, 96, 50, 14
GROUPBOX "Group", IDC_GROUPBOX1, 4, 4, 188, 84, BS_GROUPBOX | WS_GROUP | WS_TABSTOP
}
2 DIALOG 6, 15, 180, 72
STYLE WS_CHILD | WS_VISIBLE | WS_BORDER
FONT 8, "MS Sans Serif"
{
AUTOCHECKBOX "Checkbox 1", IDC_CHECKBOX1, 8, 8, 80, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
AUTOCHECKBOX "Checkbox 2", IDC_CHECKBOX2, 8, 28, 80, 12
AUTOCHECKBOX "Checkbox 3", IDC_CHECKBOX3, 8, 48, 60, 12
}
/****************************************************************************
* guitest.rh
*
* produced by Borland Resource Workshop
*
* Copyright 1999 Ove Kven
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
#define IDC_CHECKBOX1 104
#define IDC_CHECKBOX2 105
#define IDC_CHECKBOX3 106
#define DIALOG_2 2
#define IDC_GROUPBOX1 10
#define DIALOG_1 1
#define ICON_1 1
/*
* Copyright 1994 Miguel de Icaza
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
char szAppName[] = "Hello";
long FAR PASCAL WndProc(HWND, UINT, WPARAM, LPARAM);
int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpszCmdLine,
int nCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
if(!hPrevInst) {
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
RegisterClass(&wndclass);
}
hwnd = CreateWindow(szAppName, szAppName,
WS_HSCROLL | WS_VSCROLL | WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 600,
400, NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
long FAR PASCAL WndProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
HDC hdc;
RECT rect;
SIZE size;
PAINTSTRUCT ps;
switch(message) {
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
InflateRect(&rect, -10, -10);
if( !IsRectEmpty( &rect ) )
{
GetTextExtentPoint32(hdc, szAppName, strlen(szAppName), &size);
SelectObject(hdc, GetStockObject(LTGRAY_BRUSH));
Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom);
rect.left = (rect.right + rect.left - size.cx) / 2;
rect.top = (rect.bottom + rect.top - size.cy) / 2;
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, rect.left, rect.top, szAppName, strlen(szAppName) );
}
EndPaint(hwnd, &ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
/*
* Copyright 1994 Miguel de Icaza
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
return MessageBox((HWND)0,
(LPSTR)"Hello, hello!",
(LPSTR)"Hello Wine Application",
(MB_OK | MB_ICONEXCLAMATION));
}
/*
* Copyright 1995 Martin von Loewis
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <commdlg.h>
typedef struct
{
HANDLE hInstance;
HWND hMainWnd;
HMENU hMainMenu;
} GLOBALS;
GLOBALS Globals;
BOOL FileOpen(HWND hWnd)
{
char filename[80] = "test.c";
OPENFILENAME ofn = { sizeof(OPENFILENAME),
hWnd, NULL, "C code\0*.c\0", NULL, 0, 0, filename, 80,
NULL, 0, NULL, NULL, OFN_CREATEPROMPT |
OFN_SHOWHELP, 0, 0, NULL, 0, NULL };
return GetOpenFileName(&ofn);
}
LRESULT CALLBACK DlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch (wParam)
{
case 100:
EndDialog(hWnd, 100);
return TRUE;
}
}
return FALSE;
}
LRESULT CALLBACK WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
switch (msg){
case WM_COMMAND:
switch(w){
case 100:
DialogBox(Globals.hInstance,
"DIADEMO", wnd,
(DLGPROC)DlgProc);
return 0;
case 101:
{
HDC hdc, hMemDC;
HBITMAP hBitmap, hPrevBitmap;
BITMAP bmp;
hBitmap = LoadBitmapA (Globals.hInstance, "BITDEMO");
hdc = GetDC (wnd);
hMemDC = CreateCompatibleDC (hdc);
hPrevBitmap = SelectObject (hMemDC, hBitmap);
GetObjectA (hBitmap, sizeof(BITMAP), &bmp);
BitBlt (hdc, 0, 0, bmp.bmWidth, bmp.bmHeight,
hMemDC, 0, 0, SRCCOPY);
SelectObject (hMemDC, hPrevBitmap);
DeleteDC (hMemDC);
ReleaseDC (wnd, hdc);
return 0;
}
case 102:
FileOpen(wnd);
return 0;
default:
return DefWindowProc (wnd, msg, w, l);
}
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (wnd, msg, w, l);
}
return 0l;
}
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
MSG msg;
WNDCLASS class;
char className[] = "class"; /* To make sure className >= 0x10000 */
char winName[] = "Test app";
Globals.hInstance = inst;
if (!prev){
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = WndProc;
class.cbClsExtra = 0;
class.cbWndExtra = 0;
class.hInstance = inst;
class.hIcon = LoadIcon (0, IDI_APPLICATION);
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hbrBackground = GetStockObject (WHITE_BRUSH);
class.lpszMenuName = 0;
class.lpszClassName = className;
}
if (!RegisterClass (&class))
return FALSE;
Globals.hMainWnd = CreateWindow (className, winName, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
LoadMenu(inst,"MAIN"), inst, 0);
ShowWindow (Globals.hMainWnd, show);
UpdateWindow (Globals.hMainWnd);
while (GetMessage (&msg, 0, 0, 0)){
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return 0;
}
/*
* Copyright 1995 Martin von Loewis
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
MAIN MENU
{
POPUP "Menu demo" {
MENUITEM "Dialog Demo", 100
MENUITEM "Bitmap Demo", 101
MENUITEM "Open...", 102
}
}
/*BITDEMO BITMAP "../rc/winelogo.bmp"*/
DIADEMO DIALOG 20, 20, 179, 118
STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_SYSMENU
CAPTION "Dialog demo"
FONT 8, "Helv"
BEGIN
CONTROL "Pushbutton", 100, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 92, 52, 13
CONTROL "Checkbox", 101, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 19, 76, 47, 12
CONTROL "Static text", 102, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 17, 60, 39, 10
CONTROL "Edit control", 103, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 18, 41, 44, 13
CONTROL "Radio button", 104, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 17, 23, 58, 12
CONTROL "", 105, "COMBOBOX", CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 13, 86, 85
CONTROL "", 106, "LISTBOX", LBS_STANDARD | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 33, 86, 85
END
/*
* Copyright 1996 Jim Peterson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <windows.h>
/* Win32 counterpart for CalcChildScroll16 is not implemented */
/* even in MS Visual C++ */
#include "windef.h"
#include "wingdi.h"
/*#include <wine/winuser16.h>*/
void Write (HDC dc, int x, int y, char *s)
{
SetBkMode(dc, TRANSPARENT);
TextOut (dc, x, y, s, strlen (s));
}
LRESULT CALLBACK WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
static short xChar, yChar;
static RECT rectHola;
static char* strHola = "Hola";
HDC dc;
PAINTSTRUCT ps;
TEXTMETRIC tm;
switch (msg){
case WM_CREATE:
dc = GetDC (wnd);
GetTextMetrics (dc, &tm);
xChar = tm.tmAveCharWidth;
yChar = tm.tmHeight;
GetTextExtentPoint32( dc, strHola, strlen(strHola), ((LPSIZE)&rectHola) + 1 );
OffsetRect( &rectHola, xChar, yChar );
ReleaseDC (wnd, dc);
break;
case WM_HSCROLL:
case WM_VSCROLL:
InvalidateRect(wnd, &rectHola, TRUE );
ScrollChildren(wnd, msg, w, l);
return 0;
case WM_PAINT:
dc = BeginPaint (wnd, &ps);
Write (dc, xChar, yChar, strHola);
EndPaint (wnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (wnd, msg, w, l);
}
return 0l;
}
LRESULT CALLBACK WndProc2 (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
static short xChar, yChar;
static RECT rectInfo;
char buf[128];
HDC dc;
PAINTSTRUCT ps;
TEXTMETRIC tm;
switch (msg){
case WM_CREATE:
dc = GetDC (wnd);
GetTextMetrics (dc, &tm);
xChar = tm.tmAveCharWidth;
yChar = tm.tmHeight;
ReleaseDC (wnd, dc);
break;
case WM_PAINT:
dc = BeginPaint (wnd, &ps);
sprintf(buf,"ps.rcPaint = {left = %d, top = %d, right = %d, bottom = %d}",
ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right,ps.rcPaint.bottom);
rectInfo.left = rectInfo.top = 0;
GetTextExtentPoint32 (dc, buf, strlen(buf), ((LPSIZE)&rectInfo) + 1 );
OffsetRect (&rectInfo, xChar, yChar );
Write (dc, xChar, yChar, buf);
EndPaint (wnd, &ps);
break;
case WM_MOVE:
case WM_SIZE:
InvalidateRect( wnd, &rectInfo, TRUE );
/*CalcChildScroll16( (UINT16)GetParent(wnd), SB_BOTH );*/
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (wnd, msg, w, l);
}
return 0l;
}
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
HWND wnd,wnd2;
MSG msg;
WNDCLASS class;
char className[] = "class"; /* To make sure className >= 0x10000 */
char class2Name[] = "class2";
char winName[] = "Test app";
if (!prev){
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = WndProc;
class.cbClsExtra = 0;
class.cbWndExtra = 0;
class.hInstance = inst;
class.hIcon = LoadIcon (0, IDI_APPLICATION);
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hbrBackground = GetStockObject (WHITE_BRUSH);
class.lpszMenuName = NULL;
class.lpszClassName = className;
if (!RegisterClass (&class))
return FALSE;
}
wnd = CreateWindow (className, winName, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
0, inst, 0);
if (!prev){
class.lpfnWndProc = WndProc2;
class.lpszClassName = class2Name;
class.hbrBackground = GetStockObject(GRAY_BRUSH);
if (!RegisterClass (&class))
return FALSE;
}
wnd2= CreateWindow (class2Name,"Child window", WS_CAPTION | WS_CHILD | WS_THICKFRAME,
50, 50, 350, 100, wnd, 0, inst, 0);
ShowWindow (wnd, show);
UpdateWindow (wnd);
ShowWindow (wnd2, show);
UpdateWindow (wnd2);
while (GetMessage (&msg, 0, 0, 0)){
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return 0;
}
/*
* This example demonstrates dynamical loading of (internal) Win32 DLLS.
*
* Copyright 1998 Marcus Meissner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <windows.h>
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
SYSTEM_INFO si;
void (CALLBACK *fnGetSystemInfo)(LPSYSTEM_INFO si);
HMODULE kernel32;
kernel32 = LoadLibrary("KERNEL32");
if (!kernel32) {
fprintf(stderr,"FATAL: could not load KERNEL32!\n");
return 0;
}
fnGetSystemInfo = (void*)GetProcAddress(kernel32,"GetSystemInfo");
if (!fnGetSystemInfo) {
fprintf(stderr,"FATAL: could not find GetSystemInfo!\n");
return 0;
}
fnGetSystemInfo(&si);
fprintf(stderr,"QuerySystemInfo returns:\n");
fprintf(stderr," wProcessorArchitecture: %d\n",si.u.s.wProcessorArchitecture);
fprintf(stderr," dwPageSize: %ld\n",si.dwPageSize);
fprintf(stderr," lpMinimumApplicationAddress: %p\n",si.lpMinimumApplicationAddress);
fprintf(stderr," lpMaximumApplicationAddress: %p\n",si.lpMaximumApplicationAddress);
fprintf(stderr," dwActiveProcessorMask: %ld\n",si.dwActiveProcessorMask);
fprintf(stderr," dwNumberOfProcessors: %ld\n",si.dwNumberOfProcessors);
fprintf(stderr," dwProcessorType: %ld\n",si.dwProcessorType);
fprintf(stderr," dwAllocationGranularity: %ld\n",si.dwAllocationGranularity);
fprintf(stderr," wProcessorLevel: %d\n",si.wProcessorLevel);
fprintf(stderr," wProcessorRevision: %d\n",si.wProcessorRevision);
return 0;
}
/*
* Copyright 1996 Jim Peterson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
HANDLE ghInstance;
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ChildProc (HWND, UINT, WPARAM, LPARAM);
int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdParam, int nCmdShow)
{
char szAppName[] = "ClassLook" ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
ghInstance = hInstance;
if (!hPrevInstance)
{
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
RegisterClass (&wndclass) ;
}
hwnd = CreateWindow (szAppName, /* window class name */
szAppName, /* window caption */
WS_OVERLAPPEDWINDOW, /* window style */
CW_USEDEFAULT, /* initial x position */
CW_USEDEFAULT, /* initial y position */
600, /* initial x size */
400, /* initial y size */
NULL, /* parent window handle */
NULL, /* window menu handle */
hInstance, /* program instance handle */
NULL) ; /* creation parameters */
ShowWindow (hwnd, nCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
RECT rect ;
WNDCLASS wndclass ;
char clsName[] = "SecondClass";
static HWND hChild;
switch (message)
{
case WM_CREATE :
wndclass.style = CS_PARENTDC | CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = ChildProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = ghInstance ;
wndclass.hIcon = NULL ;
wndclass.hCursor = LoadCursor (NULL, IDC_CROSS) ;
wndclass.hbrBackground = GetStockObject (LTGRAY_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = clsName;
RegisterClass (&wndclass);
hChild = CreateWindow(clsName,"Child Window",
WS_CHILD | WS_VISIBLE | WS_BORDER,
10, 10, 580, 380, hwnd, NULL, ghInstance, NULL);
ShowWindow(hChild, SW_SHOW);
case WM_PAINT :
hdc = BeginPaint (hwnd, &ps) ;
GetClientRect (hwnd, &rect) ;
DrawText (hdc, "Hello, Windows!", -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
EndPaint (hwnd, &ps);
return 0 ;
case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
LRESULT CALLBACK ChildProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hDC;
PAINTSTRUCT ps;
WNDCLASS wndClass;
char *classes[]={"EDIT","BUTTON","LISTBOX","STATIC","SCROLLBAR","COMBOBOX","COMBOLBOX", NULL};
char** curr;
char buf[256];
RECT rect ;
int i;
switch (message) {
case WM_PAINT:
curr = classes;
i=0;
hDC = BeginPaint(hwnd, &ps);
SelectObject(hDC,GetStockObject(ANSI_FIXED_FONT));
while (*curr) {
wsprintf(buf,"%12s:",*curr);
GetClassInfo(NULL, *curr, &wndClass);
if(wndClass.style&CS_VREDRAW) lstrcat(buf," | CS_VREDRAW");
if(wndClass.style&CS_HREDRAW) lstrcat(buf," | CS_HREDRAW" );
if(wndClass.style&CS_KEYCVTWINDOW) lstrcat(buf," | CS_KEYCVTWINDOW" );
if(wndClass.style&CS_DBLCLKS) lstrcat(buf," | CS_DBLCLKS" );
if(wndClass.style&CS_OWNDC) lstrcat(buf," | CS_OWNDC" );
if(wndClass.style&CS_CLASSDC) lstrcat(buf," | CS_CLASSDC" );
if(wndClass.style&CS_PARENTDC) lstrcat(buf," | CS_PARENTDC" );
if(wndClass.style&CS_NOKEYCVT) lstrcat(buf," | CS_NOKEYCVT" );
if(wndClass.style&CS_NOCLOSE) lstrcat(buf," | CS_NOCLOSE" );
if(wndClass.style&CS_SAVEBITS) lstrcat(buf," | CS_SAVEBITS" );
if(wndClass.style&CS_GLOBALCLASS) lstrcat(buf," | CS_GLOBALCLASS");
GetClientRect (hwnd, &rect) ;
TextOut (hDC, 5,20+i,buf,lstrlen(buf)) ;
i += 15;
curr++;
}
/* EndPaint(hwnd, &ps);
break;
hDC = BeginPaint(hwnd, &ps);
*/
MoveToEx(hDC, 0, 0, NULL);
LineTo(hDC, 500, 500);
EndPaint(hwnd, &ps);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
return (0L);
}
/*********************************************************************
* *
* rolex.c: Windows clock application for WINE (by Jim Peterson) *
* *
* This is a translation of a Turbo Pascal OWL application I made *
* once, so it's a little flaky (tons of globals, functions that *
* could have been in-lined, etc.). The source code should easily *
* compile with a standard Win32 C compiler. *
* *
* To try it out, type 'make rolex'. *
*
* Copyright Jim Peterson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*********************************************************************/
#include <math.h>
#include <string.h>
#include "windows.h"
char AppName[] = "Rolex";
char WindowName[] = "Rolex";
int WindowWidth = 100;
int WindowHeight = 121;
COLORREF FaceColor = RGB(192,192,192);
COLORREF HandColor = RGB(0,0,0);
COLORREF EtchColor = RGB(0,0,0);
float Pi=3.1415926;
typedef struct
{
int StartX,StartY,EndX,EndY;
} HandData;
int MaxX,MaxY;
HandData OldSecond,OldHour,OldMinute;
HWND HWindow;
void DrawFace(HDC dc)
{
int MidX, MidY, t;
MidX=MaxX/2;
MidY=MaxY/2;
SelectObject(dc,CreateSolidBrush(FaceColor));
SelectObject(dc,CreatePen(PS_SOLID,1,EtchColor));
Ellipse(dc,0,0,MaxX,MaxY);
for(t=0; t<12; t++)
{
MoveToEx(dc,MidX+sin(t*Pi/6)*0.9*MidX,MidY-cos(t*Pi/6)*0.9*MidY,NULL);
LineTo(dc,MidX+sin(t*Pi/6)*0.8*MidX,MidY-cos(t*Pi/6)*0.8*MidY);
}
if(MaxX>64 && MaxY>64)
for(t=0; t<60; t++)
SetPixel(dc,MidX+sin(t*Pi/30)*0.9*MidX,MidY-cos(t*Pi/30)*0.9*MidY
,EtchColor);
DeleteObject(SelectObject(dc,GetStockObject(NULL_BRUSH)));
DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN)));
memset(&OldSecond,0,sizeof(OldSecond));
memset(&OldMinute,0,sizeof(OldMinute));
memset(&OldHour,0,sizeof(OldHour));
}
void DrawHourHand(HDC dc)
{
MoveToEx(dc, OldHour.StartX, OldHour.StartY, NULL);
LineTo(dc, OldHour.EndX, OldHour.EndY);
}
void DrawMinuteHand(HDC dc)
{
MoveToEx(dc, OldMinute.StartX, OldMinute.StartY, NULL);
LineTo(dc, OldMinute.EndX, OldMinute.EndY);
}
void DrawSecondHand(HDC dc)
{
MoveToEx(dc, OldSecond.StartX, OldSecond.StartY, NULL);
LineTo(dc, OldSecond.EndX, OldSecond.EndY);
}
BOOL UpdateHourHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos)
{
int Sx, Sy, Ex, Ey;
BOOL rv;
rv = FALSE;
Sx = MidX; Sy = MidY;
Ex = MidX+sin(Pos*Pi/6000)*XExt;
Ey = MidY-cos(Pos*Pi/6000)*YExt;
rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX ||
Sy!=OldHour.StartY || Ey!=OldHour.EndY );
if(rv)DrawHourHand(dc);
OldHour.StartX = Sx; OldHour.EndX = Ex;
OldHour.StartY = Sy; OldHour.EndY = Ey;
return rv;
}
BOOL UpdateMinuteHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos)
{
int Sx, Sy, Ex, Ey;
BOOL rv;
rv = FALSE;
Sx = MidX; Sy = MidY;
Ex = MidX+sin(Pos*Pi/30000)*XExt;
Ey = MidY-cos(Pos*Pi/30000)*YExt;
rv = ( Sx!=OldMinute.StartX || Ex!=OldMinute.EndX ||
Sy!=OldMinute.StartY || Ey!=OldMinute.EndY );
if(rv)DrawMinuteHand(dc);
OldMinute.StartX = Sx; OldMinute.EndX = Ex;
OldMinute.StartY = Sy; OldMinute.EndY = Ey;
return rv;
}
BOOL UpdateSecondHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos)
{
int Sx, Sy, Ex, Ey;
BOOL rv;
rv = FALSE;
Sx = MidX; Sy = MidY;
Ex = MidX+sin(Pos*Pi/3000)*XExt;
Ey = MidY-cos(Pos*Pi/3000)*YExt;
rv = ( Sx!=OldSecond.StartX || Ex!=OldSecond.EndX ||
Sy!=OldSecond.StartY || Ey!=OldSecond.EndY );
if(rv)DrawSecondHand(dc);
OldSecond.StartX = Sx; OldSecond.EndX = Ex;
OldSecond.StartY = Sy; OldSecond.EndY = Ey;
return rv;
}
void Idle(HDC idc)
{
SYSTEMTIME st;
WORD H, M, S, F;
int MidX, MidY;
HDC dc;
BOOL Redraw;
if(idc)
dc=idc;
else
dc=GetDC(HWindow);
if(!dc)return;
GetLocalTime(&st);
H = st.wHour;
M = st.wMinute;
S = st.wSecond;
F = st.wMilliseconds / 10;
F = F + S*100;
M = M*1000+F/6;
H = H*1000+M/60;
MidX = MaxX/2;
MidY = MaxY/2;
SelectObject(dc,CreatePen(PS_SOLID,1,FaceColor));
Redraw = FALSE;
if(UpdateHourHand(dc,MidX,MidY,MidX*0.5,MidY*0.5,H)) Redraw = TRUE;
if(UpdateMinuteHand(dc,MidX,MidY,MidX*0.65,MidY*0.65,M)) Redraw = TRUE;
if(UpdateSecondHand(dc,MidX,MidY,MidX*0.79,MidY*0.79,F)) Redraw = TRUE;
DeleteObject(SelectObject(dc,CreatePen(PS_SOLID,1,HandColor)));
if(Redraw)
{
DrawSecondHand(dc);
DrawMinuteHand(dc);
DrawHourHand(dc);
}
DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN)));
if(!idc) ReleaseDC(HWindow,dc);
}
LRESULT CALLBACK ProcessAppMsg(HWND wnd,UINT msg,WPARAM w,LPARAM l)
{
PAINTSTRUCT PaintInfo;
HDC dc;
switch(msg)
{
case WM_PAINT:
if(GetUpdateRect(wnd,NULL,FALSE))
{
dc=BeginPaint(wnd,&PaintInfo);
DrawFace(dc);
Idle(dc);
EndPaint(wnd,&PaintInfo);
}
break;
case WM_SIZE:
MaxX = LOWORD(l);
MaxY = HIWORD(l);
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (wnd, msg, w, l);
}
return 0l;
}
WPARAM MessageLoop()
{
MSG msg;
while(1)
{
Sleep(1); /* sleep 1 millisecond */
if(PeekMessage(&msg,0,0,0,PM_REMOVE))
{
if(msg.message == WM_QUIT) return msg.wParam;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
Idle(NULL);
}
}
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
WNDCLASS class;
if(!prev)
{
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = ProcessAppMsg;
class.cbClsExtra = 0;
class.cbWndExtra = 0;
class.hInstance = inst;
class.hIcon = 0; /* Draw my own icon */
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
class.lpszMenuName = 0;
class.lpszClassName = AppName;
}
if (!RegisterClass (&class)) return -1;
HWindow=CreateWindowEx(WS_EX_TOPMOST,AppName,WindowName,WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,WindowWidth,WindowHeight,
0,0,inst,0);
memset(&OldSecond,0,sizeof(OldSecond));
memset(&OldMinute,0,sizeof(OldMinute));
memset(&OldHour,0,sizeof(OldHour));
MaxX = WindowWidth;
MaxY = WindowHeight;
ShowWindow (HWindow, show);
UpdateWindow (HWindow);
return MessageLoop();
}
/*
* This test program was copied from the former file documentation/cdrom-label
*
* Copyright 1998 Petter Reinholdtsen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <stdio.h>
#include <string.h> /* for strcat() */
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
char drive, root[]="C:\\", label[1002], fsname[1002];
DWORD serial, flags, filenamelen, labellen = 1000, fsnamelen = 1000;
printf("Drive Serial Flags Filename-Length "
"Label Fsname\n");
for (drive = 'A'; drive <= 'Z'; drive++)
{
root[0] = drive;
if (GetVolumeInformation(root,label,labellen,&serial,
&filenamelen,&flags,fsname,fsnamelen))
{
strcat(label,"\""); strcat (fsname,"\"");
printf("%c:\\ 0x%08lx 0x%08lx %15ld \"%-20s \"%-20s\n",
drive, (long) serial, (long) flags, (long) filenamelen,
label, fsname);
}
}
return 0;
}
......@@ -6,6 +6,7 @@ MODULE = none
INSTALLSUBDIRS = \
control \
expand \
notepad \
progman \
regedit \
......
Makefile
expand.dbg.c
expand.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = expand
APPMODE = cui
IMPORTS = lz32 kernel32
C_SRCS = expand.c
@MAKE_PROG_RULES@
### Dependencies:
/*
* Copyright 1997 Victor Schneider
* Copyright 2002 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -22,32 +23,29 @@
#include <windows.h>
#include <lzexpand.h>
int PASCAL WinMain(HINSTANCE hinstCurrent,
HINSTANCE hinstPrevious,
LPSTR lpCmdLine,
int nCmdShow)
int main(int argc, char *argv[])
{
OFSTRUCT SourceOpenStruct1, SourceOpenStruct2;
char OriginalName[256];
char FAR *lpzDestFile;
DWORD dwreturn;
HFILE hSourceFile, hDestFile;
/* Most Windows compilers have something like this: */
extern int _ARGC;
extern char **_ARGV;
hSourceFile = LZOpenFile(_ARGV[1], (LPOFSTRUCT) &SourceOpenStruct1, OF_READ);
if ((_ARGC == 3) && (_ARGV[2] != NULL))
lpzDestFile = _ARGV[2];
else {
lpzDestFile = OriginalName;
GetExpandedName(_ARGV[1], lpzDestFile);
};
hDestFile = LZOpenFile(lpzDestFile, (LPOFSTRUCT) &SourceOpenStruct2,
OF_CREATE | OF_WRITE);
if (argc < 2)
{
fprintf( stderr, "Usage: %s infile [outfile]\n", argv[0] );
return 1;
}
hSourceFile = LZOpenFile(argv[1], &SourceOpenStruct1, OF_READ);
if (argv[2])
hDestFile = LZOpenFile(argv[2], &SourceOpenStruct2, OF_CREATE | OF_WRITE);
else
{
char OriginalName[MAX_PATH];
GetExpandedName(argv[1], OriginalName);
hDestFile = LZOpenFile(OriginalName, &SourceOpenStruct2, OF_CREATE | OF_WRITE);
}
dwreturn = LZCopy(hSourceFile, hDestFile);
if (dwreturn != 0)
fprintf(stderr,"LZCopy failed: return is %ld\n",dwreturn);
fprintf(stderr,"LZCopy failed: return is %ld\n",dwreturn);
LZClose(hSourceFile);
LZClose(hDestFile);
return dwreturn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment