Re: How to find out the IDs of controls and types?
Posted: Thu Jan 11, 2024 8:58 pm
João, the procedure is not finished. It has classes and other functions working together. This procedure would only be to catch controls that are not declared by the FWH.
For now it's like this
For now it's like this
Code: Select all | Expand
DEFINE DIALOG oDlgMy Resource "MY_DLG"
ACTIVE DIALOG oDlgMy ON INIT G_CTRLS_COLORS_API(oDlgMy)
FUNCTION G_CTRLS_COLORS_API(f_oDlgContainer)
Local lc_aCtrlsAllFwh := {}
Local lc_aIDsAllFwh := {}
Local lc_aCtrlsAllApi := {}
Local lc_aIDsSayFwh := {}
Local lc_iFor := 0
lc_aCtrlsAllFwh := f_oDlgContainer:aControls
For lc_iFor := 1 To Len(lc_aCtrlsAllFwh)
If ValType(lc_aCtrlsAllFwh[lc_iFor]) == "O"
AAdd(lc_aIDsAllFwh,lc_aCtrlsAllFwh[lc_iFor]:nID)
EndIf
Next
EnumChildWindows( f_oDlgContainer:hWnd,;
{ | _hChild | AAdd( lc_aCtrlsAllApi, { GetClassName( _hChild ), GetDlgCtrlID( _hChild ), _hChild, } ) } )
For lc_iFor := 1 To Len(lc_aCtrlsAllApi)
If Upper(lc_aCtrlsAllApi[lc_iFor,1]) == "STATIC"
If hb_AScan(lc_aIDsAllFwh,lc_aCtrlsAllApi[lc_iFor,2]) == 0 ; //Static Api > SAY Fwh not declared
.and. lc_aCtrlsAllApi[lc_iFor,2] != 65535 //Static borland or IDs null
SetWindowTheme(GetDc(lc_aCtrlsAllApi[lc_iFor,3]), "", "" )
Ctl3DLook(GetDc(lc_aCtrlsAllApi[lc_iFor,3]), .F.)
SetTextColor(GetDc(lc_aCtrlsAllApi[lc_iFor,3]), CLR_WHITE)
SetBkColor(GetDc(lc_aCtrlsAllApi[lc_iFor,3]), CLR_CYAN)
EndIf
EndIf
next
Return Nil