Windows 3.1 applications can't see the NT desktop; they are constrained to a view of the hard drives directory structure only.

Further complicating matters, creating a Windows shortcut won't help. They don't function quite like Unix symbolic links ("symlinks"); apparently Microsoft is a little inconsistent internally.

No worries!

Off your hard drive find the winnt subdirectory. From there go to profiles, then find your user name.

Click on your user name and look for desktop.

Click on this link and behold the wonders of your desktop.

Wasn't that fun?

That's fine for users, but life gets weird if you want do something repeatable. (Yes, some people are still stuck maintaining Win16 code; I average about a day a month on that). NT does not require that the OS be installed in a directory named winnt; that's the default, but you can't count on it. I'm told that it need not even be on the c: drive. GetWindowsDirectory() is Win32-only, so you can't do that either. getenv() is ANSI C, according to the Borland docs (it's in K&R, too), so you should be able to get %WINDIR% that way. Then, of course, you've got problems with "long file name" bullshit . . .

tftv256 has a point. The only safe way is to dig into the registry. I don't know how much you can do with the registry in Win16; I seem to recall that there is at least a minimal API . . . If you've got enough time on your hands to do it all by hand with read(), God bless you :) In Win32 there's SHGetSpecialFolderLocation(), which hides the labyrinthine registry crapola. Thank God it's unlikely anybody will have to do this in Win16.
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.