开发者

Hidden Window Display on Users Desktop

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 actual开发者_C百科ly 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?


Try and set the location of the form to off-screen.

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜