Questions tagged [wm-paint]

WM_PAINT is a central message in the classic Microsoft Windows API.

The WM_PAINT message is central in the classic Microsoft Windows API. It is sent to a window when it needs to redraw (a portion of) its content.

77 questions
2
votes
2 answers

Behaviour of DefWindowProc WinApi

Can somebody explain why with DefWindowProc everything is ok, but if I remove it, the string "Hello windows" appears on screen without window and any buttons? "UpdateWindow" sends to window procedure WM_PAINT message, so why the text is displayed…
lysergic
  • 21
  • 1
  • 3
1
vote
1 answer

What cause WS_TABSTOP to affect window painting order?

In WTL, CBitmapButton does not support picture with transparent layer, like PNG. so i customize the code to use GDI+ to draw PNG, name it as CPNGButton. But things are strange on win XP. When the button is overlaped by other window, the button…
toki
  • 411
  • 4
  • 14
1
vote
1 answer

Framerate of WM_PAINT

Could anybody tell me please how can I get framerate of WM_PAINT message in frames per second? I'm trying to make a software renderer, and framerate is very important for debugging.
Triang3l
  • 1,230
  • 9
  • 29
1
vote
1 answer

Getting the X and Y client space coordinates of a WM_PAINT dirty rect in Win32 API using C++

I'm trying to design an abstraction layer for windows for various platforms. I decided to add a callback for when a window, or a section of it needs to be redrawn. I'm trying to make it fit into this callback type: using paint_callback_t =…
1
vote
2 answers

window isn't showing line made in WM_PAINT

I'm kinda new to this area, so.. I made the following code, as far as i understand, in WM_PAINT i'm creating a line, however i can't see this line, because the window isn't displaying at all. i have a thread that calls WM_PAINT every 2 seconds, but…
dusm
  • 1,207
  • 4
  • 18
  • 24
1
vote
2 answers

Handling WM_PAINT in a Subclassed CStatic Control

I created a custom control whose class has CStatic as base class. Currently I handle the drawing using WM_PAINT event. But there is a strange behavior. When I re-enable the window after disabling it using CWnd::EnableWindow function, it refuses to…
Ragesh Chakkadath
  • 1,521
  • 1
  • 14
  • 32
1
vote
1 answer

Is win32-gdi system-driven WM_PAINT flicker free?

running this code leads to the title question: if you resize the window you will not see any flicker (repaint sended by the system) if you move mouse inside the window, severe flicker will occurr (repaint sended by me) how to reproduce the…
freesoft
  • 57
  • 7
1
vote
1 answer

Please confirm the best way to Restore the DC when a custom Pen and a custom Brush are selected

Can someone confirm if this sample code from Microsoft fails to restore the custom brush set with SetDCBrushColor? case WM_PAINT: { hdc = BeginPaint(hWnd, &ps); // Initializing original object …
Ken_sf
  • 89
  • 1
  • 9
1
vote
1 answer

Getting several WM_PAINT message with one dispatch

I'm getting several WM_PAINT messages/events in the message handler for my window while I resize it, even though I only translate+dispatch a single message. Is this normal? Why is this happening? (I was expecting to get one WM_PAINT message per…
ZeroZ30o
  • 375
  • 2
  • 18
1
vote
2 answers

WM_PAINT message frequency : C# (.Net Framework 4.7.2 WinForms) vs. C++

I am currently converting some of my old games implemented using C# (FW version 4.7.2) WinForms to Direct3D using C++. Currently, all my real-time graphics games implement the OnPaint override, draw into the Graphics object retrieved from the…
Oguz Ozgul
  • 6,809
  • 1
  • 14
  • 26
1
vote
2 answers

Rich Edit Control paints whole application black after unminimize

SOLVED: I've posted my solution as an answer. Here's my problem: (gif) (Sort of solved if I reload the bitmaps for painting the background image when unminimizing before any WM_PAINT message.) It happens whenever I unminimize the application, time…
1
vote
1 answer

WM_PAINT message, BeginPaint loop

I can't understand why I got a loop on BeginPaint function. I have already read posts about this kind of loop but almost all of them recommend: "Don't forget to use BeginPaint function on WM_PAINT message, because it entails subsequent WM_PAINT…
Daniil Vorobeyv
  • 145
  • 2
  • 2
  • 10
1
vote
1 answer

WM_PAINT with PROGRESS_CLASS

I'm creating Win32 control: m_progress = CreateWindowExW(0, PROGRESS_CLASSW, L"ProgressBar", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 153, 339, 135, 33, m_window, (HMENU)0, m_instance, 0); SendMessageW(m_progress, WM_SETFONT, (WPARAM)m_fontBold,…
1
vote
1 answer

Why does my call to D2D1::RenderTarget::DrawText() result in a WM_PAINT being sent repeatedly?

I have a small 2D rendering library in C++ that runs on Win32 apps, and uses Direct2D to do it's drawing. I have called BeginDraw(), done a load of drawing and then called DrawText(). This is of course before EndDraw(). Instead of returning so I can…
Andy Good
  • 37
  • 3
1
vote
1 answer

TextBox drawn in WM_PAINT flickers on mouse enter/leave

I have a custom TextBox in which I draw some place holder text when it's empty. It works pretty well, but it flickers when the mouse enters and leaves the TextBox. It seems related to the border becoming blue when the mouse hovers the control (I'm…
Julien
  • 1,181
  • 10
  • 31