Home All Groups Group Topic Archive Search About

Ghost image on a Form after GetSaveFileName

Author
19 Jun 2009 10:22 AM
Howard Kaikow
Earlier today, I began to see a ghost image on a Form after running the
GetSaveFileName API function.
The image is part of one of the thumbnails in the left side of the Save As
dialog issued via GetSaveFileName.

The code was of the form:

                    if  GetSaveFileNameW(VarPtr(OFName)) = 0 then
                        Do stuff
                    Else
                        Do other stuff, this is the branch being taken
                   end if

I appear to have gotten around the problem with the following:

                    i = GetSaveFileNameW(VarPtr(OFName))
                    Me.Refresh
                    If i = 0 Then

                        Do stuff
                    Else
                        Do other stuff, this is the branch being taken
                   end if

What causes this?
Me.Refresh seems to work, would DoEvents have done as well?

Author
19 Jun 2009 9:35 PM
Thorsten Albers
Howard Kaikow <kai***@standards.com> schrieb im Beitrag
<u66nEfM8JHA.1***@TK2MSFTNGP05.phx.gbl>...
> What causes this?

- A bad graphics adapter driver? (Note that the newest driver not in any
case is the best...)
- A badly implemented subclassing of the form with which the problem
appears
- A third party control on the form which prevents the form from being
refreshed automatically
etc.

--
Thorsten Albers

albers (a) uni-freiburg.de