For DOS Protected Mode version of sensor core software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

59 lines
1.9 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: LgIconFolder.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of LgIconFolder.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "LgIconFolder.h"
#include "LgAux.h"
BOOL CLgIconFolder::Unmake( LPCTSTR pFolderName )
{
if( !pFolderName )
return FALSE;
LPCTSTR pcszDesktopFileName = _T("desktop.ini");
// remove pretty from old folder
TCHAR pDesktopFileName[MAX_PATH];
::PathUnmakeSystemFolder( pFolderName );
::PathCombine( pDesktopFileName, pFolderName, pcszDesktopFileName );
::PathUnmakeSystemFolder( pDesktopFileName );
return ::DeleteFile( pDesktopFileName );
}
BOOL CLgIconFolder::Make( LPCTSTR pFolderName, LPCTSTR pIconFileName, INT nIconID, LPCTSTR pInfoTip )
{
if( !pFolderName )
return FALSE;
// create target directory
if( !LgCreateDirectory( pFolderName ) )
return FALSE;
LPCTSTR pcszSectionName = _T(".ShellClassInfo");
LPCTSTR pcszDesktopFileName = _T("desktop.ini");
// create "desktop.ini" file
TCHAR pDesktopFileName[MAX_PATH];
PathCombine( pDesktopFileName, pFolderName, pcszDesktopFileName );
// write parameters
WritePrivateProfileString( pcszSectionName, "ConfirmFileOp", "0", pDesktopFileName );
WritePrivateProfileString( pcszSectionName, "InfoTip", pInfoTip, pDesktopFileName );
WritePrivateProfileString( pcszSectionName, "IconFile", pIconFileName, pDesktopFileName );
TCHAR pIconIndex[MAX_PATH];
itoa( -nIconID, pIconIndex, 10 );
WritePrivateProfileString( pcszSectionName, "IconIndex", pIconIndex, pDesktopFileName );
// make directory as system
PathMakeSystemFolder( pFolderName );
return TRUE;
}