Manipulating Word and Its SpellChecker pt. 1

Now that I have the handle for Word I need to make use of the Topmost function to raise it above the others. I found this page to be helpful:

VB TopMost Function

The most useful parts are:

Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Public Sub MakeTopMost(Handle As Long)
SetWindowPos Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub

Public Sub MakeNormal(Handle As Long)
SetWindowPos Handle, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub

About this Entry

This page contains a single entry by tmichael published on June 7, 2003 2:33 PM.

Word's Classname was the previous entry in this blog.

Bringing a specific window to the top yet again is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.