1. RE: Difference Between a Control ID and a Win32 Handle

Ron,

I'll take a stab at this...Derek, correct me if I'm wrong.

A control ID returned from the create() routine is basically an index to 
a sequence of hWnds stored internally in win32lib.  Each time you issue 
a create() the hWnd returned from the createEx() Windows API is appended 
to the end of the list and you are given that index number.

Why, you may ask? It's faster within win32lib to refer to a sequence 
index than to try and find the hWnd in a sequence of hWnds.  

HTH,

Jonas
Ron Tarrant wrote:
> Hi all,
> 
> I'm trying to find out what the difference is between a control
> ID (that's returned by the create() routine) and a handle
> (as in HWnd).
> 
> I'm assuming they aren't the same thing because in a call such as:
> 
> w32Proc(ScrollWindow, {getHandle(myWindow), HChange, 0, 0, 0})
> 
> where myWindow is the control ID, it's passed to the getHandle()
> routine to get the handle needed by ScrollWindow(). To me, this
> implies that we're dealing with two separate entities.
> 
> Also, browsing through the docs for win32lib's getControlInfo()
> routine, I don't see any mention of an lValue for the control ID
> of the control about which I'm seeking information. Does anyone know
> if there's a way to use getControlInfo() to get the control ID?
> I'm using it in a while loop to find the top-level window in
> which a control is located, so I don't think getSelf() will work
> in this case.
> 
> Thanks!
> 
> -Ron T.
> 
>

new topic     » topic index » view message » categorize

2. RE: Difference Between a Control ID and a Win32 Handle

petelomax at blueyonder.co.uk wrote:
> On Sat, 28 Sep 2002 11:20:08 +0000, Ron Tarrant
> <rtarrant at sympatico.ca> wrote:
> 
> 
> >I'm using it in a while loop to find the top-level window in
> >which a control is located, so I don't think getSelf() will work
> >in this case.
> 
> Try findParentWindow

Ah! I missed that one.

Thanks, Pete!

-Ron T.

new topic     » goto parent     » topic index » view message » categorize

3. RE: Difference Between a Control ID and a Win32 Handle

Jonas  Temple wrote:
> Ron,
> 
> I'll take a stab at this...Derek, correct me if I'm wrong.
> 
> A control ID returned from the create() routine is basically an index to 
> 
> a sequence of hWnds stored internally in win32lib.  Each time you issue 
> a create() the hWnd returned from the createEx() Windows API is appended 
> 
> to the end of the list and you are given that index number.
> 
> Why, you may ask? It's faster within win32lib to refer to a sequence 
> index than to try and find the hWnd in a sequence of hWnds.  

Okay, I think I see now. An hWnd is a real honest-to-goodness pointer
and a control ID is an index into the array of honest-to-goodness
pointers managed by win32lib.

Thanks, Jonas.

-Ron T.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu