diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-25 21:45:01 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-25 21:45:01 +0100 |
| commit | 55211af76164fe6c39249c14be47363d35a4db0f (patch) | |
| tree | 417d9e8805c52d6421798331bea59993e7f1fa1a /alf/alfbutton.cpp | |
| parent | 02d94ecd62e11e28ba87451c392cc6b633bb5c56 (diff) | |
add memory allocation functions
Diffstat (limited to 'alf/alfbutton.cpp')
| -rw-r--r-- | alf/alfbutton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index b0458b2..5f7a638 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -23,12 +23,12 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT RECT r = { 0, 0, 0x7FFFFFFF, 100 }; int textlen = GetWindowTextLength(hwnd); - TCHAR *textbuf = (TCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY|HEAP_GENERATE_EXCEPTIONS, (textlen + 1)*sizeof(TCHAR)); + TCHAR *textbuf = ALF_New(TCHAR, textlen + 1); GetWindowText(hwnd, textbuf, textlen+1); DrawText(hdc, textbuf, -1, &r, format); - HeapFree(GetProcessHeap(), 0, textbuf); + ALF_Free(textbuf); int xpadding = ALF_Compat_GetSystemMetricsForDpi(SM_CXEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 6; |
