├── Chapt_14 ├── FontEmbed │ ├── testdoc.tmp │ └── resource.h ├── Font │ ├── Raster.h │ └── Charset.h └── Chapt_14.dsw ├── Chapt_04 ├── QueryDDraw │ ├── QueryDDraw.asp │ ├── resource.h │ └── QueryDDraw.rc ├── DDISpy │ ├── resource.h │ └── DDISpy.rc ├── Diver │ ├── resource.h │ ├── Functable.h │ ├── Report.h │ ├── Proxy.h │ ├── Timer.h │ ├── Stack.h │ ├── Dump.h │ ├── Report.cpp │ └── Diver.rc ├── PogyGDI │ ├── resource.h │ └── PogyGDI.rc ├── Skimmer │ ├── resource.h │ └── Skimmer.rc ├── DDIWatcher │ ├── resource.h │ └── DDIWatcher.rc ├── TestDDraw │ └── resource.h ├── Pogy │ ├── Pogy.h │ ├── resource.h │ ├── ApiPage.h │ ├── Aplet.h │ ├── Setup.h │ └── Event.h └── Patcher │ ├── DisAsm.h │ └── Patcher.h ├── Res ├── 277.bmp ├── 279.bmp ├── API.ico ├── Com.ico ├── area.ico ├── brick.bmp ├── cube.bmp ├── empty.ico ├── equal.ico ├── font.ico ├── gdi.emf ├── graph.ico ├── image.ico ├── licon.bmp ├── line.ico ├── lion.bmp ├── micon.bmp ├── night.bmp ├── open.ico ├── panda.bmp ├── pixel.ico ├── print.ico ├── rgb1.bmp ├── rgb24.bmp ├── rgb4.bmp ├── rgb8.bmp ├── setup.ico ├── sicon.bmp ├── spy.ico ├── text.ico ├── tiger.bmp ├── brick01.bmp ├── brick02.bmp ├── change.ico ├── colive.ico ├── confuse.bmp ├── flower.bmp ├── gdihand.ico ├── palette.ico ├── paper01.bmp ├── printer.ico ├── puzzle.bmp ├── rgbrle4.bmp ├── rgbrle8.bmp ├── rock01.bmp ├── syscall.ico ├── tiger1.bmp ├── tiger2.bmp ├── wood01.bmp ├── wood02.bmp ├── Jetplane.bmp ├── marble01.bmp ├── mosquit1.bmp ├── mosquit2.bmp ├── mosquit3.bmp ├── pandatex.bmp ├── pattern01.bmp ├── tigertex.bmp ├── tigerwalk.bmp ├── whaletex.bmp └── elephanttex.bmp ├── include ├── Image.cpp ├── fonttext.h ├── jlib │ ├── jversion.h │ └── jconfig.h ├── toolbarb.h ├── PalLoadBitmap.h ├── basicdib.h ├── EditView.h ├── mmfile.h ├── wingraph.h ├── filedialog.h ├── BitmapInfo.h ├── atom.h ├── Status.h ├── crc.H ├── GDIObject.h ├── Decoder.h ├── MemDump.h ├── Toolbar.h ├── CheckMark.h ├── Canvas.h ├── timer.h ├── guires.h ├── Lookup.h ├── BitmapMenu.h ├── pehack.h └── pefile.h ├── Chapt_09 ├── Areas │ ├── area.ico │ └── resource.h └── Chapt_09.dsw ├── Chapt_15 ├── Text │ ├── TextDemo.cpp │ ├── ChooseFont.h │ └── Panose.h └── Chapt_15.dsw ├── Chapt_16 ├── EMFDCTest │ ├── dib_0.bmp │ ├── dib_1.bmp │ ├── dib_2.bmp │ └── resource.h ├── EMFScope │ ├── SPEHON32 │ │ ├── RESOURCE.H │ │ └── PLAYSPL.H │ ├── EXAMEMF.H │ ├── THUNK.H │ ├── SPOOLFIL.H │ └── CANVAS.H ├── EMF │ ├── Res │ │ ├── pre.cpp │ │ └── post.cpp │ ├── Cache.cpp │ ├── EmfDC.h │ └── Cache.h └── Chapt_16.dsw ├── Chapt_08 ├── LineCurve │ ├── LineCurve.cpp │ └── resource.h └── Chapt_08.dsw ├── README.md ├── Chapt_01 ├── Hello1 │ ├── resource.h │ ├── Hello1.cpp │ ├── Hello1.h │ └── Hello1.rc ├── Hello3 │ ├── resource.h │ └── Hello3.rc ├── Hello4 │ ├── resource.h │ └── Hello4.rc ├── SetProc │ ├── resource.h │ └── SetProc.rc ├── GDISpeed │ ├── resource.h │ └── GDISpeed.rc └── Chapt_01.dsw ├── Chapt_02 ├── HTMLDrv │ ├── resource.h │ └── HTMLDrv.rc ├── Timer │ ├── resource.h │ └── Timer.rc ├── Chapt_02.dsw └── SysCall │ └── resource.h ├── Chapt_05 ├── Ellipse │ └── resource.h ├── WindowDC │ └── resource.h ├── WinPaint │ └── resource.h ├── FrameWindow │ └── resource.h └── Device │ ├── DevCaps.h │ ├── DCAttr.h │ ├── resource.h │ └── DevPage.h ├── Chapt_18 ├── ddbasic │ └── resource.h ├── DemoD3D │ └── resource.h ├── DemoDD │ └── resource.h └── Chapt_18.dsw ├── Chapt_03 ├── Periscope │ ├── resource.h │ ├── periscope.h │ └── Periscope.rc ├── QueryTab │ ├── resource.h │ └── QueryTab.rc ├── TestPeriscope │ └── resource.h ├── Fosterer │ ├── resource.h │ └── ImageModule.h ├── Chapt_03.dsw └── Handles │ ├── FindTab.h │ ├── GDI.H │ ├── MemView.h │ ├── Handles.h │ ├── Snapshot.h │ └── dcdtable.h ├── Chapt_10 ├── Scrambler │ ├── resource.h │ └── Scrambler.cpp └── Chapt_10.dsw ├── Chapt_07 ├── GDIObj │ └── resource.h ├── PixelSpeed │ └── resource.h ├── ColorSpace │ └── resource.h ├── ClipRegion │ └── resource.h └── Mandelbrot │ └── resource.h ├── Chapt_06 ├── WeiQi │ └── resource.h ├── CoordinateSpace │ └── resource.h └── Chapt_06.dsw ├── Chapt_17 ├── Printer │ ├── pssample.txt │ └── pclsample.txt ├── PrinterDevice │ ├── resource.h │ ├── DevCaps.h │ ├── DCAttr.h │ └── DevPage.h └── ImagePrint │ └── imageview.h ├── Chapt_12 └── Chapt_12.dsw ├── Chapt_13 └── Chapt_13.dsw └── Chapt_11 └── Chapt_11.dsw /Chapt_14/FontEmbed/testdoc.tmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Chapt_04/QueryDDraw/QueryDDraw.asp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Res/277.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/277.bmp -------------------------------------------------------------------------------- /Res/279.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/279.bmp -------------------------------------------------------------------------------- /Res/API.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/API.ico -------------------------------------------------------------------------------- /Res/Com.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/Com.ico -------------------------------------------------------------------------------- /Res/area.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/area.ico -------------------------------------------------------------------------------- /Res/brick.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/brick.bmp -------------------------------------------------------------------------------- /Res/cube.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/cube.bmp -------------------------------------------------------------------------------- /Res/empty.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/empty.ico -------------------------------------------------------------------------------- /Res/equal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/equal.ico -------------------------------------------------------------------------------- /Res/font.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/font.ico -------------------------------------------------------------------------------- /Res/gdi.emf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/gdi.emf -------------------------------------------------------------------------------- /Res/graph.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/graph.ico -------------------------------------------------------------------------------- /Res/image.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/image.ico -------------------------------------------------------------------------------- /Res/licon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/licon.bmp -------------------------------------------------------------------------------- /Res/line.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/line.ico -------------------------------------------------------------------------------- /Res/lion.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/lion.bmp -------------------------------------------------------------------------------- /Res/micon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/micon.bmp -------------------------------------------------------------------------------- /Res/night.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/night.bmp -------------------------------------------------------------------------------- /Res/open.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/open.ico -------------------------------------------------------------------------------- /Res/panda.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/panda.bmp -------------------------------------------------------------------------------- /Res/pixel.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/pixel.ico -------------------------------------------------------------------------------- /Res/print.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/print.ico -------------------------------------------------------------------------------- /Res/rgb1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgb1.bmp -------------------------------------------------------------------------------- /Res/rgb24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgb24.bmp -------------------------------------------------------------------------------- /Res/rgb4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgb4.bmp -------------------------------------------------------------------------------- /Res/rgb8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgb8.bmp -------------------------------------------------------------------------------- /Res/setup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/setup.ico -------------------------------------------------------------------------------- /Res/sicon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/sicon.bmp -------------------------------------------------------------------------------- /Res/spy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/spy.ico -------------------------------------------------------------------------------- /Res/text.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/text.ico -------------------------------------------------------------------------------- /Res/tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/tiger.bmp -------------------------------------------------------------------------------- /Res/brick01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/brick01.bmp -------------------------------------------------------------------------------- /Res/brick02.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/brick02.bmp -------------------------------------------------------------------------------- /Res/change.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/change.ico -------------------------------------------------------------------------------- /Res/colive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/colive.ico -------------------------------------------------------------------------------- /Res/confuse.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/confuse.bmp -------------------------------------------------------------------------------- /Res/flower.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/flower.bmp -------------------------------------------------------------------------------- /Res/gdihand.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/gdihand.ico -------------------------------------------------------------------------------- /Res/palette.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/palette.ico -------------------------------------------------------------------------------- /Res/paper01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/paper01.bmp -------------------------------------------------------------------------------- /Res/printer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/printer.ico -------------------------------------------------------------------------------- /Res/puzzle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/puzzle.bmp -------------------------------------------------------------------------------- /Res/rgbrle4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgbrle4.bmp -------------------------------------------------------------------------------- /Res/rgbrle8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rgbrle8.bmp -------------------------------------------------------------------------------- /Res/rock01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/rock01.bmp -------------------------------------------------------------------------------- /Res/syscall.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/syscall.ico -------------------------------------------------------------------------------- /Res/tiger1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/tiger1.bmp -------------------------------------------------------------------------------- /Res/tiger2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/tiger2.bmp -------------------------------------------------------------------------------- /Res/wood01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/wood01.bmp -------------------------------------------------------------------------------- /Res/wood02.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/wood02.bmp -------------------------------------------------------------------------------- /Res/Jetplane.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/Jetplane.bmp -------------------------------------------------------------------------------- /Res/marble01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/marble01.bmp -------------------------------------------------------------------------------- /Res/mosquit1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/mosquit1.bmp -------------------------------------------------------------------------------- /Res/mosquit2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/mosquit2.bmp -------------------------------------------------------------------------------- /Res/mosquit3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/mosquit3.bmp -------------------------------------------------------------------------------- /Res/pandatex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/pandatex.bmp -------------------------------------------------------------------------------- /Res/pattern01.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/pattern01.bmp -------------------------------------------------------------------------------- /Res/tigertex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/tigertex.bmp -------------------------------------------------------------------------------- /Res/tigerwalk.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/tigerwalk.bmp -------------------------------------------------------------------------------- /Res/whaletex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/whaletex.bmp -------------------------------------------------------------------------------- /include/Image.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/include/Image.cpp -------------------------------------------------------------------------------- /include/fonttext.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/include/fonttext.h -------------------------------------------------------------------------------- /Res/elephanttex.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Res/elephanttex.bmp -------------------------------------------------------------------------------- /Chapt_09/Areas/area.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_09/Areas/area.ico -------------------------------------------------------------------------------- /Chapt_15/Text/TextDemo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_15/Text/TextDemo.cpp -------------------------------------------------------------------------------- /Chapt_16/EMFDCTest/dib_0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_16/EMFDCTest/dib_0.bmp -------------------------------------------------------------------------------- /Chapt_16/EMFDCTest/dib_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_16/EMFDCTest/dib_1.bmp -------------------------------------------------------------------------------- /Chapt_16/EMFDCTest/dib_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_16/EMFDCTest/dib_2.bmp -------------------------------------------------------------------------------- /Chapt_08/LineCurve/LineCurve.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpn/windows-graphics-programming-src/HEAD/Chapt_08/LineCurve/LineCurve.cpp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # windows-graphics-programming-src 2 | Source Code for Feng Yuan's excellent book: Windows Graphics Programming. 3 | 4 | http://www.amazon.com/Windows-Graphics-Programming-Hewlett-Packard-Professional/dp/0130869856/ref=sr_1_1?s=books&ie=UTF8&qid=1426629728&sr=1-1&keywords=windows+graphics+programming 5 | 6 | All content copyright Feng Yuan. 7 | 8 | Source code downloaded from: http://blogs.msdn.com/b/fyuan/archive/2007/03/20/source-code-for-windows-graphics-programming-win32-gdi-and-directdraw.aspx 9 | 10 | -------------------------------------------------------------------------------- /Chapt_01/Hello1/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Hello1.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_01/Hello3/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Hello3.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_01/Hello4/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Hello4.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_01/SetProc/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by SetProc.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_02/HTMLDrv/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by HTMLDrv.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_02/Timer/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Timer.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_04/DDISpy/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by DDISpy.rc 4 | // 5 | #define IDI_SPY 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_05/Ellipse/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Ellipse.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_18/ddbasic/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by ddbasic.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_01/GDISpeed/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by GDISpeed.rc 4 | // 5 | #define IDI_GRAPH 104 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 105 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_03/Periscope/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Periscope.rc 4 | // 5 | #define IDI_SPY 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_03/QueryTab/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by QueryTab.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_05/WindowDC/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by WindowDC.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_10/Scrambler/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Scrambler.rc 4 | // 5 | #define IDI_IMAGE 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 103 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_03/TestPeriscope/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by TestPeriscope.rc 4 | // 5 | #define IDI_GRAPH 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1000 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chapt_04/Diver/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Diver.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_04/PogyGDI/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by PogyGDI.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_04/Skimmer/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Skimmer.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_04/DDIWatcher/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by DDIWatcher.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_04/QueryDDraw/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by QueryDDraw.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_04/TestDDraw/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by TestDDraw.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDI_SPY 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Chapt_07/GDIObj/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by GDIObj.rc 4 | // 5 | #define IDD_GDIOBJ 101 6 | #define IDI_HANDLE 103 7 | #define IDC_PROCESS 1000 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 104 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1001 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /Chapt_16/EMFDCTest/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by EMFDCTest.rc 4 | // 5 | #define IDB_BITMAP1 101 6 | #define IDB_BITMAP2 102 7 | #define IDB_BITMAP3 103 8 | #define IDI_PRINT 107 9 | 10 | // Next default values for new objects 11 | // 12 | #ifdef APSTUDIO_INVOKED 13 | #ifndef APSTUDIO_READONLY_SYMBOLS 14 | #define _APS_NEXT_RESOURCE_VALUE 108 15 | #define _APS_NEXT_COMMAND_VALUE 40001 16 | #define _APS_NEXT_CONTROL_VALUE 1000 17 | #define _APS_NEXT_SYMED_VALUE 101 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /Chapt_18/DemoD3D/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by DemoD3D.rc 4 | // 5 | #define IDB_TIGER 101 6 | #define IDB_PANDA 102 7 | #define IDB_WHALE 104 8 | #define IDB_ELEPHANT 105 9 | #define IDI_GRAPH 106 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NEXT_RESOURCE_VALUE 107 16 | #define _APS_NEXT_COMMAND_VALUE 40001 17 | #define _APS_NEXT_CONTROL_VALUE 1000 18 | #define _APS_NEXT_SYMED_VALUE 101 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /Chapt_05/WinPaint/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by WinPaint.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_GRAPH 102 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_VIEW_HREDRAW 40002 9 | #define IDM_VIEW_VREDRAW 40003 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NEXT_RESOURCE_VALUE 103 16 | #define _APS_NEXT_COMMAND_VALUE 40004 17 | #define _APS_NEXT_CONTROL_VALUE 1000 18 | #define _APS_NEXT_SYMED_VALUE 101 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /Chapt_06/WeiQi/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by WeiQi.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_COLIVE 102 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_BOARD_9 40016 9 | #define IDM_BOARD_13 40017 10 | #define IDM_BOARD_19 40018 11 | 12 | // Next default values for new objects 13 | // 14 | #ifdef APSTUDIO_INVOKED 15 | #ifndef APSTUDIO_READONLY_SYMBOLS 16 | #define _APS_NEXT_RESOURCE_VALUE 103 17 | #define _APS_NEXT_COMMAND_VALUE 40019 18 | #define _APS_NEXT_CONTROL_VALUE 1000 19 | #define _APS_NEXT_SYMED_VALUE 101 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /Chapt_07/PixelSpeed/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by PixelSpeed.rc 4 | // 5 | #define IDD_SPEED 101 6 | #define IDI_PIXEL 103 7 | #define IDC_REPORT 1000 8 | #define IDC_CPU 1001 9 | #define IDC_OVERHEAD 1002 10 | #define IDC_TU 1003 11 | 12 | // Next default values for new objects 13 | // 14 | #ifdef APSTUDIO_INVOKED 15 | #ifndef APSTUDIO_READONLY_SYMBOLS 16 | #define _APS_NEXT_RESOURCE_VALUE 104 17 | #define _APS_NEXT_COMMAND_VALUE 40001 18 | #define _APS_NEXT_CONTROL_VALUE 1004 19 | #define _APS_NEXT_SYMED_VALUE 101 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /Chapt_17/Printer/pssample.txt: -------------------------------------------------------------------------------- 1 | <1B> 2 | %-12345X@PJL JOB 3 | @PJL ENTER LANGUAGE = POSTSCRIPT 4 | %!PS-Adobe-3.0 5 | %%Title: Document 6 | %%Creator: Pscript.dll Version 5.0 7 | %%Orientation: Portrait 8 | %%PageOrder: Special 9 | %%TargetDevice: (HP Color LaserJet 8500) (3010.104) 1 10 | %%LanguageLevel: 3 11 | %%EndComments 12 | 13 | .. 14 | 15 | %%IncludeResource: font TimesNewRomanPSMT 16 | F /F0 0 /256 T /TimesNewRomanPSMT mF 17 | /F0S53 F0 18 | [83 0 0 -83 0 0 ] mFS 19 | F0S53 setfont 20 | 21 | 650 574 moveto 22 | (Printer Control Language)[47 28 23 41 23 37 28 21 55 42 41 23 28 42 23 21 50 37 41 41 41 37 41 0]xshow 23 | showpage 24 | (%%[Page: 1]%%) = 25 | %%PageTrailer 26 | 27 | %%Trailer 28 | %%BoundingBox: 12 12 600 780 29 | %%Pages: 1 30 | (%%[LastPage]%%) = 31 | %%EOF 32 | <1B>%-12345X@PJL EOJ 33 | <1B>%-12345X -------------------------------------------------------------------------------- /Chapt_17/Printer/pclsample.txt: -------------------------------------------------------------------------------- 1 | PCL_RESET "<1B>E" 2 | PJL_ENTER_PCL3GUI "<1B>@PJL ENTER LANGUAGE=PCL3GUI<0D><0A>" 3 | PCL_RESET "<1B>E" 4 | 5 | CmdStartDoc "<1B>&u600D<1B>*o5W<04 09 00 00 00>" 6 | PCL_US_LETTER: "<1B>&l2A" 7 | PCL_MEDSOURCE_TRAY1 "<1B>&l1H" 8 | PCL_MEDSOURCE_PRELOAD "<1B>&l-2H" 9 | PCL_MEDIA_PLAIN "<1B>&l0M" 10 | PCL_PQ_NORMAL "<1B>*o0M" 11 | PCL_CRD_K662_C334 "<1B>*g26W<0204025802580002012C012C0004012C012C0004012C012C0004>" 12 | PCL_ORIENT_PORTRAIT "<1B>&l0O" 13 | 14 | CmdStartPage "<1B>&l0E<1B>*p0y0X<1B>&l0L<1B>*r1A" 15 | 16 | "<1B2A62306D32393779326D313776AC00>" 17 | "<0103C0EA0003FFFC00C0EA000103C031>" 18 | "<3776AC000103C0EA0003FFFC00C0EA00>" 19 | ... 20 | 21 | CmdEndPage "<1B>*rC<0C>" 22 | 23 | PJL_EXIT_LANGUAGE "<1B>%%-12345X" 24 | 25 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/SPEHON32/RESOURCE.H: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by spehon32.rc 4 | // 5 | #define IDD_SPOOLSPY 101 6 | #define IDI_COLIVE 102 7 | #define IDR_MAIN 103 8 | #define IDC_LINE1 1000 9 | #define IDC_LINE2 1001 10 | #define IDC_LINE3 1002 11 | #define IDC_LINE4 1003 12 | #define IDC_MIDVIEW 1008 13 | 14 | // Next default values for new objects 15 | // 16 | #ifdef APSTUDIO_INVOKED 17 | #ifndef APSTUDIO_READONLY_SYMBOLS 18 | #define _APS_NEXT_RESOURCE_VALUE 104 19 | #define _APS_NEXT_COMMAND_VALUE 40001 20 | #define _APS_NEXT_CONTROL_VALUE 1009 21 | #define _APS_NEXT_SYMED_VALUE 101 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /Chapt_07/ColorSpace/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by ColorSpace.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_GRAPH 103 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_COLORSPACE_RGB 40004 9 | #define IDM_COLORSPACE_HLS 40008 10 | #define IDM_COLORSPACE_RGB2HLS 40009 11 | #define IDM_COLORSPACE_DEFPAL 40010 12 | #define IDM_COLORSPACE_HFTPAL 40011 13 | 14 | // Next default values for new objects 15 | // 16 | #ifdef APSTUDIO_INVOKED 17 | #ifndef APSTUDIO_READONLY_SYMBOLS 18 | #define _APS_NEXT_RESOURCE_VALUE 104 19 | #define _APS_NEXT_COMMAND_VALUE 40012 20 | #define _APS_NEXT_CONTROL_VALUE 1000 21 | #define _APS_NEXT_SYMED_VALUE 101 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /Chapt_07/ClipRegion/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by ClipRegion.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_GRAPH 103 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_VIEW_HREDRAW 40002 9 | #define IDM_VIEW_VREDRAW 40003 10 | #define IDM_TEST_DEFAULT 40004 11 | #define IDM_TEST_SETCLIP 40005 12 | #define IDM_TEST_SETMETACLIP 40006 13 | #define IDM_TEST_SETMETA 40007 14 | 15 | // Next default values for new objects 16 | // 17 | #ifdef APSTUDIO_INVOKED 18 | #ifndef APSTUDIO_READONLY_SYMBOLS 19 | #define _APS_NEXT_RESOURCE_VALUE 104 20 | #define _APS_NEXT_COMMAND_VALUE 40008 21 | #define _APS_NEXT_CONTROL_VALUE 1000 22 | #define _APS_NEXT_SYMED_VALUE 101 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /Chapt_17/PrinterDevice/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by PrinterDevice.rc 4 | // 5 | #define IDD_DEVICEPAGE 101 6 | #define IDD_DEVICECAPS 102 7 | #define IDD_DCATTRIBUTES 103 8 | #define IDI_PRINT 104 9 | #define IDC_DEVICE 1000 10 | #define IDC_DEVICECAPS 1006 11 | #define IDC_CAPS 1008 12 | #define IDC_DCATTR 1009 13 | #define IDC_DCATTRIBUTES 1010 14 | #define IDC_INFO2 1021 15 | 16 | // Next default values for new objects 17 | // 18 | #ifdef APSTUDIO_INVOKED 19 | #ifndef APSTUDIO_READONLY_SYMBOLS 20 | #define _APS_NEXT_RESOURCE_VALUE 105 21 | #define _APS_NEXT_COMMAND_VALUE 40001 22 | #define _APS_NEXT_CONTROL_VALUE 1022 23 | #define _APS_NEXT_SYMED_VALUE 101 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /Chapt_09/Chapt_09.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Area"=.\Areas\Area.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_15/Chapt_15.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Text"=.\Text\Text.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_12/Chapt_12.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Imaging"=.\Imaging\Imaging.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_13/Chapt_13.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Palette"=.\Palette\Palette.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_08/Chapt_08.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "LineCurve"=.\LineCurve\LineCurve.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_11/Chapt_11.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "AdvBitmap"=.\AdvBitmap\AdvBitmap.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /Chapt_07/Mandelbrot/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Mandelbrot.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_PIXEL 104 7 | #define ID_FILE_EXIT 40001 8 | #define ID_VIEW_RESET 40002 9 | #define IDM_OPT_128 40009 10 | #define IDM_OPT_256 40010 11 | #define IDM_OPT_512 40011 12 | #define IDM_OPT_1024 40012 13 | #define IDM_OPT_4096 40013 14 | #define IDM_OPT_64 40014 15 | #define IDM_OPT_16384 40015 16 | 17 | // Next default values for new objects 18 | // 19 | #ifdef APSTUDIO_INVOKED 20 | #ifndef APSTUDIO_READONLY_SYMBOLS 21 | #define _APS_NEXT_RESOURCE_VALUE 105 22 | #define _APS_NEXT_COMMAND_VALUE 40016 23 | #define _APS_NEXT_CONTROL_VALUE 1000 24 | #define _APS_NEXT_SYMED_VALUE 101 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /Chapt_03/Fosterer/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Fosterer.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_SPY 102 7 | #define ID_EXIT 40001 8 | #define ID_HELP_GDIKDX 40002 9 | #define ID_HELP_DUMPHMGR 40003 10 | #define ID_HELP_DUMPOBJ 40004 11 | #define ID_CMD_DUMPHMGR 40005 12 | #define ID_CMD_DUMPOBJ 40006 13 | #define ID_CMD_DDC 40009 14 | #define ID_CMD_DPDEV 40010 15 | #define ID_CMD_DLDEV 40011 16 | #define ID_CMD_DGDEV 40012 17 | 18 | // Next default values for new objects 19 | // 20 | #ifdef APSTUDIO_INVOKED 21 | #ifndef APSTUDIO_READONLY_SYMBOLS 22 | #define _APS_NEXT_RESOURCE_VALUE 103 23 | #define _APS_NEXT_COMMAND_VALUE 40013 24 | #define _APS_NEXT_CONTROL_VALUE 1000 25 | #define _APS_NEXT_SYMED_VALUE 101 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /include/jlib/jversion.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Modified by: Yuan, Feng www.fengyuan.com // 6 | // Changes : C++, exception, in-memory source, BGR byte order // 7 | // Version : 1.00.000, May 31, 2000 // 8 | //-------------------------------------------------------------------------// 9 | 10 | /* 11 | * jversion.h 12 | * 13 | * Copyright (C) 1991-1998, Thomas G. Lane. 14 | * This file is part of the Independent JPEG Group's software. 15 | * For conditions of distribution and use, see the accompanying README file. 16 | * 17 | * This file contains software version identification. 18 | */ 19 | 20 | 21 | #define JVERSION "6b 27-Mar-1998" 22 | 23 | #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" 24 | -------------------------------------------------------------------------------- /include/jlib/jconfig.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Modified by: Yuan, Feng www.fengyuan.com // 6 | // Changes : C++, exception, in-memory source, BGR byte order // 7 | // Version : 1.00.000, May 31, 2000 // 8 | //-------------------------------------------------------------------------// 9 | 10 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 11 | /* see jconfig.doc for explanations */ 12 | 13 | #define HAVE_UNSIGNED_CHAR 14 | #define HAVE_UNSIGNED_SHORT 15 | #undef CHAR_IS_UNSIGNED 16 | 17 | /* Define "boolean" as unsigned char, not int, per Windows custom */ 18 | typedef unsigned char boolean; 19 | 20 | #ifdef JPEG_INTERNALS 21 | 22 | #undef RIGHT_SHIFT_IS_UNSIGNED 23 | 24 | #endif /* JPEG_INTERNALS */ 25 | 26 | -------------------------------------------------------------------------------- /Chapt_02/Chapt_02.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "HTMLDrv"=.\HTMLDrv\HTMLDrv.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "SysCall"=.\SysCall\SysCall.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "Timer"=.\Timer\Timer.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Global: 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<3> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | -------------------------------------------------------------------------------- /Chapt_15/Text/ChooseFont.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : choosefont.h // 10 | // Description: Customized font selection dialog box // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | void FontSelection(HINSTANCE hInst); -------------------------------------------------------------------------------- /Chapt_14/Font/Raster.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : raster.h // 10 | // Description: Bitmap/vector decoder // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | int DecodeRasterFont(HDC hDC, const TCHAR * filename); 15 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/Pogy.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : pogy.h // 10 | // Description: Spy control program entries // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | KAplet *CreatePogy(void); 15 | void DeletePogy(KAplet *aplet); 16 | -------------------------------------------------------------------------------- /Chapt_05/FrameWindow/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by FrameWindow.rc 4 | // 5 | #define IDS_FILENEW 1 6 | #define IDS_HELPABOUT 2 7 | #define IDR_MAIN 101 8 | #define IDI_GRAPH 102 9 | #define IDM_APP_EXIT 40001 10 | #define IDM_EDIT_UNDO 40002 11 | #define IDM_EDIT_CUT 40003 12 | #define IDM_EDIT_COPY 40004 13 | #define IDM_EDIT_PASTE 40005 14 | #define IDM_VIEW_TOOLBAR 40006 15 | #define IDM_VIEW_STATUSBAR 40007 16 | #define IDM_APP_ABOUT 40008 17 | #define IDM_FILE_NEW 40009 18 | #define IDM_FILE_OPEN 40010 19 | 20 | // Next default values for new objects 21 | // 22 | #ifdef APSTUDIO_INVOKED 23 | #ifndef APSTUDIO_READONLY_SYMBOLS 24 | #define _APS_NEXT_RESOURCE_VALUE 103 25 | #define _APS_NEXT_COMMAND_VALUE 40011 26 | #define _APS_NEXT_CONTROL_VALUE 1000 27 | #define _APS_NEXT_SYMED_VALUE 101 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/SPEHON32/PLAYSPL.H: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : playspl.h // 10 | // Description: Replacement for gdiPlaySpoolStrea // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | HDC WINAPI MygdiPlaySpoolStream(LPSTR, LPSTR, LPSTR, DWORD, LPDWORD, HDC); 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Pogy.rc 4 | // 5 | #define IDS_SETUP 1 6 | #define IDS_API 2 7 | #define IDS_EVENT 3 8 | #define IDD_EVENT 101 9 | #define IDD_API 102 10 | #define IDD_SETUPPOGY 103 11 | #define IDI_SPY 110 12 | #define IDI_SYSCALL 112 13 | #define IDI_COM 113 14 | #define IDI_API 114 15 | #define IDC_EVENT 1000 16 | #define IDC_LIST 1001 17 | #define IDC_TARGET 1005 18 | #define IDC_LOGCALL 1006 19 | #define IDC_DISPCALL 1007 20 | 21 | // Next default values for new objects 22 | // 23 | #ifdef APSTUDIO_INVOKED 24 | #ifndef APSTUDIO_READONLY_SYMBOLS 25 | #define _APS_NO_MFC 1 26 | #define _APS_NEXT_RESOURCE_VALUE 112 27 | #define _APS_NEXT_COMMAND_VALUE 40001 28 | #define _APS_NEXT_CONTROL_VALUE 1009 29 | #define _APS_NEXT_SYMED_VALUE 101 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /Chapt_06/CoordinateSpace/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by CoordinateSpace.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_GRAPH 102 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_VIEW_DOTLINE 40002 9 | #define IDM_VIEW_CUBE30 40003 10 | #define IDM_VIEW_REGION 40004 11 | #define IDM_VIEW_CUBE45 40005 12 | #define IDM_VIEW_MMTEXT 40006 13 | #define IDM_VIEW_MMLOENGLISH 40007 14 | #define IDM_VIEW_MMHIENGLISH 40008 15 | #define IDM_VIEW_MMLOMETRIC 40009 16 | #define IDM_VIEW_MMHIMETRIC 40010 17 | #define IDM_VIEW_MMTWIPS 40011 18 | #define IDM_VIEW_MMISOTROPIC 40012 19 | #define IDM_VIEW_MMANISOTROPIC 40013 20 | 21 | // Next default values for new objects 22 | // 23 | #ifdef APSTUDIO_INVOKED 24 | #ifndef APSTUDIO_READONLY_SYMBOLS 25 | #define _APS_NEXT_RESOURCE_VALUE 103 26 | #define _APS_NEXT_COMMAND_VALUE 40014 27 | #define _APS_NEXT_CONTROL_VALUE 1000 28 | #define _APS_NEXT_SYMED_VALUE 101 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /Chapt_14/Chapt_14.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Font"=.\Font\Font.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "FontEmbed"=.\FontEmbed\FontEmbed.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | Global: 46 | 47 | Package=<5> 48 | {{{ 49 | }}} 50 | 51 | Package=<3> 52 | {{{ 53 | }}} 54 | 55 | ############################################################################### 56 | 57 | -------------------------------------------------------------------------------- /Chapt_10/Chapt_10.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Bitmaps"=.\Bitmaps\Bitmaps.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "Scrambler"=.\Scrambler\Scrambler.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | Global: 46 | 47 | Package=<5> 48 | {{{ 49 | }}} 50 | 51 | Package=<3> 52 | {{{ 53 | }}} 54 | 55 | ############################################################################### 56 | 57 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/EXAMEMF.H: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : examemf.h // 10 | // Description: EMF data analysis // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KInputFile; 15 | 16 | BOOL CheckNTSpoolEmfFile(KInputFile *emf, ENHMETAHEADER *header); 17 | 18 | BOOL PlayNTEnhMetaFile(HDC hDC, KInputFile *emf, RECT *rect); 19 | -------------------------------------------------------------------------------- /Chapt_09/Areas/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Area.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_AREA 105 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_TEST_DITHER 40002 9 | #define IDM_TEST_HATCHBRUSH 40020 10 | #define IDM_TEST_SYSCOLORBRUSH 40021 11 | #define IDM_TEST_RECTANGLE 40022 12 | #define IDM_TEST_DRAWFRAMECONTROL 40023 13 | #define IDM_TEST_ELLIPSE 40024 14 | #define IDM_TEST_PIECHART 40025 15 | #define IDM_TEST_POLYFILLMODE 40026 16 | #define IDM_TEST_FILLPATH 40027 17 | #define IDM_TEST_REGION 40028 18 | #define IDM_TEST_REGIONOP 40029 19 | #define IDM_TEST_REGIONPAINT 40030 20 | #define IDM_TEST_GRADIENTFILL 40031 21 | 22 | // Next default values for new objects 23 | // 24 | #ifdef APSTUDIO_INVOKED 25 | #ifndef APSTUDIO_READONLY_SYMBOLS 26 | #define _APS_NEXT_RESOURCE_VALUE 106 27 | #define _APS_NEXT_COMMAND_VALUE 40032 28 | #define _APS_NEXT_CONTROL_VALUE 1000 29 | #define _APS_NEXT_SYMED_VALUE 101 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /include/toolbarb.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : toolbarb.h // 10 | // Description: Toolbar with bitmap switching // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #pragma once 15 | 16 | // Toolbar window 17 | class KToolbarB : public KToolbar 18 | { 19 | public: 20 | BOOL SetBitmap(HINSTANCE hInstance, int resourceID); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /include/PalLoadBitmap.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : palloadbitmap.h // 10 | // Description: Load a bitmap under a logical palette // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | BITMAPINFO * LoadDIB(HINSTANCE hInst, LPCTSTR pBitmapName, bool & bNeedFree); 15 | 16 | HBITMAP PaletteLoadBitmap(HINSTANCE hInst, LPCTSTR pBitmapName, HPALETTE hPalette); 17 | 18 | HPALETTE CreateSystemPalette(void); 19 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Functable.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : functable // 10 | // Description: KMyFuncTable class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KMyFuncTable : public KFuncTable 15 | { 16 | void FuncEntryCallBack(KRoutineInfo *routine, EntryInfo *info); 17 | void FuncExitCallBack(KRoutineInfo *routine, ExitInfo *info, unsigned leavetime, int depth); 18 | }; 19 | -------------------------------------------------------------------------------- /include/basicdib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : basicdib.h // 12 | // Description: Basic DIB handling // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | BITMAPINFO * LoadBMP(HMODULE hModule, const TCHAR * pResName); 17 | BITMAPINFO * LoadBMPFile(const TCHAR * pFileName); 18 | 19 | int GetDIBColorCount(const BITMAPINFO * pDIB); 20 | BOOL MaptoGray(BITMAPINFO * pDIB); 21 | -------------------------------------------------------------------------------- /Chapt_14/FontEmbed/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by FontEmbed.rc 4 | // 5 | #define IDR_RT_TTF1 101 6 | #define IDR_RT_TTF2 102 7 | #define IDR_RT_TTF3 103 8 | #define IDD_FONT 105 9 | #define IDI_FONT 106 10 | #define IDC_LOAD 1001 11 | #define IDC_FONTLIST 1002 12 | #define IDC_SAMPLE1 1003 13 | #define IDC_SAMPLE2 1004 14 | #define IDC_SAMPLE3 1005 15 | #define IDC_MESSAGE 1006 16 | #define IDC_HIDDEN 1007 17 | #define IDC_PRIVATE 1008 18 | #define IDC_NOENUM 1009 19 | #define IDC_MEM 1010 20 | #define IDC_PUBLIC 1011 21 | #define IDC_GENERATE 1012 22 | #define IDC_UNLOAD 1013 23 | 24 | // Next default values for new objects 25 | // 26 | #ifdef APSTUDIO_INVOKED 27 | #ifndef APSTUDIO_READONLY_SYMBOLS 28 | #define _APS_NEXT_RESOURCE_VALUE 107 29 | #define _APS_NEXT_COMMAND_VALUE 40001 30 | #define _APS_NEXT_CONTROL_VALUE 1013 31 | #define _APS_NEXT_SYMED_VALUE 101 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /Chapt_06/Chapt_06.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "CoordinateSpace"=.\CoordinateSpace\CoordinateSpace.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "WeiQi"=.\WeiQi\WeiQi.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | Begin Project Dependency 30 | Project_Dep_Name wingraph 31 | End Project Dependency 32 | }}} 33 | 34 | ############################################################################### 35 | 36 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 37 | 38 | Package=<5> 39 | {{{ 40 | }}} 41 | 42 | Package=<4> 43 | {{{ 44 | }}} 45 | 46 | ############################################################################### 47 | 48 | Global: 49 | 50 | Package=<5> 51 | {{{ 52 | }}} 53 | 54 | Package=<3> 55 | {{{ 56 | }}} 57 | 58 | ############################################################################### 59 | 60 | -------------------------------------------------------------------------------- /Chapt_02/SysCall/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by SysCall.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_GRAPH 102 7 | #define ID_EXIT 40001 8 | #define ID_HELP_GDIKDX 40002 9 | #define ID_HELP_DUMPHMGR 40003 10 | #define ID_HELP_DUMPOBJ 40004 11 | #define ID_CMD_DUMPHMGR 40005 12 | #define ID_CMD_DUMPOBJ 40006 13 | #define ID_CMD_DDC 40009 14 | #define ID_CMD_DPDEV 40010 15 | #define ID_CMD_DLDEV 40011 16 | #define ID_CMD_DGDEV 40012 17 | #define ID_GDI_SYSCALL 40013 18 | #define ID_USER_SYSCALL 40014 19 | #define ID_NTDLL_SYSCALL 40015 20 | #define ID_WIN32K_SYSCALLTAB 40016 21 | #define ID_NTOSKRNL_SYSCALLTAB 40017 22 | #define ID_GDI_POGY 40018 23 | 24 | // Next default values for new objects 25 | // 26 | #ifdef APSTUDIO_INVOKED 27 | #ifndef APSTUDIO_READONLY_SYMBOLS 28 | #define _APS_NEXT_RESOURCE_VALUE 103 29 | #define _APS_NEXT_COMMAND_VALUE 40019 30 | #define _APS_NEXT_CONTROL_VALUE 1000 31 | #define _APS_NEXT_SYMED_VALUE 101 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/ApiPage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : apipage.h // 12 | // Description: KApiPage class // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | extern KApiTable ApiTable; 17 | 18 | class KApiPage : public KPropertySheetPage 19 | { 20 | virtual BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 21 | 22 | public: 23 | KListView List; 24 | HINSTANCE hInst; 25 | HWND m_hWnd; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/THUNK.H: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : thunk.h // 10 | // Description: Three Intel instruction for linking Win32 with C++ // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | typedef unsigned char ThunkData[9]; 15 | 16 | void inline ThunkInit(ThunkData t, void * This) 17 | { 18 | t[0] = 0xB9; // mov ecx, 19 | *((DWORD *)(t+1)) = (DWORD) This; // this 20 | *((DWORD *)(t+5)) = 0x20FF018B; // mov eax, [ecx] 21 | // jmp [eax] 22 | } 23 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/Aplet.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : applet.h // 10 | // Description: Spy control program property sheet // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KAplet 15 | { 16 | public: 17 | virtual void InitProcess(HINSTANCE hInstance) = 0; 18 | virtual void TermProcess(HINSTANCE hInstance) = 0; 19 | 20 | virtual int GetPropertySheetPages(HINSTANCE hInst, HPROPSHEETPAGE *hPage) = 0; 21 | virtual void Initialize(HINSTANCE hInst) = 0; 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /Chapt_05/Device/DevCaps.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : devcap.h // 10 | // Description: KDeviceCaps class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDeviceCaps : public KDialog 15 | { 16 | HDC m_hDC; 17 | KListView m_List; 18 | 19 | BOOL OnInitDialog(void); 20 | 21 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 22 | 23 | void OneCap(int index, const TCHAR * name, const TCHAR * format); 24 | 25 | public: 26 | 27 | KDeviceCaps(HDC hDC) 28 | { 29 | m_hDC = hDC; 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /include/EditView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : editview.h // 12 | // Description: EDIT window with Win32 data type decoding // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KEditView : public KScrollCanvas 17 | { 18 | HWND m_hEdit; 19 | HINSTANCE m_hInstance; 20 | 21 | virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 22 | 23 | public: 24 | 25 | KEditView(void) 26 | { 27 | } 28 | 29 | bool Initialize(HINSTANCE hInstance); 30 | void Decode(DWORD m_Data, DWORD m_Type); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /Chapt_17/PrinterDevice/DevCaps.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : devcaps.h // 10 | // Description: KDeviceCaps dialog box // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDeviceCaps : public KDialog 15 | { 16 | HDC m_hDC; 17 | KListView m_List; 18 | 19 | BOOL OnInitDialog(void); 20 | 21 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 22 | 23 | void OneCap(int index, const TCHAR * name, const TCHAR * format); 24 | 25 | public: 26 | 27 | KDeviceCaps(HDC hDC) 28 | { 29 | m_hDC = hDC; 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/Setup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : setup.h // 12 | // Description: KSetupPogyPage class // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KSetupPogyPage : public KPropertySheetPage 17 | { 18 | virtual BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 19 | 20 | public: 21 | 22 | bool bLogCall; 23 | bool bDispCall; 24 | 25 | void SetButtons(void); 26 | void ReadButtons(void); 27 | void ReadOptions(HINSTANCE hInstance); 28 | void SaveOptions(HINSTANCE hInstance); 29 | }; 30 | -------------------------------------------------------------------------------- /Chapt_05/Device/DCAttr.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : dcattr.h // 10 | // Description: KDCAttributes class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDCAttributes : public KDialog 15 | { 16 | HDC m_hDC; 17 | HWND m_hWnd; 18 | 19 | KListView m_List; 20 | 21 | BOOL OnInitDialog(void); 22 | 23 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | void Add(LPCTSTR pszAttribute, LPCTSTR pszFormat, ...); 25 | 26 | void DumpDC(HDC hDC); 27 | 28 | public: 29 | 30 | KDCAttributes(HDC hDC) 31 | { 32 | m_hDC = hDC; 33 | } 34 | }; -------------------------------------------------------------------------------- /Chapt_04/Patcher/DisAsm.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : disasm.h // 10 | // Description: Intel machine code parser // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #pragma once 15 | 16 | #include "OpCode.h" 17 | 18 | class KDisAsm 19 | { 20 | const char * m_funcname; 21 | bool m_error; 22 | 23 | public: 24 | KDisAsm(); 25 | virtual ~KDisAsm(); 26 | 27 | int OperandLen(const OpCode * map, unsigned opcode, int opndsize, int & modrm); 28 | int Length(const unsigned char * code, const char * funcname); 29 | }; 30 | 31 | int First5(const unsigned char * pProc, const char * funcname); -------------------------------------------------------------------------------- /Chapt_08/LineCurve/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by LineCurve.rc 4 | // 5 | #define IDR_MAIN 101 6 | #define IDI_LINE 106 7 | #define IDM_FILE_EXIT 40001 8 | #define IDM_TEST_DRAWMODE 40002 9 | #define IDM_TEST_WIDTHCAP 40003 10 | #define IDM_TEST_DCPEN 40004 11 | #define IDM_TEST_PENSTYLE 40005 12 | #define IDM_TEST_COSMETIC 40006 13 | #define IDM_TEST_GEOMETRIC_WIDTH 40007 14 | #define IDM_TEST_GEOMETRIC_STYLE 40008 15 | #define IDM_TEST_LINE1 40009 16 | #define IDM_TEST_LINE2 40010 17 | #define IDM_TEST_BEZIER 40011 18 | #define IDM_TEST_BEZIERDEMO 40012 19 | #define IDM_TEST_BEZIERPEN 40013 20 | #define IDM_TEST_ARC 40014 21 | #define IDM_TEST_ARCBEZIER 40015 22 | #define IDM_TEST_ANGLEARCBEZIER 40016 23 | #define IDM_TEST_PATH 40017 24 | #define IDM_TEST_PATHSTYLECURVE 40018 25 | #define IDM_TEST_MAPPATH 40019 26 | 27 | // Next default values for new objects 28 | // 29 | #ifdef APSTUDIO_INVOKED 30 | #ifndef APSTUDIO_READONLY_SYMBOLS 31 | #define _APS_NEXT_RESOURCE_VALUE 107 32 | #define _APS_NEXT_COMMAND_VALUE 40020 33 | #define _APS_NEXT_CONTROL_VALUE 1000 34 | #define _APS_NEXT_SYMED_VALUE 101 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/SPOOLFIL.H: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : spoolfile.h // 10 | // Description: Win9x Spool file // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | const int n_maxsplsize = 2048; 15 | 16 | class KSpoolFile 17 | { 18 | char DevData[n_maxsplsize]; 19 | 20 | int size_header; 21 | int size_devmode; 22 | int size_std; 23 | 24 | public: 25 | KSpoolFile(); 26 | 27 | BOOL ReceiveData(COPYDATASTRUCT *cd); 28 | void GenDevFile(const char *emffilename); 29 | }; 30 | 31 | extern KSpoolFile SpoolFile; 32 | 33 | const char *GetDevFileName(const char *emffilename); 34 | 35 | 36 | -------------------------------------------------------------------------------- /Chapt_16/EMF/Res/pre.cpp: -------------------------------------------------------------------------------- 1 | #define STRICT 2 | #define WIN32_LEAN_AND_MEAN 3 | 4 | #include 5 | #include "resource.h" 6 | 7 | HINSTANCE hModule; 8 | 9 | int GetDIBColorCount(const BITMAPINFOHEADER & bmih) 10 | { 11 | if ( bmih.biBitCount <= 8 ) 12 | if ( bmih.biClrUsed ) 13 | return bmih.biClrUsed; 14 | else 15 | return 1 << bmih.biBitCount; 16 | else if ( bmih.biCompression==BI_BITFIELDS ) 17 | return 3 + bmih.biClrUsed; 18 | else 19 | return bmih.biClrUsed; 20 | } 21 | 22 | class KDIB 23 | { 24 | const BITMAPINFO * m_pDIB; 25 | const void * m_pBits; 26 | 27 | public: 28 | KDIB() 29 | { 30 | m_pDIB = NULL; 31 | } 32 | 33 | void Load(int resid) 34 | { 35 | if ( m_pDIB ) 36 | return; 37 | 38 | HRSRC hRsc = FindResource(hModule, MAKEINTRESOURCE(resid), RT_BITMAP); 39 | 40 | if ( hRsc ) 41 | { 42 | m_pDIB = (const BITMAPINFO *) LockResource(LoadResource(hModule, hRsc)); 43 | m_pBits = & m_pDIB->bmiColors[GetDIBColorCount(m_pDIB->bmiHeader)]; 44 | } 45 | } 46 | 47 | int StretchDIBits(HDC hDC, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh, int coloruse, DWORD rop) 48 | { 49 | return ::StretchDIBits(hDC, dx, dy, dw, dh, sx, sy, sw, sh, 50 | m_pBits, m_pDIB, coloruse, rop); 51 | } 52 | 53 | }; 54 | 55 | 56 | void OnDraw(HDC hDC) 57 | { 58 | HRGN hRegion = NULL; 59 | -------------------------------------------------------------------------------- /Chapt_17/PrinterDevice/DCAttr.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : dcattr.h // 10 | // Description: KDCAttributes dialog box // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDCAttributes : public KDialog 15 | { 16 | HDC m_hDC; 17 | HWND m_hWnd; 18 | 19 | KListView m_List; 20 | 21 | BOOL OnInitDialog(void); 22 | 23 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | void Add(LPCTSTR pszAttribute, LPCTSTR pszFormat, ...); 25 | 26 | void DumpDC(HDC hDC); 27 | 28 | public: 29 | 30 | KDCAttributes(HDC hDC) 31 | { 32 | m_hDC = hDC; 33 | } 34 | }; -------------------------------------------------------------------------------- /include/mmfile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : mmfile.h // 12 | // Description: Memory-mapped file // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KMemoryMappedFile 17 | { 18 | HANDLE m_hFile; 19 | HANDLE m_hMapping; 20 | 21 | public: 22 | const unsigned char * m_View; 23 | 24 | KMemoryMappedFile() 25 | { 26 | m_hFile = INVALID_HANDLE_VALUE; 27 | m_hMapping = NULL; 28 | m_View = NULL; 29 | } 30 | 31 | ~KMemoryMappedFile(); 32 | bool Open(LPCTSTR szFileName); 33 | }; 34 | -------------------------------------------------------------------------------- /Chapt_05/Device/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Device.rc 4 | // 5 | #define IDD_DEVICEPAGE 101 6 | #define IDD_DEVICECAPS 102 7 | #define IDD_DCATTRIBUTES 103 8 | #define IDI_GRAPH 104 9 | #define IDC_DEVICE 1000 10 | #define IDC_MODES 1001 11 | #define IDC_DEVICESTRING 1002 12 | #define IDC_STATEFLAGS 1003 13 | #define IDC_DEVICEID 1004 14 | #define IDC_DEVICEKEY 1005 15 | #define IDC_DEVICECAPS 1006 16 | #define IDC_CAPS 1008 17 | #define IDC_DCATTR 1009 18 | #define IDC_DCATTRIBUTES 1010 19 | #define IDC_CREATEDC 1011 20 | #define IDC_GETDC 1012 21 | #define IDC_GETDCPARENT 1014 22 | #define IDC_GETDCOK 1015 23 | #define IDC_MEMDC 1016 24 | #define IDC_MEMDC2 1017 25 | #define IDC_WMF 1018 26 | #define IDC_EMF 1019 27 | 28 | // Next default values for new objects 29 | // 30 | #ifdef APSTUDIO_INVOKED 31 | #ifndef APSTUDIO_READONLY_SYMBOLS 32 | #define _APS_NEXT_RESOURCE_VALUE 105 33 | #define _APS_NEXT_COMMAND_VALUE 40001 34 | #define _APS_NEXT_CONTROL_VALUE 1020 35 | #define _APS_NEXT_SYMED_VALUE 101 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /include/wingraph.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : wingraph.h // 10 | // Description: Consolidated include files // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #pragma once 15 | 16 | #include "win.h" 17 | #include "Canvas.h" 18 | #include "Toolbar.h" 19 | #include "Status.h" 20 | #include "FrameWnd.h" 21 | #include "ScrollCanvas.h" 22 | #include "filedialog.h" 23 | #include "dialog.h" 24 | 25 | #include "Color.h" 26 | #include "Dib.h" 27 | #include "ddb.h" 28 | #include "Image.h" 29 | #include "GDIObject.h" 30 | #include "BitmapInfo.h" 31 | #include "DIBSection.h" 32 | #include "Rop.h" 33 | #include "Affine.h" 34 | 35 | -------------------------------------------------------------------------------- /Chapt_05/Device/DevPage.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : devpage.h // 10 | // Description: KDevicePage class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDevicePage : public KPropertySheetPage 15 | { 16 | HINSTANCE m_hInstance; 17 | 18 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 19 | 20 | BOOL OnInitDialog(HWND hWnd); 21 | 22 | BOOL OnDeviceChange(HWND hWnd); 23 | BOOL OnDeviceCaps(HWND hWnd); 24 | BOOL OnDCAttributes(HWND hWnd); 25 | 26 | public: 27 | 28 | KDevicePage(HINSTANCE hInstance) 29 | { 30 | m_hInstance = hInstance; 31 | } 32 | 33 | }; 34 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Report.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : report.h // 10 | // Description: Send report to spy control program // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | typedef enum 15 | { 16 | M_CREATE, 17 | M_DESTROY, 18 | M_ENTER, 19 | M_LEAVE, 20 | M_ENTERSUMMARY, 21 | M_LEAVESUMMARY, 22 | M_MAILBOX, 23 | M_TEXT 24 | } ReportMessageId; 25 | 26 | 27 | class ReportMessage 28 | { 29 | public: 30 | unsigned m_para; 31 | unsigned m_time; 32 | unsigned m_tick; 33 | TCHAR m_text[256]; 34 | }; 35 | 36 | LRESULT Send(unsigned id, unsigned para, unsigned time, const char *messtext); 37 | -------------------------------------------------------------------------------- /Chapt_04/Pogy/Event.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : event.h // 10 | // Description: KEventPage class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KEventPage : public KPropertySheetPage 15 | { 16 | unsigned StartTime; 17 | HWND hMailBox; 18 | KSetupPogyPage * pSetupPage; 19 | 20 | virtual BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 21 | 22 | public: 23 | 24 | void Initialize(KSetupPogyPage * setuppage) 25 | { 26 | pSetupPage = setuppage; 27 | } 28 | 29 | HRESULT MonitorWindow(HWND hWnd, int oper, const char *owner); 30 | }; 31 | -------------------------------------------------------------------------------- /include/filedialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : filedialog.h // 12 | // Description: File common dialog box wrapper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KFileDialog 17 | { 18 | void SetupOFN(OPENFILENAME & ofn, TCHAR Filter[], HWND hWnd, 19 | const TCHAR * pExtension, const TCHAR * pClass); 20 | 21 | public: 22 | TCHAR m_FileName[MAX_PATH]; 23 | TCHAR m_TitleName[MAX_PATH]; 24 | 25 | // "bmp" "Bitmap Files" 26 | BOOL GetOpenFileName(HWND hWnd, const TCHAR * pExtension, const TCHAR * pClass); 27 | BOOL GetSaveFileName(HWND hWnd, const TCHAR * pExtension, const TCHAR * pClass); 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /Chapt_03/Fosterer/ImageModule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : imagemodule.h // 12 | // Description: Debug symbol query using ImageHlp API // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KImageModule 17 | { 18 | HANDLE m_hProcess; 19 | IMAGEHLP_SYMBOL m_is[10]; // leave enough space for the name 20 | 21 | public: 22 | KImageModule(); 23 | virtual ~KImageModule(); 24 | 25 | PIMAGE_DEBUG_INFORMATION m_pidi; 26 | 27 | bool Load(char * filename, char * sympath); 28 | void Unload(void); 29 | 30 | const IMAGEHLP_SYMBOL * ImageGetSymbol(const char * name); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /Chapt_01/Hello1/Hello1.cpp: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : hello1.cpp // 10 | // Description: Hello World Demo 1, start browser, Chapter 1 // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #define STRICT 15 | #define NOCRYPT 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | const TCHAR szOperation[] = _T("open"); 22 | const TCHAR szAddress[] = _T("www.helloworld.com"); 23 | 24 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int nShow) 25 | { 26 | HINSTANCE hRslt = ShellExecute(NULL, szOperation, szAddress, NULL, NULL, SW_SHOWNORMAL); 27 | 28 | assert( hRslt > (HINSTANCE) HINSTANCE_ERROR); 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Chapt_01/Hello1/Hello1.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : hello1.h // 10 | // Description: Hello World Demo 1, start browser, Chapter 1 // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #define STRICT 15 | #define NOCRYPT 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | const TCHAR szOperation[] = _T("open"); 22 | const TCHAR szAddress[] = _T("www.helloworld.com"); 23 | 24 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int nShow) 25 | { 26 | HINSTANCE hRslt = ShellExecute(NULL, szOperation, szAddress, NULL, NULL, SW_SHOWNORMAL); 27 | 28 | assert( hRslt > (HINSTANCE) HINSTANCE_ERROR); 29 | 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Chapt_14/Font/Charset.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : charset.h // 12 | // Description: KCharSetView class // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #define UNICODE_CHARSET 0 17 | 18 | 19 | class KCharSetView : public KView 20 | { 21 | BYTE m_nCharSet; 22 | HFONT m_hAnsiFont; 23 | 24 | int m_width; 25 | int m_height; 26 | int m_font; 27 | int m_row; 28 | 29 | void DispRow(HDC hDC, int x0, int y0, int y, WCHAR ch, int length); 30 | 31 | public: 32 | 33 | KCharSetView(void); 34 | 35 | virtual int OnCommand(int cmd, HWND hWnd); 36 | virtual int OnDraw(HDC hDC, const RECT * rcPaint); 37 | 38 | }; 39 | -------------------------------------------------------------------------------- /Chapt_16/EMF/Cache.cpp: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : cache.cpp // 10 | // Description: KCache class: remove duplication // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #define STRICT 15 | #define WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "Cache.h" 22 | 23 | 24 | bool KCache::Match(long size, const void * data, long & rslt) 25 | { 26 | for (int i=0; i=0 ) 31 | return true; 32 | } 33 | 34 | rslt = m_total ++; 35 | 36 | m_Cache[rslt % CacheSize].Set(size, data, rslt); 37 | 38 | return false; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Chapt_18/DemoDD/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by DemoDD.rc 4 | // 5 | #define IDS_FILENEW 1 6 | #define IDS_FILEOPEN 2 7 | #define IDR_MAIN 101 8 | #define IDR_DEMO 102 9 | #define IDB_TIGER 170 10 | #define IDB_PLANE 171 11 | #define IDB_NIGHT 172 12 | #define IDI_GRAPH 174 13 | #define IDM_FILE_EXIT 40001 14 | #define IDM_FILE_NEW 40002 15 | #define IDM_FILE_CLOSE 40003 16 | #define IDM_FILE_OPEN 40004 17 | #define IDM_FILE_SAVE 40005 18 | #define IDM_EDIT_COPY 40101 19 | #define IDM_EDIT_PASTE 40102 20 | #define IDM_WINDOW_CASCADE 40301 21 | #define IDM_WINDOW_TILE 40302 22 | #define IDM_WINDOW_ARRANGE 40303 23 | #define IDM_WINDOW_CLOSEALL 40304 24 | #define IDM_FILE_CREATEDIRECTDRAW 40305 25 | #define IDM_FILE_PLA 40306 26 | #define IDM_FILE_BITMAPTEXT 40307 27 | #define IDM_FILE_CLIP 40308 28 | 29 | // Next default values for new objects 30 | // 31 | #ifdef APSTUDIO_INVOKED 32 | #ifndef APSTUDIO_READONLY_SYMBOLS 33 | #define _APS_NEXT_RESOURCE_VALUE 175 34 | #define _APS_NEXT_COMMAND_VALUE 40309 35 | #define _APS_NEXT_CONTROL_VALUE 1016 36 | #define _APS_NEXT_SYMED_VALUE 101 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /Chapt_16/EMF/Res/post.cpp: -------------------------------------------------------------------------------- 1 | 2 | } 3 | 4 | LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 5 | { 6 | switch ( uMsg ) 7 | { 8 | case WM_PAINT: 9 | { 10 | PAINTSTRUCT ps; 11 | 12 | HDC hDC = BeginPaint(hWnd, & ps); 13 | OnDraw(hDC); 14 | EndPaint(hWnd, & ps); 15 | 16 | return 0; 17 | } 18 | 19 | case WM_DESTROY: 20 | PostQuitMessage(0); 21 | return 0; 22 | 23 | default: 24 | return DefWindowProc(hWnd, uMsg, wParam, lParam); 25 | } 26 | } 27 | 28 | 29 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPTSTR, int nCmdShow) 30 | { 31 | WNDCLASSEX wc; 32 | 33 | memset(& wc, 0, sizeof(wc)); 34 | wc.cbSize = sizeof(wc); 35 | wc.lpfnWndProc = WndProc; 36 | wc.hInstance = hInst; 37 | wc.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH); 38 | wc.lpszClassName = "EMFDC"; 39 | 40 | if ( ! RegisterClassEx(& wc) ) 41 | return -1; 42 | 43 | hModule = hInst; 44 | 45 | HWND hWnd = CreateWindowEx(0, "EMFDC", "Decompiled EMF", WS_OVERLAPPEDWINDOW, 46 | CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 47 | NULL, NULL, hInst, NULL); 48 | 49 | ShowWindow(hWnd, nCmdShow); 50 | UpdateWindow(hWnd); 51 | 52 | MSG msg; 53 | 54 | while ( GetMessage(&msg, NULL, 0, 0) ) 55 | { 56 | TranslateMessage(&msg); 57 | DispatchMessage(&msg); 58 | } 59 | 60 | return msg.wParam; 61 | } 62 | -------------------------------------------------------------------------------- /include/BitmapInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : bitmapinfo.h // 12 | // Description: BITMAPINFO wrapper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KBitmapInfo 17 | { 18 | public: 19 | 20 | typedef struct 21 | { 22 | BITMAPINFOHEADER bmiHeader; 23 | RGBQUAD bmiColors[256+3]; 24 | } DIBINFO; 25 | 26 | DIBINFO m_dibinfo; 27 | 28 | void SetFormat(int width, int height, int bitcount, int compression = BI_RGB); 29 | 30 | void SetGrayScale(DWORD mask); 31 | 32 | BITMAPINFO * GetBMI(void) const 33 | { 34 | return (BITMAPINFO *) & m_dibinfo; 35 | } 36 | 37 | BITMAPINFO * CopyBMI(void) const; 38 | 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /include/atom.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : atom.h // 10 | // Description: KAtomTable class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #include "Decoder.h" 15 | 16 | class KAtomTable : public IAtomTable 17 | { 18 | typedef enum 19 | { 20 | MAX_BUFFER = 32768, 21 | MAX_NAMES = 2048 22 | }; 23 | 24 | int m_bufpos; 25 | int m_names; 26 | 27 | char m_buffer[MAX_BUFFER]; 28 | const char * m_name[MAX_NAMES]; 29 | 30 | public: 31 | 32 | KAtomTable(void); 33 | 34 | virtual ATOM AddAtom(const char * name); 35 | 36 | virtual const char * GetAtomName(ATOM atom) 37 | { 38 | return m_name[(int)atom]; 39 | } 40 | }; 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/Status.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : status.h // 12 | // Description: Status window wrapper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | typedef enum 17 | { 18 | pane_1, 19 | pane_2, 20 | pane_3 21 | }; 22 | 23 | 24 | // Status window 25 | class KStatusWindow 26 | { 27 | public: 28 | HWND m_hWnd; 29 | UINT m_ControlID; 30 | 31 | KStatusWindow() 32 | { 33 | m_hWnd = NULL; 34 | m_ControlID = 0; 35 | } 36 | 37 | void Create(HWND hParent, UINT nControlID); 38 | void Resize(HWND hParent, int width, int height); 39 | void SetText(int pane, HINSTANCE hInst, int messid, int param=0); 40 | void SetText(int pane, LPCTSTR message); 41 | }; 42 | -------------------------------------------------------------------------------- /include/crc.H: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : crc.h // 12 | // Description: CRC check sum // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KCRC 17 | { 18 | unsigned short crctab[256]; 19 | 20 | typedef enum 21 | { 22 | // CITT XMODEM ARC 23 | poly = 0xA001, // the poly: 0x1021 0x1021 A001 24 | initcrc = 0x0000, // init value: -1 0 0 25 | byteswap = true // bit order: false true true 26 | }; 27 | 28 | public: 29 | 30 | KCRC(); 31 | 32 | unsigned short Update(unsigned short crc, unsigned char * buffer, int len); 33 | }; 34 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Proxy.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : proxy.h // 10 | // Description: API hooking gluing declarations // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | typedef struct 15 | { 16 | unsigned m_flag; 17 | unsigned m_edx; 18 | unsigned m_ecx; 19 | unsigned m_ebx; 20 | unsigned m_eax; 21 | 22 | unsigned m_funcid; 23 | unsigned m_rtnads; 24 | unsigned m_para[32]; 25 | } EntryInfo; 26 | 27 | 28 | typedef struct 29 | { 30 | unsigned m_rslt; 31 | } ExitInfo; 32 | 33 | 34 | void ProxyInit(void); 35 | 36 | void ProxyProlog(void); 37 | 38 | class KStack; 39 | class KFuncTable; 40 | 41 | extern KStack * pStack; 42 | extern KFuncTable * pFuncTable; 43 | 44 | -------------------------------------------------------------------------------- /Chapt_03/Chapt_03.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Fosterer"=.\Fosterer\Fosterer.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Handles"=.\Handles\Handles.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "Periscope"=.\Periscope\Periscope.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "QueryTab"=.\QueryTab\QueryTab.dsp - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "TestPeriscope"=.\TestPeriscope\TestPeriscope.dsp - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | }}} 63 | 64 | ############################################################################### 65 | 66 | Global: 67 | 68 | Package=<5> 69 | {{{ 70 | }}} 71 | 72 | Package=<3> 73 | {{{ 74 | }}} 75 | 76 | ############################################################################### 77 | 78 | -------------------------------------------------------------------------------- /include/GDIObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : gdiobject.h // 12 | // Description: GDI object selection/deselection wrapper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KGDIObject 17 | { 18 | HGDIOBJ m_hOld; 19 | HDC m_hDC; 20 | 21 | public: 22 | 23 | HGDIOBJ m_hObj; 24 | 25 | KGDIObject(HDC hDC, HGDIOBJ hObj) 26 | { 27 | m_hDC = hDC; 28 | m_hObj = hObj; 29 | m_hOld = SelectObject(hDC, hObj); 30 | 31 | assert(m_hDC); 32 | assert(m_hObj); 33 | assert(m_hOld); 34 | } 35 | 36 | ~KGDIObject() 37 | { 38 | HGDIOBJ h = SelectObject(m_hDC, m_hOld); 39 | // assert(h==m_hObj); 40 | 41 | DeleteObject(m_hObj); 42 | // assert(GetObjectType(m_hObj)==0); 43 | } 44 | }; 45 | 46 | -------------------------------------------------------------------------------- /include/Decoder.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : decoder.h // 10 | // Description: IAtomTable, IDecoder abstract base classes // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #ifndef DECODER_INC 15 | 16 | #define DECODER_INC 17 | 18 | struct IAtomTable 19 | { 20 | virtual ATOM AddAtom(const char * name) = 0; 21 | virtual const char * GetAtomName(ATOM atom) = 0; 22 | }; 23 | 24 | 25 | struct IDecoder 26 | { 27 | IDecoder * pNextDecoder; 28 | 29 | virtual bool Initialize(IAtomTable * pAtomTable) = 0; 30 | 31 | virtual int Decode(ATOM typ, const void * pValue, char * szBuffer, int nBufferSize) = 0; 32 | }; 33 | 34 | typedef IDecoder * (WINAPI * DecoderCreator)(void); 35 | 36 | #endif -------------------------------------------------------------------------------- /Chapt_03/Handles/FindTab.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : findtabl.h // 10 | // Description: KLocateGdiTablePage class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | 15 | #pragma once 16 | 17 | #include "property.h" 18 | #include "listview.h" 19 | #include "snapshot.h" 20 | 21 | class KLocateGdiTablePage: public KPropertySheetPage 22 | { 23 | KListView m_Regions; 24 | HINSTANCE m_hInst; 25 | KSnapShot m_snapshot; 26 | 27 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 28 | void GdiQueryTable(); 29 | 30 | public: 31 | KLocateGdiTablePage(); 32 | virtual ~KLocateGdiTablePage(); 33 | 34 | void Initialize(HINSTANCE hInstance) 35 | { 36 | m_hInst = hInstance; 37 | } 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /include/MemDump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : memdump.h // 12 | // Description: Memory dumper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class ofstream; 17 | 18 | class KMemDump 19 | { 20 | TCHAR m_filename[MAX_PATH]; 21 | 22 | ofstream * m_stream; 23 | 24 | public: 25 | TCHAR m_line[128]; 26 | 27 | void OpenDump(void); 28 | void CloseDump(void); 29 | 30 | void DumpLine(unsigned char * p, unsigned offset, int unitsize); 31 | void Dump(unsigned char * start, unsigned offset, int size, int unitsize); 32 | void Newline(void); 33 | void Writeln(const TCHAR * text); 34 | 35 | KMemDump() 36 | { 37 | m_stream = NULL; 38 | } 39 | }; 40 | 41 | 42 | -------------------------------------------------------------------------------- /Chapt_18/Chapt_18.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DemoD3D"=.\DemoD3D\DemoD3D.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "DemoDD"=.\DemoDD\DemoDD.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | Begin Project Dependency 30 | Project_Dep_Name wingraph 31 | End Project Dependency 32 | }}} 33 | 34 | ############################################################################### 35 | 36 | Project: "ddbasic"=.\ddbasic\ddbasic.dsp - Package Owner=<4> 37 | 38 | Package=<5> 39 | {{{ 40 | }}} 41 | 42 | Package=<4> 43 | {{{ 44 | Begin Project Dependency 45 | Project_Dep_Name wingraph 46 | End Project Dependency 47 | }}} 48 | 49 | ############################################################################### 50 | 51 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 52 | 53 | Package=<5> 54 | {{{ 55 | }}} 56 | 57 | Package=<4> 58 | {{{ 59 | }}} 60 | 61 | ############################################################################### 62 | 63 | Global: 64 | 65 | Package=<5> 66 | {{{ 67 | }}} 68 | 69 | Package=<3> 70 | {{{ 71 | }}} 72 | 73 | ############################################################################### 74 | 75 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Timer.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : timer.h // 10 | // Description: High performance timer count ( Pentium only ) // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | void ResetTimer(void); 15 | unsigned GetMicroSecond(void); 16 | 17 | class NestedTimer 18 | { 19 | unsigned overhead_start_low; 20 | DWORD overhead_start_high; 21 | 22 | unsigned CPUSpeed10; // 1/10 Mhz 23 | unsigned CPUSpeed16; // 1/16 Mhz 24 | 25 | public: 26 | BOOL started; 27 | 28 | NestedTimer() 29 | { 30 | CPUSpeed10 = 1000; 31 | CPUSpeed16 = 1000; 32 | 33 | started = FALSE; 34 | } 35 | 36 | unsigned GetCPUSpeed(void); 37 | 38 | }; 39 | 40 | extern NestedTimer nTimer; 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/Toolbar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : toolbar.h // 12 | // Description: Toolbar wrapper // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #include 17 | 18 | // Toolbar window 19 | class KToolbar 20 | { 21 | protected: 22 | HWND m_hToolTip; 23 | UINT m_ControlID; 24 | 25 | HINSTANCE m_ResInstance; 26 | UINT m_ResId; 27 | public: 28 | 29 | HWND m_hWnd; 30 | 31 | KToolbar() 32 | { 33 | m_hWnd = NULL; 34 | m_hToolTip = NULL; 35 | m_ControlID = 0; 36 | 37 | m_ResInstance = NULL; 38 | m_ResId = 0; 39 | } 40 | 41 | void Create(HWND hParent, HINSTANCE hInstance, UINT nControlID, const TBBUTTON * pButtons, int nCount); 42 | void Resize(HWND hParent, int width, int height); 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /include/CheckMark.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : checkmark.h // 12 | // Description: Use DDB as menu checkmarks // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KCheckMark 17 | { 18 | protected: 19 | typedef enum { MAXSUBIMAGES = 50 }; 20 | 21 | HBITMAP m_hBmp; 22 | int m_nSubImageId[MAXSUBIMAGES]; 23 | HBITMAP m_hSubImage [MAXSUBIMAGES]; 24 | int m_nUsed; 25 | 26 | public: 27 | KCheckMark() 28 | { 29 | m_hBmp = NULL; 30 | m_nUsed = 0; 31 | } 32 | 33 | ~KCheckMark(); 34 | 35 | void AddBitmap(int id, HBITMAP hBmp); 36 | void LoadToolbar(HMODULE hModule, int resid, bool transparent=false); 37 | HBITMAP GetSubImage(int id); 38 | BOOL SetCheckMarks(HMENU hMenu, UINT uPos, UINT uFlags, int unchecked, int checked); 39 | }; 40 | -------------------------------------------------------------------------------- /include/Canvas.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : canvas.h // 12 | // Description: Simple drawing child window // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KStatusWindow; 17 | 18 | // main drawing window, normally a child window of a frame window 19 | 20 | class KCanvas : public KWindow 21 | { 22 | public: 23 | virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | virtual void OnDraw(HDC hDC, const RECT * rcPaint); 25 | virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); 26 | 27 | KStatusWindow * m_pStatus; 28 | HINSTANCE m_hInst; 29 | 30 | KCanvas(); 31 | 32 | void SetStatus(HINSTANCE hInst, KStatusWindow * pStatus) 33 | { 34 | m_hInst = hInst; 35 | m_pStatus = pStatus; 36 | } 37 | 38 | virtual ~KCanvas(); 39 | }; -------------------------------------------------------------------------------- /Chapt_04/Diver/Stack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : stack.h // 12 | // Description: Multithread-safe shared stack // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KStack 17 | { 18 | #define MAXSTACKSIZE 256 19 | #define MAXTHREADNO 32 20 | 21 | int nFree; 22 | int FreeCell; 23 | KRoutineInfo Cell[MAXSTACKSIZE]; 24 | 25 | CRITICAL_SECTION cs; 26 | 27 | int nThread; 28 | 29 | unsigned Thread[MAXTHREADNO]; 30 | int Tos [MAXTHREADNO]; 31 | int Depth [MAXTHREADNO]; 32 | 33 | public: 34 | KStack(); 35 | ~KStack(); 36 | 37 | int LookupThread(BOOL addifmissing); 38 | KRoutineInfo * Push(void); 39 | KRoutineInfo * Lookup(int & depth); 40 | void Pop(void); 41 | 42 | }; 43 | -------------------------------------------------------------------------------- /Chapt_17/ImagePrint/imageview.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : imageview.h // 10 | // Description: KImageCanvas class // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KPicture; 15 | 16 | class KImageCanvas : public KPageCanvas 17 | { 18 | KPicture * m_pPicture; 19 | 20 | void GetWndClassEx(WNDCLASSEX & wc) 21 | { 22 | KPageCanvas::GetWndClassEx(wc); 23 | 24 | wc.hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_PRINT)); 25 | } 26 | 27 | public: 28 | 29 | virtual void UponDrawPage(HDC hDC, const RECT * rcPaint, int width, int height, int pageno); 30 | 31 | virtual int OnCommand(int cmd, HWND hWnd); 32 | 33 | KImageCanvas(KPicture * pPicture, HBRUSH hBackground) : KPageCanvas(hBackground) 34 | { 35 | m_pPicture = pPicture; 36 | } 37 | 38 | ~KImageCanvas(); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /Chapt_16/EMF/EmfDC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : emfdc.h // 12 | // Description: EMF decompiler // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | 17 | #include "Formator.h" 18 | 19 | 20 | class KTreeView; 21 | 22 | class KEmfDC : public KMemoryMappedFile 23 | { 24 | KofstreamPipe fmt; 25 | int m_nSeq; 26 | 27 | bool Decode(const EMR * emr, KTreeView * pTree); 28 | bool DeCompileBuffer(const TCHAR * outfile, const void * buffer, 29 | KTreeView * pTree, HENHMETAFILE & hEmf); 30 | 31 | public: 32 | 33 | const TCHAR * DecodeRecord(const EMR * emr); 34 | 35 | bool DeCompile(const TCHAR * outfile, const char * FileName, 36 | KTreeView * pTree, HENHMETAFILE & hEmf); 37 | bool DeCompile(const TCHAR * outline, HENHMETAFILE hEmf, 38 | KTreeView * pTree); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /Chapt_17/PrinterDevice/DevPage.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : devpage.h // 10 | // Description: KDevicePage page // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KDevicePage : public KPropertySheetPage 15 | { 16 | HINSTANCE m_hInstance; 17 | PRINTER_INFO_2 * m_pInfo2; 18 | KListView m_infolist; 19 | 20 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 21 | 22 | BOOL OnInitDialog(HWND hWnd); 23 | 24 | BOOL OnDeviceChange(HWND hWnd); 25 | BOOL OnDeviceCaps(HWND hWnd); 26 | BOOL OnDCAttributes(HWND hWnd); 27 | 28 | public: 29 | 30 | KDevicePage(HINSTANCE hInstance) 31 | { 32 | m_hInstance = hInstance; 33 | m_pInfo2 = NULL; 34 | } 35 | 36 | ~KDevicePage() 37 | { 38 | if ( m_pInfo2 ) 39 | delete [] (BYTE *) m_pInfo2; 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /include/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : timer.h // 12 | // Description: High-precision timer using Intel clock cycle count // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #pragma warning(disable : 4035) 17 | 18 | inline unsigned __int64 GetCycleCount(void) 19 | { 20 | _asm _emit 0x0F 21 | _asm _emit 0x31 22 | } 23 | 24 | class KTimer 25 | { 26 | unsigned __int64 m_startcycle; 27 | 28 | public: 29 | 30 | unsigned __int64 m_overhead; 31 | 32 | KTimer(void) 33 | { 34 | m_overhead = 0; 35 | Start(); 36 | m_overhead = Stop(); 37 | } 38 | 39 | void Start(void) 40 | { 41 | m_startcycle = GetCycleCount(); 42 | } 43 | 44 | unsigned __int64 Stop(void) 45 | { 46 | return GetCycleCount()-m_startcycle-m_overhead; 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /Chapt_03/Handles/GDI.H: -------------------------------------------------------------------------------- 1 | #pragma 2 | //-----------------------------------------------------------------------------------// 3 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 4 | // ISBN 0-13-086985-6 // 5 | // // 6 | // Written by Yuan, Feng www.fengyuan.com // 7 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 8 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 9 | // // 10 | // FileName : gdi.h // 11 | // Description: GDI object implementation illustration, Chapter 3 // 12 | // Version : 1.00.000, May 31, 2000 // 13 | //-----------------------------------------------------------------------------------// 14 | 15 | class _GdiObj 16 | { 17 | public: 18 | virtual int GetObjectType(void) = 0; 19 | virtual int GetObject(int cbBuffer, void * pBuffer) =0; 20 | virtual bool DeleteObject(void) = 0; 21 | virtual bool UnrealizeObject(void) = 0; 22 | }; 23 | 24 | 25 | class _Pen : public _GdiObj 26 | { 27 | public: 28 | 29 | virtual int GetObjectType(void) 30 | { 31 | return OBJ_PEN; 32 | } 33 | 34 | virtual int GetObject(int cbBuffer, void * pBuffer) = 0; 35 | virtual bool DeleteObject(void) = 0; 36 | 37 | virtual bool UnrealizeObject(void) 38 | { 39 | return true; 40 | } 41 | }; 42 | 43 | _Pen * _CreatePen(int fnPenStyle, int nWidth, COLORREF crColor); 44 | 45 | 46 | -------------------------------------------------------------------------------- /include/guires.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : guires.h // 12 | // Description: Query USER/GDI resources, Windows 2000 // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KGUIResource 17 | { 18 | int m_gdi, m_user; 19 | 20 | public: 21 | KGUIResource() 22 | { 23 | m_gdi = GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS); 24 | m_user = GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS); 25 | } 26 | 27 | ~KGUIResource() 28 | { 29 | int gdi = GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS); 30 | int user = GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS); 31 | 32 | if ( (m_gdi==gdi) && (m_user==user) ) 33 | return; 34 | 35 | char temp[64]; 36 | wsprintf(temp, "ResourceDifference: gdi(%d->%d) user(%d->%d)\n", m_gdi, gdi, m_user, user); 37 | OutputDebugString(temp); 38 | } 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /Chapt_03/Handles/MemView.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : memview.h // 10 | // Description: Memory dumper dialog box // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #pragma once 15 | 16 | #include "memdump.h" 17 | 18 | class KMemViewer : public KDialog, public KMemDump 19 | { 20 | unsigned char * m_start; 21 | unsigned char * m_current; 22 | 23 | unsigned m_size; 24 | unsigned m_pagesize; 25 | HFONT m_hFont; 26 | 27 | int UnitSize(void) const; 28 | 29 | void DumpPage(void); 30 | void Search(void); 31 | 32 | virtual BOOL OnInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam); 33 | virtual BOOL OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam); 34 | 35 | public: 36 | 37 | KMemViewer(unsigned start, unsigned size) 38 | { 39 | m_start = (unsigned char *) start; 40 | m_size = size; 41 | } 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /include/Lookup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : lookup.h // 12 | // Description: index to string mapping // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | typedef struct 17 | { 18 | unsigned key; 19 | unsigned long mask; 20 | const TCHAR * name; 21 | } DicItem; 22 | 23 | 24 | #define twin(name) { name, 0xffffffff, TEXT(#name) } 25 | #define pair(name) { name, 0xffffffff, TEXT(#name) } 26 | #define item(key, name) { key, 0xffffffff, name } 27 | #define tripod(name, mask) { name, mask, TEXT(#name) } 28 | #define dummyitem { 0, 0xffffffff, NULL } 29 | 30 | bool Lookup(unsigned index, const DicItem *dic, TCHAR * szResult); 31 | const TCHAR *Lookup(unsigned index, const DicItem *dic); 32 | 33 | unsigned Decode(const TCHAR *item, const DicItem *dic); 34 | 35 | -------------------------------------------------------------------------------- /Chapt_03/Handles/Handles.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : handles.h // 12 | // Description: KHGDIOBJ page // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #include "property.h" 17 | 18 | // GDI Handle Table Property Sheet Page 19 | class KHGDIOBJ : public KPropertySheetPage 20 | { 21 | unsigned WM_SHAREHANDLE; 22 | 23 | HDC m_hDCScreen; 24 | int m_nCreator; 25 | int m_nCopy; 26 | 27 | BOOL Generate(HWND rslt, bool search); 28 | BOOL OnInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam); 29 | BOOL OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam); 30 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 31 | 32 | public: 33 | 34 | KHGDIOBJ() 35 | { 36 | WM_SHAREHANDLE = 0xFFFFFFFF; 37 | } 38 | 39 | }; 40 | 41 | LPCTSTR GetObjectTypeName(HGDIOBJ Handle); 42 | -------------------------------------------------------------------------------- /include/BitmapMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : bitmapmenu.h // 12 | // Description: Use bitmap on the menu // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KBitmapMenu 17 | { 18 | typedef enum { MAX_BITMAP = 16 }; 19 | 20 | HBITMAP m_hBitmap[MAX_BITMAP]; 21 | int m_nBitmap; 22 | HMENU m_hMenu; 23 | int m_nChecked; 24 | int m_nFirstCommand; 25 | 26 | public: 27 | KBitmapMenu() 28 | { 29 | m_nBitmap = 0; 30 | } 31 | 32 | ~KBitmapMenu() 33 | { 34 | for (int i=0; i 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name wingraph 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "EMFDCTest"=.\EMFDCTest\EMFDCTest.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "emfscope"=.\EMFScope\EMFSCOPE.DSP - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | Begin Project Dependency 42 | Project_Dep_Name spehon32 43 | End Project Dependency 44 | }}} 45 | 46 | ############################################################################### 47 | 48 | Project: "spehon32"=.\EMFScope\SPEHON32\SPEHON32.DSP - Package Owner=<4> 49 | 50 | Package=<5> 51 | {{{ 52 | }}} 53 | 54 | Package=<4> 55 | {{{ 56 | }}} 57 | 58 | ############################################################################### 59 | 60 | Project: "wingraph"=..\include\wingraph\wingraph.dsp - Package Owner=<4> 61 | 62 | Package=<5> 63 | {{{ 64 | }}} 65 | 66 | Package=<4> 67 | {{{ 68 | }}} 69 | 70 | ############################################################################### 71 | 72 | Global: 73 | 74 | Package=<5> 75 | {{{ 76 | }}} 77 | 78 | Package=<3> 79 | {{{ 80 | }}} 81 | 82 | ############################################################################### 83 | 84 | -------------------------------------------------------------------------------- /include/pehack.h: -------------------------------------------------------------------------------- 1 | #pragma 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : pehack.h // 12 | // Description: API hooking through import/export table // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KPEFile 17 | { 18 | PIMAGE_DOS_HEADER pDOSHeader; 19 | PIMAGE_NT_HEADERS pNTHeader; 20 | 21 | public: 22 | const char * pModule; 23 | 24 | const char * RVA2Ptr(unsigned rva) 25 | { 26 | if ( (pModule!=NULL) && rva ) 27 | return pModule + rva; 28 | else 29 | return NULL; 30 | } 31 | 32 | KPEFile(HMODULE hModule); 33 | const void * GetDirectory(int id); 34 | PIMAGE_IMPORT_DESCRIPTOR GetImportDescriptor(LPCSTR pDllName); 35 | const unsigned * GetFunctionPtr(PIMAGE_IMPORT_DESCRIPTOR 36 | pImport, LPCSTR pProcName); 37 | 38 | FARPROC SetImportAddress(LPCSTR pDllName, LPCSTR pProcName, 39 | FARPROC pNewProc); 40 | 41 | FARPROC SetExportAddress(LPCSTR pProcName, FARPROC pNewProc); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /Chapt_01/Chapt_01.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "GDISpeed"=.\GDISpeed\GDISpeed.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "Hello1"=.\Hello1\Hello1.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "Hello2"=.\Hello2\Hello2.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "Hello3"=.\Hello3\Hello3.dsp - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "Hello4"=.\Hello4\Hello4.dsp - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | }}} 63 | 64 | ############################################################################### 65 | 66 | Project: "SetProc"=.\SetProc\SetProc.dsp - Package Owner=<4> 67 | 68 | Package=<5> 69 | {{{ 70 | }}} 71 | 72 | Package=<4> 73 | {{{ 74 | }}} 75 | 76 | ############################################################################### 77 | 78 | Global: 79 | 80 | Package=<5> 81 | {{{ 82 | }}} 83 | 84 | Package=<3> 85 | {{{ 86 | }}} 87 | 88 | ############################################################################### 89 | 90 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Report.cpp: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : report.cpp // 10 | // Description: Send report to spy control program // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #define NOCRYPT 15 | 16 | #include 17 | #include 18 | 19 | #include "Report.h" 20 | 21 | // Report to Client 22 | 23 | extern HWND h_Controller; 24 | 25 | LRESULT Send(unsigned id, unsigned para, unsigned time, const TCHAR *messtext) 26 | { 27 | COPYDATASTRUCT cds; 28 | ReportMessage rpt; 29 | 30 | memset(& rpt, 0, sizeof(rpt)); 31 | 32 | rpt.m_para = para; 33 | rpt.m_time = time; 34 | rpt.m_tick = GetTickCount(); 35 | 36 | if ( messtext ) 37 | _tcsncpy(rpt.m_text, messtext, sizeof(rpt.m_text)/sizeof(TCHAR)-1); 38 | 39 | cds.dwData = id; 40 | cds.cbData = sizeof(rpt); 41 | cds.lpData = (void *) & rpt; 42 | 43 | return SendMessage(h_Controller, WM_COPYDATA, NULL, (LPARAM) & cds); 44 | } 45 | -------------------------------------------------------------------------------- /Chapt_03/Handles/Snapshot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : snapshot.h // 12 | // Description: Virtual memory snap shot // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #include "crc.h" 17 | 18 | // Memory Region 19 | class KRegion 20 | { 21 | public: 22 | unsigned char * start; 23 | unsigned size; 24 | unsigned type; 25 | unsigned short crc; 26 | unsigned short lastcrc; 27 | int count; 28 | }; 29 | 30 | class KListView; 31 | 32 | 33 | class KSnapShot 34 | { 35 | typedef enum { nMaxRegionNo = 512 }; 36 | 37 | KCRC m_crc; 38 | 39 | KRegion m_Regions[nMaxRegionNo]; 40 | int m_nRegionNo; 41 | 42 | KRegion * FindRegion(unsigned char * regionstart, unsigned regionsize); 43 | 44 | public: 45 | KSnapShot() 46 | { 47 | m_nRegionNo = 0; 48 | } 49 | 50 | void Shot(KListView * list); 51 | void ShowDetail(HINSTANCE hInst, unsigned start, unsigned size); 52 | }; 53 | 54 | 55 | -------------------------------------------------------------------------------- /Chapt_16/EMF/Cache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : cache.h // 12 | // Description: KCache class: remove duplication // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | class KSignature 17 | { 18 | long m_size; 19 | const void * m_data; 20 | long m_seq; 21 | 22 | public: 23 | 24 | KSignature() 25 | { 26 | m_size = 0; 27 | m_data = NULL; 28 | m_seq = 0; 29 | } 30 | 31 | long Match(long size, const void * data) 32 | { 33 | if ( (m_size==size) && (memcmp(m_data, data, size)==0) ) 34 | return m_seq; 35 | else 36 | return -1; 37 | } 38 | 39 | void Set(long size, const void * data, long seq) 40 | { 41 | m_size = size; 42 | m_data = data; 43 | m_seq = seq; 44 | } 45 | }; 46 | 47 | 48 | class KCache 49 | { 50 | typedef enum { CacheSize = 64 }; 51 | 52 | KSignature m_Cache[CacheSize]; 53 | long m_total; 54 | 55 | public: 56 | KCache() 57 | { 58 | m_total = 0; 59 | } 60 | 61 | bool Match(long size, const void * data, long & rslt); 62 | }; 63 | 64 | -------------------------------------------------------------------------------- /Chapt_03/Handles/dcdtable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : dcdtable.h // 12 | // Description: Decode GDI handle table paer // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | #include "property.h" 17 | #include "listview.h" 18 | #include "gditable.h" 19 | 20 | class KDecodeTablePage : public KPropertySheetPage 21 | { 22 | // overwriting 23 | BOOL DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | 25 | KListView m_Objects; 26 | 27 | void TestnCount(bool testdelete); 28 | void TestnCount(int obj, HDC hDC1, HDC hDC2, bool testdelete); 29 | void Query(void); 30 | void DumpGDITable(void); 31 | void TestpUserSolidBrush(void); 32 | void TestpUserRectRegion(void); 33 | 34 | void ShowDetails(unsigned index); 35 | void Modify(unsigned index); 36 | 37 | KGDITable m_GDITable; 38 | 39 | public: 40 | 41 | HINSTANCE m_hInst; 42 | 43 | bool IsGDITableAccessible(void) const 44 | { 45 | return m_GDITable.IsGDITableAccessible(); 46 | } 47 | 48 | KDecodeTablePage(); 49 | }; 50 | -------------------------------------------------------------------------------- /Chapt_15/Text/Panose.h: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : panose.h // 10 | // Description: Panose font matching // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KPanoseView : public KCanvas 15 | { 16 | virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 17 | 18 | HMENU m_hViewMenu; 19 | HWND m_hFrame; 20 | KListView m_Fonts; 21 | 22 | void GetWndClassEx(WNDCLASSEX & wc) 23 | { 24 | KCanvas::GetWndClassEx(wc); 25 | 26 | wc.hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_TEXT)); 27 | } 28 | 29 | public: 30 | 31 | typedef enum { MAX_FONTS = 256 }; 32 | 33 | PANOSE m_Panose[MAX_FONTS]; 34 | TCHAR m_TypeFace[MAX_FONTS][32]; 35 | int m_nFonts; 36 | 37 | KPanoseView() 38 | { 39 | m_hViewMenu = NULL; 40 | m_hFrame = NULL; 41 | 42 | m_nFonts = 0; 43 | } 44 | 45 | void AddFont(const TCHAR * fullname, HDC hDC); 46 | void ListPANOSE(void); 47 | 48 | bool Initialize(HINSTANCE hInstance, KStatusWindow * pStatus, HWND hWndFrame); 49 | }; 50 | -------------------------------------------------------------------------------- /Chapt_01/GDISpeed/GDISpeed.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // English (U.S.) resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // Icon 26 | // 27 | 28 | // Icon with lowest ID value placed first to ensure application icon 29 | // remains consistent on all systems. 30 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 31 | 32 | #ifdef APSTUDIO_INVOKED 33 | ///////////////////////////////////////////////////////////////////////////// 34 | // 35 | // TEXTINCLUDE 36 | // 37 | 38 | 1 TEXTINCLUDE DISCARDABLE 39 | BEGIN 40 | "resource.h\0" 41 | END 42 | 43 | 2 TEXTINCLUDE DISCARDABLE 44 | BEGIN 45 | "#include ""afxres.h""\0" 46 | END 47 | 48 | 3 TEXTINCLUDE DISCARDABLE 49 | BEGIN 50 | "\r\n" 51 | "\0" 52 | END 53 | 54 | #endif // APSTUDIO_INVOKED 55 | 56 | #endif // English (U.S.) resources 57 | ///////////////////////////////////////////////////////////////////////////// 58 | 59 | 60 | 61 | #ifndef APSTUDIO_INVOKED 62 | ///////////////////////////////////////////////////////////////////////////// 63 | // 64 | // Generated from the TEXTINCLUDE 3 resource. 65 | // 66 | 67 | 68 | ///////////////////////////////////////////////////////////////////////////// 69 | #endif // not APSTUDIO_INVOKED 70 | 71 | -------------------------------------------------------------------------------- /Chapt_16/EMFScope/CANVAS.H: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : canvas.h // 10 | // Description: EMFScope canvas window // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | class KInputFile; 15 | 16 | class KCanvasWindow : public KWindow 17 | { 18 | HENHMETAFILE hMetaFile; 19 | KInputFile *hNTMetaFile; 20 | 21 | ENHMETAHEADER MetaHeader; 22 | 23 | LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 24 | 25 | char CurEmfFileName[MAX_PATH]; 26 | 27 | void GetDisplayRect(RECT *r); 28 | 29 | public: 30 | int scale; 31 | COLORREF canvas_backcolor; 32 | int canvas_delay; 33 | 34 | int page_margin; 35 | HINSTANCE hInstance; 36 | 37 | KCanvasWindow(HINSTANCE hInst, HWND hWnd, int x, int y, int w, int h); 38 | 39 | void SetDelay(int delay); 40 | void SetScaleColor(int newscale, COLORREF backcolor); 41 | BOOL UnloadEmfFile(const char *filename); 42 | BOOL LoadEmfFile(const char *filename); 43 | BOOL Print(void); 44 | BOOL Exam(void); 45 | 46 | const char *OpenFile(void); 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /Chapt_04/Diver/Diver.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_01/Hello1/Hello1.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_01/Hello3/Hello3.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_01/Hello4/Hello4.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_02/Timer/Timer.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_04/DDISpy/DDISpy.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_04/PogyGDI/PogyGDI.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_04/Skimmer/Skimmer.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_10/Scrambler/Scrambler.cpp: -------------------------------------------------------------------------------- 1 | //-----------------------------------------------------------------------------------// 2 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 3 | // ISBN 0-13-086985-6 // 4 | // // 5 | // Written by Yuan, Feng www.fengyuan.com // 6 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 7 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 8 | // // 9 | // FileName : scrambler.cpp // 10 | // Description: Screen scrambler demo program, Chapter 10 // 11 | // Version : 1.00.000, May 31, 2000 // 12 | //-----------------------------------------------------------------------------------// 13 | 14 | #define STRICT 15 | #define WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, PSTR, int) 21 | { 22 | HDC hDC = GetDC(NULL); 23 | 24 | int width = GetSystemMetrics(SM_CXSCREEN); 25 | int height = GetSystemMetrics(SM_CYSCREEN); 26 | 27 | for (int i=0; i<2000; i++) 28 | { 29 | HBRUSH hBrush = CreateSolidBrush(RGB(rand()%256, rand()%256, rand()%256)); 30 | SelectObject(hDC, hBrush); 31 | 32 | BOOL rslt = StretchBlt(hDC, rand() % width, rand() % height, -64, -64, 33 | hDC, rand() % width, rand() % height, 32, 32, (rand() % 256) << 16); 34 | SelectObject(hDC, GetStockObject(WHITE_BRUSH)); 35 | DeleteObject(hBrush); 36 | Sleep(1); 37 | } 38 | 39 | ReleaseDC(NULL, hDC); 40 | 41 | RedrawWindow(NULL, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /include/pefile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //-----------------------------------------------------------------------------------// 4 | // Windows Graphics Programming: Win32 GDI and DirectDraw // 5 | // ISBN 0-13-086985-6 // 6 | // // 7 | // Written by Yuan, Feng www.fengyuan.com // 8 | // Copyright (c) 2000 by Hewlett-Packard Company www.hp.com // 9 | // Published by Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com // 10 | // // 11 | // FileName : pefile.h // 12 | // Description: PE file access // 13 | // Version : 1.00.000, May 31, 2000 // 14 | //-----------------------------------------------------------------------------------// 15 | 16 | // PE File Access 17 | class KPEFile 18 | { 19 | char * m_pBaseAddress; 20 | IMAGE_DOS_HEADER * m_pDOSHeader; 21 | IMAGE_NT_HEADERS * m_pNTHeader; 22 | 23 | void * RealAddress(unsigned rta) 24 | { 25 | if ( rta == 0) 26 | return NULL; 27 | else 28 | return m_pBaseAddress + rta; 29 | } 30 | 31 | public: 32 | KPEFile(void) 33 | { 34 | m_pBaseAddress = NULL; 35 | m_pDOSHeader = NULL; 36 | m_pNTHeader = NULL; 37 | } 38 | 39 | bool Load(const TCHAR * filename); 40 | void Unload(void); 41 | 42 | virtual bool FuncEnumCallBack(const char * funcname) 43 | { 44 | return true; 45 | } 46 | 47 | virtual bool SectionEnumCallBack(IMAGE_SECTION_HEADER * pSection) 48 | { 49 | return true; 50 | } 51 | 52 | int EnumExported(void); 53 | int EnumSection(void); 54 | 55 | const char * GetSectionName(unsigned offset); 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /Chapt_01/SetProc/SetProc.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_02/HTMLDrv/HTMLDrv.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_ICON1 ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_03/Periscope/Periscope.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_03/QueryTab/QueryTab.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_GRAPH ICON DISCARDABLE "..\\..\\Res\\graph.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_04/DDIWatcher/DDIWatcher.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | -------------------------------------------------------------------------------- /Chapt_04/QueryDDraw/QueryDDraw.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_SPY ICON DISCARDABLE "..\\..\\Res\\spy.ico" 32 | 33 | #ifdef APSTUDIO_INVOKED 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // 36 | // TEXTINCLUDE 37 | // 38 | 39 | 1 TEXTINCLUDE DISCARDABLE 40 | BEGIN 41 | "resource.h\0" 42 | END 43 | 44 | 2 TEXTINCLUDE DISCARDABLE 45 | BEGIN 46 | "#include ""afxres.h""\r\n" 47 | "\0" 48 | END 49 | 50 | 3 TEXTINCLUDE DISCARDABLE 51 | BEGIN 52 | "\r\n" 53 | "\0" 54 | END 55 | 56 | #endif // APSTUDIO_INVOKED 57 | 58 | #endif // English (U.S.) resources 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | 63 | #ifndef APSTUDIO_INVOKED 64 | ///////////////////////////////////////////////////////////////////////////// 65 | // 66 | // Generated from the TEXTINCLUDE 3 resource. 67 | // 68 | 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | #endif // not APSTUDIO_INVOKED 72 | 73 | --------------------------------------------------------------------------------