|
-
Sep 8th, 2000, 01:34 AM
#1
Thread Starter
New Member
I need to get the hWnd of my UserControl. The property is not exposed even if I change the "Parent" or "Windowless" properties it seems. I need to be able to get the hWnd for each instance of my ocx to pass to the API "SetTimer" function. Currently I am using a third party control to achieve this, but don't want it in my finished ocx. I would dearly love someone to enlighten me on this, and I thank you in advance
-
Sep 8th, 2000, 03:58 AM
#2
had the same problem too...
... this helped me
Code:
Public Property Get hWnd() As Long
hWnd = UserControl.hWnd
End Property
Just insert this in your UserControl's code.
The UserControl MUST NOT be windowless in order to have a window handle.
Regards
da_bob
______________
-
Sep 8th, 2000, 09:57 AM
#3
Thread Starter
New Member
Thanks
I had tried that da_Bob but it didn't work, it simply recurses into a stack overload. I've tried changing the container property, and with "Windowless" as true, and when that wouldn't work I tried it false. For some reason it won't expose the hWnd. I have heard of this problem before but never did find the solution, but now I am in need of it. I'm wondering if "GetWindow" may be the answer, but if so, and how, I don't know, though I'd love someone to enlighten me 
Thank you da_Bob anyway.
-
Sep 8th, 2000, 11:49 AM
#4
Thread Starter
New Member
Thank you
da_bob you were %100 correct. I added the instance num as in "UserControl1" and strangely it didn't work.
Thank you very much indeed
regards
morgo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|