Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetForegroundWindow& Lib "user32" (ByVal hwnd As Long)
then
Public Function ShowWindow(ByVal sWindowName As String)
Dim lWindowHandle As Long
lWindowHandle = FindWindow(vbNullString, Trim(sWindowName))
If lWindowHandle <> 0 Then
SetForegroundWindow (lWindowHandle)
Else
' Error Message
End If
End Function
sWindow name = the title bar of the programs window to be pulled forward.
Could it be that the title bar text is not consistent and that's why it won't work? [sig]<p> Tarek<br><a href= > </a><br>The more I learn, the more I need to learn![/sig]
The program to be brought forward is a DOS app, therefore the title bar is constant. Something like "RUNFORM - RUNFORM".
The DOS box is not minimised. I checked this one myself. I set the property of the link to Maximized and the screen came forward 3 times. On the fourth attempt it just flashs on the taskbar.
Can you reproduce the problem in a minimalist app? Post the code if you can; I hate things that sometimes work and sometimes not.... [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.