What you describe sounds correct, however, if you are not getting the expected result then it's possible your MIDI device is not fully MIDI compliant.
The following example code successfully plays a broken chord using running status on the Windows built-in MIDI device on my Windows 11 machine:
#pragma comment(lib, "Winmm.lib")
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <mmsystem.h>
#include <mmeapi.h>
#include <iostream>
int main()
{
try
{
HMIDIOUT hMidiOut = 0;
MMRESULT mmResult = midiOutOpen(&hMidiOut, -1, NULL, NULL, CALLBACK_NULL);
if (mmResult != MMSYSERR_NOERROR)
throw std::exception("Failed to open the MIDI device.");
mmResult = midiOutShortMsg(hMidiOut, 0x007F4090);
if (mmResult != MMSYSERR_NOERROR)
throw std::exception("midiOutShortMsg() failed.");
Sleep(500);
mmResult = midiOutShortMsg(hMidiOut, 0x00007F42);
if (mmResult != MMSYSERR_NOERROR)
throw std::exception("midiOutShortMsg() failed.");
Sleep(500);
mmResult = midiOutShortMsg(hMidiOut, 0x00007F44);
if (mmResult != MMSYSERR_NOERROR)
throw std::exception("midiOutShortMsg() failed.");
Sleep(3000);
midiOutReset(hMidiOut);
midiOutClose(hMidiOut);
}
catch (const std::exception& e)
{
std::cout << e.what() << std::endl;
}
}