Get CPU Temperature

Truth to be told, it depends on the hardware. A library that works on most hardware is OpenHardwareMonitorLib. Unfortunately, it has no documentation and actually doesn’t really exist as an independent piece of software. It’s part of an open source software named “Open Hardware Monitor”. it’s done in .NET C Sharp and of course, only … Read more

What are the different calling conventions in C/C++ and what do each mean?

Simple answer: I use cdecl, stdcall, and fastcall. I seldom use fastcall. stdcall is used to call Windows API functions. Detailed answer (Stolen from Wikipedia): cdecl – In cdecl, subroutine arguments are passed on the stack. Integer values and memory addresses are returned in the EAX register, floating point values in the ST0 x87 register. … Read more

Show touch keyboard (TabTip.exe) in Windows 10 Anniversary edition

OK, I reverse engineered what explorer does when the user presses that button in the system tray. Basically it creates an instance of an undocumented interface ITipInvocation and calls its Toggle(HWND) method, passing desktop window as an argument. As the name suggests, the method either shows or hides the keyboard depending on its current state. … Read more

Replacing WinMain() with main() function in Win32 programs

You can use standard main in a “windows” app (that is, a GUI subsystem Windows application) even with the Microsoft tools, if you add the following to the Microsoft linker options: /subsystem:windows /ENTRY:mainCRTStartup Note that this is not necessary for the GNU toolchain. Still for the Microsoft tools you can alternatively add this to your … Read more

What’s a “.dll.a” file?

Naming the output file libjvm.dll.a will allow gcc to recognize it as a library named jvm. The .dll.a suffix indicates (by convention) that it is an import library, rather than a static library (which would simply be named libjvm.a, again by convention).

Why does CreateProcess give error 193 (%1 is not a valid Win32 app)

The most likely explanations for that error are: The file you are attempting to load is not an executable file. CreateProcess requires you to provide an executable file. If you wish to be able to open any file with its associated application then you need ShellExecute rather than CreateProcess. There is a problem loading one … Read more

Is there a Windows equivalent to fdopen for HANDLEs?

Unfortunately, HANDLEs are completely different beasts from FILE*s and file descriptors. The CRT ultimately handles files in terms of HANDLEs and associates those HANDLEs to a file descriptor. Those file descriptors in turn backs the structure pointer by FILE*. Fortunately, there is a section on this MSDN page that describes functions that “provide a way … Read more