Click here to Skip to main content
15,868,419 members
Articles / Desktop Programming / MFC
Article

True Colour Developer Studio Addin

Rate me:
Please Sign up or sign in to vote.
4.96/5 (15 votes)
26 Jan 2000CPOL 321K   2.8K   39   26
Use any colour in the Developer Studio IDE
  • Download add-in DLL - 18 Kb
  • Download source files - 31 Kb

    Sample Image - devtruecolour.gif

    Introduction

    Ever got frustrated with only being able to use 16 colours in the developer studio IDE? DevTrueColour is an add-in that customizes the Tools | Options | Format tab, hiding the 16 colour combo boxes and replacing them with two Office 97 style colour pickers (courtesy of Chris Maunder). All editor windows are updated without restarting the IDE

    Installation

    1. Build the DevTrueColour.dsp project OR copy DevTrueColour.dll into program files\microsoft visual studio\common\msdev98\addins
    2. Open Tools | Customize | Add-ins and Macro Files and tick DevTrueColour.
    3. Tools | Options | Format. You should have 2 replacement combo boxes for the colours

    The add-in uses Chris Maunder's Office 97 style Colour Picker control.

    Limitations

    Under certain circumstances, the colour pickers don't update. This seems to be due to having different colours for items that appear in more than one category. Eg. If Bookmark is set to red in Output Window and green in Source Windows, then All Windows is selected, the colour pickers don't update. This appears to be a feature of Developer Studio, as it happens without the add-in enabled!

    I have only been able to test the add-in in VC6.0. It should work in 5.0, but if it doesn't you are welcome to fix it and I will incorporate any changes into the original.

    How it works

    The colour combo boxes on the Format page are owner draw controls, with the item data containing a COLORREF, or 0x8000000 if Automatic is selected. It we can change the item data value we can use the combo box as a means of injecting any colour we want into developer studio.

    On loading, the add-in registers a thread wide window procedure hook, which it uses to wait for WM_INITDIALOG on the Format tab of the options. Unfortunately the title of the Format child dialog isn't set at this point, so we have to use the existence of a couple of child controls to verify the identity of the page.

    The original combo boxes are hidden, and the colour picker combo's are created. I had to put these in modeless child dialogs to get message reflection to work, which is a bit messy, but this had the side effect of allowing easier access to the colour picker notification messages.

    Whenever the colour picker closes, the corresponding hidden combo box has item 0's data set to the new colour and a couple a fake key presses sent to it (VK_END followed by VK_HOME) to update the sample text.

    The hook procedure also catches CB_FINDSTRINGEXACT, which is used to update the colour picker's selected colour, WM_ENABLE, which enables and disables the colour picker windows based on the enabled state of the hidden colour combo boxes, and WM_DESTROY, which is used for cleaning up when the property sheet is closed.

  • License

    This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


    Written By
    Software Developer (Senior)
    United Kingdom United Kingdom
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    GeneralOffice 2000 or 2003 colors Pin
    Adrian Bacaianu16-Nov-03 5:35
    Adrian Bacaianu16-Nov-03 5:35 
    GeneralCrashes DevStudio when active and loses focus Pin
    Jeff Elliott14-Nov-03 6:25
    Jeff Elliott14-Nov-03 6:25 
    GeneralPrinting and copying in colour Pin
    gazefac7-Oct-03 14:45
    sussgazefac7-Oct-03 14:45 
    GeneralWM_CHANGEBORDER Pin
    the_sikander25-Jun-03 4:51
    the_sikander25-Jun-03 4:51 
    GeneralDoesn't work in VC 6 SP5 Prof Edit Pin
    Franz Klein20-May-03 23:34
    Franz Klein20-May-03 23:34 
    GeneralRe: Doesn't work in VC 6 SP5 Prof Edit Pin
    Simon Capewell4-Aug-03 23:53
    Simon Capewell4-Aug-03 23:53 
    GeneralRe: Doesn't work in VC 6 SP5 Prof Edit Pin
    VogelH9-Mar-05 10:02
    professionalVogelH9-Mar-05 10:02 
    GeneralGreat Addin Pin
    olaymic11-Apr-03 1:39
    olaymic11-Apr-03 1:39 
    QuestionWhat about.... Pin
    alan939-Apr-03 2:19
    alan939-Apr-03 2:19 
    AnswerRe: What about.... Pin
    Simon Capewell5-May-03 23:36
    Simon Capewell5-May-03 23:36 
    GeneralRe: What about.... Pin
    alan936-May-03 2:27
    alan936-May-03 2:27 
    GeneralGreat utility Pin
    mama_pendse6-Mar-03 21:41
    mama_pendse6-Mar-03 21:41 
    GeneralPheww! Pin
    Nitron8-Jan-03 15:06
    Nitron8-Jan-03 15:06 
    GeneralStill can't use resource editor for >256 color bitmaps. Pin
    11-Jun-02 7:06
    suss11-Jun-02 7:06 
    GeneralRe: Still can't use resource editor for >256 color bitmaps. Pin
    Simon Capewell23-Aug-02 4:27
    Simon Capewell23-Aug-02 4:27 
    Generalwinnt error Pin
    13-May-02 23:31
    suss13-May-02 23:31 
    GeneralRe: winnt error Pin
    Simon Capewell1-Jul-02 0:20
    Simon Capewell1-Jul-02 0:20 
    try using the dependency viewer on the dll. You may be missing some system dlls
    GeneralBug report... Pin
    4-Dec-01 0:53
    suss4-Dec-01 0:53 
    GeneralRe: Bug report... Pin
    Jeff Elliott14-Nov-03 6:28
    Jeff Elliott14-Nov-03 6:28 
    GeneralI have problems with the addin Pin
    22-Jun-01 4:54
    suss22-Jun-01 4:54 
    GeneralRe: I have problems with the addin Pin
    Simon Capewell13-Jul-01 6:55
    Simon Capewell13-Jul-01 6:55 
    GeneralRe: I have problems with the addin Pin
    4-Sep-01 18:26
    suss4-Sep-01 18:26 
    GeneralRock 'n Roll! Pin
    Bret Pehrson10-Jun-00 19:59
    sussBret Pehrson10-Jun-00 19:59 
    GeneralExcellent! Pin
    Abu20-May-00 11:29
    Abu20-May-00 11:29 
    GeneralGreat add-in! Any idea where.. Pin
    James White29-Mar-00 5:32
    James White29-Mar-00 5:32 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.