Re: Getting Combo Box Drop Down Button hWnd?
- Posted by Al Getz <Xaxo at aol.com> Jun 09, 2005
- 591 views
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"