rodecomp/Source/Client/Application/ApplicationMessages.cpp
ragnarok-clanker 30cdd441a1 Maintenance: [forced, admin decision] Resubmission of returned batch 10026 rebased on c246e79d: also renames the CMode+0x10 write in
Batch #10033 by ragnarok-clanker: forced by an admin (0 lower score(s), 6 changed function(s)); checked with 479 compiled unit(s), including every includer of Source/Client/Application/ApplicationMessages.h, Source/Client/Application/Launcher.h, Source/Client/Mode/CMode.h, Source/Client/ModeFade.h, Source/UI/Window/UIWindowMgr.h.
2026-11-02 14:34:46 +00:00

45 lines
1.4 KiB
C++

#include "Client/Application/ApplicationMessages.h"
#include "Client/Application/ApplicationWindow.h"
#include "Client/Application/Launcher.h"
#include "Client/Input/InputCharset.h"
#include "Contents/Configuration/ServiceOptions.h"
#include <cstdint>
#include <imm.h>
// OFFSET: 0x00E57380
// FUNCTION: fn_24357
void PumpApplicationMessages() {
MSG message;
while (PeekMessageA(&message, nullptr, 0, 0, PM_REMOVE)) {
if (message.message == WM_KEYDOWN && message.wParam == VK_PROCESSKEY) {
typedef void(__thiscall * KeyHandler)(InputCharset*, UINT);
(*reinterpret_cast<KeyHandler**>(g_serverLanguage))[3](g_serverLanguage, ImmGetVirtualKey(message.hwnd));
}
TranslateMessage(&message);
DispatchMessageA(&message);
}
if (g_windowDragging == true) {
POINT point;
GetCursorPos(&point);
const int deltaX = point.x - g_windowDragStart.x;
const int deltaY = point.y - g_windowDragStart.y;
if (deltaX != 0 || deltaY != 0) {
MoveWindow(
hWnd, g_windowDragRect.left + deltaX, g_windowDragRect.top + deltaY, g_windowDragRect.right - g_windowDragRect.left,
g_windowDragRect.bottom - g_windowDragRect.top, TRUE
);
}
if ((GetAsyncKeyState(VK_LBUTTON) & 0x8000) == 0) {
g_windowDragging = false;
if (g_serviceOptions.Get(ServiceOption::ConfineCursor) != 0) {
ClipApplicationCursor(hWnd);
}
}
}
}