From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Capture mouse inputs with Windows API

Capture mouse inputs with Windows API - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Capture mouse inputs with Windows API

- [Woman] To capture mass inputs from the user, I decided to structure my application as a Windows program. And there are two functions, at the very least, a Windows program should have. The WinMain function serves as a program's entry point. Replacing the standard C++ main function. It contains the initialization code to create the program window, then enters into a continuous loop to translate messages from the keyboard and other inputs. The other function, WndProc, serves as a callback that gets executed to handle inputs directed at the window. Now, these function signatures may look terrifying, especially if haven't looked at Windows code before, but don't be alarmed. Although there are lots of strange typedefs, the basic structure of a program is pretty straightforward. At the top of InstrumentWinMain.cpp, I included the windows.h header file, which is necessary to use Windows API as well as the header files of my…

Contents