Link to home
Start Free TrialLog in
Avatar of MarkNieuwoudt
MarkNieuwoudt

asked on

SHOWWINDOW API - Hide then show the same window.

I have the following procedure... I hide the window then I want to show it again, this code does not work. You can try this with calculator. Does anyone have a soultion to this problem.

Thanks in advance


Mark

Public Sub Dock_Window( _
        ByVal sAppHandle As Long, _
        ByVal lParentHandle As Long)

        Dim lOriginalParent As Long
        lOriginalParent = GetParent(sAppHandle)

        Call ShowWindow(sAppHandle, 0)                         'Hides the window
        Application.DoEvents()
        Call SetParent(sAppHandle, lOriginalParent)
        Call ShowWindow(sAppHandle, 1)

    End Sub
Avatar of S-Twilley
S-Twilley

where are you API declarations?
... and as far as i know, you want to use Integer instead of Long now...

Public Sub Dock_Window( _
        ByVal sAppHandle As Integer, _
        ByVal lParentHandle As Integer)

        Dim lOriginalParent As Integer
Avatar of MarkNieuwoudt

ASKER

s-Twilley

Here is the API declaration. Where can I find a list of all the declarations which return integers instead of longs.

 Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
   

Thanks

Mark
ASKER CERTIFIED SOLUTION
Avatar of S-Twilley
S-Twilley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob Learned
Are you working with windows external to your application?

Bob
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial