systemutilities.h

Go to the documentation of this file.
00001 //***************************************************************************
00002 // Copyright 2008 Autodesk, Inc.  All rights reserved.
00003 // Use of this software is subject to the terms of the Autodesk license agreement 
00004 // provided at the time of installation or download, or which otherwise accompanies 
00005 // this software in either electronic or hard copy form.
00006 //***************************************************************************
00007 
00008 #pragma once
00009 
00010 #ifndef _STRBASICS_
00011 #   include "strbasic.h"                // MCHAR
00012 #endif
00013 
00014 #include "strclass.h"
00015 
00017 UtilExport bool IsDebugging();
00018 
00020 UtilExport int  NumberOfProcessors();
00021 
00023 UtilExport bool IsWindows9x();
00024 
00026 UtilExport bool IsWindows98or2000();
00027 
00029 UtilExport int  GetScreenWidth();
00030 
00032 UtilExport int GetScreenHeight();
00033 
00035 UtilExport bool IsGetACPAsian();
00036 
00037 namespace MaxSDK
00038 {
00039 namespace Util
00040 {
00059     UtilExport WORD GetLanguageID();
00060 
00069     UtilExport const MCHAR* GetLanguageTLA();
00070 
00074     UtilExport bool CopyToClipBoard(const MCHAR* text, HWND hwnd);
00075 
00076 } // end namespace Util
00077 } // end namespace MaxSDK
00078 
00079 // CSIDL functions added 030110  --prs.
00080 
00081 UtilExport HRESULT UtilGetFolderPath(
00082     HWND hwndOwner, // just calls SFGetFolderPath()
00083     int nFolder, 
00084     HANDLE hToken, 
00085     DWORD dwFlags, 
00086     LPTSTR pszPath);
00087 
00088 // negative indices, refer to specCSID[] array in systemutilities.cpp
00089 
00093 
00094 
00095 #define APP_MAP_DIR            -1
00096 #define APP_FOLIAGE_DIR        -2
00097 #define APP_XREF_DIR           -3
00098 #define APP_PLUGIN_INI_DIR     -4
00099 #define APP_STDPLUGS_DIR       -5
00100 #define APP_PLUGINS_DIR        -6
00101 #define APP_FILELINK_DIR       -7
00102 #define APP_CATALOGS_DIR       -8
00103 #define APP_CUI_SCRIPTS_DIR    -9   // added 030224  --prs.
00104 // xavier robitaille | 03.02.05 | add textures dir. to bitmap paths
00105 #ifdef TEXTURES_DIR_BMP_SEARCH_PATH
00106 #define APP_INT_OFFSET         -1
00107 #define APP_TEXTURES_DIR       -10
00108 #else
00109 #define APP_INT_OFFSET         0
00110 #endif
00111 #define APP_CUI_DIR                 -10 + APP_INT_OFFSET
00112 #define APP_FX_DIR                  -11 + APP_INT_OFFSET    //!< Returns the hardware shader directory set in Configure Paths
00113 #define APP_CUI_WRITE_DIR           -12 + APP_INT_OFFSET
00114 #define APP_MARKET_DEF_WRITE_DIR    -13 + APP_INT_OFFSET
00115 #define APP_LAST_SPEC_DIR           -13 + APP_INT_OFFSET
00116 
00117 
00119 
00122 UtilExport bool IsUsingProfileDirectories();
00123 
00125 
00130 UtilExport bool IsUsingRoamingProfiles();
00131 
00133 
00142 UtilExport bool GetSpecDir(int index, const MCHAR *dirName, MCHAR *buf);    // get directory path
00143 
00145 
00154 UtilExport bool TryCSIDLDir(int csidl, const MCHAR *dirName, MCHAR *buf);   // create directory path
00155 
00156 UtilExport BOOL IsSSE();
00157 
00158 namespace MaxSDK
00159 {
00160 namespace Util
00161 {
00162     /* \brief scans a parent folder and all sub-folders for a file
00163        
00164        this function scans a directory tree (a parent folder and all sub-folders) in search of a file with the file name 'filename'.
00165        if filename is found, it returns true and an absolute path is saved in the parameter 'targetPath'. If 
00166        'filename' is not found, it returns false and the parameter targetpath is left unchanged
00167 
00168        param[in] treeroot absolute path to the parent directory
00169        param[in] filename the file that you are searching for
00170        param[out] the absolute path to the file you are searching for
00171 
00172        /returns true if if filename is successfully found, false otherwise
00173     */
00174     UtilExport bool ScanDirectoryTree(const MCHAR *treeroot, const MCHAR *filename, MSTR& targetpath );
00175 
00176 } // end namespace Util
00177 } // end namespace MaxSDK
00178 
00179