MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / CreateTabDialogBrush

Function CreateTabDialogBrush

source/script_gui.cpp:10416–10439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10414
10415
10416HBRUSH CreateTabDialogBrush(HWND aDlg, HDC aCompatibleDC)
10417{
10418 HBRUSH brush = NULL;
10419 RECT rect;
10420 GetClientRect(aDlg, &rect);
10421 if (HDC bitmap_dc = CreateCompatibleDC(aCompatibleDC))
10422 {
10423 if (HBITMAP bitmap = CreateCompatibleBitmap(aCompatibleDC, rect.right, rect.bottom))
10424 {
10425 HBITMAP prev_bitmap = (HBITMAP)SelectObject(bitmap_dc, bitmap);
10426
10427 // Print the tab control into the bitmap.
10428 SendMessage(aDlg, WM_PRINTCLIENT, (WPARAM)bitmap_dc, PRF_CLIENT);
10429
10430 // Create a brush from the bitmap.
10431 brush = CreatePatternBrush(bitmap);
10432
10433 SelectObject(bitmap_dc, prev_bitmap);
10434 DeleteObject(bitmap);
10435 }
10436 DeleteDC(bitmap_dc);
10437 }
10438 return brush;
10439}
10440
10441
10442

Callers 1

TabDialogProcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected