FIX: Can't Restore Default Foxhead Icon After Set Icon Prop (135906)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
This article was previously published under Q135906 SYMPTOMS
After setting the Icon property of the _SCREEN object in Visual FoxPro to
an icon file or to blank, you can't restore the default foxhead icon. If
you set _SCREEN.Icon="", then only a square white box is shown when Visual
FoxPro is minimized when running under Windows 3.x or Windows NT. In
Windows 95, the icon shown on the task bar button for the minimized Visual
FoxPro, is a generic gray button that looks like a program window with a
blue title bar. These same incorrect icons show up when switching tasks by
pressing ALT+TAB.
WORKAROUND
There are at least two known workarounds for this, each one with its own
advantages and disadvantages.
Workaround One
Use the MODIFY WINDOW SCREEN command without any clauses to set the Visual
FoxPro icon back to the default foxhead. The main drawback of this method
is that other properties of the _SCREEN object are also set back to their
defaults. Therefore, _SCREEN.Picture, _SCREEN.Fontname, _SCREEN.Caption,
and so on are set back to their defaults. An additional side effect of this
is that the Picture and Icon properties of the _SCREEN object will still
report the user defined values even though the defaults show up visually
(no picture and the foxhead icon). To work around this drawback, you can
save the necessary properties of the _SCREEN object in variables, and then
restore them after using the MODIFY WINDOW SCREEN command. The following
commands can be issued in the Command window to illustrate this:
_SCREEN.Icon=HOME()+"samples\graphics\icons\flag\ctrcan.ico"
_SCREEN.Picture=HOME()+"fox.bmp"
_SCREEN.Fontname="Wingdings"
_SCREEN.Fontsize=16
cScrPic=_SCREEN.Picture
cScrFont=_SCREEN.Fontname
nScrFontsz=_SCREEN.Fontsize
* Minimize Visual FoxPro and check the icon. Restore Visual FoxPro.
MODIFY WINDOW SCREEN
* Minimize Visual FoxPro and check the icon. Restore Visual FoxPro.
? _SCREEN.Picture && this returns the name of the picture file
* even though the picture isn't displayed
? _SCREEN.Icon && this returns the name of the icon file even
* though the icon is now the default icon
? _SCREEN.Fontname && this should be Arial
? _SCREEN.Fontsize && this should be 10
* The next three commands restore the specified settings:
_SCREEN.Picture=cScrPic
_SCREEN.Fontname=cScrFont
_SCREEN.Fontsize=nScrFontsz
Workaround Two
Create a foxhead icon file and set the _SCREEN.Icon property to that icon
file. You can change the Fox.bmp bitmap file (located in the VFP directory)
to an icon file by using the Imagedit program that comes with the
Professional Edition of Visual FoxPro. The main drawbacks for this
workaround are that the icon file will not have a transparent background
and the resolution isn't as good as the default icon built into Visual
FoxPro.
Steps to convert the Fox.bmp file to an icon file:
- Start Imagedit and open the VFP\Fox.bmp file.
- On the Edit menu in Imagedit, click Copy.
- On the File menu in Imagedit, click New, and create a new icon file.
Choose the "EGA/VGA 16-Color 32x32" option for the icon file.
- On the Edit menu, click Paste. In the Paste From Clipboard dialog box,
choose either option. The "Stretch/shrink clipboard bitmap?" option
produces a larger icon but it won't look as good as the "Clip clipboard
bitmap?" option. Both will have white backgrounds and this will show
when using the icon in Visual FoxPro. The background can be changed to
black, but that will also appear when it is used in Visual FoxPro if the
Windows desktop is other than black.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem has been fixed in
Visual FoxPro 5.0 for Windows.
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | kbBug kbfix kbvfp500fix KB135906 kbAudDeveloper |
---|
|