Windows SDK Application: How to get the windows directory?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Windows SDK Application: How to get the windows directory?

Threaded View

  1. #1
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Windows SDK Application: How to get the windows directory?

    Q: How to get the windows directory?

    A:

    Code:
    TCHAR szDirectory[MAX_PATH] = "";
    
    UINT Bytes = ::GetWindowsDirectory(szDirectory, sizeof(szDirectory));
    if(!Bytes)
      // Error -> call '::GetLastError()'
    else if(Bytes > sizeof(szDirectory))
      // Buffer too small
    else
      // Success
    Last edited by Andreas Masur; July 24th, 2005 at 06:00 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center