Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CloseWindow Function

Status
Not open for further replies.

AppSpecialist

Programmer
Jul 6, 2001
64
CA
I have a closewindow function running on a timer to close a particular window if it is the active window.

I have found this code works on most PC's however, on one PC the VB program sees the window I am looking for is in foreground and it tries to minimize it, but cannot. All that happens is you see the screen flicker as the timer cuts in trying to minimize it... any thoughts?

Here is a stripped down version of code:

If AspectWinSetControl1.WinsetState = awWrapUp Then

fg_hwnd = GetForegroundWindow()

If UCase(RTrim(GetWindowTitle(fg_hwnd))) = "ASPECT WINSET" Then

CloseWindow(fg_hwnd)

ScrPop.Visible = True
ScrPop.Show

End If

End If
 
Does the window have any dialog boxes or modal forms open that were spawned from it? I think that would cause this behaviour.

VBrit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top