Results 1 to 2 of 2

Thread: API call.......?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Oxford, UK
    Posts
    13

    Exclamation

    Does anyone know how to change the state of an external window? for example if my application has a form and button, i want the button to be able to restore Word... which i know is open, but just minimized!!! i also have the title of the window..... i am sure there is a simple call, maybe to the win api, but not sure.

  2. #2
    Guest
    Use the FindWindow and ShowWindow api functions.

    Code:
    Declare Function FindWindow Lib "user32.dll" _
    Alias "FindWindowA" (ByVal lpClassName As Any, ByVal _
    lpWindowName As Any) As Long
    
    Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As _
    Long, ByVal nCmdShow As Long) As Long 
    
    
    Private Sub Command1_Click()
    
         handl = FindWindow(vbNullString, "Microsoft Word - Untitled")
         If handl <> 0 Then
              ShowWindow handl, 9 'restore window
         End If
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width