1. Getting Combo Box Drop Down Button hWnd?

Hello,


Anyone have any luck getting the hWnd to the drop down button in a
drop down ComboBoxEx32 class combobox?
I've gotten the other control's hWnd's pretty easy but this one is
a little elusive.
I'm pretty sure it was discussed before somewhere on here.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » topic index » view message » categorize

2. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> 
> 
> Hello,
> 
> 
> Anyone have any luck getting the hWnd to the drop down button in a
> drop down ComboBoxEx32 class combobox?
> I've gotten the other control's hWnd's pretty easy but this one is
> a little elusive.
> I'm pretty sure it was discussed before somewhere on here.
> 
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"
> 


Hello Al,
I'm just guessing, but maybe the drop down button is a child of a child control
it is over the edit control, so maybe it is a child of the edit control.
So if you got the handle of the edit control, you may try to enumerate the
children
of that edit control.

regards,
Jacques Deschênes

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

3. Re: Getting Combo Box Drop Down Button hWnd?

jacques deschênes wrote:
> 
> Al Getz wrote:
> > 
> > 
> > Hello,
> > 
> > 
> > Anyone have any luck getting the hWnd to the drop down button in a
> > drop down ComboBoxEx32 class combobox?
> > I've gotten the other control's hWnd's pretty easy but this one is
> > a little elusive.
> > I'm pretty sure it was discussed before somewhere on here.
> > 
> > 
> > Take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> > 
> 
> Hello Al,
> I'm just guessing, but maybe the drop down button is a child of a child
> control
> it is over the edit control, so maybe it is a child of the edit control.
> So if you got the handle of the edit control, you may try to enumerate the
> children
> of that edit control.
> 
> regards,
> Jacques Deschênes
> 

Hi Jacques,


That sounded like a good guess so i tried it but it doesnt seem to
work either sad  Of course first i enum child windows of the hCBox
and that gives me two to work from, but neither provides any new
hWnd's on enumerating their 'childs' (if any).
I've already proved that this hWnd does in fact exist and that it
gets an 'internal' id assigned by Windows.
ChildWindowFromPoint doesnt work either, unless you're only after
the edit control hWnd.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

4. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> > > Anyone have any luck getting the hWnd to the drop down button in a
> > > drop down ComboBoxEx32 class combobox?
> > > I've gotten the other control's hWnd's pretty easy but this one is
> > > a little elusive.
> > > I'm pretty sure it was discussed before somewhere on here.

Al,

I browsed through MSDN for ComboBox/ComboBoxEx and I can see no way to get the
handle of the button control.

Might we ask as to why you're needing the handle for the dropdown button?  There
might be another way around what you're trying to do.

Jonas Temple
http://www.yhti.net/~jktemple

P.S. - Yeah, I know I haven't been around lately but I'm going to try and change
that.

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

5. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> 
> 
> Hello,
> 
> 
> Anyone have any luck getting the hWnd to the drop down button in a
> drop down ComboBoxEx32 class combobox?
> I've gotten the other control's hWnd's pretty easy but this one is
> a little elusive.
> I'm pretty sure it was discussed before somewhere on here.
> 
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"
> 

Al:

You can use the GetDlgItem function with any parent-child window pair,
not just with dialog boxes. As long as the hDlg parameter specifies a
parent window and the child window has a unique identifier
(as specified by the hMenu parameter in the CreateWindow or
CreateWindowEx function that created the child window),
GetDlgItem returns a valid handle to the child window. 


Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

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

6. Re: Getting Combo Box Drop Down Button hWnd?

Bernie Ryan wrote:
> 
> Al Getz wrote:
> > 
> > 
> > Hello,
> > 
> > 
> > Anyone have any luck getting the hWnd to the drop down button in a
> > drop down ComboBoxEx32 class combobox?
> > I've gotten the other control's hWnd's pretty easy but this one is
> > a little elusive.
> > I'm pretty sure it was discussed before somewhere on here.
> > 
> > 
> > Take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> > 
> 
> Al:
> 
> You can use the GetDlgItem function with any parent-child window pair,
> not just with dialog boxes. As long as the hDlg parameter specifies a
> parent window and the child window has a unique identifier
> (as specified by the hMenu parameter in the CreateWindow or
> CreateWindowEx function that created the child window),
> GetDlgItem returns a valid handle to the child window. 
> 
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.ew
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 

Hi Bernie,

Thanks for the idea, but i tried it and it doesnt get the hWnd, it
just returns zero (0).  It could be because this particular hWnd
doesnt seem to be registered or acknowledged as a 'child' window
by Windows, so it also doesnt show up when enumerating child windows.
Im guessing now that Windows creates the button control similar to
how an up/down control works...where the up/down controls calls the
edit control a "buddy" window so maybe there's no parent/child 
relationship.
Also what doesnt work is 'GetWindow' with ANY flag, because, again
im guessing though, the window is not related to the hComboBox as
a child.
As per another suggestion, it doesnt not seem to be a child of a
child either.  It just seems to exist.
One thing i didnt try was to try to get the hWnd by looking up 
children of the parent main window, but i'd hate to have to do that
in the applications anyway unless there was also some simple way to
tell that button from possible many other buttons.

Any more ideas appreciated and i'll most likely try them too.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

7. Re: Getting Combo Box Drop Down Button hWnd?

Jonas Temple wrote:
> 
> Al Getz wrote:
> > > > Anyone have any luck getting the hWnd to the drop down button in a
> > > > drop down ComboBoxEx32 class combobox?
> > > > I've gotten the other control's hWnd's pretty easy but this one is
> > > > a little elusive.
> > > > I'm pretty sure it was discussed before somewhere on here.
> 
> Al,
> 
> I browsed through MSDN for ComboBox/ComboBoxEx and I can see no way to get the
> handle
> of the button control.
> 
> Might we ask as to why you're needing the handle for the dropdown button? 
> There might
> be another way around what you're trying to do.
> 
> Jonas Temple
> <a href="http://www.yhti.net/~jktemple">http://www.yhti.net/~jktemple</a>
> 
> P.S. - Yeah, I know I haven't been around lately but I'm going to try and
> change that.
> 


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

8. Re: Getting Combo Box Drop Down Button hWnd?

Jonas Temple wrote:
> 
> Al Getz wrote:
> > > > Anyone have any luck getting the hWnd to the drop down button in a
> > > > drop down ComboBoxEx32 class combobox?
> > > > I've gotten the other control's hWnd's pretty easy but this one is
> > > > a little elusive.
> > > > I'm pretty sure it was discussed before somewhere on here.
> 
> Al,
> 
> I browsed through MSDN for ComboBox/ComboBoxEx and I can see no way to get the
> handle
> of the button control.
> 
> Might we ask as to why you're needing the handle for the dropdown button? 
> There might
> be another way around what you're trying to do.
> 
> Jonas Temple
> <a href="http://www.yhti.net/~jktemple">http://www.yhti.net/~jktemple</a>
> 
> P.S. - Yeah, I know I haven't been around lately but I'm going to try and
> change that.
> 

Hello,

Yes, thanks for asking smile
Im trying to change the internal id of the button control...something
that has been very successful with the two other controls that are
contained within the ComboBox control.
By changing the internal id's i can get the id of my controls very
quickly, rather than have to search through a possible long list of
hWnds.
Right now im using a 'workaround' by allocating about 20 id's just
for ComboBox button controls, so that my library ignores any message
coming from one of those buttons, while the user's controls are 
handled correctly.
Internally Windows automatically assignes id's to the ComboBox
controls starting at 1000 decimal.  Since a user typically creates
maybe 100 or 200 controls, 1000 is way too high and causes an error.
By allocating 20 (or more) id's there's no problem, but i'd still
like to handle this the same way i've handled the other two sub controls...
by simply changing the id's, and that way they can get events and other
stuff normal controls can handle.

Any ideas?

I've considered subclassing, but i'd rather not because i havent
needed to do that yet and will only use that as a last resort...even
after allocating some (rather wasted) space for combo boxes that
may never be created.  After all i guess it's not really that
much space anyway and it's only allocated if the user creates more
than 1000 controls.

So far all things considered, i'd like to be able to get the hWnd
and reassign the id...it's worked so well with the other sub controls.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

9. Re: Getting Combo Box Drop Down Button hWnd?

A useful tool for investigating this kind of thing is WinSpy++
http://www.catch22.net/software/winspy.asp

I used it to look at a combobox but saw no Drop Down hWnd.

I suspect that MS does not want us mere mortals to know about, let alone use,
such internal details of controls. An application using such undocumented
internals may break in future OS's.

Larry Miller

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

10. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> 
> Hi Bernie,
> 
> Thanks for the idea, but i tried it and it doesnt get the hWnd, it
> just returns zero (0).  It could be because this particular hWnd
> doesnt seem to be registered or acknowledged as a 'child' window
> by Windows, so it also doesnt show up when enumerating child windows.
> Im guessing now that Windows creates the button control similar to
> how an up/down control works...where the up/down controls calls the
> edit control a "buddy" window so maybe there's no parent/child 
> relationship.
> Also what doesnt work is 'GetWindow' with ANY flag, because, again
> im guessing though, the window is not related to the hComboBox as
> a child.
> As per another suggestion, it doesnt not seem to be a child of a
> child either.  It just seems to exist.
> One thing i didnt try was to try to get the hWnd by looking up 
> children of the parent main window, but i'd hate to have to do that
> in the applications anyway unless there was also some simple way to
> tell that button from possible many other buttons.
> 
> Any more ideas appreciated and i'll most likely try them too.
> 

Al:

Go here you should be able to create your own combbox
and do what you want with it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/comboex/reflist.asp

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

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

11. Re: Getting Combo Box Drop Down Button hWnd?

Hi,
Guessing again!
What about if the drop down button is not really a control but a drawing in the
edit control client area.  In that case the edit wndproc test for the location
of the
WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and act 
accordingly. A way to test would be to subclass the edit control and block 
the passing of WM_LBUTTONDOWN to the default edit wndproc

regards,
Jacques Deschênes

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

12. Re: Getting Combo Box Drop Down Button hWnd?

Larry Miller wrote:
> 
> A useful tool for investigating this kind of thing is WinSpy++
> <a
> href="http://www.catch22.net/software/winspy.asp">http://www.catch22.net/software/winspy.asp</a>
> 
> I used it to look at a combobox but saw no Drop Down hWnd.
> 
> I suspect that MS does not want us mere mortals to know about, let alone use,
> such internal details of controls. An application using such undocumented
> internals may break in future OS's.
> 
> Larry Miller
> 

Hi Larry,

Well, i dont have any problem getting the hWnd in some debug mode, problem 
is it has to be gotten programatically during the creation phase of the
ComboBox.  Nasty thing is Windows doesnt bother to post a WM_CREATE message
either!  This is looking like one of those nasty oversights on the part of
MS.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

13. Re: Getting Combo Box Drop Down Button hWnd?

Bernie Ryan wrote:
> Al:
> 
> Go here you should be able to create your own combbox
> and do what you want with it.
> 
> <a
> href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/comboex/reflist.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/comboex/reflist.asp</a>
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.ew
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 

Hi Bernie,

Well, i read most of that and tried a few things like the CBEM_ messages
and nothing turned up the correct hWnd.  I know it really exists because
i can get it through a message trap, but one that i dont think can be
used to get it without a physical action on the part of the user of the
program, so that doesnt help, except for maybe debugging.

Any more ideas appreciated...

Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

14. Re: Getting Combo Box Drop Down Button hWnd?

jacques deschênes wrote:
> 
> 
> Hi,
> Guessing again!
> What about if the drop down button is not really a control but a drawing in
> the
> edit control client area.  In that case the edit wndproc test for the location
> of the
> 
> WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and act 
> accordingly. A way to test would be to subclass the edit control and block 
> the passing of WM_LBUTTONDOWN to the default edit wndproc
> 
> regards,
> Jacques Deschênes
> 

Hi Jacques,

Very good idea, and it does in fact work, but that's what i've been
doing for debug purposes (to verify the hWnd does exist and what it
really is at run time).  The problem is, there's no way to force the
button to generate a WM_LBUTTONUP (actually what i really trap) or
WM_LBUTTONDOWN without the user taking part.  Apparently, the only
way to get that to give the correct hWnd is to have someone move the
mouse over the button and click it at least once, which triggers a
WM_LBUTTONx which of course passes the correct hWnd which can then
be logged and used like any other hWnd.  This of course wont be
acceptable so i need another way.
I'd hate to have to programmatically move the mouse and click the
button just to generate the message so i can trap all the combobox
button hWnd's to every single combobox (w/dropdown) hee hee.  It 
would be funny however, especially if we had the mouse move at near
human speed so the user would watch this taking place every time they
open up their program smile

Keep the ideas coming and i'll keep trying them...


Thanks and take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

15. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> 
> jacques deschênes wrote:
> > 
> > 
> > Hi,
> > Guessing again!
> > What about if the drop down button is not really a control but a drawing in
> > the
> > edit control client area.  In that case the edit wndproc test for the
> > location of the
> > 
> > WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and act
> >
> > accordingly. A way to test would be to subclass the edit control and block 
> > the passing of WM_LBUTTONDOWN to the default edit wndproc
> > 
> > regards,
> > Jacques Deschênes
> > 
> 
> Hi Jacques,
> 
> Very good idea, and it does in fact work, but that's what i've been
> doing for debug purposes (to verify the hWnd does exist and what it
> really is at run time).  The problem is, there's no way to force the
> button to generate a WM_LBUTTONUP (actually what i really trap) or
> WM_LBUTTONDOWN without the user taking part.  Apparently, the only
> way to get that to give the correct hWnd is to have someone move the
> mouse over the button and click it at least once, which triggers a
> WM_LBUTTONx which of course passes the correct hWnd which can then
> be logged and used like any other hWnd.  This of course wont be
> acceptable so i need another way.
> I'd hate to have to programmatically move the mouse and click the
> button just to generate the message so i can trap all the combobox
> button hWnd's to every single combobox (w/dropdown) hee hee.  It 
> would be funny however, especially if we had the mouse move at near
> human speed so the user would watch this taking place every time they
> open up their program smile
> 
> Keep the ideas coming and i'll keep trying them...
> 
> 
> Thanks and take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"
> 

Disclaimer:
I don't really know anything about this stuff but I had an idea 
when reading this last post. And, you seem to be grasping for
sraws here so here's my idea.

Instead of programatically moving the mouse to click the button
could you set_focus to the parent control (the combo-box I guess)
and pass a keyboard event such as Enter or Space or Down_Arrow ?

======
Lewy T
http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=Townsend

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

16. Re: Getting Combo Box Drop Down Button hWnd?

> Subject: Re: Getting Combo Box Drop Down Button hWnd?
>
>
> posted by: jacques desch=EAnes <desja at globetrotter.net>
>
>
> Hi,
> Guessing again!
> What about if the drop down button is not really a control but a drawing =
in the
> edit control client area.  In that case the edit wndproc test for the loc=
ation of the
> WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and =
act
> accordingly. A way to test would be to subclass the edit control and bloc=
k
> the passing of WM_LBUTTONDOWN to the default edit wndproc
>
> regards,
> Jacques Desch=EAnes

I saw the following technique being recommended to create a funny
looking button in an eit box:
1/when processing WM_NCPAINT, draw the button
2/track the WM_LBUTTONDOWN to know ig there's a click
3/as the button lies on the non client area of the window (be it an edit
box or not), trap WM_NCHITTEST to return a fake "in window" answer when
"button" is clicked. This allows for WM_LBUTTONDOWN to be processed at all.=


I'm telling you this from memory, and some details may be incorrect.
Please email me at ccuvier at free.fr for the web page (can't remember
where I snatched it from).

Tne het result is as follows: of %$ uses this technique to implement
drop down buttons, you'll never get your hand on iy, as it is not a
control at all, hence has no hwnd of its own.
CChris

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

17. Re: Getting Combo Box Drop Down Button hWnd?

Lewis Townsend wrote:
> 
> Al Getz wrote:
> > 
> > jacques deschênes wrote:
> > > 
> > > 
> > > Hi,
> > > Guessing again!
> > > What about if the drop down button is not really a control but a drawing
> > > in the
> > > edit control client area.  In that case the edit wndproc test for the
> > > location of the
> > > 
> > > WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and
> > > act
> > > accordingly. A way to test would be to subclass the edit control and block
> > >
> > > the passing of WM_LBUTTONDOWN to the default edit wndproc
> > > 
> > > regards,
> > > Jacques Deschênes
> > > 
> > 
> > Hi Jacques,
> > 
> > Very good idea, and it does in fact work, but that's what i've been
> > doing for debug purposes (to verify the hWnd does exist and what it
> > really is at run time).  The problem is, there's no way to force the
> > button to generate a WM_LBUTTONUP (actually what i really trap) or
> > WM_LBUTTONDOWN without the user taking part.  Apparently, the only
> > way to get that to give the correct hWnd is to have someone move the
> > mouse over the button and click it at least once, which triggers a
> > WM_LBUTTONx which of course passes the correct hWnd which can then
> > be logged and used like any other hWnd.  This of course wont be
> > acceptable so i need another way.
> > I'd hate to have to programmatically move the mouse and click the
> > button just to generate the message so i can trap all the combobox
> > button hWnd's to every single combobox (w/dropdown) hee hee.  It 
> > would be funny however, especially if we had the mouse move at near
> > human speed so the user would watch this taking place every time they
> > open up their program smile
> > 
> > Keep the ideas coming and i'll keep trying them...
> > 
> > 
> > Thanks and take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> > 
> 
> Disclaimer:
> I don't really know anything about this stuff but I had an idea 
> when reading this last post. And, you seem to be grasping for
> sraws here so here's my idea.
> 
> Instead of programatically moving the mouse to click the button
> could you set_focus to the parent control (the combo-box I guess)
> and pass a keyboard event such as Enter or Space or Down_Arrow ?
> 
> ======
> Lewy T
> <a
> href="http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=Townsend">http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=Townsend</a>
> 

Hi Lewis,

That's an interesting idea and i will most likely try it at some point,
but im wondering now if it will be possible in the whole time frame of
things.  That is, i'll have to setfocus and call some action key to get
the button 'pressed' (which might work), and that's just fine (im guessing),
but the problem im wondering about is this:
The time frame is during the creation of the ComboBox, and i'd like
to have the task completed before the Create() call returns so that the
next combobox (if any) to be created can be processed properly.  What
im not sure of at this point is if the message will be processed that
quickly, and i dont think it will be because the program doesnt enter
it's message loop until AFTER all the controls (or at least most)
are created.  There might be a way around this but i think it would
take some thought, but if i cant find a more direct way i'll be coming
back to this idea so thanks for the suggestion.
Whatever happens i'll post something here.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

18. Re: Getting Combo Box Drop Down Button hWnd?

Christian Cuvier wrote:
> 
> > Subject: Re: Getting Combo Box Drop Down Button hWnd?
> >
> >
> > posted by: jacques desch=EAnes <desja at globetrotter.net>
> >
> >
> > Hi,
> > Guessing again!
> > What about if the drop down button is not really a control but a drawing =
> in the
> > edit control client area.  In that case the edit wndproc test for the loc=
> ation of the
> > WM_LBUTTONDOWN  and if it got a hit on the button area, it redraw it and =
> act
> > accordingly. A way to test would be to subclass the edit control and bloc=
> k
> > the passing of WM_LBUTTONDOWN to the default edit wndproc
> >
> > regards,
> > Jacques Desch=EAnes
> 
> I saw the following technique being recommended to create a funny
> looking button in an eit box:
> 1/when processing WM_NCPAINT, draw the button
> 2/track the WM_LBUTTONDOWN to know ig there's a click
> 3/as the button lies on the non client area of the window (be it an edit
> box or not), trap WM_NCHITTEST to return a fake "in window" answer when
> "button" is clicked. This allows for WM_LBUTTONDOWN to be processed at all.=
> 
> 
> I'm telling you this from memory, and some details may be incorrect.
> Please email me at ccuvier at free.fr for the web page (can't remember
> where I snatched it from).
> 
> Tne het result is as follows: of %$ uses this technique to implement
> drop down buttons, you'll never get your hand on iy, as it is not a
> control at all, hence has no hwnd of its own.
> CChris
> 
> 

Hi Chris,

Well, that's nice of you to suggest, and i do appreciate it because i'm 
looking at all the possibilities here, but it's sort of a moot point
because it doesnt really matter whether it's the hWnd of the 'button'
or the hWnd of the 'listbox' (probably more properly the listbox)...
but in any case i need this hWnd, be it one class or another.

Once i get this hWnd which does really exist (proved by guessing at
the hWnd and using it in various ways) the program works exactly as
expected, which suggests to me that if i can find a better way to 
get this hWnd (regardless what class it belongs to) i can solve
the problem.  The reason i originally guessed it was the 'button'
hWnd was because left clicking that very button generates an
event which can be trapped and examined in detail (for it's hWnd).

Im pretty sure you're right that it's not 'really' the button, that
it's really the list box, but i still need that hWnd.  Maybe this
could pave the way for a better solution however...



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

19. Re: Getting Combo Box Drop Down Button hWnd?

On ??, Al Getz wrote:

Nasty thing is Windows doesnt bother to post a WM_CREATE message
either!  This is looking like one of those nasty oversights on the
part of MS.

Have you tried trapping WM_PARENTNOTIFY with WM_CREATE in the lowword
of wParam? Just a thought...

Regards,
Pete

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

20. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> Im trying to change the internal id of the button control...something
> that has been very successful with the two other controls that are
> contained within the ComboBox control.
> By changing the internal id's i can get the id of my controls very
> quickly, rather than have to search through a possible long list of
> hWnds.

Rather than stuff around like this, why not just create a hash value from the
hWnd and use that to scan a tiny list instead? I'm sure that will take much less
time to do.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

21. Re: Getting Combo Box Drop Down Button hWnd?

Hi there again Pete,

Thanks very much for the idea, but it's looking like trapping
messages wont work out because of the time frame.  It sort of 
works for debugging (at least you can get the hWnd) but it 
doesnt seem to be a practical method to use in real time.
By the time the message arrives it's a little late.
Also, there doesnt seem to be any message at all posted until
something is forced, such as the user clicking the little down
arrow button.  That seems to be the only way to get a message
from the control, which finally reveals it's hWnd.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

22. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> > Im trying to change the internal id of the button control...something
> > that has been very successful with the two other controls that are
> > contained within the ComboBox control.
> > By changing the internal id's i can get the id of my controls very
> > quickly, rather than have to search through a possible long list of
> > hWnds.
> 
> Rather than stuff around like this, why not just create a hash value from the
> hWnd
> and use that to scan a tiny list instead? I'm sure that will take much less
> time to
> do.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Hi there Derek,

Oh yes, very good idea!  If i cant find this within the next day or
so i'll do that.  Luckily it wont be hard to convert my lib to do
that and i think it would be pretty fast to search a small list
like you said so the overhead time shouldn't add much of a delay.

BTW, what method is WinLib currently using to get ID's from hWnd's?


Thanks for the idea, and take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

23. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> 
> Also, there doesnt seem to be any message at all posted until
> something is forced, such as the user clicking the little down
> arrow button.  That seems to be the only way to get a message
> from the control, which finally reveals it's hWnd.

Al:

Can't use send message to send down-arrow ?

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

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

24. Re: Getting Combo Box Drop Down Button hWnd?

Bernie Ryan wrote:
> 
> Al Getz wrote:
> > 
> > Also, there doesnt seem to be any message at all posted until
> > something is forced, such as the user clicking the little down
> > arrow button.  That seems to be the only way to get a message
> > from the control, which finally reveals it's hWnd.
> 
> Al:
> 
> Can't use send message to send down-arrow ?
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.ew
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 

Hi Bernie,

Yes, i think sendmessage will initiate the drop down list
after a set focus.  The problem with sendmessage directly to
the arrow is that we dont know the hWnd beforehand, which is
what this is all about.

I've discovered something new which i didnt know about when i first
posted this question.  If i can prove this it might simplify things.
I'll try a few experiments and see if this new thing proves out and
if so i'll post an update a little later today.  If not, well, he he,
i guess i'll be trying the sendmessage thing to see how complicated
it will get to trap the posted message in real time.

Im beginning to wonder something else too though...that is,
i wonder just how many ComboBoxes with Dropdown listbox most
users will be creating after all...Anyone reading this do an 
application with a whole lotta' ComboBoxes? (like 100)


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

25. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
> Yes, i think sendmessage will initiate the drop down list
> after a set focus.  The problem with sendmessage directly to
> the arrow is that we dont know the hWnd beforehand, which is
> what this is all about.

Al:
    If you send up/down arrow message to combobox; you
  should know the hWnd of the COMBOBOX.

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

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

26. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:

> BTW, what method is WinLib currently using to get ID's from hWnd's?

I only get the ID from hWnds that I've created. If I get a message from a
foreign hWnd, I just do the default message processing for it.

Whenever a new control is created I allocate a spot in the control_hWnd
sequence. The index for that spot is the new control's ID value. After creating
the control and thus getting its hWnd, I save the hWnd in the sequence at
control_hWnd[newid] and call SetWindowLong to save the new id in the control's
User Data area.

In simple general terms I do this ...

    control_hWnd &= 0
    newid = length(control_hWnd)
    hWnd = call_c_func( CreateWindow, { . . . })
    control_hWnd[newid] = hWnd
    VOID = call_c_func( SetWindowLong, { hWnd, GWL_USERDATA, newid } )

Then in the message processing loop, when presented with a hWnd I call
GetWindowLong to fetch the id for my control.

    id = c_func( GetWindowLong, {hWnd, GWL_USERDATA } )
    if not integer(id) then
       id = 0 -- Foreign hWnd
    end if

The above code is greatly simplified as there a few fiddly bits when dealing
with treeviews and combo boxes.

For combo boxes, I get the first child hWnd which is the edit area and pretend
to create a new edit box but use this info instead.

    control_hWnd &= 0
    editid = length(control_hWnd)
    edit_hWnd = call_c_func( GetWindow,{ hWnd, GW_CHILD})
    control_hWnd[editid] = edit_hWnd
    VOID = call_c_func( SetWindowLong, { edit_hWnd, GWL_USERDATA, edit_id } )

I've never needed to do any special processing of message from a combo box's
button image. All the normal WM_COMMAND messages seem to cover that.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

27. Re: Getting Combo Box Drop Down Button hWnd?

Bernie Ryan wrote:
> 
> Al Getz wrote:
> > Yes, i think sendmessage will initiate the drop down list
> > after a set focus.  The problem with sendmessage directly to
> > the arrow is that we dont know the hWnd beforehand, which is
> > what this is all about.
> 
> Al:
>     If you send up/down arrow message to combobox; you
>   should know the hWnd of the COMBOBOX.
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.ew
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 

Hi Bernie,

Yes, that should work.  I'll might try it tomorrow, but as i was saying
in another post i've found something easier i think...


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

28. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> 
> > BTW, what method is WinLib currently using to get ID's from hWnd's?
> 
> I only get the ID from hWnds that I've created. If I get a message from a
> foreign hWnd,
> I just do the default message processing for it.
> 
> Whenever a new control is created I allocate a spot in the control_hWnd
> sequence. The
> index for that spot is the new control's ID value. After creating the control
> and thus
> getting its hWnd, I save the hWnd in the sequence at control_hWnd[newid] and
> call SetWindowLong
> to save the new id in the control's User Data area.
> 
> In simple general terms I do this ...
> 
>     control_hWnd &= 0
>     newid = length(control_hWnd)
>     hWnd = call_c_func( CreateWindow, { . . . })
>     control_hWnd[newid] = hWnd
>     VOID = call_c_func( SetWindowLong, { hWnd, GWL_USERDATA, newid } )
> 
> Then in the message processing loop, when presented with a hWnd I call
> GetWindowLong
> to fetch the id for my control.
> 
>     id = c_func( GetWindowLong, {hWnd, GWL_USERDATA } )
>     if not integer(id) then
>        id = 0 -- Foreign hWnd
>     end if
> 
> The above code is greatly simplified as there a few fiddly bits when dealing
> with treeviews
> and combo boxes. 
> 
> For combo boxes, I get the first child hWnd which is the edit area and pretend
> to create
> a new edit box but use this info instead.
> 
>     control_hWnd &= 0
>     editid = length(control_hWnd)
>     edit_hWnd = call_c_func( GetWindow,{ hWnd, GW_CHILD})
>     control_hWnd[editid] = edit_hWnd
>     VOID = call_c_func( SetWindowLong, { edit_hWnd, GWL_USERDATA, edit_id } )
> 
> I've never needed to do any special processing of message from a combo box's
> button
> image. All the normal WM_COMMAND messages seem to cover that.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Hello Derek,

I'm using a similar method but because i was worried about the user
of the lib wanting to use GWL_USERDATA i used an alternate method
for controls which didnt require exclusive setting of each id,
but now im not so worried so maybe i'll switch to using GWL_USERDATA
exclusively also.  This will mean i can reject id's too that are
zero (im assuming your's does that too).  Since the sub control listbox
will have an id of zero (when aquired with GetWindowLong) i can
simply default with those id's.

The only thing im wondering now is... if having an id assigned
to the sub control will add some sort of functionality to the
lib, in which case i would still seek to assign a private id.
I guess it doesnt matter that much though...


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

29. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:

[snip]
 
> I'm using a similar method but because i was worried about the user
> of the lib wanting to use GWL_USERDATA i used an alternate method
> for controls which didnt require exclusive setting of each id,

One of the changes I'm bringing to win32lib is to use Window Properties instead
of the User Data field.

Look up the SetProp, GetProp and RemoveProp API calls.
 
> The only thing im wondering now is... if having an id assigned
> to the sub control will add some sort of functionality to the
> lib, in which case i would still seek to assign a private id.
> I guess it doesnt matter that much though...

Example: For combo boxes, having an ID for the edit area allows users to easily
do keystroke processing.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

30. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> 
> [snip]
>  
> > I'm using a similar method but because i was worried about the user
> > of the lib wanting to use GWL_USERDATA i used an alternate method
> > for controls which didnt require exclusive setting of each id,
> 
> One of the changes I'm bringing to win32lib is to use Window Properties
> instead of
> the User Data field.
> 
> Look up the SetProp, GetProp and RemoveProp API calls.
>  
> > The only thing im wondering now is... if having an id assigned
> > to the sub control will add some sort of functionality to the
> > lib, in which case i would still seek to assign a private id.
> > I guess it doesnt matter that much though...
> 
> Example: For combo boxes, having an ID for the edit area allows users to
> easily do
> keystroke processing.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Hi again Derek,

I had considered using Windows Properties API's but decided that because
they use string values that they would add an unnecessary delay to
looking up the id's, and using ATOM's would muddie up the processing
and probably cause a delay also.
I still like your hashing idea and may turn to that at some point
down the road, unless switching to using GetWindowLong exclusively
works the way i want it too :)


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

31. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:

[snip]

> I had considered using Windows Properties API's but decided that because
> they use string values that they would add an unnecessary delay to
> looking up the id's, and using ATOM's would muddie up the processing
> and probably cause a delay also.

The string value is the name of the property and not the value of it.

constant  idprop = allocate_string("win32libid")

. . .
     control_hWnd &= 0
     newid = length(control_hWnd)
     hWnd = call_c_func( CreateWindow, { . . . })
     control_hWnd[newid] = hWnd
     VOID = call_c_func( SetProperty, { hWnd, idprop, newid } )

and later 

     id = call_c_func( GetProperty, { hWnd, idprop } )
     
-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

32. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> 
> [snip]
> 
> > I had considered using Windows Properties API's but decided that because
> > they use string values that they would add an unnecessary delay to
> > looking up the id's, and using ATOM's would muddie up the processing
> > and probably cause a delay also.
> 
> The string value is the name of the property and not the value of it.
> 
> constant  idprop = allocate_string("win32libid")
> 
> . . .
>      control_hWnd &= 0
>      newid = length(control_hWnd)
>      hWnd = call_c_func( CreateWindow, { . . . })
>      control_hWnd[newid] = hWnd
>      VOID = call_c_func( SetProperty, { hWnd, idprop, newid } )
> 
> and later 
> 
>      id = call_c_func( GetProperty, { hWnd, idprop } )
>      
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Hi there Derek,

Now that i see it written out it doesnt seem as bad as it originally
looked.  Just one question...did you have a problem with using
GetWindowLong() with GWL_USERDATA that would motivate you to look
for another method of managing id's ?


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

33. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:
[snip]

> Just one question...did you have a problem with using
> GetWindowLong() with GWL_USERDATA that would motivate you to look
> for another method of managing id's ?

No. The idea works very well. My reason for changing it is that I've expanded
the use of control properties to a huge degree and I wanted to enable developers
to add their own plus invent totally new types of controls. So I needed a nice
proven way of doing this. At first I used standard Euphoria sequences, but now I
believe that the built-in Windows API stuff will perform better.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

34. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> [snip]
> 
> > Just one question...did you have a problem with using
> > GetWindowLong() with GWL_USERDATA that would motivate you to look
> > for another method of managing id's ?
> 
> No. The idea works very well. My reason for changing it is that I've expanded
> the use
> of control properties to a huge degree and I wanted to enable developers to
> add their
> own plus invent totally new types of controls. So I needed a nice proven way
> of doing
> this. At first I used standard Euphoria sequences, but now I believe that the
> built-in
> Windows API stuff will perform better.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Hi again derek,

Oh ok, now i remember why i originally rejected the idea for use
in managing id's...

Using a string identifier of two characters long ("ID") requires
three times longer to access than using GetWindowLong().  This means
GetWindowLong() can retrieve three id's in the time it takes GetProp()
to retrieve one.  And that's assuming only two chars used for the
string AND only a few Properties...increasing the string length increases
the access time, and also increasing the number of Properties for a given
hWnd also increases the access time.  I doubt that adding Properties for
another hWnd will increase access time however, luckily :)

All this of course doesnt mean it's not useable, just that it's going
to eat up a bit more time to do the same thing (and this will occur
for each posted message).



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

35. Re: Getting Combo Box Drop Down Button hWnd?

I have been following the ongoing coversation between Al and Derek with
interest. I would like to add that there is a potential problem with setting
the GWL_USERDATA field on some controls. With the large marjority of controls,
all those currently supported by WIn32Lib, there is no problem. But setting 
this field on an IP Address control, "SysIPAddress32" class, has caused a
very serious problem for me. After this field has been set any reference to
the control prior to the main window opening causes a machine exception. 
Otherwise an error is generated on startup. Also, the SetWindowLong funtion does
not return 0 when this is done. The only window styles specified are WS_CHILD 
and WS_VISIBLE. If the function is removed the control opens and functions 
normally. I have noticed this only with this control type. 
This is on Windows 2000 with SP4 and IE6.

It appears that this control is using the GWL_USERDATA field for it's own use. 
Is it possible that I am doing something wrong, or is this not an entirely 
legitimate thing to do? MSDN does not specifically mention it's use with 
controls, only with windows.

Larry Miller

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

36. Re: Getting Combo Box Drop Down Button hWnd?

Larry Miller wrote:
> 
> I have been following the ongoing coversation between Al and Derek with
> interest. I would like to add that there is a potential problem with setting
> the GWL_USERDATA field on some controls. With the large marjority of controls,
> all those currently supported by WIn32Lib, there is no problem. But setting 
> this field on an IP Address control, "SysIPAddress32" class, has caused a
> very serious problem for me. After this field has been set any reference to
> the control prior to the main window opening causes a machine exception. 
> Otherwise an error is generated on startup. Also, the SetWindowLong funtion
> does
> not return 0 when this is done. The only window styles specified are WS_CHILD 
> and WS_VISIBLE. If the function is removed the control opens and functions 
> normally. I have noticed this only with this control type. 
> This is on Windows 2000 with SP4 and IE6.
> 
> It appears that this control is using the GWL_USERDATA field for it's own use.
>
> Is it possible that I am doing something wrong, or is this not an entirely 
> legitimate thing to do? MSDN does not specifically mention it's use with 
> controls, only with windows.
> 
> Larry Miller
> 

Hi there,

Very interesting Larry!  Why dont you try GetWindowLong() before you
set that value and see what it returns?  Report back here and we can
discuss it.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

37. Re: Getting Combo Box Drop Down Button hWnd?

Hi Al

I checked the value returned by GetWindowLong().
It is always a 7 digit number and is often the same, but not always, over 
different runs of the app. (usually 1479464 or 1479488). Other IP Address 
controls have different numbers but are often repeated. The number is not 
the control hWnd or the parent window's hWnd. The value returned for other 
types of controls is always 0.

I have not had a chance to check this on Win98 but will later today. I don't
have access to an XP machine.

Larry Miller

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

38. Re: Getting Combo Box Drop Down Button hWnd?

Larry Miller wrote:
> 
> It is always a 7 digit number and is often the same, but not always, over 
> different runs of the app. (usually 1479464 or 1479488). Other IP Address 

Larry:
   Maybe it's a pointer to a SZ string why don't you try peeking
   at some of the bytes it's pointing to.

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

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

39. Re: Getting Combo Box Drop Down Button hWnd?

Larry Miller wrote:
> 
> Hi Al
> 
> I checked the value returned by GetWindowLong().
> It is always a 7 digit number and is often the same, but not always, over 
> different runs of the app. (usually 1479464 or 1479488). Other IP Address 
> controls have different numbers but are often repeated. The number is not 
> the control hWnd or the parent window's hWnd. The value returned for other 
> types of controls is always 0.
> 
> I have not had a chance to check this on Win98 but will later today. I don't
> have access to an XP machine.
> 
> Larry Miller
> 

Bernie wrote:

>Larry:
>   Maybe it's a pointer to a SZ string why don't you try peeking
>   at some of the bytes it's pointing to.
>
>Bernie

Hi Bernie and Larry,

If it returns other than zero (0) for me that's enough
evidence it's being used by some program.  I guess that means
it cant be used.




Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

40. Re: Getting Combo Box Drop Down Button hWnd?

Hi Larry,

If you want to know the amount of user data bytes the control reserved you
should call
GetClassLong(hControl,GCL_CBWNDEXTRA)
and to know how user data bytes are reserved for the control class you should
call
GetClassLong(hControl,GCL_CBCLSEXTRA)
Obviously those memory spaces are reserved by the control for internal use and
you should not write to it.

regards,
Jacques Deschênes

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

41. Re: Getting Combo Box Drop Down Button hWnd?

Al Getz wrote:

[snip suggestion of Window Property API]
> 
> Oh ok, now i remember why i originally rejected the idea for use
> in managing id's...
> 
> Using a string identifier of two characters long ("ID") requires
> three times longer to access than using GetWindowLong().  This means
> GetWindowLong() can retrieve three id's in the time it takes GetProp()
> to retrieve one.  And that's assuming only two chars used for the
> string AND only a few Properties...increasing the string length increases
> the access time, and also increasing the number of Properties for a given
> hWnd also increases the access time.  I doubt that adding Properties for
> another hWnd will increase access time however, luckily :)

My testing of this indicates that there is no effective difference at all. That
is to say that using GetWindowLong and GetProp ("idwin32lib") has no difference
in performance. Even when adding 20+ properties to a hWnd, the GetProp is the
same speed as GetWindowLong.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

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

42. Re: Getting Combo Box Drop Down Button hWnd?

Derek Parnell wrote:
> 
> Al Getz wrote:
> 
> [snip suggestion of Window Property API]
> > 
> > Oh ok, now i remember why i originally rejected the idea for use
> > in managing id's...
> > 
> > Using a string identifier of two characters long ("ID") requires
> > three times longer to access than using GetWindowLong().  This means
> > GetWindowLong() can retrieve three id's in the time it takes GetProp()
> > to retrieve one.  And that's assuming only two chars used for the
> > string AND only a few Properties...increasing the string length increases
> > the access time, and also increasing the number of Properties for a given
> > hWnd also increases the access time.  I doubt that adding Properties for
> > another hWnd will increase access time however, luckily :)
> 
> My testing of this indicates that there is no effective difference at all.
> That is
> to say that using GetWindowLong and GetProp ("idwin32lib") has no difference
> in performance.
> Even when adding 20+ properties to a hWnd, the GetProp is the same speed as
> GetWindowLong.
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> irc://irc.sorcery.net:9000/euphoria
> 

Derek, that's hardly believable smile

Seeing as how one function requires a string compare and one uses an
array access, i dont see how they can return with the same delay.
The delay i've measured is three times longer but it's still not
that long so it's not going to be a 'major' issue most likely.
I just dont like changing something that adds a delay unless the
increased functionality is worth it.  In my code i use an added atom
test that adds a little time too.

No worries though, if it's just my computer then dont worry about 
it at all smile


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

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

Search



Quick Links

User menu

Not signed in.

Misc Menu