Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 253859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:47:54+00:00 2026-05-11T21:47:54+00:00

I have a Win32 GUI application that has several edit controls (plain old EDIT

  • 0

I have a Win32 GUI application that has several edit controls (plain old “EDIT” classname).

The logic is that the user is to fill the edit box selected by the application. To make it clearer which one is to be filled now I want to somehow highlight the “current” edit box. Then, when the user has done input and asked the application to proceed the edit box would have to become “usual” again.

The ideal way would be to paint its background with a color of choice. How could I achieve this or similar selection – maybe I could substitute the brush used to paint the control temporarily? If it’s not possible with edit control what replacement controls available in Windows starting with Win2k are out there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:47:54+00:00Added an answer on May 11, 2026 at 9:47 pm

    You can handle the WM_CTLCOLOREDIT notification in the parent window for the edit controls. The notification is sent when the edit control is about to be drawn. So in general, you would use RedrawWindow or something to force a redraw, then handle the inevitable control colour notification. In this, you set the fore and back colour for the device context which is passed in with the notification:

    LRESULT OnControlColorEdit(HWND hwnd, DWORD msg, WPARAM wParam, LPARAM lParam)
    {
       if( !toHighlight ) {
           return DefWindowProc( hwnd, msg, wParam, lParam );
       }
       HDC dc = reinterpret_cast<HDC>(wParam);
       ::SetBkColor(dc, whatever);
       ::SetTextColor(dc, whatever);
       HBRUSH brush = // create a solid brush of necessary color - should cache it and destroy when no longer needed
       return reinterpret_cast<LRESULT>( brush );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use the strval() function to convert a number… May 12, 2026 at 12:07 am
  • Editorial Team
    Editorial Team added an answer create function xcurr return varchar2 is v_curr varchar2(32); begin SELECT… May 12, 2026 at 12:07 am
  • Editorial Team
    Editorial Team added an answer Define "change in the contents of a folder". If it… May 12, 2026 at 12:07 am

Related Questions

In win32, how do I setup a callback mechanism for RichEdit I have not
I have several slave machines and a master machine which together run a distributed
I need to change the functionality of an application based on the executable name.
I see many user interface control libraries for .NET, but where can I get

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.