|
-
Jun 20th, 2000, 06:31 AM
#1
Thread Starter
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 20th, 2000, 07:01 AM
#2
Lively Member
Thanks a lot Kedaman, I'm going to work with it.
Regards.
Angel Maldonado López.
VB Programmer
-
Jun 20th, 2000, 07:33 AM
#3
If you want to display Icons for ALL file types, then use the ExtractAssociatedIcon() API, i.e.
Code:
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 DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Sub Command1_Click()
Dim lIcon As Long
On Error GoTo User_Cancelled
With CommonDialog1
.CancelError = True
.DialogTitle = "Select a File..."
.Filter = "All Files (*.*)|*.*"
.ShowOpen
Picture1 = LoadPicture()
Picture1.AutoRedraw = True
lIcon = ExtractAssociatedIcon(App.hInstance, .FileName, -1)
Call DrawIconEx(Picture1.hdc, 0, 0, lIcon, 32, 32, 0, 0, 3)
Picture1 = Picture1.Image
DestroyIcon lIcon
End With
User_Cancelled:
End Sub
-
Jun 20th, 2000, 07:49 AM
#4
Thread Starter
transcendental analytic
That's great, Aaron, youre always providing code!
but i have a qwestion, what's the point with this:
Picture1 = LoadPicture()
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 20th, 2000, 08:01 AM
#5
In my code I'm making the Icon I draw onto the Picturebox Persistent so you can't clear it using the Cls Method, using LoadPicture() loads an empty image into the Picturebox, effectively clearing it.
-
Jun 20th, 2000, 08:50 AM
#6
Thread Starter
transcendental analytic
Ok i see, i just wondered why you would need it to be persistent? Doesn't it drain more performance?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 20th, 2000, 08:07 PM
#7
That depends on the size of the Image and what it's going to be used for.
In my example I'm just displaying a single Icon in a Picturebox, so it's not hogging resources.
Making it persistent is just something I've gotten into the habit of doing, as usually with these examples I get asked,
"How can I stop the picture being erased when the Form/Picturebox is Repainted?".
-
Jun 21st, 2000, 12:08 AM
#8
Thread Starter
transcendental analytic
But won't just using autoredraw solve that problem?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 21st, 2000, 12:59 AM
#9
Lively Member
Hi Aaron:
It works perfectly, thanks a lot to both.
Best regards ! ! !
Angel Maldonado López.
VB Programmer
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
|