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 8047357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:04:18+00:00 2026-06-05T06:04:18+00:00

This will diplay the text on the screen with a TRANSPARENT BG and A

  • 0

This will diplay the text on the screen with a TRANSPARENT BG and A colored text, but what if i want to change the

text later, how do i do? should i use: SendMessage(); or: SetWindowText( ) If yes, how and if

no, then what then??? and how

case WM_PAINT:

       dc = BeginPaint(hwnd, &Ps);

SetBkMode(dc, TRANSPARENT);

        SetTextColor(dc, RGB(454,0,0)); 

       TextOut(dc, 10, 200, L"SEE? ", 5);

       EndPaint(hwnd, &Ps);

       break;
  • 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-06-05T06:04:19+00:00Added an answer on June 5, 2026 at 6:04 am

    If you want to draw the text associated with your window – this is what you should do:

    1. Don’t call TextOut with the hard-coded string. Instead obtain it via GetWindowText.
    2. Add a hander to WM_SETTEXT message. Upon receiving it – invalidate your window (or at least the area where the text is assumed to be drawn).

    Now some explanations about transparency and etc.

    I assume your window has an associated background brush (i.e. its WNDCLASS had non-zero hbrBackground member upon class registration). If not – you’re painting a transparent text above a non-painted area, which may contain any junk.

    During the call to BeginPaint your window procedure receives WM_ERASEBACKGROUND. Assuming you pass it to the DefWindowProc – the client area of your window will be filled by the background brush. So that every time you begin painting – the client are of your window will be filled by some brush. Then you draw your text transparently on the newly-filled background. So that no smearing should occur.

    Whenever you want to change something visual on your window – drawing extra things in-place is not enough. Because at any time your window may be requested by the OS to redraw itself. So that your window must be able to paint itself adequately upon receiving WM_PAINT.

    A common practice is to invalidate your window (or a part of it, using InvalidateRect or similar function) upon some change. And then, when you receive WM_PAINT – repaint your window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This will probably be obvious but I can't find the best way. I want
This will sound silly, but trust me it is for a good (i.e. over-engineered)
This will probably be easy, but I need to access the values in this
This will be probable quite odd question. But i thought I will give it
This will be implemented in Javascript (jQuery) but I suppose the method could be
This will be a bit subjective, I'm afraid, but I'd value the advice of
I want to use jQuery Thickbox for displaying my images but so far when
All I want to have is a full-screen simple text editor. However, I don't
I am trying to display a text, that that will use the maximum possible
I am trying to create an AVPlayer that will display a video file. This

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.