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

Related Questions

I have a Win32 GUI application that uses GDI havily. It needs to draw
I have a C++ Win32 application that was written as a Windows GUI project,
We have a Win32 application that hosts the .NET runtime and opens up .NET
I have a delphi (Win32) web application that can run either as a CGI
I have a C++ application that uses the Win32 API for Windows, and I'm
You're stepping through C/C++ code and have just called a Win32 API that has
I have a win32 GUI (MFC) application which I need to port to a
I have a monster of a win32 application with GUI based on a mixture
I have a C++ Win32 application that runs as a console app if run
I have a .NET program and a Borland Win32 program that need to pass

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.