开发者

How to enable scrollable console?

开发者 https://www.devze.com 2023-02-04 08:56 出处:网络
In Visual C++, I Created con开发者_C百科sole usingAllocConsole function. But I could not control its scroll bar using mouse wheel.

In Visual C++, I Created con开发者_C百科sole using AllocConsole function. But I could not control its scroll bar using mouse wheel. Only way to control scroll bar is dragging it. It is too uncomfortable.

Is there any way to control scroll bar using mouse wheel?


Try SetConsoleMode and disable ENABLE_MOUSE_INPUT and use ENABLE_PROCESSED_INPUT.

something like

GetConsoleMode(hConsoleHandle, &lpMode);
SetConsoleMode(hConsoleHandle, lpMode & ~ENABLE_MOUSE_INPUT | ENABLE_PROCESSED_INPUT);
0

精彩评论

暂无评论...
验证码 换一张
取 消