how to not paint window any more?

mc 4,436 Reputation points
2024-08-29T06:29:46.69+00:00

I create a window and I do not want it re- render itselft.

I will draw something in WM_CREATE and then it do not render again.

how to do it?

no matter I maximize or minimalize it will not render itsselft.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,592 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,693 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Darran Rowe 916 Reputation points
    2024-08-29T06:56:05.76+00:00

    WM_CREATE is only ever sent to the window once. It is sent during the call of CreateWindowEx. So it is natural that anything drawn in WM_CREATE will only be drawn once.

    The normal way of drawing to the window is done by handling the WM_PAINT message. This message is sent whenever the Window needs to be drawn. It is rare that a Windows application will not draw in the WM_PAINT handler, games tend to be the biggest application type that draws independently of the windows messages.

    1 person found this answer helpful.
    0 comments No comments

  2. Castorix31 84,546 Reputation points
    2024-08-29T07:08:00.2466667+00:00
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.