Announcement

Collapse
No announcement yet.

GetClassName and SuperClasses

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetClassName and SuperClasses

    By trial and error I found this out and hope it will be helpful to someone.

    By using GetClassName in the Dialog callback I've found I can do things in WM_CTLCOLOREDIT and like events the same way regardless of control id.

    For example the following code will turn a field to red if negative based solely on the ClassName.

    Code:
           CASE %WM_CTLCOLOREDIT
             LenT& = GetClassName(CBLPARAM,DispStr,%MAX_PATH)
             IF TRIM$(DispStr) = "NEditNumber" THEN
               GetWindowText CBLPARAM,Txt,LenT& 
               IF VAL(Txt) < 0 then
                 SetTextColor CBWPARAM,%RED
                 SetBkColor CBWPARAM,%WHITE
                 FUNCTION=App_Brush
               ELSE
                 SetTextColor CBWPARAM,%BLACK
                 SetBkColor CBWPARAM,%WHITE
                 FUNCTION=App_Brush
               END IF
             END IF
    Bob Mechler
Working...
X