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
1
vote
1 answer

Windows API: Simple window does not redraw correctly

I'm working on a Lua binding for Windows API. So far I've been able to create a basic window with a list box control: require('Alien') package.path = 'libs\\?.lua;libs\\?\\init.lua;' .. package.path local function printf(...)…
Rena
  • 606
  • 7
  • 21
1
vote
2 answers

Drawing polygons using multithreading in C++

I am drawing polygons (Polygon(dc, points, 3)) using in WM_PAINT event using C++. I have a big number of polygons so I am trying to implement multithreading. I am running VS2013 so I have included thread. I have created a function I want to run on a…
pro100tom
  • 165
  • 1
  • 10
1
vote
2 answers

C++ WinAPI TextOut() update text

I'm creating a Windows application with WinAPI. I'm using the TextOut() function to display updated text to the user when handling the WM_PAINT message for the window. case WM_PAINT: { PAINTSTRUCT ps; HDC hdc; hdc = BeginPaint(hwnd,…
yop
  • 141
  • 1
  • 4
  • 11
1
vote
1 answer

Not receiving WM_PAINT message when returning from Security Screen (Ctrl+Alt+Del) in Windows7

I need to detect the closing of the security screen, this is the full screen that appears when a user presses Ctrl+Alt+Del under windows. In Xp my application receives an wm_paint message when this screen is closed but under windows 7, a message is…
Andrew
  • 1,608
  • 16
  • 31
1
vote
0 answers

InvalidateRect called too frequently blocks other windows from redrawing

I develop audio plugins, which are run inside their hosts and work realtime. Each plugin has its own window with controls, which often contains some kind of analysis pane, a pretty big rectangle that gets repeatedly painted (e.g. 20-50x per second).…
Vojtěch Melda Meluzín
  • 1,117
  • 3
  • 11
  • 22
1
vote
1 answer

Scrolling Graph

I am trying to draw a graph that has a scrollbar, the graph uses time for the x-axis and i'd like to have a limited x-axis (1 minute) so up until 1 minute, the scroll bar's page is the length of the scrollbar, after that the page should be '60…
Daboyzuk
  • 449
  • 4
  • 14
0
votes
0 answers

WM_SIZE and WM_MOUSEMOVE: different behaviour during repainting client area

I am writing a quite simple WinAPI application. Just a window with single button in client area (this is minimum reproducible example). Button creation code is in WM_CREATE main window message handler: case WM_CREATE: hInst =…
0
votes
1 answer

MFC OnDraw vs. OnPaint

I am wondering about the difference between OnDraw() and OnPaint() in MFC. After searching the Internet for a while, I found a useful article. In summary, WM_PAINT will trigger OnPaint(), which calls OnDraw() and passes a CDC*: void…
0
votes
1 answer

C++ WM_PAINT timer

How do I make a timer work in c++ WM_PAINT? I'm trying to "print" it via Wm_Paint, because at the moment I don't know another method of adding a timer, googling didn't help. Here's what I have declared in CALLBACK: TCHAR s[10], str[20] =…
dapet
  • 69
  • 8
0
votes
1 answer

What means by 'clear the update region' when painting the client area on Windows?

Here the Painting the Window mentioned that: After you finish painting the client area, you clear the update region, which tells the operating system that it does not need to send another WM_PAINT message until something changes. One may write…
heLomaN
  • 1,634
  • 2
  • 22
  • 33
0
votes
0 answers

Win32 c++ Iterate RGB colors to windows in WM_PAINT

I have a VS2019 c++ application which has the following interface : It works wonder for 'single' measurements (through the 'Measure Sample' button). The measurement is made and all the data gathered is shown on the interface a) in graph form, b)in…
Roger Breton
  • 81
  • 1
  • 9
0
votes
0 answers

Delphi TCheckbox problems overriding WM_PAINT

I'm using an old version of Delphi (7), but that shouldn't matter much. Themes are in use. I need to have control over the background and font color of the checkbox and text of a TCheckbox. I have adapted some code found elsewhere which basically…
Ross
  • 157
  • 9
0
votes
2 answers

WinAPI Is Region meaningless?

Could you explain me why WinAPI needs InvalidateRgn with its handle to the region to be added to the update region (hRgn) if we have only RECT during BeginPaint while processing WM_PAINT? Thanks in advance!
0
votes
0 answers

How to clip the corner rectangle created by two scrollbar controls

Let's say you have a resizable window with child scrollbar controls, and the scrollbars come and go depending on whether the window contents are large enough to require scrolling. When both scrollbars are present, a small rectangle is effectively…
user15025873
0
votes
0 answers

Is there a safe way to paint a little extra onto a subclassed control?

Let's say you want to add a little extra graphical info to a Windows control. For example, you want to add drag/drop functionality to a listview (using the procedure discussed here), but with horizontal lines signaling the drop/insertion points as…
user15025873