mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
Fixed wm_paint test to use ReactOS build system.
svn path=/trunk/; revision=4593
This commit is contained in:
parent
91316fff93
commit
71df58baf5
2 changed files with 16 additions and 63 deletions
|
@ -1,66 +1,20 @@
|
||||||
# Makefile - Proj_Listing1_1.dsp
|
|
||||||
|
|
||||||
ifndef CFG
|
PATH_TO_TOP = ../../..
|
||||||
CFG=Proj_Listing1_1 - Win32 Debug
|
|
||||||
endif
|
|
||||||
CC=gcc
|
|
||||||
CFLAGS=
|
|
||||||
CXX=g++
|
|
||||||
CXXFLAGS=$(CFLAGS)
|
|
||||||
RC=windres -O COFF
|
|
||||||
ifeq "$(CFG)" "Proj_Listing1_1 - Win32 Release"
|
|
||||||
CFLAGS+=-fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -W
|
|
||||||
LD=$(CXX) $(CXXFLAGS)
|
|
||||||
LDFLAGS=
|
|
||||||
LDFLAGS+=-Wl,--subsystem,windows
|
|
||||||
LIBS+=-lkernel32 -luser32 -lgdi32
|
|
||||||
else
|
|
||||||
ifeq "$(CFG)" "Proj_Listing1_1 - Win32 Debug"
|
|
||||||
CFLAGS+=-fexceptions -g -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_MBCS -W
|
|
||||||
LD=$(CXX) $(CXXFLAGS)
|
|
||||||
LDFLAGS=
|
|
||||||
LDFLAGS+=-Wl,--subsystem,windows
|
|
||||||
LIBS+=-lkernel32 -luser32 -lgdi32
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef TARGET
|
TARGET_NORC = yes
|
||||||
TARGET=WM_PAINT.exe
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: all
|
TARGET_TYPE = program
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
%.o: %.c
|
TARGET_APPTYPE = windows
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
|
||||||
|
|
||||||
%.o: %.cpp
|
TARGET_NAME = wm_paint
|
||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
|
|
||||||
|
|
||||||
%.res: %.rc
|
TARGET_SDKLIBS = kernel32.a gdi32.a
|
||||||
$(RC) $(CPPFLAGS) -o $@ -i $<
|
|
||||||
|
|
||||||
SOURCE_FILES= \
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
Listing1_1.cpp
|
|
||||||
|
|
||||||
HEADER_FILES=
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
RESOURCE_FILES=
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
SRCS=$(SOURCE_FILES) $(HEADER_FILES) $(RESOURCE_FILES)
|
|
||||||
|
|
||||||
OBJS=$(patsubst %.rc,%.res,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.rc,$(SRCS)))))
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
-del $(OBJS) $(TARGET)
|
|
||||||
|
|
||||||
.PHONY: depends
|
|
||||||
depends:
|
|
||||||
-$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cpp,$(SRCS)) > Proj_Listing1_1.dep
|
|
||||||
|
|
||||||
-include Proj_Listing1_1.dep
|
|
||||||
|
|
||||||
|
# EOF
|
||||||
|
|
|
@ -31,8 +31,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
wc.lpfnWndProc = MainWndProc;
|
wc.lpfnWndProc = MainWndProc;
|
||||||
wc.hInstance = HInstance;
|
wc.hInstance = HInstance;
|
||||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wc.hbrBackground =
|
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||||
reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1);
|
|
||||||
wc.lpszClassName = WndClassName;
|
wc.lpszClassName = WndClassName;
|
||||||
|
|
||||||
if (RegisterClass(&wc))
|
if (RegisterClass(&wc))
|
||||||
|
@ -70,7 +69,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
{
|
{
|
||||||
// determine the invalidated area of the window
|
// determine the invalidated area of the window
|
||||||
RECT RUpdate;
|
RECT RUpdate;
|
||||||
GetUpdateRect(HWnd, &RUpdate, false);
|
GetUpdateRect(HWnd, &RUpdate, NULL);
|
||||||
|
|
||||||
// grab a handle to our window's
|
// grab a handle to our window's
|
||||||
// common display device context
|
// common display device context
|
||||||
|
@ -87,11 +86,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
RUpdate.right, RUpdate.bottom);
|
RUpdate.right, RUpdate.bottom);
|
||||||
|
|
||||||
// fill the client area with the background brush
|
// fill the client area with the background brush
|
||||||
HBRUSH HBrush =
|
//HBRUSH HBrush =
|
||||||
reinterpret_cast<HBRUSH>(
|
//reinterpret_cast<HBRUSH>
|
||||||
GetClassLong(HWnd, GCL_HBRBACKGROUND)
|
(HBRUSH)(GetClassLong(HWnd, GCL_HBRBACKGROUND)
|
||||||
);
|
);
|
||||||
FillRect(Hdc, &RClient, HBrush);
|
FillRect(Hdc, &RClient, NULL);
|
||||||
|
|
||||||
// render the persistent text
|
// render the persistent text
|
||||||
const char* text = "Persistent Text";
|
const char* text = "Persistent Text";
|
Loading…
Reference in a new issue