오전 11:07 2002-11-29
HICON을 ico로 바꾸는 방법
==========================================================================
icon 포맷
Icons in Win32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp
vc 샘플
conPro: Icon Manager Sample 참조
vb에서
Dim hWnd As Long
Dim hIcon As Long
Dim path As String
path = "C:\icon.exe"
hWnd = GetWindowLong(Me.hWnd, GWL_HINSTANCE)
hIcon = ExtractIcon(hWnd, path, 1)
Picture1.AutoRedraw = True
DrawIcon Picture1.hdc, 0, 0, hIcon
SavePicture Picture1.Image, "C:\icon.bmp"
IPicture 이용
One way =>
OleCreatePictureIndirect() with PICTDESC.icon.hicon = hIcon =>
IPicture
StgCreateDocfile()
CreateStream()
IPicture->SaveAsFile
// ... don't forget all Release()...
Then you read the temporary Stream =>
StgOpenStorage()
Stat() for .ICO size.
OpenStream()
GlobalAlloc()
GlobalLock()
Read()
CreateFile()-WriteFile()-CloseHandle()
GlobalUnlock()
GloBalFree()
HICON을 ico로 바꾸는 방법
==========================================================================
icon 포맷
Icons in Win32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp
vc 샘플
conPro: Icon Manager Sample 참조
vb에서
Dim hWnd As Long
Dim hIcon As Long
Dim path As String
path = "C:\icon.exe"
hWnd = GetWindowLong(Me.hWnd, GWL_HINSTANCE)
hIcon = ExtractIcon(hWnd, path, 1)
Picture1.AutoRedraw = True
DrawIcon Picture1.hdc, 0, 0, hIcon
SavePicture Picture1.Image, "C:\icon.bmp"
IPicture 이용
One way =>
OleCreatePictureIndirect() with PICTDESC.icon.hicon = hIcon =>
IPicture
StgCreateDocfile()
CreateStream()
IPicture->SaveAsFile
// ... don't forget all Release()...
Then you read the temporary Stream =>
StgOpenStorage()
Stat() for .ICO size.
OpenStream()
GlobalAlloc()
GlobalLock()
Read()
CreateFile()-WriteFile()-CloseHandle()
GlobalUnlock()
GloBalFree()
'KB > MFC/Win32' 카테고리의 다른 글
MFC정규DLL안의 dlg에서 엑티브엑스컨트롤쓸때 (0) | 2004.04.28 |
---|---|
IE 웹브라우저 마우스 아래 있는 아이템 얻기 (0) | 2004.04.28 |
확장자로 실행파일 찾기 (0) | 2004.04.28 |
[DB] 트리거 사용 (0) | 2004.04.28 |
익스플로러 인터페이스 받기 (0) | 2004.04.28 |