====== GetSystemDirectory() ====== [[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemdirectory.asp|GetSystemDirectory()]] returns the Windows System directory (typically C:\WINDOWS\SYSTEM), which is where most Windows DLLs are stored. The [[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemdirectory.asp|GetSystemDirectory()]] function, which exists in KERNEL32.DLL, is not declared in the DLL_KERNEL32 record in SYSPROCS. To use this function, we can create a new DLL_ record in SYSPROCS (for this example, DLL_TEST), and then run the [[declare_fcns|DECLARE_FCNS]] routine from the System Monitor to create a record in SYSOBJ that implements the call. The signature is similar to [[getwindowsdirectory|GetWindowsDirectory()]]. The DLL_TEST record in SYSPROCS is shown below: {{GetSystemDirectory.gif?646x100}} To create the object file $GETSYSTEMDIRECTORY, in SYSOBJ, which calls GetSystemDirectory(), run the [[declare_fcns|DECLARE_FCNS]] routine from the System Monitor. The output of a successful run is shown below. {{RunDLLTest.gif?409x180}} The code, coded from the click event of a button in an OpenInsight window, is shown below: declare function GetSystemDirectory sysDirectory = str(' ',255) retval = GetSystemDirectory( sysDirectory, 255) call msg(@window, 'System Directory is ' : sysDirectory[1,retval]) When the window is run, and the button is clicked, the output message is shown below: {{winsysdir.gif?284x98}}