Creating workable button click without using CreateWindow in C++ using dev C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Creating workable button click without using CreateWindow in C++ using dev C++

Before I learnt about CreateWindow I attempted to do button click in console (using C++ language, I use Dev C++) and I somehow did it without using CreateWindow (the code is way longer though). Now I'm curious and wanted to know if anyone can do this too without using CreateWindow (you can include any any header). There are lots of amazing programmers out there and I can't wait to see different solutions by all pros out there!!!

25th Jul 2017, 11:30 AM
kenlove96
kenlove96 - avatar
1 Answer
+ 1
It's quite simple, use GetAsyncKeyState to poll for a left mouse button click, and then get the cursors position if lmb was clicked. With that you can then use to mouse xy to check if it was over certain part of the console, such as a text button
25th Jul 2017, 3:37 PM
aklex
aklex - avatar