Главная страница | назад





Article #17393: How can I determine where the Windows directory is?

 Question and Answer Database
FAQ2393C.txt How can I determine where the Windows directory is?
Category :Windows API
Platform :All
Product :C++Builder 3.x
Question:
How can I determine where the Windows directory is?
Answer:
You can make a call to the Windows API function
GetWindowsDirectory().
If you want the system directory, simply call the Windows API function
GetSystemDirectory().
Example:
#define MAX_PATH 144
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char a[MAX_PATH];
GetWindowsDirectory(a, sizeof(a));
ShowMessage(a);
GetSystemDirectory(a, sizeof(a));
ShowMessage(a);
}
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99