hi there

i cant figure this one:

i have a program i made. in the main form, it eventually gets to the code where it has to execute a 3rd party program.

it minmized this window and shows a splash form i made in vb to tell the user that the program is loading

it then calls another form up but this form isnt shown as it has other code in it.

so in this nonshown form it has a code which says many other stuff along with the command to keep the splash screen on focus so its windowstate is vbnormal

when the 3rd party program is closed, i told it to close the splash form and in the splash form on the unload query i have said to set the windowstate of the main form to vbnormal - since it was minimized.

it used to do it - but not now

actually - it only ever works at home but not at university and i don know why. please help

the window stays on the taskbar and no matter what u try and do to get the focus to vbnormal on the mainform - it wont do it. it just sticks at the taskbar.

help!

code on main form:

Code:
..
..
completerun = temppath + "\setenvironment.bat"


Me.WindowState = vbMinimized

frmExecuteRomeStatus.Show
DoEvents
frmExecuteRomeStatus.WindowState = vbNormal
frmExecuteOperation.runrome (completerun)
romestatus is the splash form and has this code:

Code:
Private Sub Form_Load()

Me.WindowState = vbNormal

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

frmMain.WindowState = vbNormal

End Sub

Private Sub Form_Unload(Cancel As Integer)

frmMain.WindowState = vbNormal


End Sub
execute rome operation form has this code:

Code:
Const SYNCHRONIZE = &H100000
  
 
Const INFINITE = &HFFFF
 'Wait forever
 
Const WAIT_OBJECT_0 = 0
 'The state of the specified object is signaled
 
Const WAIT_TIMEOUT = &H102
 'The time-out interval elapsed & the object’s state
'is nonsignaled.
 

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _
            ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, _
            ByVal dwMilliseconds As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Sub runrome(ByVal runrome As String)

Dim lPid As Long
Dim lHnd As Long
Dim lRet As Long


lPid = Shell(runrome, vbMinimizedFocus)

If lPid <> 0 Then
        frmExecuteRomeStatus.WindowState = vbNormal
        DoEvents
        
        'Get a handle to the shelled process.
        lHnd = OpenProcess(SYNCHRONIZE, 0, lPid)
        

        If lHnd <> 0 Then
                lRet = WaitForSingleObject(lHnd, INFINITE)
                CloseHandle (lHnd)
        End If
        frmMain.WindowState = vbNormal
        
        Unload frmExecuteRomeStatus
        
        Unload Me
End If

End Sub

Private Sub Form_Load()

frmExecuteRomeStatus.WindowState = vbNormal
DoEvents

End Sub
help! i appreciate any help and advice.

thanks