MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / MakeBitmapButton

Function MakeBitmapButton

src/Helpers.c:645–658  ·  view source on GitHub ↗

============================================================================= MakeBitmapButton()

Source from the content-addressed store, hash-verified

643// MakeBitmapButton()
644//
645void MakeBitmapButton ( HWND hwnd, int nCtlId, HINSTANCE hInstance, UINT uBmpId )
646{
647 HWND hwndCtl = GetDlgItem ( hwnd, nCtlId );
648 BITMAP bmp;
649 BUTTON_IMAGELIST bi;
650 HBITMAP hBmp = LoadImage ( hInstance, MAKEINTRESOURCE ( uBmpId ), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION );
651 GetObject ( hBmp, sizeof ( BITMAP ), &bmp );
652 bi.himl = ImageList_Create ( bmp.bmWidth, bmp.bmHeight, ILC_COLOR32 | ILC_MASK, 1, 0 );
653 ImageList_AddMasked ( bi.himl, hBmp, CLR_DEFAULT );
654 DeleteObject ( hBmp );
655 SetRect ( &bi.margin, 0, 0, 0, 0 );
656 bi.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER;
657 SendMessage ( hwndCtl, BCM_SETIMAGELIST, 0, ( LPARAM ) &bi );
658}
659
660
661//=============================================================================

Callers 4

RunDlgProcFunction · 0.85
OpenWithDlgProcFunction · 0.85
FavoritesDlgProcFunction · 0.85
Style_ConfigDlgProcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected