2557 int prevDCStretchMode;
2558 int prevMemDCStretchMode;
2559 int prevButtonDCStretchMode;
2560 int prevLicenseDCStretchMode;
2565 HDC hDC, memDC, buttonDC, licenseDC;
2569 static int bits_pixel = 0;
2570 static int idCtl = 0;
2571 static int mouse_x, mouse_y;
2573 static char szBitmap[_MAX_PATH];
2574 static char szLicense[ _MAX_PATH ];
2575 static char szButtonBitmap[_MAX_PATH];
2577 static wchar_t szString1[ 500 ];
2578 static wchar_t szString2[ 500 ];
2579 static wchar_t szWholeString[ 1000 ];
2588 static wchar_t szWSMsg2[ _MAX_PATH ];
2589 static wchar_t szWholeWSMsg[ 1000 ];
2592 static HBITMAP hBitmap = 0;
2593 static HBITMAP oldBitmap = 0;
2595 static HBITMAP oldLicenseBitmap = 0;
2596 static HBITMAP hButtonBitmap = 0;
2598 static HBITMAP hLicenseBitmap;
2601 static HBRUSH hStaticBrush = 0;
2602 static HPALETTE hpal = 0;
2603 static HPALETTE hpalold = 0;
2607 static int FlickerIndex = 0;
2608 static BOOL PaintOnlyFlicker =
TRUE;
2609 static BOOL PaintBackground =
TRUE;
2610 static UINT timer_id = 0;
2612 static RECT tray_rect;
2613 static RECT paint_rect;
2614 static RECT dlg_rect;
2615 static RECT bitmap_rect;
2616 static RECT flicker_rect;
2617 static RECT buttons_rect;
2618 static RECT license_rect;
2619 static RECT BackgroundRect[ (
NUM_BUTTONS * 3 ) + 3 ];
2622 static int CurrentButton = 0;
2623 static int LastButton = 0;
2624 static int PrevButton = 0;
2633 HDC hdc = GetDC( window_handle );
2637 GetCursorPos( &pPoint );
2638 ScreenToClient( window_handle, &pPoint );
2639 sprintf(
string,
"%d, %d", pPoint.x, pPoint.y );
2640 TextOut( hdc, 10, 50,
string, 8 );
2641 ReleaseDC( window_handle, hdc );
2667 wideBuffer2.
format(wideBuffer, fullProductName.
str());
2673 SetWindowText( window_handle,
szBuffer );
2678 SendMessage( window_handle, WM_SETICON, ICON_SMALL, (
long)LoadIcon(
Main::hInstance, MAKEINTRESOURCE(1)));
2680 #if(BACKGROUND_BITMAP)
2685 GetClientRect( GetDesktopWindow(), &rect );
2686 SystemParametersInfo( SPI_GETWORKAREA, 0, &tray_rect, 0 );
2697 HDC hdc = GetDC( window_handle );
2701 ReleaseDC( window_handle, hdc );
2715 memset( szWSMsg2,
'\0', _MAX_PATH );
2716 memset( szWholeWSMsg,
'\0', 1000 );
2736 memset( buffer1,
'\0',
sizeof( buffer1 ));
2740 strcpy( szBitmap, _TEXT(
"Background2" ));
2743 strcpy( szLicense, _TEXT(
"License_FRENCH2" ));
2745 strcpy( szLicense, _TEXT(
"License_GERMAN2" ));
2747 strcpy( szLicense, _TEXT(
"License_USA2" ));
2749 license_rect.left = 186;
2750 license_rect.top = 414;
2754 strcpy( szBitmap, _TEXT(
"BacKground" ));
2757 strcpy( szLicense, _TEXT(
"License_FRENCH2" ));
2759 strcpy( szLicense, _TEXT(
"License_GERMAN2" ));
2761 strcpy( szLicense, _TEXT(
"License_USA2" ));
2763 license_rect.left = 186;
2764 license_rect.top = 414;
2768 strcpy( szBitmap, _TEXT(
"Background" ));
2769 strcpy( buffer1,
"FLICKER" );
2772 strcpy( szLicense, _TEXT(
"License_FRENCH" ));
2774 strcpy( szLicense, _TEXT(
"License_GERMAN" ));
2776 strcpy( szLicense, _TEXT(
"License_USA" ));
2778 license_rect.left = 238;
2779 license_rect.top = 580;
2800 }
else if( i == 9 ) {
2802 }
else if ( i > 8 ) {
2811 if ( hFlicker[0] ) {
2812 GetObject( hFlicker[0],
sizeof( BITMAP ), (LPTSTR)&fm );
2815 flicker_rect.right = flicker_rect.left + fm.bmWidth;
2816 flicker_rect.bottom = flicker_rect.top + fm.bmHeight;
2823 if ( hLicenseBitmap ) {
2824 GetObject( hLicenseBitmap,
sizeof( BITMAP ), (LPTSTR)&lm );
2825 license_rect.right = license_rect.left + lm.bmWidth;
2826 license_rect.bottom = license_rect.top + lm.bmHeight;
2834 GetObject( hBitmap,
sizeof( BITMAP ), (LPTSTR)&bm );
2840 bitmap_rect.left = dlg_rect.left = 0;
2841 bitmap_rect.top = dlg_rect.top = 0;
2842 bitmap_rect.right = dlg_rect.right = bm.bmWidth;
2843 bitmap_rect.bottom = dlg_rect.bottom = bm.bmHeight;
2852 dlg_rect.right = rect.right;
2853 dlg_rect.bottom = tray_rect.bottom;
2856 dlg_rect.right = bm.bmWidth + 6;
2857 dlg_rect.bottom = bm.bmHeight + GetSystemMetrics( SM_CYCAPTION ) + 6;
2859 dlg_rect.right = 640;
2860 dlg_rect.bottom = 480;
2863 dlg_rect.right = bm.bmWidth + 6;
2864 dlg_rect.bottom = bm.bmHeight + GetSystemMetrics( SM_CYCAPTION ) + 6;
2892 Msg( __LINE__, TEXT(__FILE__), TEXT(
"----------------------------- determining button area ---------------------------" ));
2903 buttons_rect.left = __min(
ButtonSizes[j].left , buttons_rect.left );
2904 buttons_rect.top = __min(
ButtonSizes[j].top , buttons_rect.top );
2910 Msg( __LINE__, TEXT(__FILE__), TEXT(
"buttons_rect = [%d,%d,%d,%d]"), buttons_rect.left, buttons_rect.top, buttons_rect.right, buttons_rect.bottom );
2911 Msg( __LINE__, TEXT(__FILE__), TEXT(
"----------------------------- determining button area ---------------------------" ));
2917 MoveWindow( window_handle,
2918 ( rect.right - dlg_rect.right )/2,
2919 ( rect.bottom - dlg_rect.bottom )/2,
2921 dlg_rect.bottom,
TRUE );
2923 MoveWindow( window_handle,
2926 dlg_rect.bottom,
TRUE );
2932 GetClientRect( window_handle, &dlg_rect );
2938 memset( BackgroundRect, 0,
sizeof ( BackgroundRect ) );
2944 BackgroundRect[0].left = dlg_rect.left;
2945 BackgroundRect[0].top = dlg_rect.top;
2946 BackgroundRect[0].right = dlg_rect.right;
2947 BackgroundRect[0].bottom = buttons_rect.top;
2949 BackgroundRect[1].left = dlg_rect.left;
2950 BackgroundRect[1].top = buttons_rect.top;
2951 BackgroundRect[1].right = buttons_rect.left;
2952 BackgroundRect[1].bottom = dlg_rect.bottom;
2954 BackgroundRect[2].left = buttons_rect.left;
2955 BackgroundRect[2].top = buttons_rect.bottom;
2956 BackgroundRect[2].right = buttons_rect.right;
2957 BackgroundRect[2].bottom = dlg_rect.bottom;
2959 BackgroundRect[3].left = buttons_rect.right;
2960 BackgroundRect[3].top = buttons_rect.top;
2961 BackgroundRect[3].right = dlg_rect.right;
2962 BackgroundRect[3].bottom = dlg_rect.bottom;
2988 for(
int index = i; index <
NUM_BUTTONS; index++ ) {
2996 BackgroundRect[j].top =
ButtonList[index]->Return_Y_Pos() +
ButtonList[index]->Return_Height();
2997 BackgroundRect[j].bottom =
ButtonList[index+1]->Return_Y_Pos() - BackgroundRect[j].top;
2998 BackgroundRect[j].left = BackgroundRect[1].right;
2999 BackgroundRect[j].right = BackgroundRect[3].left - BackgroundRect[1].left - 1;
3009 BackgroundRect[j].top =
ButtonList[index]->Return_Y_Pos();
3010 BackgroundRect[j].bottom =
ButtonList[index]->Return_Height();
3011 BackgroundRect[j].left = BackgroundRect[1].right;
3012 BackgroundRect[j].right =
ButtonList[index]->Return_X_Pos() - BackgroundRect[1].right;
3016 BackgroundRect[j].top =
ButtonList[index]->Return_Y_Pos();
3017 BackgroundRect[j].bottom =
ButtonList[index]->Return_Height();
3018 BackgroundRect[j].left =
ButtonList[index]->Return_X_Pos() +
ButtonList[index]->Return_Width();
3019 BackgroundRect[j].right = BackgroundRect[3].left - (
ButtonList[index]->Return_X_Pos() +
ButtonList[index]->Return_Width());
3025 Msg( __LINE__, TEXT(__FILE__), TEXT(
"----------------------------- WM_INITDIALOG ---------------------------" ));
3026 Msg( __LINE__, TEXT(__FILE__), TEXT(
"DeskTopWindowRect(w/o tray) = [%d,%d,%d,%d]"), tray_rect.left, tray_rect.top, tray_rect.right, tray_rect.bottom );
3027 Msg( __LINE__, TEXT(__FILE__), TEXT(
"DeskTopWindowRect = [%d,%d,%d,%d]"), rect.left, rect.top, rect.right, rect.bottom );
3028 Msg( __LINE__, TEXT(__FILE__), TEXT(
"b640X480 = [%d]"),
b640X480 );
3029 Msg( __LINE__, TEXT(__FILE__), TEXT(
"b800X600 = [%d]"),
b800X600 );
3030 Msg( __LINE__, TEXT(__FILE__), TEXT(
"ClientRect = [%d,%d,%d,%d]"), dlg_rect.left, dlg_rect.top, dlg_rect.right, dlg_rect.bottom );
3032 for( index = 0; index < (
NUM_BUTTONS * 3 ) + 3; index++ ) {
3033 Msg( __LINE__, TEXT(__FILE__), TEXT(
"BackgroundRect[%d] = [%d,%d,%d,%d]"), index, BackgroundRect[index].top, BackgroundRect[index].bottom, BackgroundRect[index].left, BackgroundRect[index].right );
3036 Msg( __LINE__, TEXT(__FILE__), TEXT(
"BitmapRect = [%d,%d,%d,%d]"), bitmap_rect.left, bitmap_rect.top, bitmap_rect.right, bitmap_rect.bottom );
3037 Msg( __LINE__, TEXT(__FILE__), TEXT(
"FlickerRect = [%d,%d,%d,%d]"), flicker_rect.left, flicker_rect.top, flicker_rect.right, flicker_rect.bottom );
3038 Msg( __LINE__, TEXT(__FILE__), TEXT(
"ButtonsRect = [%d,%d,%d,%d]"), buttons_rect.left, buttons_rect.top, buttons_rect.right, buttons_rect.bottom );
3039 Msg( __LINE__, TEXT(__FILE__), TEXT(
"-----------------------------------------------------------------------" ));
3047 hStaticBrush = CreateSolidBrush(
RGB( 192, 192, 192 ));
3055 timer_id = SetTimer( window_handle, 1000, 500L,
NULL );
3071 case WM_PALETTECHANGED:
3072 if (( HWND )w_param != window_handle ) {
3073 SendMessage( window_handle, WM_QUERYNEWPALETTE, w_param, l_param );
3082 case WM_QUERYNEWPALETTE:
3083 hDC = GetDC( window_handle );
3084 hpalold = SelectPalette( hDC, hpal,
FALSE );
3085 i = RealizePalette( hDC );
3087 InvalidateRect( window_handle, &dlg_rect,
TRUE );
3089 SelectPalette( hDC, hpalold,
TRUE );
3090 RealizePalette( hDC );
3091 ReleaseDC( window_handle, hDC );
3099 if ( w_param == 1000 ) {
3102 if ( Flicker && hFlicker[0] ) {
3110 InvalidateRect( window_handle, &flicker_rect,
FALSE );
3112 InvalidateRect( window_handle, &flicker_rect,
FALSE );
3113 UpdateWindow( window_handle );
3115 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_TIMER: FlickerRect = [%d,%d,%d,%d]"), flicker_rect.left, flicker_rect.right, flicker_rect.top, flicker_rect.bottom );
3138 if( IsIconic( ccwindow )){
3139 ShowWindow( ccwindow, SW_RESTORE );
3141 SetForegroundWindow( ccwindow );
3147 if( IsIconic( ccwindow )){
3148 ShowWindow( ccwindow, SW_RESTORE );
3150 SetForegroundWindow( ccwindow );
3154 PostMessage( window_handle, WM_COMMAND, (WPARAM)MAKELONG(
IDD_CANCEL, BN_CLICKED ), (LPARAM)GetDlgItem( window_handle,
IDD_CANCEL ));
3167 if ( GetUpdateRect( window_handle, &paint_rect,
FALSE )) {
3175 hDC = BeginPaint( window_handle, &ps );
3177 #if( BACKGROUND_BITMAP )
3184 memDC = CreateCompatibleDC( hDC );
3185 buttonDC = CreateCompatibleDC( hDC );
3186 licenseDC = CreateCompatibleDC( hDC );
3191 prevDCStretchMode = SetStretchBltMode( hDC, STRETCH_DELETESCANS );
3192 prevMemDCStretchMode = SetStretchBltMode( memDC, STRETCH_DELETESCANS );
3193 prevButtonDCStretchMode = SetStretchBltMode( buttonDC,STRETCH_DELETESCANS );
3194 prevLicenseDCStretchMode = SetStretchBltMode( licenseDC,STRETCH_DELETESCANS );
3199 hpalold = SelectPalette( hDC, hpal,
FALSE );
3200 RealizePalette( hDC );
3201 SelectPalette( memDC, hpal,
FALSE );
3202 RealizePalette( memDC );
3203 SelectPalette( buttonDC, hpal,
FALSE );
3204 RealizePalette( buttonDC );
3205 SelectPalette( licenseDC, hpal,
FALSE );
3206 RealizePalette( licenseDC );
3219 if ( paint_rect.left == rect.left &&
3220 paint_rect.top == rect.top &&
3221 paint_rect.right == rect.right &&
3222 paint_rect.bottom == rect.bottom ) {
3224 PaintBackground =
FALSE;
3234 if ( PaintBackground ) {
3239 oldBitmap = ( HBITMAP )SelectObject( memDC, hBitmap );
3245 for(
int i=0; i < (
NUM_BUTTONS * 3 ) + 3; i++ ) {
3247 if( BackgroundRect[i].left != 0 || BackgroundRect[i].top != 0 ||
3248 BackgroundRect[i].right != 0 || BackgroundRect[i].bottom != 0 ) {
3250 result = StretchBlt( hDC,
3251 BackgroundRect[i].left,
3252 BackgroundRect[i].top,
3253 BackgroundRect[i].right,
3254 BackgroundRect[i].bottom,
3256 BackgroundRect[i].left,
3257 BackgroundRect[i].top,
3258 BackgroundRect[i].right,
3259 BackgroundRect[i].bottom,
3267 HPEN pen = CreatePen( PS_SOLID, 1,
TEXT_COLOR );
3268 HGDIOBJ oldpen = SelectObject( hDC, pen );
3269 SetBkMode( hDC, TRANSPARENT );
3271 MoveToEx( hDC, BackgroundRect[i].left+1, BackgroundRect[i].top+1,
NULL );
3272 LineTo( hDC, BackgroundRect[i].right-1, BackgroundRect[i].top+1 );
3273 LineTo( hDC, BackgroundRect[i].right-1, BackgroundRect[i].bottom-1 );
3274 LineTo( hDC, BackgroundRect[i].left+1, BackgroundRect[i].bottom-1 );
3275 LineTo( hDC, BackgroundRect[i].left+1, BackgroundRect[i].top+1 );
3277 SelectObject( hDC, oldpen );
3278 DeleteObject( pen );
3308 StretchBlt( hDC, dlg_rect.left, dlg_rect.top, dlg_rect.right, dlg_rect.bottom,
3309 memDC, bitmap_rect.left, bitmap_rect.top, bitmap_rect.right, bitmap_rect.bottom,
3313 SelectObject( memDC, oldBitmap );
3314 SelectObject( licenseDC, oldLicenseBitmap );
3317 PaintBackground =
TRUE;
3324 if ( Flicker && hFlicker[0] ) {
3327 oldBitmap = ( HBITMAP )SelectObject( memDC, hFlicker[0] );
3334 flicker_rect.bottom,
3339 flicker_rect.bottom,
3343 HPEN pen = CreatePen( PS_SOLID, 1,
TEXT_COLOR );
3344 HGDIOBJ oldpen = SelectObject( hDC, pen );
3345 SetBkMode( hDC, TRANSPARENT );
3347 MoveToEx( hDC, flicker_rect.left+1, flicker_rect.top+1,
NULL );
3348 LineTo( hDC, flicker_rect.right-1, flicker_rect.top+1 );
3349 LineTo( hDC, flicker_rect.right-1, flicker_rect.bottom-1 );
3350 LineTo( hDC, flicker_rect.left+1, flicker_rect.bottom-1 );
3351 LineTo( hDC, flicker_rect.left+1, flicker_rect.top+1 );
3353 SelectObject( hDC, oldpen );
3354 DeleteObject( pen );
3357 SelectObject( memDC, oldBitmap );
3376 RECT src_rect, dst_rect;
3378 strcpy( szButtonBitmap,
ButtonList[i]->Return_Bitmap( ));
3380 if ( hButtonBitmap ) {
3382 GetObject( hButtonBitmap,
sizeof( BITMAP ), (LPTSTR)&bm );
3384 dst_rect.left =
ButtonList[i]->Return_X_Pos();
3385 dst_rect.top =
ButtonList[i]->Return_Y_Pos();
3386 dst_rect.right =
ButtonList[i]->Return_Stretched_Width();
3387 dst_rect.bottom =
ButtonList[i]->Return_Stretched_Height();
3390 src_rect.right = bm.bmWidth;
3391 src_rect.bottom = bm.bmHeight;
3396 oldBitmap = ( HBITMAP ) SelectObject( buttonDC, hButtonBitmap );
3410 SelectObject( buttonDC, oldBitmap );
3411 DeleteObject( hButtonBitmap );
3465 HPEN pen = CreatePen( PS_SOLID, 2,
TEXT_COLOR );
3466 HGDIOBJ oldpen = SelectObject( hDC, pen );
3467 SetBkMode( hDC, TRANSPARENT );
3480 outline_rect.bottom );
3484 outline_rect.bottom );
3490 SelectObject( hDC, oldpen );
3491 DeleteObject( pen );
3509 HPEN hPen1 = CreatePen( PS_SOLID, 1,
RGB( 255, 255, 255 ));
3515 HGDIOBJ oldpen = SelectObject( hDC, hPen1 );
3533 SelectObject( hDC, oldpen );
3537 DeleteObject( hPen1 );
3544 SetStretchBltMode( hDC, prevDCStretchMode );
3545 SetStretchBltMode( memDC, prevMemDCStretchMode );
3546 SetStretchBltMode( buttonDC, prevButtonDCStretchMode );
3547 SetStretchBltMode( licenseDC, prevLicenseDCStretchMode );
3549 SelectPalette( hDC, hpalold,
FALSE );
3550 SelectPalette( memDC, hpalold,
FALSE );
3551 SelectPalette( buttonDC, hpalold,
FALSE );
3552 SelectPalette( licenseDC, hpalold,
FALSE );
3555 DeleteDC( buttonDC );
3556 DeleteDC( licenseDC );
3585 text_rect.
Width = 140;
3590 text_rect.
Width = 180;
3597 one.left = text_rect.
X;
3598 one.top = text_rect.
Y;
3599 one.right = text_rect.
X + text_rect.
Width;
3600 one.bottom = text_rect.
Y + text_rect.
Height;
3602 FrameRect( hDC, &one, (HBRUSH)( COLOR_WINDOW + 1 ));
3631 text_rect.
Width = 300;
3636 text_rect.
Width = 420;
3643 one.left = text_rect.
X;
3644 one.top = text_rect.
Y;
3645 one.right = text_rect.
X + text_rect.
Width;
3646 one.bottom = text_rect.
Y + text_rect.
Height;
3648 FrameRect( hDC, &one, (HBRUSH)( COLOR_WINDOW + 1 ));
3667 if ( hStaticBrush ) {
3668 HBRUSH oldBrush = (HBRUSH) SelectObject( hDC, hStaticBrush );
3669 GetClientRect( window_handle, (LPRECT) &dlg_rect );
3670 FillRect( hDC, &dlg_rect, hStaticBrush );
3671 SelectObject( hDC, oldBrush );
3677 EndPaint( window_handle, &ps );
3697 #if(BACKGROUND_BITMAP)
3699 InvalidateRect( window_handle, &dlg_rect,
FALSE );
3709 idCtl = LOWORD( w_param );
3711 unsigned int result =
TRUE;
3712 bool end_dialog =
false;
3718 cd_drive = (int)(
szBuffer[0] -
'a' );
3720 #if(BACKGROUND_BITMAP)
3729 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_PREVIEWS Selected." ));
3732 unsigned int success;
3734 char filepath[MAX_PATH];
3757 std::wstring wFileName;
3761 const wchar_t *tmp = wFileName.c_str();
3765 hack[0] = (char)( *tmp & 0xFF );
3766 fname.append( hack );
3770 char newdir[MAX_PATH];
3771 char olddir[MAX_PATH];
3772 char filepath[MAX_PATH];
3774 GetCurrentDirectory(MAX_PATH, olddir);
3776 _snprintf(newdir, MAX_PATH,
"%ssupport",
szArgvPath);
3777 SetCurrentDirectory(newdir);
3779 _snprintf(filepath, MAX_PATH,
"%s%s",
szArgvPath, fname.c_str());
3781 unsigned int success;
3784 SetCurrentDirectory(olddir);
3804 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_CANCEL Selected." ));
3823 char volume_to_match[ MAX_PATH ];
3827 result =
Prompt_For_CD( window_handle, volume_to_match,
"Autorun:InsertCDROMWithVolume1",
"Autorun:ExitMessage2", &cd_drive );
3832 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_OK Selected." ));
3833 result =
GlobalMainWindow->Run_Setup( window_handle, &dlg_rect, cd_drive );
3834 }
else if ( idCtl ==
IDD_OK2 ) {
3835 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_OK2 Selected." ));
3837 }
else if (idCtl ==
IDD_OK3 ) {
3838 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_OK3 Selected, running WorldBuilder." ));
3840 }
else if (idCtl ==
IDD_OK4 ) {
3841 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_OK4 Selected, running PatchGet." ));
3862 char volume_to_match[ MAX_PATH ];
3870 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_VIEW_DEMO Selected." ));
3881 #if( SHOW_GAMESPY_BUTTON )
3886 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_GAMESPY Selected." ));
3902 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_NEW_ACCOUNT Selected." ));
3913 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_REGISTER Selected." ));
3924 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_INTERNET Selected." ));
3938 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_UPDATE Selected." ));
3949 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_EXPLORE Selected." ));
3958 Msg( __LINE__, TEXT(__FILE__), TEXT(
"IDD_UNINSTALL Selected." ));
3989 DeleteObject( hpal );
3992 DeleteObject( hBitmap );
3995 DeleteObject( hFlicker[i] );
3999 KillTimer( window_handle, timer_id );
4000 EndDialog( window_handle, idCtl );
4004 if ( hStaticBrush ) {
4005 DeleteObject( hStaticBrush );
4008 EndDialog( window_handle, idCtl );
4009 KillTimer( window_handle, timer_id );
4010 KillTimer( window_handle, gem_timer_id );
4021 if ( w_param == SC_CLOSE ) {
4022 #if(BACKGROUND_BITMAP)
4031 DeleteObject( hpal );
4034 DeleteObject( hBitmap );
4037 DeleteObject( hFlicker[i] );
4042 if ( hStaticBrush ) {
4043 DeleteObject( hStaticBrush );
4060 KillTimer( window_handle, timer_id );
4061 EndDialog( window_handle, w_param );
4070 #if( !BACKGROUND_BITMAP )
4071 case WM_SYSCOLORCHANGE:
4072 if ( hStaticBrush ) {
4073 DeleteObject( hStaticBrush );
4074 hStaticBrush = CreateSolidBrush( GetSysColor( COLOR_WINDOW ));
4098 #if( !BACKGROUND_BITMAP )
4100 if ( HIWORD( l_param ) == CTLCOLOR_STATIC ) {
4102 SetTextColor(( HDC )w_param, GetSysColor( COLOR_WINDOWTEXT ));
4103 SetBkColor( (HDC)wParam, GetSysColor( COLOR_WINDOW ));
4106 UnrealizeObject( hStaticBrush );
4107 point.x = point.y = 0;
4108 ClientToScreen( window_handle, &point );
4109 SetBrushOrgEx( (HDC)w_param, point.x, point.y,
NULL );
4110 return((LRESULT) hStaticBrush );
4117 #if(BACKGROUND_BITMAP)
4118 case WM_LBUTTONDOWN:
4125 mouse_x = LOWORD( l_param );
4126 mouse_y = HIWORD( l_param );
4143 InvalidateRect( window_handle, &rect,
FALSE );
4145 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_LBUTTONDOWN -- %s. rect = [%d,%d,%d,%d]."),
4146 ButtonList[i]->Return_Normal_Bitmap(), rect.left, rect.top, rect.right, rect.bottom );
4148 UpdateWindow( window_handle );
4160 #if(BACKGROUND_BITMAP)
4164 int focus_index = 0;
4165 int found_focus = -1;
4170 mouse_x = LOWORD( l_param );
4171 mouse_y = HIWORD( l_param );
4206 if ( found_focus == -1 ) {
4216 ButtonList[focus_index]->Return_Area ( &rect );
4217 InvalidateRect( window_handle, &rect,
FALSE );
4219 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_LBUTTONUP -- %s[FOCUS_STATE] = [x=%d, y=%d, w=%d, h=%d]."),
4220 ButtonList[ focus_index ]->Return_Normal_Bitmap(), rect.left, rect.top, rect.right, rect.bottom );
4222 UpdateWindow( window_handle );
4230 if( focus_index == found_focus ) {
4233 ButtonList[ found_focus ]->Return_Area ( &rect );
4234 InvalidateRect( window_handle, &rect,
FALSE );
4236 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_LBUTTONUP -- %s[FOCUS_STATE] = [x=%d, y=%d, w=%d, h=%d]."),
4237 ButtonList[ found_focus ]->Return_Normal_Bitmap(), rect.left, rect.top, rect.right, rect.bottom );
4239 UpdateWindow( window_handle );
4249 ButtonList[ focus_index ]->Return_Area ( &rect );
4250 InvalidateRect( window_handle, &rect,
FALSE );
4252 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_LBUTTONUP -- %s[NORMAL_STATE] = [x=%d, y=%d, w=%d, h=%d]."),
4253 ButtonList[ focus_index ]->Return_Normal_Bitmap(),
4254 rect.left, rect.top, rect.right, rect.bottom );
4256 UpdateWindow( window_handle );
4265 ButtonList[ found_focus ]->Return_Area ( &rect );
4266 InvalidateRect( window_handle, &rect,
FALSE );
4268 Msg( __LINE__, TEXT(__FILE__), TEXT(
"WM_LBUTTONUP -- %s[FOCUS_STATE] = [x=%d, y=%d, w=%d, h=%d]."),
4269 ButtonList[ found_focus ]->Return_Normal_Bitmap(), rect.left, rect.top, rect.right, rect.bottom );
4271 UpdateWindow( window_handle );
4279 nResult = UpdateWindow( window_handle );
4284 if ( found_focus >= 0 ) {
4287 (
ButtonList[found_focus]->Is_Mouse_In_Region( mouse_x, mouse_y ))) {
4288 SendMessage( window_handle, WM_COMMAND,
ButtonList[found_focus]->Return_Id(), 0L );
4300 #if(BACKGROUND_BITMAP)
4310 mouse_x = LOWORD( l_param );
4311 mouse_y = HIWORD( l_param );
4313 #if(USE_MOUSE_MOVES)
4336 if( CurrentButton != LastButton ) {
4348 if ( w_param & MK_LBUTTON ) {
4375 InvalidateRect( window_handle, &rect,
FALSE );
4382 UpdateWindow( window_handle );
4393 #if( USE_MOUSE_MOVES )
4398 if ( CurrentButton != 0 ) {
4400 LastButton = CurrentButton;
4405 if ( LastButton != PrevButton ) {
4406 PrevButton = LastButton;
4421 case WM_LBUTTONDBLCLK:
4423 InvalidateRect( window_handle, &dlg_rect,
TRUE );
4429 #if(BACKGROUND_BITMAP)
4442 SendMessage( window_handle, WM_SYSCOMMAND, SC_CLOSE, 0L );
4454 SendMessage( window_handle, WM_COMMAND,
ButtonList[i]->Return_Id(), 0L );
4469 int focused_button = 0;
4470 int next_button = 0;
4501 ButtonList[focused_button]->Return_Area ( &rect );
4502 InvalidateRect( window_handle, &rect,
FALSE );
4504 Msg( __LINE__, TEXT(__FILE__), TEXT(
"VK_DOWN/VK_TAB -- %s = [%s]."),
ButtonList[focused_button]->Return_Normal_Bitmap(),
"NORMAL_STATE" );
4513 ButtonList[next_button]->Return_Area ( &rect );
4514 InvalidateRect( window_handle, &rect,
FALSE );
4517 Msg( __LINE__, TEXT(__FILE__), TEXT(
"VK_DOWN/VK_TAB -- %s = [%s]."),
ButtonList[next_button]->Return_Normal_Bitmap(),
"FOCUS_STATE" );
4528 int focused_button = 0;
4529 int next_button = 0;
4537 if ( next_button < 0 ) {
4540 while (( next_button > 0 ) && !
ButtonList[ next_button ] ) {
4547 while (( next_button >= 0 ) && !
ButtonList[ next_button ] ) {
4560 ButtonList[focused_button]->Return_Area ( &rect );
4561 InvalidateRect( window_handle, &rect,
FALSE );
4563 Msg( __LINE__, TEXT(__FILE__), TEXT(
"VK_DOWN/VK_TAB -- %s = [%s]."),
ButtonList[focused_button]->Return_Normal_Bitmap(),
"NORMAL_STATE" );
4572 ButtonList[next_button]->Return_Area ( &rect );
4573 InvalidateRect( window_handle, &rect,
FALSE );
4576 Msg( __LINE__, TEXT(__FILE__), TEXT(
"VK_DOWN/VK_TAB -- %s = [%s]."),
ButtonList[next_button]->Return_Normal_Bitmap(),
"FOCUS_STATE" );