jpm Posted April 14, 2004 Posted April 14, 2004 // NOT WORKING WHY ???? nColor= -1 HDC hDC=GetDC(m_hWndGUITab); nColor = GetBkColor(hDC); ReleaseDC(m_hWndGUITab,hDC); Why this code set always ncolor to -1 the Handle is a tab control? Thanks for the help
Holger Posted April 14, 2004 Posted April 14, 2004 Hi JP,maybe this one from MSDN says why:http://msdn.microsoft.com/library/default.....setbkcolor.aspCTabCtrl::SetBkColorRemarksThe SetBkColor and GetBkColor member functions are not valid for class CTabCtrl. These member functions are not implemented in MFC because the underlying Windows 95 TCM_SETCOLOR message was not implemented. Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
jpm Posted April 14, 2004 Author Posted April 14, 2004 Hi JP,maybe this one from MSDN says why:http://msdn.microsoft.com/library/default.....setbkcolor.aspwell, do you think it is still true under XP !!!
Valik Posted April 15, 2004 Posted April 15, 2004 JP, I searched MSDN library for "TCM_SETCOLOR" and it turned up 2 results, both saying what Holger posted. I also searched in Visual Studio for TCM_SETCOLOR and it couldn't find the symbol. I don't know exactly how much stock I would put in an example from MFC, but I would recommend first searching CodeProject.com and if you can't find anything there, search the web.
jpm Posted April 15, 2004 Author Posted April 15, 2004 JP, I searched MSDN library for "TCM_SETCOLOR" and it turned up 2 results, both saying what Holger posted. I also searched in Visual Studio for TCM_SETCOLOR and it couldn't find the symbol. I don't know exactly how much stock I would put in an example from MFC, but I would recommend first searching CodeProject.com and if you can't find anything there, search the web.Thanks Valik,I am not use to codeproject but I will have a try.Holger or CyberSlug point me to the whole stuff to paint the tab control in fact it is only painting the tabs names but that a lot of code for small impact.I just want to manage the may the color for control created for a tab fit with the tab default background color.
Holger Posted April 15, 2004 Posted April 15, 2004 @jpm: is it possible (somehow) to 'paint' a rectangle with the backgroundcolor over the tab-control? Like if you write an empty label-control over the false-colored area... But after that the added tabs should be visible... I don't know...a big MS-logical problem I think... I don't know if other programming-languages has this feature... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
jpm Posted April 15, 2004 Author Posted April 15, 2004 @jpm: is it possible (somehow) to 'paint' a rectangle with the backgroundcolor over the tab-control?Like if you write an empty label-control over the false-colored area...But after that the added tabs should be visible...I don't know...a big MS-logical problem I think... I don't know if other programming-languages has this feature...Thanks,That's a solution I first use for painting before Larry and Valik found more basic way to do it perhaps I will came back to the tabitem being a control with color attribute. That's not solving the gray left top corner.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now