I looked in several places but couldn’t find it out, or if I found something code doesn’t seem to work properly. Like the code below for example (I don’t have much idea what it does, cause I don’t know the cpp language)
#include <Windows.h>
#define WM_LBUTTONDOWN 0x0201
int clickCount = 0;
LRESULT CALLBACK WndProc(_In_ HWND hWnd, _In_ UINT msg, _In_ WPARAM wParam, _In_ LPARAM lParam)
{
switch (msg)
{
case WM_LBUTTONDOWN:
clickCount++;
if (clickCount >= 3) {
// Perform action when left mouse button clicked 3 times
std::cout << "Left mouse button clicked 3 times" << std::endl;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
int main()
{
WNDCLASS wc = { 0 };
wc.lpfnWndProc = WndProc;
wc.hInstance = NULL;
wc.lpszClassName = L"Class";
RegisterClass(&wc);
HWND hWnd = CreateWindow(L"Class", L"Title", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 500, NULL, NULL, NULL, NULL);
ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}