Previous  Next


int mb_get_os_environment( LPSTR lpszOutStr, LPCTSTR lpszVariable, int nStartIndex )



Returns the Operating System Environment variable from the OS.  If the variable has several items separated by a semicolon ";", then the index specifies the item number starting with first item being index 0.  The function returns the number of characters written to the output string.




char szFolder[_MAX_PATH];


int i = 0;


while ( mb_get_os_environment( szFolder, MB_ENV_INC, i++ ) > 0 )


  printf( "%s\n", szFolder );