Can anyone give me some hints on how to get a handle to a userform please? In full vb I believe you can use userform.hwnd, but this property isn't there in VBA. Will I have to make some API calls to get it?
Can anyone give me some hints on how to get a handle to a userform please? In full vb I believe you can use userform.hwnd, but this property isn't there in VBA. Will I have to make some API calls to get it?
You can declare this in your user form code:
then get handles to it when its active with this:Private Declare Function GetActiveWindow Lib "user32.dll" () As Long
dim hWnd as Long hWnd = GetActiveWindow()
Hope that helps
K :-)
This should help:
http://www.thecodenet.com/articles.php?id=2
"Computers are useless. They can only give you answers." - Pablo Picasso
Mark Rowlinson FIA | The Code Net
thanks very much guys, both your answers came in very handy!