Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
With a modeless userform, is it possible to detect its state via VBA, i.e. if it has focus or not? What is client coordinates? Any help appreciated. jacob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This sub returns the caption of the userform, or of Excel, depending on
which is the active window: Declare Function GetActiveWindow32 Lib "user32" Alias _ "GetActiveWindow" () As Integer Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Private Const BUFFER_LEN As Long = 254 Sub ShowActiveWindow() Dim RetLen As Long Dim sBuffer As String * BUFFER_LEN RetLen = GetWindowText(GetActiveWindow32, sBuffer, BUFFER_LEN) If RetLen 0 Then MsgBox Left(sBuffer, RetLen) End Sub -- Jim Rech Excel MVP "jacob" wrote in message ... | Hi, | With a modeless userform, is it possible to detect its | state via VBA, i.e. if it has focus or not? | | What is client coordinates? | | Any help appreciated. | | jacob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Modeless userform | New Users to Excel | |||
Can RefEdit Contrl be Used on a Modeless Userform? | Excel Programming | |||
Modeless userform | Excel Programming | |||
Disable close button of Modeless Userform | Excel Programming | |||
Focus back from modeless userform to sheet | Excel Programming |