CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    12

    How to get the HWnd of Microsoft Word?

    Hello,

    My VB program is controlling Microsoft Word via Automation. After starting it up (using CreateObject), I also need to know Word's Window Handle for other forms of processing.

    How can I get Word's window handle?

    Thanx.
    MingWah


  2. #2
    Join Date
    Oct 1999
    Location
    India
    Posts
    5

    Re: How to get the HWnd of Microsoft Word?

    You can use the FindWindow with the combination of the SetWindowPos APIs to accomplish this task.

    The FindWindow will return the hWnd of the window that you are looking for and then you can use the SetWindowPos API to bring the focus of that window to the front. Check the syntax for declaration with the API text viewer.

    You will have to pass the ClassName or the Window Title for the FindWindow API.



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

Featured