BOOL CToneBalanceDlg::PreDoModal(LPVOID lpVoid) { m_bAutoPreview = GetDefaultInt(Quarter_bAuto_Str, YES); m_bPercentages = GetDefaultInt(Quarter_bPercent_Str, NO); m_bUseMidPer = GetDefaultInt(Quarter_bUseMidPer_Str, YES); m_nHSacrifice = GetDefaultInt(Quarter_HSacrifice_Str, 5); m_nSSacrifice = GetDefaultInt(Quarter_SSacrifice_Str, 5); return CPPMapDlg::PreDoModal(lpVoid); }
void dbgv( /***********************************************************************/ LPSTR lpFormat, LPTR lpArguments) { char szBuffer[512]; static int hFile, debug; static BOOL bReopen; if ( !debug ) // First time in... debug = GetDefaultInt( "debug", -1 ); if ( debug <= 0 ) return; if ( lpFormat ) { if ( !hFile ) { lstrcpy( szBuffer, Control.ProgHome ); lstrcat( szBuffer, "DEBUG.TXT" ); if ( bReopen ) { if ( (hFile = _lopen( szBuffer, OF_WRITE )) < 0 ) hFile = 0; else _llseek( hFile, 0L, 2 ); } else { if ( (hFile = _lcreat( szBuffer, 0 )) < 0 ) hFile = 0; } } if ( hFile ) { wvsprintf( szBuffer, lpFormat, (LPSTR)lpArguments ); lstrcat(szBuffer, "\r\n"); _lwrite( hFile, szBuffer, lstrlen(szBuffer) ); if (debug > 1) OutputDebugString(szBuffer); } } else if ( hFile ) { lstrcpy( szBuffer, "---------- CLOSED ----------\r\n" ); _lwrite( hFile, szBuffer, lstrlen(szBuffer) ); _lclose( hFile ); bReopen = YES; hFile = 0; } }
BOOL Bomb( HINSTANCE hInstance ) /************************************************************************/ { #ifdef _MAC return FALSE; #endif FNAME sz; BOOL bDisable, bPutDay1, bPutDay2; int iDay, iDay1, iDay2, iDaysInstalled; STRING szMessage; GetModuleFileName( hInstance, sz, sizeof(sz)-1); if ( !IsDemo( sz ) ) return( NO ); iDay = day(); iDay1 = GetProfileInt( "windows", "DeviceID", -1 ); iDay2 = GetDefaultInt( "DeviceID", -1 ); bPutDay1 = (iDay1 < 0); // If they can't be found, we'll write them out bPutDay2 = (iDay2 < 0); if ( bPutDay1 && bPutDay2 ) // First time running iDay1 = iDay2 = iDay; else if ( bPutDay1 ) // Windows was reinstalled (or different version) iDay1 = iDay2; else if ( bPutDay2 ) // PP was reinstalled iDay2 = iDay1; if ( bPutDay1 ) WriteProfileString( "windows", "DeviceID", itoa(iDay1,sz,10) ); if ( bPutDay2 ) PutDefaultInt( "DeviceID", iDay2 ); iDaysInstalled = iDay - min( iDay1, iDay2 ); if ( bDisable = (iDaysInstalled < 0 || iDaysInstalled >= 30) ) lstrcpy( szMessage, "\tTHIS COPY HAS EXPIRED" ); else wsprintf( szMessage, "You have %d days before this copy expires", 30 - iDaysInstalled ); Print( "Thank you for trying out this 30 day working copy of Crayola software.\n\n%ls.\n\nTo order your full version, use the enclosed offer card or call:\n\n\tUSA, Canada\t1-800-598-1930\n\tUnited Kingdom\t(+44) 0 483 747526\n\tScandanavia\t(+45) 43 43 26 77\n\tFrance\t\t(+33) 1 69 18 19 50\n\tGermany\t\t(+49) 089 260 3830\n\tAustralia/N.Z.\t(+61) 2 415 2642\n\tOthers call USA\t1-214-234-1769\n\t\t(rotary)\t1-214-234-6018", (LPSTR)szMessage ); return( bDisable ); }
static void HandleBrushSettings( int idTool, BOOL fPut ) /************************************************************************/ { LPSTR lp; BRUSHSETTINGS FAR *Br; STRING str; STRING tmp; LPSTR pName; int brush; if ( fPut ) return; // DON'T WRITE INTO THE INI JUST YET switch ( idTool ) { case IDC_PAINT: pName = "Paint"; break; case IDC_CRAYON: pName = "Crayon"; break; case IDC_MARKER: pName = "Marker"; break; case IDC_LINES: pName = "Lines"; break; case IDC_SHAPES: pName = "Shapes"; break; case IDC_ERASER: pName = "Eraser"; break; default: return; } /* set basic portion of property name */ lstrcpy( str, pName ); lp = str + lstrlen( str); if ( fPut ) SaveRetouchBrush( idTool ); /* set basic portion of property name */ lstrcpy( str, pName ); lp = str + lstrlen( str); brush = GetBrushIndex( idTool ); Br = &lpBrushSettings[brush]; lstrcpy( lp, "BrushShape"); if (fPut) PutDefaultString( str, itoa( Br->BrushShape - IDC_BRUSHCIRCLE, tmp, 10)); else Br->BrushShape = GetDefaultInt( str, 0 ) + IDC_BRUSHCIRCLE; lstrcpy( lp, "BrushSize"); if (fPut) PutDefaultString( str, itoa( Br->BrushSize, tmp, 10)); else Br->BrushSize = GetDefaultInt( str, 15 ); lstrcpy( lp, "Opacity"); if (fPut) PutDefaultString( str, itoa( Br->Opacity, tmp, 10)); else Br->Opacity = GetDefaultInt( str, 255 ); lstrcpy( lp, "Pressure"); if (fPut) PutDefaultString( str, itoa( Br->Pressure, tmp, 10)); else Br->Pressure = GetDefaultInt( str, 64 ); lstrcpy( lp, "MergeMode"); if (fPut) PutDefaultString( str, itoa( Br->MergeMode, tmp, 10)); else Br->MergeMode = (MERGE_MODE)GetDefaultInt( str, (int)MM_NORMAL ); lstrcpy( lp, "Feather"); if (fPut) PutDefaultString( str, itoa( Br->Feather, tmp, 10)); else Br->Feather = GetDefaultInt( str, 100 ); lstrcpy( lp, "StyleName" ); if ( fPut ) PutDefaultString( str, Retouch.StyleName ); else GetDefaultString( str, "", Retouch.StyleName, sizeof(FNAME) ); }