1. Си / Говнокод #23155

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    void SetTitleBarIcon(HWND hDlg)
    {
    	int i16, s16, s32;
    	HICON hSmallIcon, hBigIcon;
    
    	// High DPI scaling
    	i16 = GetSystemMetrics(SM_CXSMICON);
    	// Adjust icon size lookup
    	s16 = i16;
    	s32 = (int)(32.0f*fScale);
    	if (s16 >= 54)
    		s16 = 64;
    	else if (s16 >= 40)
    		s16 = 48;
    	else if (s16 >= 28)
    		s16 = 32;
    	else if (s16 >= 20)
    		s16 = 24;
    	if (s32 >= 54)
    		s32 = 64;
    	else if (s32 >= 40)
    		s32 = 48;
    	else if (s32 >= 28)
    		s32 = 32;
    	else if (s32 >= 20)
    		s32 = 24;
    
    	// Create the title bar icon
    	hSmallIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s16, s16, 0);
    	SendMessage (hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);
    	hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s32, s32, 0);
    	SendMessage (hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);
    }

    https://github.com/pbatard/rufus/blob/92d046e663811fd922262f1f347ad2ebe8e09b97/src/stdlg.c#L1607-L1639

    Запостил: j123123, 05 Июля 2017

    Комментарии (4) RSS

    Добавить комментарий