• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

Refresh screen

I have an app that opens a command prompt window then moves that command prompt window.  Everything works fine but after the command prompt window is moved there is a "ghost" of the window where it originally was.  If you grab the command prompt window and move it around it will erase the ghost of itself if that makes sense.  

What I need is something that will refresh the screen to get rid of the "ghost" image of the command prompt window (vb6).
0
MERCOMMS
Asked:
MERCOMMS
1 Solution
 
Element1910Commented:
Is it creating a ghost copy every time you move it or only once?
0
 
MERCOMMSAuthor Commented:
I only move it via code one time and it doesn't create the ghost then but instead leaves a ghost of where it was originally.  Then if I grab the window I can use it kind of like an eraser to erase the ghost.
0
 
Martin LissOlder than dirtCommented:
Does the same thing happen if the code is run in the IDE? If NOT then try putting a DoEvents line after the code that moves the window.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
MERCOMMSAuthor Commented:
Doevents after moving the window has no affect.
0
 
eemitCommented:
Try to set Form AutoRedraw property to True.
0
 
Martin LissOlder than dirtCommented:
Does it only happen with the exe?
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Is your app by chance waiting for the command prompt window to close?

How are you opening that command prompt?
0
 
shorvathCommented:
I assume that when you say you are 'Moving the Window' you are using the API

Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As _
Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As _
Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long 

Open in new window

The last option, bRepaint determines if the screen is repainted or not.

If you don't want the ghost image, set this value to TRUE  ( 1 )

retval = MoveWindow(Form1.hWnd, 200, 150, 175, 300, 1)

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now