============================================================================= MakeBitmapButton()
| 643 | // MakeBitmapButton() |
| 644 | // |
| 645 | void 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 | //============================================================================= |
no outgoing calls
no test coverage detected