Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lowercase windows.h and uppercase Windows.h difference?

Tags:

c

winapi

What is the difference between lowercase <windows.h> and uppercase <Windows.h> header? I am reading some old tutorials on Win32 programming and they all use lowercase 'w'. Code compiles fine, but VS 2012 autocomplete feature only lists <Windows.h> header.

like image 839
balky Avatar asked Mar 17 '13 21:03

balky


People also ask

What does Windows h do in Word?

windows. h is a Windows-specific header file for the C and C++ programming languages which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various functions and subsystems.


1 Answers

The file systems on Windows are case insensitve so either one will work when compiling on Windows. However, if you were to compile on Linux using the MinGW cross compiler for example, the case would matter.

The MinGW windows.h header always seems to be lower case.

The Windows.h file provided with Microsoft's tools have used a variety of cases.

  • old VC++ installations (VC++98 and earlier) appear to install WINDOWS.H - all caps
  • newer VC++ installations and Windows SDKs seem to use Windows.h
  • some mobile device SDKs (PocketPC or Windows mobile) use windows.h - all lowercase.

Since windows.h will always work on both Windows and a Linux cross compile, I'd use #include <windows.h> if I ever thought about it. Which I can't recall doing until answering this.

I wouldn't worry about this too much. Even if the capitalized form finds its way onto a Linux MinGW build, an easy (if maybe annoying) fix is to create a Windows.h file that just turns around and includes windows.h.

like image 78
Michael Burr Avatar answered Oct 04 '22 19:10

Michael Burr