Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Find the window handle and call <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633539%28v=VS.85%29.aspx" rel="nofollow">SetForegroundWindow</a></p> <pre class="lang-vb prettyprint-override"><code>Public Function FindWindowByPartialTitle(ByVal _ TestFlex_string As String) As Long m_TestFlexString = TestFlex_string m_TestFlexHwnd = 0 ' Enumerate windows. EnumWindows AddressOf EnumCallback, 0 ' Return the hWnd found (if any). FindWindowByPartialTitle = m_TestFlexHwnd End Function ' Check a returned task to see if it's the one we want. Public Function EnumCallback(ByVal app_hWnd As Long, ByVal _ param As Long) As Long Dim buf As String Dim title As String Dim Length As Long ' Get the window's title. Length = GetWindowTextLength(app_hWnd) buf = Space$(Length) Length = GetWindowText(app_hWnd, buf, Length) title = Left$(buf, Length) ' See if the title contains the TestFlex string. If InStr(title, m_TestFlexString) &lt;&gt; 0 Then ' This is the one we want. m_TestFlexHwnd = app_hWnd ' Stop searching. EnumCallback = 0 Else ' Continue searching. EnumCallback = 1 End If End Function </code></pre> <p>So with the above function you should be able to do something like:</p> <pre class="lang-vb prettyprint-override"><code>Dim saveAsHwnd as Long call saveAsHwnd = FindWindowByPartialTitle("Save") call SetForegroundWindo(saveAsHwnd) </code></pre> <p>Don't forget to decalre SetForegroundWindow as well:</p> <pre class="lang-vb prettyprint-override"><code>Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload