3ds Max C++ API Reference
systemutilities.h File Reference
#include "strbasic.h"
#include "strclass.h"

Namespaces

 MaxSDK
 
 MaxSDK::Util
 
 MaxSDK::Graphics
 

Macros

AppPaths

These are the ID's of max's system paths

#define APP_MAP_DIR   -1
 System directory that points to <max data>/maps. More...
 
#define APP_FOLIAGE_DIR   -2
 System directory that points to <max data>/maps. More...
 
#define APP_XREF_DIR   -3
 System directory that points to <max data>/maps. More...
 
#define APP_PLUGIN_INI_DIR   -4
 System directory that points to <max data>/maps. More...
 
#define APP_STDPLUGS_DIR   -5
 System directory that points to <max data>/maps. More...
 
#define APP_PLUGINS_DIR   -6
 System directory that points to <max data>/maps. More...
 
#define APP_FILELINK_DIR   -7
 System directory that points to <max data>/maps. More...
 
#define APP_CATALOGS_DIR   -8
 System directory that points to <max data>/maps. More...
 
#define APP_CUI_SCRIPTS_DIR   -9
 System directory that points to <max data>/maps. More...
 
#define APP_INT_OFFSET   0
 System directory that points to <max data>/maps. More...
 
#define APP_CUI_DIR   -10 + APP_INT_OFFSET
 System directory that points to <max data>/maps. More...
 
#define APP_FX_DIR   -11 + APP_INT_OFFSET
 Returns the hardware shader directory set in Configure Paths. More...
 
#define APP_CUI_WRITE_DIR   -12 + APP_INT_OFFSET
 System directory that points to <max data>/maps. More...
 
#define APP_MARKET_DEF_WRITE_DIR   -13 + APP_INT_OFFSET
 System directory that points to <max data>/maps. More...
 
#define APP_SYS_PATH_UI_LN_DIR   -14 + APP_INT_OFFSET
 System directory that points to <max data>/maps. More...
 
#define APP_LAST_SPEC_DIR   -14 + APP_INT_OFFSET
 System directory that points to <max data>/maps. More...
 

Functions

UtilExport bool IsDebugging ()
 Returns true if 3ds Max is running under a debugger. More...
 
UtilExport int NumberOfProcessors ()
 Returns the number of processors in the system. More...
 
UtilExport int GetScreenWidth ()
 Returns the width of the screen (including multiple monitors) More...
 
UtilExport int GetScreenHeight ()
 Returns the height of the screen (including multiple monitors) More...
 
UtilExport void UseLanguagePackLocale (HMODULE hMyModule=reinterpret_cast< HMODULE >(&__ImageBase))
 Sets the locale for a DLL or thread to match that of the language pack being used at 3ds Max start up. More...
 
UtilExport WORD GetLanguageID ()
 Returns the identifier of the language used by 3ds Max. More...
 
UtilExport LANGID GetLocaleValue ()
 Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More...
 
UtilExport const MCHARGetLocaleValueAsHexString ()
 Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More...
 
UtilExport const MCHARGetLanguageTLA ()
 Returns the "three letter acronym" (TLA) of the language used by 3ds Max. More...
 
UtilExport const MCHARGetLanguagePackDirName ()
 Returns the two-two (eg "en-US" or "ja-JP") language pack directory for the language pack in use by 3ds Max. More...
 
UtilExport UINT CodePageForLanguage (LANGID)
 Returns the code page corresponding to the specified locale value. More...
 
UtilExport bool CopyToClipBoard (const MCHAR *text, HWND hwnd)
 copies a string to the system wide clipboard More...
 
UtilExport HRESULT UtilGetFolderPath (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, MSTR &path)
 
UtilExport bool IsUsingProfileDirectories ()
 Returns a value indicating whether the application is configured to use User Profiles or not. More...
 
UtilExport bool IsUsingRoamingProfiles ()
 Returns a value indicating whether the application is configured to use romaing User Profiles or not. More...
 
UtilExport bool GetSpecDir (int index, const MCHAR *dirName, MSTR &specPath)
 This function is used to convert a path relative to the 3ds max install to an absolute path. More...
 
UtilExport bool TryCSIDLDir (int csidl, const MCHAR *dirName, MSTR &csidlPath)
 This is a helper for creating standard windows CSIDL directories. More...
 
UtilExport BOOL IsSSE ()
 
UtilExport bool ScanDirectoryTree (const MCHAR *treeroot, const MCHAR *filename, MSTR &targetpath)
 
UtilExport MSTR CaptureCallStack (int skipFirstNStackLevels=3, int maxStackLevels=-1)
 
UtilExport MSTR GetVersionOfFile (const MCHAR *fileName)
 Returns the file version as a string of form "#.#.#.#" where the numbers are the major version, the update version, the Hot Fix number, and the build number. More...
 
UtilExport MSTR GetMaxBuildNumber ()
 Returns the 3ds Max build number as a string of form "#.#.#.#" where the numbers are the major version, the update version, the Hot Fix number, and the build number. More...
 
UtilExport InterfaceUtilGetCOREInterface ()
 Access to core interfaces from maxutil - no need to link against core.dll. More...
 
UtilExport Interface7UtilGetCOREInterface7 ()
 
UtilExport Interface8UtilGetCOREInterface8 ()
 
UtilExport Interface9UtilGetCOREInterface9 ()
 
UtilExport Interface10UtilGetCOREInterface10 ()
 
UtilExport Interface11UtilGetCOREInterface11 ()
 
UtilExport Interface12UtilGetCOREInterface12 ()
 
UtilExport Interface13UtilGetCOREInterface13 ()
 
UtilExport Interface14UtilGetCOREInterface14 ()
 
UtilExport Interface15UtilGetCOREInterface15 ()
 
UtilExport Interface16UtilGetCOREInterface16 ()
 
UtilExport Interface17UtilGetCOREInterface17 ()
 
MAX_DEPRECATED UtilExport Interface17UtilGetCOREInterface18 ()
 
MAX_DEPRECATED UtilExport Interface17UtilGetCOREInterface19 ()
 
UtilExport IPathConfigMgrUtilGetPathConfigMgr ()
 
UtilExport MaxSDK::Graphics::IDisplayManagerGetIDisplayManager ()
 Helper function to access the IDisplayManager core interface. More...
 
UtilExport bool IsGpuPresent ()
 Method that verifies if at least one GPU is present on the current system. More...
 

Variables

IMAGE_DOS_HEADER __ImageBase
 

Macro Definition Documentation

◆ APP_MAP_DIR

#define APP_MAP_DIR   -1

System directory that points to <max data>/maps.

◆ APP_FOLIAGE_DIR

#define APP_FOLIAGE_DIR   -2

System directory that points to <max data>/maps.

◆ APP_XREF_DIR

#define APP_XREF_DIR   -3

System directory that points to <max data>/maps.

◆ APP_PLUGIN_INI_DIR

#define APP_PLUGIN_INI_DIR   -4

System directory that points to <max data>/maps.

◆ APP_STDPLUGS_DIR

#define APP_STDPLUGS_DIR   -5

System directory that points to <max data>/maps.

◆ APP_PLUGINS_DIR

#define APP_PLUGINS_DIR   -6

System directory that points to <max data>/maps.

◆ APP_FILELINK_DIR

#define APP_FILELINK_DIR   -7

System directory that points to <max data>/maps.

◆ APP_CATALOGS_DIR

#define APP_CATALOGS_DIR   -8

System directory that points to <max data>/maps.

◆ APP_CUI_SCRIPTS_DIR

#define APP_CUI_SCRIPTS_DIR   -9

System directory that points to <max data>/maps.

◆ APP_INT_OFFSET

#define APP_INT_OFFSET   0

System directory that points to <max data>/maps.

◆ APP_CUI_DIR

#define APP_CUI_DIR   -10 + APP_INT_OFFSET

System directory that points to <max data>/maps.

◆ APP_FX_DIR

#define APP_FX_DIR   -11 + APP_INT_OFFSET

Returns the hardware shader directory set in Configure Paths.

◆ APP_CUI_WRITE_DIR

#define APP_CUI_WRITE_DIR   -12 + APP_INT_OFFSET

System directory that points to <max data>/maps.

◆ APP_MARKET_DEF_WRITE_DIR

#define APP_MARKET_DEF_WRITE_DIR   -13 + APP_INT_OFFSET

System directory that points to <max data>/maps.

◆ APP_SYS_PATH_UI_LN_DIR

#define APP_SYS_PATH_UI_LN_DIR   -14 + APP_INT_OFFSET

System directory that points to <max data>/maps.

◆ APP_LAST_SPEC_DIR

#define APP_LAST_SPEC_DIR   -14 + APP_INT_OFFSET

System directory that points to <max data>/maps.

Function Documentation

◆ IsDebugging()

UtilExport bool IsDebugging ( )

Returns true if 3ds Max is running under a debugger.

◆ NumberOfProcessors()

UtilExport int NumberOfProcessors ( )

Returns the number of processors in the system.

◆ GetScreenWidth()

UtilExport int GetScreenWidth ( )

Returns the width of the screen (including multiple monitors)

◆ GetScreenHeight()

UtilExport int GetScreenHeight ( )

Returns the height of the screen (including multiple monitors)

◆ UtilGetFolderPath()

UtilExport HRESULT UtilGetFolderPath ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwFlags,
MSTR path 
)

◆ IsUsingProfileDirectories()

UtilExport bool IsUsingProfileDirectories ( )

Returns a value indicating whether the application is configured to use User Profiles or not.

The application can be configured to use User Profiles.

Returns
true if the application uses User Profile directories

◆ IsUsingRoamingProfiles()

UtilExport bool IsUsingRoamingProfiles ( )

Returns a value indicating whether the application is configured to use romaing User Profiles or not.

The application can be configured to use roaming User Profiles. This value is dependent on whether the application uses User Profiles at all. Even if this returns true, if IsUsingProfileDirectories() returns false, then the application will default to the legacy path configuration locations under the application root install directory.

Returns
true if the application uses User Profile directories

◆ GetSpecDir()

UtilExport bool GetSpecDir ( int  index,
const MCHAR dirName,
MSTR specPath 
)

This function is used to convert a path relative to the 3ds max install to an absolute path.

This function is used to convert a path relative to the 3ds max install to an absolute path. For instance, this will yield the absolute path of the downloads directory:

GetSpecDir(APP_DOWNLOAD_DIR, _M("downloads"), buf);\n
#define APP_DOWNLOAD_DIR
The ID used to access the user defined location where downloaded files should be deposited by default...
Definition: MaxDirectories.h:240
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
UtilExport bool GetSpecDir(int index, const MCHAR *dirName, MSTR &specPath)
This function is used to convert a path relative to the 3ds max install to an absolute path.
Parameters
[in]index- The ID of the directory to return. This value should be one of AppPaths.
[in]dirName- The subdirectory to look for
[out]specPath- The resolved absolute path, or null string on failure.

/returns true if specPath was successfully resolved, false otherwise.

◆ TryCSIDLDir()

UtilExport bool TryCSIDLDir ( int  csidl,
const MCHAR dirName,
MSTR csidlPath 
)

This is a helper for creating standard windows CSIDL directories.

This function is a helper for creating standard windows CSIDL directories The list of possible root directories is shown in the windows header SHLOBJ.h. In particular, the TryCSIDLDir() function can be used to create CSIDL_LOCAL_APPDATA paths, where you can put application-specific data tailored to the current windows user.

Parameters
[in]csidl- The ID of the directory to return. Should be one of the windows CSIDL defines.
[in]dirName- specifies the relative pathname.
[out]csidlPath- The absolute path to the created CSIDL directory, or null string on failure.

/returns true if csidlPath was successfully created, false otherwise.

◆ IsSSE()

UtilExport BOOL IsSSE ( )

◆ UtilGetCOREInterface()

UtilExport Interface* UtilGetCOREInterface ( )

Access to core interfaces from maxutil - no need to link against core.dll.

◆ UtilGetCOREInterface7()

UtilExport Interface7* UtilGetCOREInterface7 ( )

◆ UtilGetCOREInterface8()

UtilExport Interface8* UtilGetCOREInterface8 ( )

◆ UtilGetCOREInterface9()

UtilExport Interface9* UtilGetCOREInterface9 ( )

◆ UtilGetCOREInterface10()

UtilExport Interface10* UtilGetCOREInterface10 ( )

◆ UtilGetCOREInterface11()

UtilExport Interface11* UtilGetCOREInterface11 ( )

◆ UtilGetCOREInterface12()

UtilExport Interface12* UtilGetCOREInterface12 ( )

◆ UtilGetCOREInterface13()

UtilExport Interface13* UtilGetCOREInterface13 ( )

◆ UtilGetCOREInterface14()

UtilExport Interface14* UtilGetCOREInterface14 ( )

◆ UtilGetCOREInterface15()

UtilExport Interface15* UtilGetCOREInterface15 ( )

◆ UtilGetCOREInterface16()

UtilExport Interface16* UtilGetCOREInterface16 ( )

◆ UtilGetCOREInterface17()

UtilExport Interface17* UtilGetCOREInterface17 ( )

◆ UtilGetCOREInterface18()

MAX_DEPRECATED UtilExport Interface17* UtilGetCOREInterface18 ( )
Deprecated:
This has been deprecated as of 3ds Max 2022, with Interface18 specific methods moved to Interface13

◆ UtilGetCOREInterface19()

MAX_DEPRECATED UtilExport Interface17* UtilGetCOREInterface19 ( )
Deprecated:
This has been deprecated as of 3ds Max 2022, with Interface19 specific methods moved to Interface14

◆ UtilGetPathConfigMgr()

UtilExport IPathConfigMgr* UtilGetPathConfigMgr ( )

Variable Documentation

◆ __ImageBase

IMAGE_DOS_HEADER __ImageBase