HWND of a view?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HWND of a view?

Jeff M.
I keep looking through documentation and the class browser, but can't
seem to find a simple way of getting the HWND of a created window/view.
I'm sure there is a simple way to do this, but any pointers in the
proper direction (and - even better - how I can easily find simple
information like this in the future) would be great! :-)

Thanks!

Jeff M.


Reply | Threaded
Open this post in threaded view
|

Re: HWND of a view?

Ian Bartholomew-21
Jeff,

>I keep looking through documentation and the class browser, but can't
> seem to find a simple way of getting the HWND of a created window/view.

Send #handle to a View instance, it answers an instance of ExternalHandle.

> I'm sure there is a simple way to do this, but any pointers in the
> proper direction (and - even better - how I can easily find simple
> information like this in the future) would be great! :-)

It's difficult to give a exact answer to that, it depends to a great extent
on what you are looking for.  In this case maybe ...

- Look at the methods and instance variables in View.
- Do a free text search (ClassBrowser/Browse Other/Containing Text) for
hwnd.
- Look at interface methods that pass a hwnd and then tracing back to see
where that parameter came from.

As a general rule, getting to know the image can be invaluable.  Spending a
bit of time just browsing around and following up on anything that looks
interesting...

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: HWND of a view?

Udo Schneider
In reply to this post by Jeff M.
Jeff M. wrote:
> I keep looking through documentation and the class browser, but can't
>  seem to find a simple way of getting the HWND of a created
> window/view. I'm sure there is a simple way to do this, but any
> pointers in the proper direction (and - even better - how I can
> easily find simple information like this in the future) would be
> great! :-)
Either #handle or #asParameter should do the job. Please note that
#asParameter might return nil as long as the View is not created whereas
#handle creates the the window if neccessary.

Nevertheless I prefer to use #asParameter as this is the way most calls
to ExternalLibraries are doing this.

That's as well my was way to discover such information. Search MSDN for
functions using these parameters, find the function in the
ExternalLibaries and search references to it up to the Level I'll need.

CU,

Udo