The Code Project View our sponsorsClick here for Dundas Consulting - experts in MFC, C++, TCP/IP and ASPAdvertise on the CodeProject
Home >> Macros and Add-ins >> DevStudio Add-ins

True Colour Developer Studio Addin
By Simon Capewell

Use any colour in the Developer Studio IDE 
 VC6, Win9x, NT4, MFC
 Posted 27 Jan 2000
Articles by this author
Send to a friend
Printer friendly version
Home Latest updates Submit your article About Us Advertise on the Code Project Contact us Discussion Forums
Navigation bar
22 users have rated this article. result:
4.73 out of 5.
  • 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.

    [Top] Sign in to vote for this article:     PoorExcellent  

    View our sponsorsWndTabs. Make Visual Studio the way it was meant to be,Advertise on the CodeProject

    Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Use DHTML' from the View dropdown and hit 'Set Options'.
     Keyword Filter
     View   Per page   Messages since
    New threadMessages 1 to 6 of 6 (Total: 6)[First] [Prev] [Next] [Last]
    Subject 
    Author 
    Date 
      I have problems with the addin
    Unconfirmed/Anonymous posting BLooD 10:54 22 Jun 01 
      Re: I have problems with the addin
     Simon Capewell 12:55 13 Jul 01 
      Rock 'n Roll!
    Unconfirmed/Anonymous posting Bret Pehrson 1:59 11 Jun 00 
      Excellent!
    Unconfirmed/Anonymous posting Abu 17:29 20 May 00 
      Great add-in! Any idea where..
    Unconfirmed/Anonymous posting James White 11:32 29 Mar 00 
      Re: Great add-in! Any idea where..
    Unconfirmed/Anonymous posting Simon Capewell 18:38 29 Mar 00 
    Last Visit: 12:00 Friday 1st January, 1999[First] [Prev] [Next] [Last]
    Home >> Macros and Add-ins >> DevStudio Add-ins
    Advertise on The Code Project
    Article content copyright Simon Capewell, 2000
    everything else © CodeProject, 1999-2001.