'As a developer/MFC'에 해당되는 글 2건

  1. 2012.09.26 탭 컨트롤에 gif 넣기
  2. 2012.05.07 Visual C++ Redistributable / vcredist_x86.exe 배포 - NSIS Script

탭 컨트롤에 gif 넣기

BOOL SetTabCtrl()
{
 m_imageList.Create(24, 17, ILC_COLORDDB, 3, 3);

 CImage imageSW;
 imageSW.Load(L".\\res\\1.gif");
 HBITMAP hSW = imageSW.Detach();
 CBitmap bmpSW;
 bmpSW.Attach((HGDIOBJ)hSW);
 m_imageList.Add(&bmpSW, RGB(255, 0, 255));

 CImage imageSystem;
 imageSystem.Load(L".\\res\\2.gif");
 HBITMAP hSystem = imageSystem.Detach();
 CBitmap bmpSystem;
 bmpSystem.Attach((HGDIOBJ)hSystem);
 m_imageList.Add(&bmpSystem, RGB(255, 0, 255));

 CImage imageUser;
 imageUser.Load(L".\\res\\3.gif");
 HBITMAP hUser = imageUser.Detach();
 CBitmap bmpUser;
 bmpUser.Attach((HGDIOBJ)hUser);
 m_imageList.Add(&bmpUser, RGB(255, 0, 255));

 // 아이콘 로드 - 아이콘 배경은 검은색으로 나옴
 // m_imageList.Add(AfxGetApp()->LoadIconW(IDR_MAINFRAME));

 m_cTabMain.SetImageList(&m_imageList);

 TCITEM item;
 item.mask = TCIF_IMAGE | TCIF_TEXT;
 item.pszText = L"1";
 item.iImage = 0;
 this->m_cTabMain.InsertItem(0, &item);

 item.pszText = L"2";
 item.iImage = 1;
 m_cTabMain.InsertItem(1, &item);

 item.pszText = L"3";
 item.iImage = 2;
 m_cTabMain.InsertItem(2, &item);

 return TRUE;
}

Visual C++ Redistributable / vcredist_x86.exe 배포 - NSIS Script

http://blog.daum.net/aonezip/37

 

NSIS Sample Script – Visual C++ 2008 Redistributable 9.0.30729.17

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
!define TIMEDOT "vcredist_x86.exe"
  
Function .onInstSuccess
  Call CheckVCRedist
   Pop $R0 
   StrCmp $R0 "-1" 0 +3
   MessageBox MB_OK|MB_ICONSTOP "프로그램 실행을 위해 Visual C++ 2008 Redistributable를 설치합니다."
   ExecWait "$INSTDIR\${TIMEDOT}"   
FunctionEnd
  
Function CheckVCRedist
   Push $R0
   ClearErrors
   ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" "Version"
  
   ; if VS 2005+ redist SP1 not installed, install it
   IfErrors 0 VSRedistInstalled
   StrCpy $R0 "-1"
  
VSRedistInstalled:
   Exch $R0
FunctionEnd

 

prev 1 next