Hi everybody,
Is there a way to change a form icon using API calls??
Help would be nice, tnx
keetsh
Printable View
Hi everybody,
Is there a way to change a form icon using API calls??
Help would be nice, tnx
keetsh
Nil Problemmo,
get a handle to your Icon and use SetClassLongyuou use this constant for nIndexCode:Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
it returns the handle of the old Icon, remember to put it back before you end your program, otherwise you could run into problems.Code:Private Const GCL_HICON = (-14)
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.
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