-
Notifications
You must be signed in to change notification settings - Fork 0
/
IconSel.cpp
46 lines (37 loc) · 804 Bytes
/
IconSel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "stdafx.h"
#include "DoHide.h"
#include "bitmap.h"
#include "WinList.h"
#include "resource.h"
TBitmap ProgIcon(IDC_PROGRAM_ICON,false);
/*
*
*
*/
void InitIcon( HWND hWnd )
{
ProgIcon.Init(hWnd);
}
/*
*
*
*/
void SetupIcon( HWND hWnd, char* IconFile, int IconId )
{
int IconCount = (int)ExtractIcon(hInst,IconFile,-1);
SendMessage(hWnd,TBM_SETRANGE,TRUE,MAKELONG(0, IconCount-1));
SendMessage(hWnd,TBM_SETTICFREQ,1,0);
SendMessage(hWnd,TBM_SETPOS,TRUE,IconId);
}
/*
*
*
*/
void UpdateIcon( HWND hSlider, HWND hIconWnd, HWND hIconFileWnd )
{
TProgramInfo info;
info.m_iIcon = SendMessage(hSlider,TBM_GETPOS,0,0);
Edit_GetText(hIconFileWnd, info.m_szFilePath, sizeof(info.m_szFilePath) );
ProgIcon.SetId( (int)info.GetFileIcon() );
InvalidateRect( hIconWnd,0,TRUE );
}