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.
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.
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.
WINDOWS.H
- all capsWindows.h
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With