Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Windows-CPP-und-C ► ««« »»»

Differences between GetWindowsDirectory and GetSystemDirectory?


The difference between GetWindowsDirectory and GetSystemDirectory is quickly explained and understood!



The GetSystemDirectory  and  GetWindowsDirectory  are similar queries, but just as important as the GetCurrentDirectory query. 

Contents:

1.) ... The directory GetWindowsDirectory  << = C:\Windows
2.) ... The directory GetSystemDirectory  << = C:\Windows\System32
3.) ... The directory GetCurrentDirectory   << = The current working directory



1.) The directory GetWindowsDirectory

Gets the path of the Windows directory.



UINT GetWindowsDirectoryA ( [out] LPSTR lpBuffer , [in] UINT uSize );



[out] lpBuffer

A pointer to a buffer that receives the path. This path does not end with a backslash unless the Windows directory is the root directory. For example, if the Windows directory is called Windows on drive C, the path of the Windows directory retrieved by this function is C:\Windows. If the system was installed in the root directory of drive C, the path retrieved is C:.

[in] uSize

The maximum size of the buffer specified by the lpBuffer parameter, in TCHARs. This value should be set to MAX_PATH.

Return Value
If the function succeeds, the return value is the length of the string copied to the buffer, in TCHARs, not including the terminating null character.

If the length is greater than the size of the buffer, the return value is the size of the buffer required to accommodate the path.


2.) The directory GetSystemDirectory


Gets the path of the system directory. The system directory contains system files such as dynamic-link libraries and drivers.


UINT GetSystemDirectoryA ( [out] LPSTR lpBuffer , [in] UINT uSize );



[out] lpBuffer

A pointer to the buffer to receive the path. This path does not end with a backslash unless the system directory is the root directory. For example, if the system directory is named Windows\System32 on drive C, the path of the system directory retrieved by this function is C:\Windows\System32.

[in] uSize

The maximum size of the buffer in TCHARs.

Return Value
If the function succeeds, the return value is the length of the string copied to the buffer in TCHARs, not including the terminating null character. If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path, including the terminating null character.



3.) The directory GetCurrentDirectory  


Gets the current directory for the current process.


DWORD GetCurrentDirectory ( [in] DWORD nBufferLength , [out] LPTSTR lpBuffer );


[in] nBufferLength

The length of the buffer for the current directory string, in TCHARs. The buffer length must include room for a terminating null character.

[out] lpBuffer

A pointer to the buffer that will receive the current directory string. This null-terminated string specifies the absolute path to the current directory.

To determine the required buffer size, set this parameter to NULL and the nBufferLength parameter to 0.

Return Value
If the function succeeds, the return value indicates the number of characters written to the buffer, excluding the terminating null character.





FAQ 33: Updated on: 4 September 2024 10:56 Windows
Windows-CPP-und-C

WHAT is MFC?


MFC stands for Microsoft Foundation Class Library MFC is intended as a C++ object-oriented library for developing desktop applications for MS Windows.
Windows-CPP-und-C

Dark theme in Win32 applications with menu and title bar!


It is not that easy to activate and use Dark Theme in Win32 applications with menu and title bar for Windows 11 & 10 Here I have found two open source projects
Windows-CPP-und-C

What is Perlin Noise?


At some point while programming you are confronted with the term Perlin or Noise or Perlin-Noise and ask yourself what kind of function it is and what is
Windows-CPP-und-C

Visual Studio 2022 takes forever and is slow, why?


It is difficult to work with Visual Studio 2022 on old hardware, it takes a long time and is very slow, thats why you need the latest hardware Ideally
Windows-CPP-und-C

Use WebView2?


Is a new control and is a browser control in Microsoft called WebView2, successor to CHtmlView or IWebBrowser Contents: 1. The new Microsoft browser
Windows-CPP-und-C

Is a number a prime number in C++?


The function IsPrime returns true if the given number is a prime number; otherwise, it returns false 1. Prime Number Detection in C++: 2. Explanation of
Windows-CPP-und-C

Using arrays and strings in C programs!


This C program explains and demonstrates some important concepts related to the use of arrays and strings. Lets walk through the different aspects of this

»»

  My question is not there in the FAQ
Asked questions on this answer:
Keywords: cpp, windows, differences, between, getwindowsdirectory, getsystemdirectory, difference, quickly, explained, understood, Questions, Answers, Software




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + AutoHideMouseCursor
  + Desktop.Calendar.Tray.OK
  + OK.Its.Raining.Men
  + Run-Command
  + MagicMouseTrails
  + CpuFrequenz
  + MultiClipBoardSlots
  + OnlyStopWatch
  + KeepMouseSpeedOK
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu


► Properties of the Recycle Bin on Windows 11! ◄
► Preview animated Gif images in File Explorer! ◄
► The Computer Management in Windows 11! ◄
► Quick access to Windows 11 Defender settings? ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....