/*[]=====================================================================[]*/ /*[] LEADTOOLS for Windows - []*/ /*[] []*/ /*[] []*/ /*[] Copyright (c) 1991-2000 LEAD Technologies, Inc. []*/ /*[] All Rights Reserved. []*/ /*[]=====================================================================[]*/ #ifndef UNREFERENCED_PARAMETER #define UNREFERENCED_PARAMETER(P) \ { \ (P) = (P); \ } #endif typedef struct tagDATA { HPALETTE hPalette; /* Logical Palette used for painting. */ L_TCHAR szFilename[128]; /* File name to load. */ FILEINFO FileInfo; /* FILEINFO structure. */ BITMAPHANDLE BitmapHandle; /* BITMAP HANDLE to hold the image. */ } DATA; DATA Data; /* Pointer to DATA structure. */ HANDLE hInst; /* Current instance. */ HWND MainWnd; /* Main Sample Window. */ L_BOOL fFirst; /* First time painting? */ L_BOOL fNewErase; /* Erase the new paint region when painting? */ L_BOOL fWindowErase; /* Erase the window when painting? */ L_UINT fPaintMode; /* Mode to use for painting. */ L_UINT32 fDisplayFlags; /* Initial display mode. */ RECT rWndSize; /* RECT for sizing the window. */ RECT rcSrc; /* RECT for paint Source. */ RECT rcSrcClip; /* RECT for paint Source Clip. */ RECT rcDest; /* RECT for paint Destination. */ RECT rcDestClip; /* RECT for paint Destination Clip. */ L_UINT32 ulROP3Code = SRCCOPY; /* ROP3 Code to use for Painting. */ #define IDM_GO 100 #define IDM_QUIT 101 #define IDM_SRCCOPY 122 #define IDM_SRCPAINT 123 #define IDM_SRCAND 124 #define IDM_SRCINVERT 125 #define IDM_SRCERASE 126 #define IDM_NOTSRCCOPY 127 #define IDM_NOTSRCERASE 128 #define IDM_MERGECOPY 129 #define IDM_MERGEPAINT 130 #define IDM_PATCOPY 131 #define IDM_PATPAINT 132 #define IDM_PATINVERT 133 #define IDM_DSTINVERT 134 #define IDM_BLACKNESS 135 #define IDM_WHITENESS 136 #define IDC_STATIC -1 #define IDC_SRCLEFT 201 #define IDC_SRCTOP 202 #define IDC_SRCRIGHT 203 #define IDC_SRCBOTTOM 204 #define IDC_SRCCLIPLEFT 205 #define IDC_SRCCLIPTOP 206 #define IDC_SRCCLIPRIGHT 207 #define IDC_SRCCLIPBOTTOM 208 #define IDC_DESTLEFT 209 #define IDC_DESTTOP 210 #define IDC_DESTRIGHT 212 #define IDC_DESTBOTTOM 213 #define IDC_DESTCLIPLEFT 214 #define IDC_DESTCLIPTOP 215 #define IDC_DESTCLIPRIGHT 216 #define IDC_DESTCLIPBOTTOM 217 #define IDC_WIDTH 218 #define IDC_HEIGHT 219 #define IDD_PAINTRECT 220 #define IDC_NEWERASE 221 #define IDC_WINDOWERASE 222 #define IDC_NORMAL 223 #define IDC_SCALETOGRAY 224 #define IDC_FAVORBLACK 225 #define USER_LOAD (WM_USER + 0) #define P_NORMAL 0 #define P_SCALETOGRAY 1 #define P_FAVORBLACK 2 int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow); L_BOOL InitApplication (HANDLE hInstance); L_BOOL InitInstance (HANDLE hInstance, L_INT nCmdShow); L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam, LPARAM lParam); BOOL Window_OnCreate (HWND hWnd, CREATESTRUCT FAR * lpCreateStruct); VOID Window_OnInitMenuPopup (HWND hWnd, HMENU hMenu, L_INT nItem, BOOL fSystemMenu); VOID Window_OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify); VOID Window_OnPaletteChanged (HWND hWnd, HWND hWndPaletteChange); BOOL Window_OnQueryNewPalette (HWND hWnd); VOID Window_OnPaletteChanging(HWND hWnd, HWND hWndPaletteChange); VOID Window_SysColorChange(HWND hwnd); VOID Window_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized); VOID Window_OnPaint (HWND hWnd); VOID Window_OnDestroy (HWND hWnd); L_BOOL CALLBACK L_EXPORT PaintRectDlgProc (HWND hDlg, UINT message, WPARAM id, LPARAM lParam);