Ejemplo n.º 1
0
COleDropTarget::COleDropTarget()
{
	// initialize local state
	m_hWnd = NULL;
	m_lpDataObject = NULL;
	m_nTimerID = 0xffff;

	AfxLockGlobals(CRIT_DROPTARGET);
	static BOOL bInitialized;
	if (!bInitialized)
	{
		// get scroll metrics from win.ini
		static const TCHAR szWindows[] = _T("windows");
		static const TCHAR szScrollDelay[] = _T("DragScrollDelay");
		static const TCHAR szScrollInset[] = _T("DragScrollInset");
		static const TCHAR szScrollInterval[] = _T("DragScrollInterval");

		nScrollInset = GetProfileInt(szWindows, szScrollInset, DD_DEFSCROLLINSET);
		nScrollDelay = GetProfileInt(szWindows, szScrollDelay, DD_DEFSCROLLDELAY);
		nScrollInterval = GetProfileInt(szWindows, szScrollInterval,
			DD_DEFSCROLLINTERVAL);

		// now initialized, no need to call Initialize any more
		bInitialized = TRUE;
	}
	AfxUnlockGlobals(CRIT_DROPTARGET);

	ASSERT_VALID(this);
}
Ejemplo n.º 2
0
/*
 * We don't offer SLM options unless we have seen a correct slm.ini file.
 *
 * Once we have seen a slm.ini, we log this in the profile and will permit
 * slm operations from then on. This function is called by the UI portions
 * of windiff: it returns TRUE if it is ok to offer SLM options.
 * Return 0 - This user hasn't touched SLM,
 *        1 - They have used SLM at some point (show basic SLM options)
 *        2 - They're one of us, so tell them the truth
 *        3 - (= 1 + 2).
 */
int
IsSLMOK(void)
{
    int Res = 0;;
    if(GetProfileInt(APPNAME, "SLMSeen", FALSE)) {
        // we've seen slm  - ok
        ++Res;
    } else {

        // haven't seen SLM yet - is there a valid slm enlistment in curdir?
        SLMOBJECT hslm;

        hslm = SLM_New(".");
        if (hslm != NULL) {

            // yes - current dir is enlisted. log this in profile
            SLM_Free(hslm);
            WriteProfileString(APPNAME, "SLMSeen", "1");
            ++Res;
        } else {
            // aparently not a SLM user.
        }
    }

    if(GetProfileInt(APPNAME, "SYSUK", FALSE)) {
        Res+=2;
    }
    return Res;
}
Ejemplo n.º 3
0
//
// Constructor
//
C[!output PROJECT_NAME]::C[!output PROJECT_NAME](TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr) :
    CTransformFilter(tszName, punk, CLSID_[!output PROJECT_NAME]),
    CPersistStream(punk, phr)
{
	// TODO: read parameters from profile
	m_[!output PROJECT_NAME]Parameters.param1 = GetProfileInt("[!output PROJECT_NAME]", "param1", 0);
	m_[!output PROJECT_NAME]Parameters.param2 = GetProfileInt("[!output PROJECT_NAME]", "param2", 0);
} 
Ejemplo n.º 4
0
void SetInternational(void)
   {
   static char cName[] = "intl";

   iDate = GetProfileInt(cName, "iDate",0);
   iTime = GetProfileInt(cName, "iTime",0);
   GetProfileString(cName, "sDate", "/", sDate,2);
   GetProfileString(cName, "sTime", ":", sTime, 2);
   GetProfileString(cName, "s1159","AM", sAMPM[0], 5);
   GetProfileString(cName, "s2359","PM", sAMPM[1], 5);
   }   
Ejemplo n.º 5
0
void CTimeMApp::LoadTitleSettings()
{
	TCHAR	szBakPath[MAX_PATH];
	GetModuleFileName(NULL, szBakPath, MAX_PATH);
	PathRemoveFileSpec(szBakPath);
	StringCbCat(szBakPath, MAX_PATH, _T("\\UserData"));

	m_Params.SetMaxBak(GetProfileInt(_T("Settings"), _T("MaxBackup"), 3));
	m_Params.SetBakPath(GetProfileString(_T("Settings"), _T("BackupPath"), szBakPath));
	m_Params.SetStartDelay(GetProfileInt(_T("Settings"), _T("StartDelay"), 0));
	m_Params.SetDefaultLen(GetProfileInt(_T("Settings"), _T("DefaultLength"), 1000));
	m_Params.SetAutoSave(GetProfileInt( _T("Settings"), _T("IsAutoSave"), TRUE));
	m_Params.SetZipToolsPath(GetProfileString( _T("Settings"), _T("ZipToolPath")));
}
Ejemplo n.º 6
0
BOOL LdapApp::InitInstance()
{
	// Standard initialization
#ifdef _WIN32
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
#endif

	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register document templates

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(LdapDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(LdapView));
	AddDocTemplate(pDocTemplate);

#ifdef _WIN32
	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;
#else
	// create a new (empty) document
	OnFileNew();

	if (m_lpCmdLine[0] != '\0')
	{
	}
#endif

	m_dirHost = GetProfileString( "Connection", "host", "localhost" );
	m_dirPort = GetProfileInt( "Connection", "port", 389 );
	m_searchBase = GetProfileString( "Search", "base", "dc=example,dc=com" );

	m_scope = GetProfileInt( "Search", "scope", LDAP_SCOPE_SUBTREE );
	m_searchFilter = GetProfileString( "Search", "filter", "objectclass=*" );

	return TRUE;
}
Ejemplo n.º 7
0
void CWordPadApp::LoadOptions()
{
	BYTE* pb = NULL;
	UINT nLen = 0;

	HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
	if (hFont == NULL)
		hFont = (HFONT)GetStockObject(ANSI_VAR_FONT);
	VERIFY(::GetObject(hFont, sizeof(LOGFONT), &m_lf));

	m_bWordSel = GetProfileInt(szSection, szWordSel, TRUE);
	TCHAR buf[2];
	buf[0] = NULL;
	GetLocaleInfo(GetUserDefaultLCID(), LOCALE_IMEASURE, buf, 2);
	int nDefUnits = buf[0] == '1' ? 0 : 1;
	SetUnits(GetProfileInt(szSection, szUnits, nDefUnits));
	m_bMaximized = GetProfileInt(szSection, szMaximized, (int)FALSE);

	if (GetProfileBinary(szSection, szFrameRect, &pb, &nLen))
	{
		ASSERT(nLen == sizeof(CRect));
		memcpy(&m_rectInitialFrame, pb, sizeof(CRect));
		delete pb;
	}
	else
		m_rectInitialFrame.SetRect(0,0,0,0);

	CRect rectScreen(0, 0, GetSystemMetrics(SM_CXSCREEN),
		GetSystemMetrics(SM_CYSCREEN));
	CRect rectInt;
	rectInt.IntersectRect(&rectScreen, &m_rectInitialFrame);
	if (rectInt.Width() < 10 || rectInt.Height() < 10)
		m_rectInitialFrame.SetRect(0, 0, 0, 0);

	if (GetProfileBinary(szSection, szPageMargin, &pb, &nLen))
	{
		ASSERT(nLen == sizeof(CRect));
		memcpy(&m_rectPageMargin, pb, sizeof(CRect));
		delete pb;
	}
	else
		m_rectPageMargin.SetRect(1800, 1440, 1800, 1440);

	m_optionsText.LoadOptions(szTextSection);
	m_optionsRTF.LoadOptions(szRTFSection);
	m_optionsWord.LoadOptions(szWordSection);
	m_optionsWrite.LoadOptions(szWriteSection);
	m_optionsIP.LoadOptions(szIPSection);
}
Ejemplo n.º 8
0
VOID  APIENTRY GetInternational()

{
  ENTER("GetInternational");

  GetProfileString(szInternational, "sShortDate", szShortDate, szShortDate, 11);
  AnsiUpper(szShortDate);
  GetProfileString(szInternational, "sTime", szTime, szTime, 2);
  GetProfileString(szInternational, "s1159", sz1159, sz1159, 9);
  GetProfileString(szInternational, "s2359", sz2359, sz2359, 9);
  GetProfileString(szInternational, "sThousand", szComma, szComma, sizeof(szComma));
  iTime   = GetProfileInt(szInternational, "iTime", iTime);
  iTLZero = GetProfileInt(szInternational, "iTLZero", iTLZero);

  LEAVE("GetInternational");
}
Ejemplo n.º 9
0
BOOL CMineApp::InitInstance()
{
	SetRegistryKey("CSER_513_2");
	m_uXMineNum = GetProfileInt(GAME_SETTING, CUSTOM_XNUM, PRIMARY_XNUM);
	m_uYMineNum = GetProfileInt(GAME_SETTING, CUSTOM_YNUM, PRIMARY_YNUM);

	//定义并注册MineWnd窗口
	m_pMineWnd = new CMineWnd();
	WNDCLASS wc;
	ZeroMemory(&wc, sizeof(wc));
	wc.hInstance = AfxGetInstanceHandle();
	wc.lpfnWndProc = ::DefWindowProc;
	wc.hbrBackground = NULL;
	wc.hCursor = LoadCursor(IDC_ARROW);
	wc.hIcon = LoadIcon(IDR_MAINFRAME);
	wc.lpszClassName = className;
	wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
	// register the minewnd class
	//注册窗口
	if (!AfxRegisterClass(&wc)) 
	{
		AfxMessageBox("注册类失败!");
		return FALSE;
	}

	// get the minewnd coordinates, width and height
	UINT uWidth = DEFAULT_FRAME_X + m_uXMineNum * MINE_WIDTH +
				LINE_WIDTH_0 * 3 + SIDE_WIDTH_0 + SIDE_WIDTH_1;
	UINT uHeight = DEFAULT_FRAME_Y + m_uYMineNum * MINE_HEIGHT + 
				LINE_WIDTH_0 * 3 + SIDE_WIDTH_0 * 2 + SIDE_WIDTH_1 + SHELL_S_H;
	UINT uXPos = GetSystemMetrics(SM_CXSCREEN) / 2 - uWidth / 2;
	UINT uYPos = GetSystemMetrics(SM_CYSCREEN) / 2 - uHeight / 2;
	//创建窗口
	if ( !m_pMineWnd->CreateEx( NULL, className, _T("扫雷"), 
		WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX, 
		uXPos, uYPos, uWidth, uHeight,
		NULL, NULL) ) 
	{
		AfxMessageBox("创建主窗口失败!");
		return FALSE;
	}
	// 绑定该窗口为主窗口
	m_pMainWnd = m_pMineWnd;
	//显示窗口
	m_pMineWnd->ShowWindow(SW_NORMAL);
	return TRUE;
}
Ejemplo n.º 10
0
void CRegistry::LoadTransferParam(TransferParam &tp, CString pszKey) {
    CCrypto crypt;
    if (Open(pszKey) == ERROR_SUCCESS) {
        tp.iService      = GetProfileInt(_T("Service"), UPLOAD_FTP);   
        tp.csServer      = GetProfileString(_T("Server"), _T(""));
        tp.nPort         = GetProfileInt(_T("Port"), DEFAULT_FTP_PORT);   
        tp.csUsername    = GetProfileString(_T("Username"), _T(""));
        tp.bSavePassword = GetProfileInt(_T("SavePassword"), TRUE);   
        if (tp.bSavePassword) {
            CString csPassword = GetProfileString(_T("Password"), _T(""));
            tp.csPassword = crypt.Decode(csPassword);
        }
        tp.csDirectory   = GetProfileString(_T("Directory"), _T("/"));

        Close();
    }
}
Ejemplo n.º 11
0
	BOOL InitInstance() {
		if (!__super::InitInstance()) {
			return FALSE;
		}

		_WIDTH = GetProfileInt(_T("SubtitleSource"), _T("w"), 640);
		_HEIGHT = GetProfileInt(_T("SubtitleSource"), _T("h"), 480);
		_ATPF = GetProfileInt(_T("SubtitleSource"), _T("atpf"), 400000);
		if (_ATPF <= 0) {
			_ATPF = 400000;
		}
		WriteProfileInt(_T("SubtitleSource"), _T("w"), _WIDTH);
		WriteProfileInt(_T("SubtitleSource"), _T("h"), _HEIGHT);
		WriteProfileInt(_T("SubtitleSource"), _T("atpf"), _ATPF);

		return TRUE;
	}
Ejemplo n.º 12
0
void ReadSettings() {
  // Read in the prefs
	prf_use_GetUpdateRect = GetProfileInt(
		"use_GetUpdateRect",
		TRUE
		);

	prf_use_Timer = GetProfileInt(
		"use_Timer",
		FALSE
		);
	prf_use_KeyPress = GetProfileInt(
		"use_KeyPress",
		TRUE
		);
	prf_use_LButtonUp = GetProfileInt(
		"use_LButtonUp",
		TRUE
		);
	prf_use_MButtonUp = GetProfileInt(
		"use_MButtonUp",
		TRUE
		);
	prf_use_RButtonUp = GetProfileInt(
		"use_RButtonUp",
		TRUE
		);
	prf_use_Deferral = GetProfileInt(
		"use_Deferral",
		TRUE
		);
}
Ejemplo n.º 13
0
Archivo: FAXC.C Proyecto: hollylee/EZP
void  GetFaxConfig()
{
    char str[80];

    GetProfileInt( ProfileName,FaxSection, ComEntry, &ComX, 2);
    GetProfileInt( ProfileName,FaxSection, AutoDialEntry, &fTelManualDial, 0);
    GetProfileInt( ProfileName,FaxSection, ToneLineEntry, &fTelTone, 1);
    GetProfileString( ProfileName,FaxSection, "InitString", InitStr, "AT&F&C1&D2");
    GetProfileString( ProfileName,FaxSection, LocalIdEntry, str, "");
    str[20]=0;
    strcpy(LocalTelId,str);
    GetProfileString( ProfileName,FaxSection, DialNumEntry, str, "");
    if(access("c:\\DOS\\韩兆强的",F_OK)==0)
        strcpy(str,"62282931");

    str[20]=0;
    strcpy(DialNumber,str);
}
Ejemplo n.º 14
0
// BabakJ: replaced int ret type with WORD2DWORD
WORD2DWORD GetIniInt(INT idsTopic, INT idsItem, INT wDefault)
{
    TCHAR szItem[32];
    TCHAR szTopic[32];

    CchString(szTopic, idsTopic);
    CchString(szItem, idsItem);

    return GetProfileInt(szTopic, szItem, wDefault);
}
void CGrannyViewerApp::ReadConfig()
{
	pDebug.SetLoglevel(GetProfileInt("log", "level", LEVEL_INFO3));

	nConfig::logTextChunk = (bool)GetProfileInt("log", "textchunk", FALSE);
	nConfig::logMesh = (bool)GetProfileInt("log", "mesh", FALSE);
	nConfig::logObject = (bool)GetProfileInt("log", "object", FALSE);
	nConfig::logObjPtr = (bool)GetProfileInt("log", "objptr", FALSE);
	nConfig::logBone = (bool)GetProfileInt("log", "bone", TRUE);
	nConfig::logBoneObj = (bool)GetProfileInt("log", "boneobj", FALSE);
	nConfig::logBoneAnim = (bool)GetProfileInt("log", "boneanim", FALSE);
}
Ejemplo n.º 16
0
BOOL CPrinterInfo::GetDefaultReverseLandscape(void)
{
	BOOL f;
	if ((f = GetProfileInt(ENTRY_ReverseLandscape, (UINT)-1)) != -1)
	{
		return f;
	}

	// By default, all DJ's have reverse landscape set.
	return IsDeskJet();
}
Ejemplo n.º 17
0
void CWinApp::LoadStdProfileSettings( UINT nMaxMRU )
/**************************************************/
{
    ASSERT( m_pRecentFileList == NULL );
    if( nMaxMRU > 0 ) {
        m_pRecentFileList = new CRecentFileList( ID_FILE_MRU_FILE1, _MRUSection,
                                                 _MRUEntry, nMaxMRU );
        m_pRecentFileList->ReadList();
    }
    GetProfileInt( _PreviewSection, _PreviewEntry, 0 );
}
Ejemplo n.º 18
0
/**************************** Function Header ******************************
 * iGetCountry
 *      Called to get the user's country code.
 *
 * RETURNS:
 *      Country code for the invoking user.
 *
 * HISTORY:
 *
 *  10:37 on Fri 19 Jan 1996    -by-    Ganesh Pandey   [ganeshp]
 *      First incarnation.
 *
 ***************************************************************************/
int
iGetCountry()
{

    DWORD   dwCountry;            /* The country code */


    dwCountry = (DWORD)GetProfileInt( L"intl", L"icountry", USA_COUNTRYCODE );


    return   (int)dwCountry;
}
Ejemplo n.º 19
0
void WINAPI DbgInitialise(HINSTANCE hInst) {
    InitializeCriticalSection(&m_CSDebug);
    m_bInit = TRUE;

    m_hInst = hInst;
    DbgInitModuleName();
    if(GetProfileInt(m_ModuleName, TEXT("BreakOnLoad"), 0))
        DebugBreak();
    DbgInitModuleSettings(false);
    DbgInitGlobalSettings(true);
    dwTimeOffset = timeGetTime();
}
Ejemplo n.º 20
0
Archivo: Reno.cpp Proyecto: m1h4/Reno
BOOL CRenoApp::InitFonts()
{
	// Read from ini
	CString name = GetProfileString(TEXT("Font"),TEXT("Name"),TEXT("Courier New"));
	ULONG height = GetProfileInt(TEXT("Font"),TEXT("Height"),14);

	// Create the default fonts
	m_Fonts[RENO_FONT_NORMAL].CreateFont(height,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,0,0,0,0,name);
	m_Fonts[RENO_FONT_BOLD].CreateFont(height,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,0,0,0,0,name);
	m_Fonts[RENO_FONT_ITALIC].CreateFont(height,0,0,0,FW_NORMAL,TRUE,0,0,DEFAULT_CHARSET,0,0,0,0,name);
	m_Fonts[RENO_FONT_UNDERLINE].CreateFont(height,0,0,0,FW_NORMAL,0,TRUE,0,DEFAULT_CHARSET,0,0,0,0,name);

	return TRUE;
}
Ejemplo n.º 21
0
void FAR PASCAL FontInit (void)
{
    LOGFONT lf;
    char    text[20];

    if (GetProfileString (ProgName, "CharSet", "", text, 20)) {
        if (isdigit(text[0])) { /* pure numeric value */
            lf.lfCharSet = atoi (text);
        }
        else {  /* menmonic value */
	    if (strncmp (text, "OEM", 3) == 0) {
		lf.lfCharSet = OEM_CHARSET;
	    }
	    else lf.lfCharSet = ANSI_CHARSET;
	}
	lf.lfHeight = GetProfileInt (ProgName, "FontHeight", 0);
	lf.lfWidth = GetProfileInt (ProgName, "FontWidth", 0);
	lf.lfEscapement = 0;
	lf.lfOrientation = 0;
	lf.lfWeight = GetProfileInt (ProgName, "FontWeight", 400);
	lf.lfItalic = 0;
	lf.lfUnderline = 0;
	lf.lfStrikeOut = 0;
	lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
	lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
	lf.lfQuality = DEFAULT_QUALITY;
	lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
        GetProfileString (ProgName, "FontName", "",
                          lf.lfFaceName, LF_FACESIZE);

        hEmacsFont = CreateFontIndirect (&lf);
    }
    else {  /* no CharSet entry, default to SYSTEM_FIXED_FONT */
	hEmacsFont = 0;
    }
    BuildCellMetrics (&EmacsCM, hEmacsFont);
} /* FontInit */
Ejemplo n.º 22
0
// copy the registry prefs into the SQLite database into table 'prefs'
int CMUSHclientApp::PopulateDatabase (void)
  {

  SetRegistryKey ("Gammon Software Solutions");

  int i;
  int db_rc = SQLITE_OK;

  for (i = 0; GlobalOptionsTable [i].pName; i++)
    {
    const char * p = (const char *) this +  GlobalOptionsTable [i].iOffset;
    const int Value = GetProfileInt ("Global prefs",  
                                GlobalOptionsTable [i].pName, 
                                GlobalOptionsTable [i].iDefault);

    db_rc = db_execute ((LPCTSTR) CFormat ("INSERT INTO prefs (name, value) VALUES ('%s', %i)",
                        GlobalOptionsTable [i].pName, Value), true);

    if (db_rc != SQLITE_OK)
      return db_rc;
    };

  for (i = 0; AlphaGlobalOptionsTable [i].pName; i++)
    {
    const char * p = (const char *) this +  AlphaGlobalOptionsTable [i].iOffset;

    // fix up the fixed-pitch font
    if (strcmp (AlphaGlobalOptionsTable [i].pName, "DefaultInputFont") == 0 ||
        strcmp (AlphaGlobalOptionsTable [i].pName, "DefaultOutputFont") == 0 ||
        strcmp (AlphaGlobalOptionsTable [i].pName, "FixedPitchFont") == 0)
       AlphaGlobalOptionsTable [i].sDefault = (LPCTSTR) m_strFixedPitchFont;
    
    CString strValue = GetProfileString ("Global prefs",  
                                AlphaGlobalOptionsTable [i].pName, 
                                AlphaGlobalOptionsTable [i].sDefault);

    strValue.Replace ("'", "''");  // fix up quotes

    db_rc = db_execute ((LPCTSTR) CFormat ("INSERT INTO prefs (name, value) VALUES ('%s', '%s')",
                        AlphaGlobalOptionsTable [i].pName, (LPCTSTR) strValue), true);

    if (db_rc != SQLITE_OK)
      return db_rc;

    };

   return SQLITE_OK;

  }  // end of CMUSHclientApp::PopulateDatabase 
Ejemplo n.º 23
0
LRESULT TransGetMNTable( HIMC hImc, LPIMESTRUCT lpIme)
{
    LPSTR   lpMnemonic;
    int     iCount, iCIM;

    UNREFERENCED_PARAMETER(hImc);

    lpMnemonic = (LPSTR)(lpIme->lParam1);
// BUGBUG: Will be changed to use Registry instead of WIN.INI
    iCIM = GetProfileInt(L"WANSUNG", L"InputMethod", IDD_2BEOL) - IDD_2BEOL;
    for (iCount = 0; iCount < 96; iCount++, lpMnemonic += 2)
        {
        *lpMnemonic = LOBYTE(HMNTable[iCIM][iCount]);
        *(lpMnemonic+1) = HIBYTE(HMNTable[iCIM][iCount]);
        }
    return TRUE;
}
Ejemplo n.º 24
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 );
}
Ejemplo n.º 25
0
int NEAR PASCAL MyGetProfileInt(WORD wAppName, WORD wKey, int nDefault)
{
   HANDLE hAppName, hKey;

   if(!(hAppName=MyLoadString(wAppName, NULL, LMEM_MOVEABLE)))
      goto Error1;
   if(!(hKey=MyLoadString(wKey, NULL, LMEM_MOVEABLE)))
      goto Error2;

   nDefault = GetProfileInt(LocalLock(hAppName), LocalLock(hKey), nDefault);

   LocalUnlock(hKey);
   LocalUnlock(hAppName);
Error2:
   LocalFree(hKey);
Error1:
   LocalFree(hAppName);
   return(nDefault);
}
Ejemplo n.º 26
0
int GetDefaultInt( LPSTR lpKeyName, int nDefault )
/************************************************************************/
{
LPSTR lp;

#ifdef PRIVATE_INI
if ( !szPreferenceFile[0] )
	{
	if ( !AstralStr( IDS_INIFILE, &lp ) ) lp = PRIVATE_INI;
	lstrcpy( szPreferenceFile, lp );
	GetIniPath( szPreferenceFile );
	}
return( GetPrivateProfileInt( ID_APPL, stripstruct(lpKeyName),
	nDefault, szPreferenceFile ) );

#else
return( GetProfileInt( ID_APPL, stripstruct(lpKeyName), nDefault ) );
#endif
}
Ejemplo n.º 27
0
VOID
SecMgrpWarnOfAutologon(
    HWND hwnd
    )
/*++

Routine Description:

    This function checks to see if autologon is turned on.
    If it is, a warning is put up to warn the user.  There is
    no UI in this utility which allows the user to change this.
    Therefore, tell the user how to do it with REGEDT32.


    
Arguments

    hwnd - Window handle.


Return Values:

    None.
    
    
--*/
{


    if (GetProfileInt( TEXT("Winlogon"), TEXT("AutoAdminLogon"), 0 ) != 0) {

       DialogBoxParam(SecMgrphInstance,
                      MAKEINTRESOURCE(SECMGR_ID_DLG_AUTOLOGON_ENABLED),
                      hwnd,
                      (DLGPROC)SecMgrpDlgProcWarnOfAutologon,
                      (LONG)0
                      );
    }

    return;
}
BOOL CXTPRegistryManager::GetProfileDword(LPCTSTR lpszSection, LPCTSTR lpszEntry, DWORD* dwResult)
{
	ASSERT(lpszSection != NULL);
	ASSERT(lpszEntry != NULL);

	if (m_strINIFileName.IsEmpty())
	{
		CHKey hSecKey(GetSectionKey(lpszSection, KEY_READ));
		if (hSecKey == NULL)
			return FALSE;

		DWORD dwType, dwCount;
		m_lResult = ::RegQueryValueEx(hSecKey, (LPTSTR)lpszEntry, NULL, &dwType,
			NULL, &dwCount);

		if (m_lResult != ERROR_SUCCESS)
			return FALSE;

		ASSERT(dwType == REG_DWORD);
		m_lResult = ::RegQueryValueEx(hSecKey, (LPTSTR)lpszEntry, NULL, &dwType,
			(LPBYTE)dwResult, &dwCount);

		if (m_lResult != ERROR_SUCCESS)
			return FALSE;

		ASSERT(dwType == REG_DWORD);
		return TRUE;
	}
	else
	{
		ASSERT(m_strINIFileName.IsEmpty() == FALSE);

		CString str = GetProfileString(lpszSection, lpszEntry, NULL);
		if (str.IsEmpty())
			return FALSE;

		*dwResult = (DWORD)GetProfileInt(lpszSection, lpszEntry, 0);
		return TRUE;
	}
}
Ejemplo n.º 29
0
/* %%Function:FInitCvt %%Owner:peterj */
BOOL FInitCvt()
{
	BOOL    fRetry = fTrue;

LRetry:

	if (vhsttbCvt == hNil)
		{
		int     i, iMac;
		BOOL    fValid;
		CHAR   *pchApnd, *pchApndSv;
		int     cch;
		CHAR    szKey[ichMaxCvtKey];
		CHAR    szBuf[ichMaxCvt];

		if ((vhsttbCvt = HsttbInit(0, fTrue/*fExt*/)) == hNil)
			return fFalse;

		Assert(cbCvtNum < ichMaxCvtKey);
		bltbx((CHAR FAR *) szCvtNum, (CHAR FAR *) szKey, cbCvtNum);

		iMac = GetProfileInt((CHAR FAR *) szApp, (CHAR FAR *) szKey, 0);
		bltbx((CHAR FAR *) szCvt, (CHAR FAR *) szKey, cbCvt);

		if (iMac >= 0)
			{
			pchApndSv = szKey + cbCvt - 1;
			for (i = 0; i < iMac; i++)
				{
				pchApnd = pchApndSv;
				CchIntToPpch(i + 1, &pchApnd);
				*pchApnd = '\0';
				cch = GetProfileString((CHAR FAR *) szApp, 
						(CHAR FAR *) szKey,
						(CHAR FAR *) szEmpty,
						(CHAR FAR *) szBuf, ichMaxCvt);
#ifdef SHOWCVT
				CommSzSz(SzShared("Converter String Read: "), szBuf);
#endif
				if ((cch = CchStripString(szBuf, cch)) == 0 ||
						ItMaxInSz(szBuf) < itCvtExtMin)
					{
					continue;
					}

				SzToStInPlace(szBuf);
				if (IbstAddStToSttb(vhsttbCvt, szBuf) == ibstNil)
					break;
				}
			}
		}

	if (vhsttbCvt != hNil && (*vhsttbCvt)->ibstMac == 0 && vpexcr == NULL
			&& fRetry)
		{
		BOOL fAnyFound;
		struct EXCR excr;
		fRetry = fFalse;
		InitExcr(&excr);
		fAnyFound = FFindOtherConvtrs();
		FreeExcr(&excr);
		if (fAnyFound)
			{
			FreePh(&vhsttbCvt);
			goto LRetry;
			}
		}

	return fTrue;
}
Ejemplo n.º 30
0
int CBCGPGanttDemoApp::GetSectionInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nDefault /*= 0*/)
{
    return GetProfileInt(lpszSection, lpszEntry, nDefault);
}