A Fix for CHARTEVENT_MOUSE_WHEEL after June 10, 2025—KB5060533 Windows update

 
I went to sleep and woke up to find my pc restarted to apply  June 10, 2025—KB5060533 (OS Builds 19044.5965 and 19045.5965)
windows update

all my EAs that mostly have GUI on it stopped receiving mouse wheel events, not the chart wheel works fine on the chart but not in the GUI.
Windows update KB5060533 seems to have affected how MT5 handles mouse events, i tried like 20 fixes this the only 1 worked for me to restore functionality


so i thought to share it here maybe it helps someone else

#property strict

#import "user32.dll"
int GetSystemMetrics(int nIndex);
int GetAsyncKeyState(int vKey);
int GetKeyState(int nVirtKey);
#import

void OnInit()
{
    FixMouseAfterUpdate();
    Print("TEST EA STARTED");
    EventSetMillisecondTimer(1000);
}

void OnDeinit(const int reason) { EventKillTimer(); }

void OnTimer() 
{
    static int counter = 0;
    Print("Timer ", counter++);
}

void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{
    Print("Event ID=", id);
    
    if(id == CHARTEVENT_MOUSE_WHEEL) 
    {
        Alert("WHEEL EVENT CAUGHT!");
    }
}

void FixMouseAfterUpdate()
{
    // Reset mouse metrics
    int xScroll = GetSystemMetrics(2);  // SM_CXHSCROLL
    int yScroll = GetSystemMetrics(3);  // SM_CYVSCROLL
    
    // Force mouse settings refresh
    ChartSetInteger(0, CHART_MOUSE_SCROLL, true);
    ChartSetInteger(0, CHART_EVENT_MOUSE_WHEEL, true);
    ChartSetInteger(0, CHART_BRING_TO_TOP, true);
}

Restart Terminal after running it.

**sorry if i posted in the wrong section, i really don't know where to put the topic