ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

main.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     PAINT for ReactOS
00003  * LICENSE:     LGPL
00004  * FILE:        base/applications/paint/main.c
00005  * PURPOSE:     Initializing everything
00006  * PROGRAMMERS: Benedikt Freisen
00007  */
00008 
00009 /* INCLUDES *********************************************************/
00010 
00011 #include "precomp.h"
00012 
00013 /* FUNCTIONS ********************************************************/
00014 
00015 HDC hDrawingDC;
00016 HDC hSelDC;
00017 int *bmAddress;
00018 BITMAPINFO bitmapinfo;
00019 int imgXRes = 400;
00020 int imgYRes = 300;
00021 
00022 HBITMAP hBms[HISTORYSIZE];
00023 int currInd = 0;
00024 int undoSteps = 0;
00025 int redoSteps = 0;
00026 BOOL imageSaved = TRUE;
00027 
00028 LONG startX;
00029 LONG startY;
00030 LONG lastX;
00031 LONG lastY;
00032 int lineWidth = 1;
00033 int shapeStyle = 0;
00034 int brushStyle = 0;
00035 int activeTool = TOOL_PEN;
00036 int airBrushWidth = 5;
00037 int rubberRadius = 4;
00038 int transpBg = 0;
00039 int zoom = 1000;
00040 int rectSel_src[4];
00041 int rectSel_dest[4];
00042 HWND hSelection;
00043 HWND hImageArea;
00044 HBITMAP hSelBm;
00045 HBITMAP hSelMask;
00046 
00047 /* initial palette colors; may be changed by the user during execution */
00048 int palColors[28] = { 0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
00049     0x00f2ff, 0x1de6a8, 0x4cb122, 0xefb700, 0xf36d4d, 0x99362f, 0x98316f,
00050     0xffffff, 0xdcdcdc, 0xb4b4b4, 0x3c5a9c, 0xb1a3ff, 0x7aaae5, 0x9ce4f5,
00051     0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5
00052 };
00053 
00054 /* foreground and background colors with initial value */
00055 int fgColor = 0x00000000;
00056 int bgColor = 0x00ffffff;
00057 
00058 HWND hStatusBar;
00059 HWND hScrollbox;
00060 HWND hMainWnd;
00061 HWND hPalWin;
00062 HWND hToolBoxContainer;
00063 HWND hToolSettings;
00064 HWND hTrackbarZoom;
00065 CHOOSECOLOR choosecolor;
00066 OPENFILENAME ofn;
00067 OPENFILENAME sfn;
00068 HICON hNontranspIcon;
00069 HICON hTranspIcon;
00070 
00071 HCURSOR hCurFill;
00072 HCURSOR hCurColor;
00073 HCURSOR hCurZoom;
00074 HCURSOR hCurPen;
00075 HCURSOR hCurAirbrush;
00076 
00077 HWND hScrlClient;
00078 
00079 HWND hToolBtn[16];
00080 
00081 HINSTANCE hProgInstance;
00082 
00083 TCHAR filename[256];
00084 TCHAR filepathname[1000];
00085 BOOL isAFile = FALSE;
00086 int fileSize;
00087 int fileHPPM = 2834;
00088 int fileVPPM = 2834;
00089 SYSTEMTIME fileTime;
00090 
00091 BOOL showGrid = FALSE;
00092 BOOL showMiniature = FALSE;
00093 
00094 HWND hwndMiniature;
00095 
00096 HWND hSizeboxLeftTop;
00097 HWND hSizeboxCenterTop;
00098 HWND hSizeboxRightTop;
00099 HWND hSizeboxLeftCenter;
00100 HWND hSizeboxRightCenter;
00101 HWND hSizeboxLeftBottom;
00102 HWND hSizeboxCenterBottom;
00103 HWND hSizeboxRightBottom;
00104 
00105 /* entry point */
00106 
00107 int WINAPI
00108 _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
00109 {
00110     HWND hwnd;               /* This is the handle for our window */
00111     MSG messages;            /* Here messages to the application are saved */
00112     
00113     WNDCLASSEX wclScroll;
00114     WNDCLASSEX wincl;
00115     WNDCLASSEX wclPal;
00116     WNDCLASSEX wclSettings;
00117     WNDCLASSEX wclSelection;
00118     
00119     TCHAR progtitle[1000];
00120     TCHAR resstr[100];
00121     HMENU menu;
00122     HWND hToolbar;
00123     HIMAGELIST hImageList;
00124     HANDLE haccel;
00125     HBITMAP tempBm;
00126     int i;
00127     TCHAR tooltips[16][30];
00128     HDC hDC;
00129     
00130     TCHAR *c;
00131     TCHAR sfnFilename[1000];
00132     TCHAR sfnFiletitle[256];
00133     TCHAR sfnFilter[1000];
00134     TCHAR ofnFilename[1000];
00135     TCHAR ofnFiletitle[256];
00136     TCHAR ofnFilter[1000];
00137     TCHAR miniaturetitle[100];
00138     static int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
00139         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
00140     };
00141 
00142     hProgInstance = hThisInstance;
00143 
00144     /* Necessary */
00145     InitCommonControls();
00146 
00147     /* initializing and registering the window class used for the main window */
00148     wincl.hInstance         = hThisInstance;
00149     wincl.lpszClassName     = _T("WindowsApp");
00150     wincl.lpfnWndProc       = WindowProcedure;
00151     wincl.style             = CS_DBLCLKS;
00152     wincl.cbSize            = sizeof(WNDCLASSEX);
00153     wincl.hIcon             = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDI_APPICON));
00154     wincl.hIconSm           = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDI_APPICON));
00155     wincl.hCursor           = LoadCursor(NULL, IDC_ARROW);
00156     wincl.lpszMenuName      = NULL;
00157     wincl.cbClsExtra        = 0;
00158     wincl.cbWndExtra        = 0;
00159     wincl.hbrBackground     = GetSysColorBrush(COLOR_BTNFACE);
00160     RegisterClassEx (&wincl);
00161 
00162     /* initializing and registering the window class used for the scroll box */
00163     wclScroll.hInstance     = hThisInstance;
00164     wclScroll.lpszClassName = _T("Scrollbox");
00165     wclScroll.lpfnWndProc   = WindowProcedure;
00166     wclScroll.style         = 0;
00167     wclScroll.cbSize        = sizeof(WNDCLASSEX);
00168     wclScroll.hIcon         = NULL;
00169     wclScroll.hIconSm       = NULL;
00170     wclScroll.hCursor       = LoadCursor(NULL, IDC_ARROW);
00171     wclScroll.lpszMenuName  = NULL;
00172     wclScroll.cbClsExtra    = 0;
00173     wclScroll.cbWndExtra    = 0;
00174     wclScroll.hbrBackground = GetSysColorBrush(COLOR_APPWORKSPACE);
00175     RegisterClassEx (&wclScroll);
00176 
00177     /* initializing and registering the window class used for the palette window */
00178     wclPal.hInstance        = hThisInstance;
00179     wclPal.lpszClassName    = _T("Palette");
00180     wclPal.lpfnWndProc      = PalWinProc;
00181     wclPal.style            = CS_DBLCLKS;
00182     wclPal.cbSize           = sizeof(WNDCLASSEX);
00183     wclPal.hIcon            = NULL;
00184     wclPal.hIconSm          = NULL;
00185     wclPal.hCursor          = LoadCursor(NULL, IDC_ARROW);
00186     wclPal.lpszMenuName     = NULL;
00187     wclPal.cbClsExtra       = 0;
00188     wclPal.cbWndExtra       = 0;
00189     wclPal.hbrBackground    = GetSysColorBrush(COLOR_BTNFACE);
00190     RegisterClassEx (&wclPal);
00191 
00192     /* initializing and registering the window class for the settings window */
00193     wclSettings.hInstance       = hThisInstance;
00194     wclSettings.lpszClassName   = _T("ToolSettings");
00195     wclSettings.lpfnWndProc     = SettingsWinProc;
00196     wclSettings.style           = CS_DBLCLKS;
00197     wclSettings.cbSize          = sizeof(WNDCLASSEX);
00198     wclSettings.hIcon           = NULL;
00199     wclSettings.hIconSm         = NULL;
00200     wclSettings.hCursor         = LoadCursor(NULL, IDC_ARROW);
00201     wclSettings.lpszMenuName    = NULL;
00202     wclSettings.cbClsExtra      = 0;
00203     wclSettings.cbWndExtra      = 0;
00204     wclSettings.hbrBackground   = GetSysColorBrush(COLOR_BTNFACE);
00205     RegisterClassEx (&wclSettings);
00206 
00207     /* initializing and registering the window class for the selection frame */
00208     wclSelection.hInstance      = hThisInstance;
00209     wclSelection.lpszClassName  = _T("Selection");
00210     wclSelection.lpfnWndProc    = SelectionWinProc;
00211     wclSelection.style          = CS_DBLCLKS;
00212     wclSelection.cbSize         = sizeof(WNDCLASSEX);
00213     wclSelection.hIcon          = NULL;
00214     wclSelection.hIconSm        = NULL;
00215     wclSelection.hCursor        = LoadCursor(NULL, IDC_SIZEALL);
00216     wclSelection.lpszMenuName   = NULL;
00217     wclSelection.cbClsExtra     = 0;
00218     wclSelection.cbWndExtra     = 0;
00219     wclSelection.hbrBackground  = NULL;
00220     RegisterClassEx (&wclSelection);
00221 
00222     /* initializing and registering the window class for the size boxes */
00223     wclSettings.hInstance       = hThisInstance;
00224     wclSettings.lpszClassName   = _T("Sizebox");
00225     wclSettings.lpfnWndProc     = SizeboxWinProc;
00226     wclSettings.style           = CS_DBLCLKS;
00227     wclSettings.cbSize          = sizeof(WNDCLASSEX);
00228     wclSettings.hIcon           = NULL;
00229     wclSettings.hIconSm         = NULL;
00230     wclSettings.hCursor         = LoadCursor(NULL, IDC_ARROW);
00231     wclSettings.lpszMenuName    = NULL;
00232     wclSettings.cbClsExtra      = 0;
00233     wclSettings.cbWndExtra      = 0;
00234     wclSettings.hbrBackground   = GetSysColorBrush(COLOR_HIGHLIGHT);
00235     RegisterClassEx (&wclSettings);
00236 
00237     LoadString(hThisInstance, IDS_DEFAULTFILENAME, filename, SIZEOF(filename));
00238     LoadString(hThisInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr));
00239     _stprintf(progtitle, resstr, filename);
00240     LoadString(hThisInstance, IDS_MINIATURETITLE, miniaturetitle, SIZEOF(miniaturetitle));
00241     
00242     /* create main window */
00243     hwnd =
00244         CreateWindowEx(0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544,
00245                        375, HWND_DESKTOP, NULL, hThisInstance, NULL);
00246     hMainWnd = hwnd;
00247 
00248     hwndMiniature =
00249         CreateWindowEx(WS_EX_PALETTEWINDOW, _T("WindowsApp"), miniaturetitle,
00250                        WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 180, 200, 120, 100, hwnd,
00251                        NULL, hThisInstance, NULL);
00252 
00253     /* loading and setting the window menu from resource */
00254     menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU));
00255     SetMenu(hwnd, menu);
00256     haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800));
00257 
00258     /* preloading the draw transparent/nontransparent icons for later use */
00259     hNontranspIcon =
00260         LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
00261     hTranspIcon =
00262         LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
00263 
00264     hCurFill     = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL));
00265     hCurColor    = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR));
00266     hCurZoom     = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM));
00267     hCurPen      = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN));
00268     hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH));
00269 
00270     CreateWindowEx(0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL,
00271                    hThisInstance, NULL);
00272 
00273     hToolBoxContainer =
00274         CreateWindowEx(0, _T("WindowsApp"), _T(""), WS_CHILD | WS_VISIBLE, 2, 2, 52, 350, hwnd, NULL,
00275                        hThisInstance, NULL);
00276     /* creating the 16 bitmap radio buttons and setting the bitmap */
00277 
00278 
00279     /* 
00280      * FIXME: Unintentionally there is a line above the tool bar. 
00281      * To prevent cropping of the buttons height has been increased from 200 to 205
00282      */
00283     hToolbar =
00284         CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
00285                        WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS,
00286                        1, 1, 50, 205, hToolBoxContainer, NULL, hThisInstance, NULL);
00287     hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0);
00288     SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM) hImageList);
00289     tempBm = LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0);
00290     ImageList_AddMasked(hImageList, tempBm, 0xff00ff);
00291     DeleteObject(tempBm);
00292     SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
00293     
00294     for(i = 0; i < 16; i++)
00295     {
00296         TBBUTTON tbbutton;
00297         int wrapnow = 0;
00298 
00299         if (i % 2 == 1)
00300             wrapnow = TBSTATE_WRAP;
00301 
00302         LoadString(hThisInstance, IDS_TOOLTIP1 + i, tooltips[i], 30);
00303         ZeroMemory(&tbbutton, sizeof(TBBUTTON));
00304         tbbutton.iString   = (INT_PTR) tooltips[i];
00305         tbbutton.fsStyle   = TBSTYLE_CHECKGROUP;
00306         tbbutton.fsState   = TBSTATE_ENABLED | wrapnow;
00307         tbbutton.idCommand = ID_FREESEL + i;
00308         tbbutton.iBitmap   = i;
00309         SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM) &tbbutton);
00310     }
00311     
00312     SendMessage(hToolbar, TB_CHECKBUTTON, ID_PEN, MAKELONG(TRUE, 0));
00313     SendMessage(hToolbar, TB_SETMAXTEXTROWS, 0, 0);
00314     SendMessage(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(25, 25));
00315 
00316     /* creating the tool settings child window */
00317     hToolSettings =
00318         CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 5, 208, 42, 140,
00319                        hToolBoxContainer, NULL, hThisInstance, NULL);
00320     hTrackbarZoom =
00321         CreateWindowEx(0, TRACKBAR_CLASS, _T(""), WS_CHILD | TBS_VERT | TBS_AUTOTICKS, 1, 1, 40, 64,
00322                        hToolSettings, NULL, hThisInstance, NULL);
00323     SendMessage(hTrackbarZoom, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG(0, 6));
00324     SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 3);
00325 
00326     /* creating the palette child window */
00327     hPalWin =
00328         CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL,
00329                        hThisInstance, NULL);
00330 
00331     /* creating the scroll box */
00332     hScrollbox =
00333         CreateWindowEx(WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""),
00334                        WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd,
00335                        NULL, hThisInstance, NULL);
00336 
00337     /* creating the status bar */
00338     hStatusBar =
00339         CreateWindowEx(0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd,
00340                        NULL, hThisInstance, NULL);
00341     SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0);
00342 
00343     hScrlClient =
00344         CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL,
00345                        hThisInstance, NULL);
00346 
00347     /* create selection window (initially hidden) */
00348     hSelection =
00349         CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100,
00350                        hScrlClient, NULL, hThisInstance, NULL);
00351 
00352     /* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */
00353     hImageArea =
00354         CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient,
00355                        NULL, hThisInstance, NULL);
00356 
00357     hDC = GetDC(hImageArea);
00358     hDrawingDC = CreateCompatibleDC(hDC);
00359     hSelDC     = CreateCompatibleDC(hDC);
00360     ReleaseDC(hImageArea, hDC);
00361     SelectObject(hDrawingDC, CreatePen(PS_SOLID, 0, fgColor));
00362     SelectObject(hDrawingDC, CreateSolidBrush(bgColor));
00363 
00364     hBms[0] = CreateDIBWithProperties(imgXRes, imgYRes);
00365     SelectObject(hDrawingDC, hBms[0]);
00366     Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1);
00367 
00368     if (lpszArgument[0] != 0)
00369     {
00370         HBITMAP bmNew = NULL;
00371         LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, &fileVPPM);
00372         if (bmNew != NULL)
00373         {
00374             TCHAR tempstr[1000];
00375             TCHAR resstr[100];
00376             TCHAR *temp;
00377             insertReversible(bmNew);
00378             GetFullPathName(lpszArgument, SIZEOF(filepathname), filepathname, &temp);
00379             _tcscpy(filename, temp);
00380             LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr));
00381             _stprintf(tempstr, resstr, filename);
00382             SetWindowText(hMainWnd, tempstr);
00383             clearHistory();
00384             isAFile = TRUE;
00385         }
00386     }
00387 
00388     /* initializing the CHOOSECOLOR structure for use with ChooseColor */
00389     choosecolor.lStructSize    = sizeof(CHOOSECOLOR);
00390     choosecolor.hwndOwner      = hwnd;
00391     choosecolor.hInstance      = NULL;
00392     choosecolor.rgbResult      = 0x00ffffff;
00393     choosecolor.lpCustColors   = (COLORREF*) &custColors;
00394     choosecolor.Flags          = 0;
00395     choosecolor.lCustData      = 0;
00396     choosecolor.lpfnHook       = NULL;
00397     choosecolor.lpTemplateName = NULL;
00398 
00399     /* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */
00400     CopyMemory(ofnFilename, filename, sizeof(filename));
00401     LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter));
00402     for(c = ofnFilter; *c; c++)
00403         if (*c == '\1')
00404             *c = '\0';
00405     ZeroMemory(&ofn, sizeof(OPENFILENAME));
00406     ofn.lStructSize    = sizeof(OPENFILENAME);
00407     ofn.hwndOwner      = hwnd;
00408     ofn.hInstance      = hThisInstance;
00409     ofn.lpstrFilter    = ofnFilter;
00410     ofn.lpstrFile      = ofnFilename;
00411     ofn.nMaxFile       = SIZEOF(ofnFilename);
00412     ofn.lpstrFileTitle = ofnFiletitle;
00413     ofn.nMaxFileTitle  = SIZEOF(ofnFiletitle);
00414     ofn.Flags          = OFN_HIDEREADONLY;
00415 
00416     CopyMemory(sfnFilename, filename, sizeof(filename));
00417     LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter));
00418     for(c = sfnFilter; *c; c++)
00419         if (*c == '\1')
00420             *c = '\0';
00421     ZeroMemory(&sfn, sizeof(OPENFILENAME));
00422     sfn.lStructSize    = sizeof(OPENFILENAME);
00423     sfn.hwndOwner      = hwnd;
00424     sfn.hInstance      = hThisInstance;
00425     sfn.lpstrFilter    = sfnFilter;
00426     sfn.lpstrFile      = sfnFilename;
00427     sfn.nMaxFile       = SIZEOF(sfnFilename);
00428     sfn.lpstrFileTitle = sfnFiletitle;
00429     sfn.nMaxFileTitle  = SIZEOF(sfnFiletitle);
00430     sfn.Flags          = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
00431 
00432     /* creating the size boxes */
00433     hSizeboxLeftTop =
00434         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00435                        hThisInstance, NULL);
00436     hSizeboxCenterTop =
00437         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00438                        hThisInstance, NULL);
00439     hSizeboxRightTop =
00440         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00441                        hThisInstance, NULL);
00442     hSizeboxLeftCenter =
00443         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00444                        hThisInstance, NULL);
00445     hSizeboxRightCenter =
00446         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00447                        hThisInstance, NULL);
00448     hSizeboxLeftBottom =
00449         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00450                        hThisInstance, NULL);
00451     hSizeboxCenterBottom =
00452         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00453                        hThisInstance, NULL);
00454     hSizeboxRightBottom =
00455         CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
00456                        hThisInstance, NULL);
00457     /* placing the size boxes around the image */
00458     SendMessage(hImageArea, WM_SIZE, 0, 0);
00459 
00460     /* by moving the window, the things in WM_SIZE are done */
00461     MoveWindow(hwnd, 100, 100, 600, 450, TRUE);
00462 
00463     /* Make the window visible on the screen */
00464     ShowWindow (hwnd, nFunsterStil);
00465 
00466     /* Run the message loop. It will run until GetMessage() returns 0 */
00467     while (GetMessage(&messages, NULL, 0, 0))
00468     {
00469         TranslateAccelerator(hwnd, haccel, &messages);
00470 
00471         /* Translate virtual-key messages into character messages */
00472         TranslateMessage(&messages);
00473         /* Send message to WindowProcedure */
00474         DispatchMessage(&messages);
00475     }
00476 
00477     /* The program return-value is 0 - The value that PostQuitMessage() gave */
00478     return messages.wParam;
00479 }

Generated on Fri May 25 2012 04:15:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.