#include <Windows.h>
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR cmdIn, int showMode)
{
TCHAR targetPath[5000];
QueryDosDevice(NULL,targetPath,5000);
MessageBox(0,targetPath,L"Info",0);
return 0;
}
Dlaczego w message box'ie pojawia się lakoniczne
global
, skoro:
If lpDeviceName is NULL, the function retrieves a list of all existing MS-DOS device names. Each null-terminated string stored into the buffer is the name of an existing MS-DOS device, for example, \Device\HarddiskVolume1 or \Device\Floppy0.
Źródło: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365461%28v=vs.85%29.aspx