differentiate between a visible and a hidden userform
Thanks, nice and simple and it exactly does the job.
RBS
"Tom Esh" wrote in message
...
On Thu, 30 Jun 2005 21:25:48 +0100, "RB Smissaert"
wrote:
In Excel VBA is there a way to detect with the API if an Excel userform
is hidden or visible?
There is no problem to get the Window handle, but I can't figure this out.
Have tried with a few GetWindow... API's, but no success sofar.
As the code is in one workbook and the userform is in another I can't do
this easily with VBA.
IsWindowVisible should do it:
Public Declare Function IsWindowVisible Lib "user32" _
(ByVal hWnd As Long) As Long
If IsWindowVisible(hwndFrm) < 0 Then
'...its visible...
End If
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
|