|
-
Apr 29th, 2000, 05:41 PM
#1
Thread Starter
Member
Hi everybody,
Is there a way to change a form icon using API calls??
Help would be nice, tnx
keetsh
-
Apr 30th, 2000, 12:45 AM
#2
Frenzied Member
Nil Problemmo,
get a handle to your Icon and use SetClassLong
Code:
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
yuou use this constant for nIndex
Code:
Private Const GCL_HICON = (-14)
it returns the handle of the old Icon, remember to put it back before you end your program, otherwise you could run into problems.
-
Apr 30th, 2000, 12:46 AM
#3
Fanatic Member
Is there a particular reason you want to use an API call for this? You can change an icon at runtime rather easily by type:
'''''''''''''''''''''''''''
Form1.icon = "somepath"
'''''''''''''''''''''''''''
Where "somepath" is the path of your icon.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Apr 30th, 2000, 01:44 AM
#4
Thread Starter
Member
Tnx Sam. But could you please explain a little more what you mean by "get a handle to your Icon and use SetClassLong"
Please help!
Hummm RealisticGraphics, I trying to get this out of an Access form. That's why )
See you
keetsh
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
|