This example finds the file/directory of the <WP_OS2SYS> object..
#define INCL_WINWORKPLACE #include <os2.h> HOBJECT hObject; CHAR szPath[CCHMAXPATH + 1]; BOOL fSuccess; hObject = WinQueryObject("<WP_OS2SYS>"); if (hObject != NULL) { /* WinQueryObject was successful */ fSuccess = WinQueryObjectPath(hObject,szPath,sizeof(szPath)); if (fSuccess) { /* WinQueryObjectPath was successful */ } else { /* WinQueryObjectPath failed */ } } else { /* WinQueryObject failed */ }