Question

We have a VB6 application that uses a non-visible window (form) for DDE communication.

We have some clients reporting that occasionally they can see this window on their desktop.

I did a scan through the code for any visible = true or show's on the form in question, but nothing.

This about all we do with it:

Load frmDDELink
frmDDELink.stuff = stuff

We don't actually explicitly display (or explicitly not display it either).

What could cause a hidden window to be displayed on a user's desktop such that it is visible?

Was it helpful?

Solution

A misbehaving app on the client's machine could do that. FindWindow() is a notoriously inaccurate API function. On top of that, all VB6 windows have the same class name. Thunder something, iirc. It might be finding your window instead of the one intended, making the wrong window visible.

OTHER TIPS

I haven't used vb6 in a long time, but try and set the location of the form to off-screen.

Try
frmDDELink.ClientLeft = -100 frmDDELink.ClientTop = -100

I like Black Frog's simple hint to set the location off-screen, and nobugz's possible explanation. I would also suggest handling the Form_Activate event and setting the form invisible again.

Private Sub Form_Activate()  
  'Log something for debugging purposes?'  
  Me.Visible = False  
End Sub  

try to set the border into none, or me.visible = false, and set the property not to display in the task bar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top