FIX: Form Icon Does Not Change on Win95 When Set at Run- Time (149330)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
This article was previously published under Q149330 SYMPTOMS
When the icon for a form is changed at run-time and the form is then
minimized, the taskbar icon does not reflect this change. This problem only
occurs with the 16-bit version of Visual Basic and Windows 95.
RESOLUTION
To work around this problem, add a call to the SetClassWord function
immediately after changing the icon. This will update the information for
the window and the correct icon will be displayed when the window is
minimized. To implement this fix, follow these steps: - Add a new module to the project. If one or more modules already exist,
these can be used instead of adding a new module.
- Add the following function and constant declarations to the module:
Declare Function SetClassWord Lib "User" (ByVal hWnd As Integer, _
ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
Public Const GCW_HICON = (-14)
- Immediately after changing the icon in code, add this call to
SetClassWord (assuming Form1 is the form where the icon was changed):
SetClassWord Form1.hWnd, GCW_HICON, Form1.hWnd
STATUS
Microsoft has confirmed this to be an issue in the Microsoft products
listed at the beginning of this article. This problem has been fixed in
Microsoft Windows 98.
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kb16bitonly kbbug kbDSupport kbOSWin98fix KB149330 |
---|
|