Hello all: could any one tell me if there is a way to differentiate between static and edit controls when using API EnumChildWindows?

I have a tab control dialog with 8 static controls each containing a name with an edit contol adjacent to it, for a total of 16 controls in the dialog.

However when I attempt to use the tooltip control things don't go according to plan.

When using a string table to supply text for the ToolTip control the top 8 controls in the dialog, 4 static and 4 edit controls will show a tooltip -- not what I want.

I end up with half the tooltips in the correct place -- over the static controls -- and the other half appears in the adjacent 4 edit controls rather than over the remaining 4 static controls.

I would like the tooltip to appear, when the mouse points to the edit controls only.

Any ideas on how I should approach this problem.
Regards, Fumio
Posted on 2002-05-23 23:39:00 by Fumio
i can answer your first question. a static controls class will be "static" and an edit controls class will be "edit". so when you do your enumeration you will invoke getclassname and then make a comparison to both the static class and the edit class. then do whatever if one or the other matches.

as for the best method for you, im not sure what to tell you. have you looked at iczelion's tutorial on tooltips? he has different regions on the window and the buttons display there own tooltips.
Posted on 2002-05-24 00:02:40 by smurf
Smurf: thank you for your assistance. The use of the GetClassName API provided just what I needed. I am providing the code I have used to perhaps assit others. Note that it is based on Iczelion's tutorial #27 regarding tooltips.
Thankyou once again.
Regards Fumio
EnumChild proc uses edi hwndChild:DWORD,lParam:DWORD
LOCAL CHbuffer[255]:BYTE


mov edi,lParam
assume edi:ptr TOOLINFO

push hwndChild
pop .uId
or .uFlags,TTF_IDISHWND
; ########################################################################
;set up string id
; ########################################################################


invoke GetClassName,hwndChild,addr bufferE2,50
xor ecx,ecx
mov cl, bufferE2
cmp cl, 'E'
je @F
invoke LoadString,hInstance,wID,addr CHbuffer,255
inc wID
lea eax, CHbuffer
mov .lpszText,eax


invoke SendMessage,hwndTool,TTM_ADDTOOL,NULL,edi

@@:
assume edi:nothing
ret
EnumChild endp
Posted on 2002-05-24 12:44:25 by Fumio
One my old module to convert dlg to win.
Dbl click will generate size txt with size for normal window pixels.
Works this way.
Disign dlg with you want you window to be (to look)
Compile any rc of the dlg with size.asm
Run it, dbl click - and you'll get created size.asm with main
window size and ready to use api's for all controls in pixels with
all you need to create them in normal way.

I send it only 'cause it about EnumChild..
Posted on 2002-05-26 14:54:13 by The Svin