Old fashion design for PC-104
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

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgIconFolder.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgIconFolder.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "LgIconFolder.h"
  16. #include "LgAux.h"
  17. BOOL CLgIconFolder::Unmake( LPCTSTR pFolderName )
  18. {
  19. if( !pFolderName )
  20. return FALSE;
  21. LPCTSTR pcszDesktopFileName = _T("desktop.ini");
  22. // remove pretty from old folder
  23. TCHAR pDesktopFileName[MAX_PATH];
  24. ::PathUnmakeSystemFolder( pFolderName );
  25. ::PathCombine( pDesktopFileName, pFolderName, pcszDesktopFileName );
  26. ::PathUnmakeSystemFolder( pDesktopFileName );
  27. return ::DeleteFile( pDesktopFileName );
  28. }
  29. BOOL CLgIconFolder::Make( LPCTSTR pFolderName, LPCTSTR pIconFileName, INT nIconID, LPCTSTR pInfoTip )
  30. {
  31. if( !pFolderName )
  32. return FALSE;
  33. // create target directory
  34. if( !LgCreateDirectory( pFolderName ) )
  35. return FALSE;
  36. LPCTSTR pcszSectionName = _T(".ShellClassInfo");
  37. LPCTSTR pcszDesktopFileName = _T("desktop.ini");
  38. // create "desktop.ini" file
  39. TCHAR pDesktopFileName[MAX_PATH];
  40. PathCombine( pDesktopFileName, pFolderName, pcszDesktopFileName );
  41. // write parameters
  42. WritePrivateProfileString( pcszSectionName, "ConfirmFileOp", "0", pDesktopFileName );
  43. WritePrivateProfileString( pcszSectionName, "InfoTip", pInfoTip, pDesktopFileName );
  44. WritePrivateProfileString( pcszSectionName, "IconFile", pIconFileName, pDesktopFileName );
  45. TCHAR pIconIndex[MAX_PATH];
  46. itoa( -nIconID, pIconIndex, 10 );
  47. WritePrivateProfileString( pcszSectionName, "IconIndex", pIconIndex, pDesktopFileName );
  48. // make directory as system
  49. PathMakeSystemFolder( pFolderName );
  50. return TRUE;
  51. }