* :--------------------------------------- * ------------------------: Copybook for GetWindowsDirectory. * : * : See the documentation for details. * :--------------------------------------- * To use: * * COPY WIN32API. * COPY GWINDIR. * . * . * : Set the type of directory you are * : looking for... (see list below) * SET GFP-PERSONAL TO TRUE * * ------------------------: Call the API to get the directory. * * SET API-GETFOLDERPATH TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * GFP-DIRECTORY-NAME * GFP-TYPE-OF-DIRECTORY * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : display a textual error message. * * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to display my-error-message. * * * ---------------------------------------------------------------- * * 01 GFP-DIRECTORY-NAME PIC X(1024). 01 GFP-TYPE-OF-DIRECTORY PIC X(4). * Description follows each item. CAUTION: Those items * that mention Version 6 refer to Windows XP only, * and may not be available on all operating systems. * Avoid using these unless you can control which platform * your users will use. Also check for exceptions in each * specific 88 value. Always test on every platform. * * --->Those items marked with !! and referencing a VIRTUAL folder * !! are not likely open-able in cobol, and should probably not * be used as parts of file names EVEN IF you are able to * retrieve its value with this api call. * Frequently this API call will not return any value for * virtual directories. * * If WIN32API-RC = 2 it means that the request was valid * for this version of windows, but the directory requested * did not actually exist. * 88 GFP-FLAG-CREATE VALUE X'00800000'. * Version 5.0. Combine this value with any of the * following values to force the creation of the * associated folder. (Somewhat Dangerous). * 88 GFP-ADMINTOOLS VALUE X'30000000'. * Version 5.0. The file system directory * that is used to store administrative tools * for an individual user. The Microsoft * Management Console (MMC) will save * customized consoles to this directory, * and it will roam with the user. * 88 GFP-ALTSTARTUP VALUE X'1D000000'. * The file system directory that * corresponds to the users nonlocalized * Startup program group. * 88 GFP-APPDATA VALUE X'1A000000'. * Version 4.71. The file system directory * that serves as a common repository for * application-specific data. A typical path * is C:\Documents and Settings\username\ * Application Data. * NOTE: You can use this to obtain the users * "My Documents" folder for all versions * of windows by just truncating the * "Application Data" subsirectory. * Do not count on the "username" portion * being present on win9x systems. * * 88 GFP-BITBUCKET VALUE X'0A000000'. * !! The VIRTUAL folder containing the objects * in the users Recycle Bin. * 88 GFP-CDBURN-AREA VALUE X'3B000000'. * Version 6.0. The file system directory * acting as a staging area for files * waiting to be written to CD. A typical * path is C:\Documents and Settings\ * username\Local Settings\Application * Data\Microsoft\CD Burning. * 88 GFP-COMMON-ADMINTOOLS VALUE X'2F000000'. * Version 5.0. The file system directory * containing administrative tools for all * users of the computer. * 88 GFP-COMMON-ALTSTARTUP VALUE X'1E000000'. * The file system directory that * corresponds to the nonlocalized Startup * program group for all users. Valid only * for Microsoft Windows NT systems. * 88 GFP-COMMON-APPDATA VALUE X'23000000'. * Version 5.0. The file system directory * containing application data for all users. * A typical path is * C:\Documents and Settings\All * Users\Application Data. * 88 GFP-COMMON-DESKTOPDIRECTORY VALUE X'19000000'. * The file system directory that contains * files and folders that appear on the * desktop for all users. A typical path * is C:\Documents and Settings\All * Users\Desktop. Valid only for Windows NT * 88 GFP-COMMON-DOCUMENTS VALUE X'2E000000'. * The file system directory that contains * documents that are common to all users. * A typical paths is * C:\Documents and Settings\All * Users\Documents. * Valid for Windows NT systems and Windows * 95 and Windows 98 systems with * Shfolder.dll installed. * 88 GFP-COMMON-FAVORITES VALUE X'1F000000'. * The file system directory that serves as * a common repository for favorite items * common to all users. Valid only for * Windows NT systems. * 88 GFP-COMMON-MUSIC VALUE X'35000000'. * Version 6.0. The file system directory * that serves as a repository for music * files common to all users. * A typical path is C:\Documents and * Settings\All Users\Documents\My Music. * 88 GFP-COMMON-PICTURES VALUE X'36000000'. * Version 6.0. The file system directory * that serves as a repository for image * files common to all users. * A typical path is C:\Documents and * Settings\All Users\Documents\My Pictures. * 88 GFP-COMMON-PROGRAMS VALUE X'17000000'. * The file system directory that contains * the directories for the common program * groups that appear on the Start menu for * all users. A typical path is C:\Documents * and Settings\All Users\Start Menu\Programs. * Valid only for Windows NT systems. * 88 GFP-COMMON-STARTMENU VALUE X'16000000'. * The file system directory that contains * the programs and folders that appear on * the Start menu for all users. A typical * path is C:\Documents and Settings\All * Users\Start Menu. Valid only for Windows * NT systems. * 88 GFP-COMMON-STARTUP VALUE X'18000000'. * The file system directory that contains * the programs that appear in the Startup * folder for all users. A typical path is * C:\Documents and Settings\All Users\Start * Menu\Programs\Startup. Valid only for NT. * 88 GFP-COMMON-TEMPLATES VALUE X'2D000000'. * The file system directory that contains * the templates that are available to all * users. A typical path is C:\Documents * and Settings\All Users\Templates. * Valid only for Windows NT systems. * 88 GFP-COMMON-VIDEO VALUE X'37000000'. * Version 6.0. The file system directory * that serves as a repository for video * files common to all users. A typical path * is C:\Documents and Settings\All * Users\Documents\My Videos. * 88 GFP-CONTROLS VALUE X'03000000'. * !! The VIRTUAL folder containing icons for * the Control Panel applications. * 88 GFP-COOKIES VALUE X'21000000'. * The file system directory that serves as * a common repository for Internet cookies. * A typical path is C:\Documents and * Settings\username\Cookies. * 88 GFP-DESKTOP VALUE X'00000000'. * !! The VIRTUAL folder representing the * Windows desktop, the root of the namespace. * Use GFP-DESKTOPDIRECTORY for cobol. * 88 GFP-DESKTOPDIRECTORY VALUE X'10000000'. * The file system directory used to * physically store file objects on the * desktop (not to be confused with the * desktop folder itself). A typical path is * C:\Documents and Settings\username\Desktop. * 88 GFP-DRIVES VALUE X'11000000'. * !! The VIRTUAL folder representing * My Computer, containing everything on the * local computer: storage devices, printers * and Control Panel. The folder may also * contain mapped network drives. * 88 GFP-FAVORITES VALUE X'06000000'. * The file system directory that serves as * a common repository for the users * favorite items. A typical path is * C:\Documents and Settings\username\Favorites. * 88 GFP-FONTS VALUE X'14000000'. * !! A VIRTUAL folder containing fonts. * A typical path is C:\Windows\Fonts. * 88 GFP-HISTORY VALUE X'22000000'. * The file system directory that serves * as a common repository for Internet history * items. * 88 GFP-INTERNET VALUE X'01000000'. * !! A VIRTUAL folder representing the Internet. * 88 GFP-INTERNET-CACHE VALUE X'20000000'. * Version 4.72. The file system directory * that serves as a common repository for * temporary Internet files. A typical path * is C:\Documents and Settings\username\Local * Settings\Temporary Internet Files. * 88 GFP-LOCAL-APPDATA VALUE X'1C000000'. * Version 5.0. The file system directory * that serves as a data repository for local * (nonroaming) applications. A typical path * is C:\Documents and Settings\username\Local * Settings\Application Data. * You probably want GFP-APPDATA instead of this * for most uses. * 88 GFP-MYDOCUMENTS VALUE X'0C000000'. * !! Version 6.0. The VIRTUAL folder representing * the My Documents desktop item. Probably NOT * directly useable by Cobol for file operations. * 88 GFP-MYMUSIC VALUE X'0D000000'. * The file system directory that serves as * a common repository for music files. A * typical path is C:\Documents and * Settings\User\My Documents\My Music. * 88 GFP-MYPICTURES VALUE X'27000000'. * Version 5.0. The file system directory * that serves as a common repository for * image files. A typical path is * C:\Documents and Settings\username\My * Documents\My Pictures. * 88 GFP-MYVIDEO VALUE X'0E000000'. * Version 6.0. The file system directory * that serves as a common repository for * video files. A typical path is * C:\Documents and Settings\username\My * Documents\My Videos. * 88 GFP-NETHOOD VALUE X'13000000'. * A file system directory containing the link * objects that may exist in the My Network Places * virtual folder. It is not the same as * GFD-NETWORK, which represents the network * namespace root. A typical path is * C:\Documents and Settings\username\NetHood. * 88 GFP-NETWORK VALUE X'12000000'. * !! A VIRTUAL folder representing Network * Neighborhood, the root of the network * namespace hierarchy. * Use GFP-NETHOOD instead. * 88 GFP-PERSONAL VALUE X'05000000'. * Version 6.0. The VIRTUAL folder representing * the My Documents desktop item. * Use this This is equivalent to GFP-MYDOCUMENTS . * for My * Documents Previous to Version 6.0: The file system * directory used to physically store a users * common repository of documents. A typical * path is C:\Documents and Settings\username * \My Documents. This should be distinguished * from the VIRTUAL My Documents folder in * the namespace. * 88 GFP-PRINTERS VALUE X'04000000'. * !! The VIRTUAL folder containing installed * printers. Use GFP-PRINTHOOD instead. * 88 GFP-PRINTHOOD VALUE X'1B000000'. * The file system directory that contains * the link objects that can exist in the * Printers virtual folder. A typical path is * C:\Documents and Settings\username\PrintHood. * 88 GFP-PROFILE VALUE X'28000000'. * Version 5.0. The users profile folder. Typical * path is C:\Documents and Settings\username. * Applications should not create files or folders * at this level; they should put their data under * the locations referred to by GFD-APPDATA or * GFD-LOCAL-APPDATA. * 88 GFP-PROFILES VALUE X'3E000000'. * Version 6.0. The file system directory * containing user profile folders. * A typical path is C:\Documents and Settings. * 88 GFP-PROGRAM-FILES VALUE X'26000000'. * Version 5.0. The Program Files folder. * A typical path is C:\Program Files. * 88 GFP-PROGRAM-FILES-COMMON VALUE X'2B000000'. * Version 5.0. A folder for components that * are shared across applications. A typical * path is C:\Program Files\Common. Valid only * for Windows NT, Windows 2000, and Windows XP * systems. Not valid for Windows Millennium * Edition (Windows Me). * 88 GFP-PROGRAMS VALUE X'02000000'. * The file system directory that contains * the users program groups (which are * themselves file system directories). * A typical path is C:\Documents and * Settings\username\Start Menu\Programs. * 88 GFP-RECENT VALUE X'08000000'. * The file system directory that contains * shortcuts to the users most recently used * documents. A typical path is C:\Documents * and Settings\username\My Recent Documents. * 88 GFP-SENDTO VALUE X'09000000'. * The file system directory that contains * Send To menu items. A typical path is * C:\Documents and Settings\username\SendTo. * 88 GFP-STARTMENU VALUE X'0B000000'. * The file system directory containing Start * menu items. A typical path is C:\Documents * and Settings\username\Start Menu. * 88 GFP-STARTUP VALUE X'07000000'. * The file system directory that corresponds * to the users Startup program group. The * system starts these programs whenever any * user logs onto Windows NT or starts Windows 95. * A typical path is C:\Documents and Settings\ * username\Start Menu\Programs\Startup. * 88 GFP-SYSTEM VALUE X'25000000'. * Version 5.0. The Windows System folder. * A typical path is C:\Windows\System32. * 88 GFP-TEMPLATES VALUE X'15000000'. * The file system directory that serves as * a common repository for document templates. * A typical path is C:\Documents and * Settings\username\Templates. * 88 GFP-WINDOWS VALUE X'24000000'. * Version 5.0. The Windows directory or * SYSROOT. This corresponds to the %windir% * or %SYSTEMROOT% environment variables. * A typical path is C:\Windows.