Skip to content

Commit

Permalink
Statusbar/Fix: Corrupted text on x64
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurumaker72 committed Jan 5, 2025
1 parent 669f22c commit f9994c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions view/gui/features/Statusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ namespace Statusbar
// We don't want to keep the weird crap from previous state, so let's clear everything
for (int i = 0; i < 255; ++i)
{
SendMessage(statusbar_hwnd, SB_SETTEXT, i, (LPARAM)"");
SendMessage(statusbar_hwnd, SB_SETTEXT, i, (LPARAM)L"");
}

// When starting the emu, we want to scale the statusbar segments to the window size
Expand Down Expand Up @@ -333,20 +333,20 @@ namespace Statusbar

const auto len = SendMessage(statusbar_hwnd, SB_GETTEXTLENGTH, segment_index, 0);

auto str = new wchar_t[len + 1]();
auto str = (wchar_t*)calloc(len + 1, sizeof(wchar_t));

SendMessage(statusbar_hwnd, SB_GETTEXT, segment_index, (LPARAM)str);

section_text[section] = str;

delete[] str;
free(str);
}

refresh_segments();

for (int i = 0; i < 255; ++i)
{
SendMessage(statusbar_hwnd, SB_SETTEXT, i, (LPARAM)"");
SendMessage(statusbar_hwnd, SB_SETTEXT, i, (LPARAM)L"");
}

for (const auto pair : section_text)
Expand Down

0 comments on commit f9994c3

Please sign in to comment.