color BLACK in disabled combobox

forum.td.development (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

color BLACK in disabled combobox

Post by NewsgroupServer » 13 Jul 2010, 21:20

 Posted by:  Sepp 

Hallo NG,

how can i set the text-color to BLACK in a disabled combobox ?
the purpose is to make the text readable, when a hardcopy of the window is
printed on grey paper.
VisWinSetFlags( hWnd, WF_DisplayOnly, TRUE ) is not enough, because the
combobox remains editble

TIA

Sepp

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

color BLACK in disabled combobox

Post by NewsgroupServer » 14 Jul 2010, 11:02

 Posted by:  Rainer Ebert 

Hi Sepp,

we do it this way:

Call SalColorSet( hWndItem, COLOR_IndexWindow, COLOR_SysWindow)
Call SetWindowStyle( hWndItem, GWL_STYLE, WS_TABSTOP, TRUE )
Call SalSendMsg( GetWindow(hWndItem,GW_CHILD),EM_SetReadOnly,FALSE,0)

Number: GWL_STYLE = -16
Number: WS_TABSTOP = 0x00010000
Number: GW_CHILD = 5
Number: EM_SetReadOnly = 0x00cf

Function: SetWindowStyle
Returns
Boolean:
Parameters
Window Handle: p_hWnd
Number: p_nStyle
Number: p_nValue
Actions
Return SetWindowLongA(p_hWnd, p_nStyle, p_nValue | GetWindowLongA(p_hWnd,
p_nStyle))

Library Name: USER32.DLL
Function: SetWindowLongA
Export Ordinal: 0
Returns
Number: LONG
Parameters
Window Handle: HWND
Number: INT
Number: LONG
Function: GetWindowLongA
Export Ordinal: 0
Returns
Number: LONG
Parameters
Window Handle: HWND
Number: INT
Function: GetWindow
Export Ordinal: 0
Returns
Window Handle: HWND
Parameters
Window Handle: HWND
Number: DWORD

Regards,
Rainer

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

color BLACK in disabled combobox

Post by NewsgroupServer » 14 Jul 2010, 21:42

 Posted by:  Sepp 

Hello,

thank you for quick response.
lots of new functions and parameters ...
i am afraid, i would not be able to code the other way ... the ENABLE
can you give me a hint?

TIA

Sepp

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

color BLACK in disabled combobox

Post by NewsgroupServer » 15 Jul 2010, 10:57

 Posted by:  Rainer Ebert 

Sepp,

the other way:

Call SalColorSet( hWndItem, COLOR_IndexWindow, COLOR_3DFace)
Call SetWindowStyle( hWndItem, GWL_STYLE, WS_TABSTOP, FALSE )
Call SalSendMsg( GetWindow(hWndItem,GW_CHILD),EM_SetReadOnly,TRUE,0)

Function: SetWindowStyle
Returns
Boolean:
Parameters
Window Handle: p_hWnd
Number: p_nStyle
Number: p_nValue
Boolean: p_bSet
Actions
If p_bSet
Return SetWindowLongA(p_hWnd, p_nStyle, p_nValue |
GetWindowLongA(p_hWnd, p_nStyle))
Else
Return SetWindowLongA(p_hWnd, p_nStyle, (0xFFFFFFFF - p_nValue) &
GetWindowLongA(p_hWnd, p_nStyle))

Regards,
Rainer

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

color BLACK in disabled combobox

Post by NewsgroupServer » 22 Jul 2010, 20:43

 Posted by:  Sepp 

Hello,

thanks again or help.
but i ddidnot explain exactly, what i need.
the datafield-part of the comboboxes should remain "open". the user wants to
markup the text and copy it to the clipboard.
there is some gupta-built-in contextmenu, that is opened after right-click
...

TIA

Sepp

Return to “td.development”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests