|
-
Apr 29th, 2001, 06:13 AM
#1
Option Explicit
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Sub Command1_Click()
Dim hIcon As Long
hIcon = ExtractAssociatedIcon(0, "Notepad.exe", 0)
If hIcon = 0 Then Exit Sub
Call DrawIcon(Picture1.hDC, 0, 0, hIcon)
End Sub
Private Sub Command2_Click()
SavePicture Picture1.Picture, "C:/pic1.ico"
End Sub
-
Apr 29th, 2001, 06:16 AM
#2
Lively Member
I didnt think picturebox supported icons... that could be the problem... try saving it as a bmp or a gif.
-
Apr 29th, 2001, 06:26 AM
#3
error again
-
Apr 29th, 2001, 06:32 AM
#4
Lively Member
Is the picture being displayed in the picturebox? as if it is in there the code shouldnt change.
-
Apr 29th, 2001, 06:35 AM
#5
yes, i'm using a PictureBox
-
Apr 29th, 2001, 06:47 AM
#6
Lively Member
Can you use picturebox control with savepicture... it doesnt say yo ucan or cant... but keeps making reference to IPictureDisp which has nothing to do with a picturebox... i dont think
-
Apr 29th, 2001, 06:54 AM
#7
i dont think i got u
what u mean?
-
Apr 29th, 2001, 06:58 AM
#8
Lively Member
From what i read if you want to use save picture you have to use ipicturedisp not picturebox... do a search for ipicturedisp on vb-forums and you will see what i mean...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|