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
0
votes
3 answers

Why call InvalidateRect() in WM_PAINT message?

So i am learning Windows API with book "Programming Windows - Charles Petzold (5th edition)". If i understand correctly, when handling WM_PAINT message calling function BeginPaint() validates given area that has to be updated. However, in this book…
Avtem
  • 55
  • 1
  • 10
0
votes
1 answer

InvalidateRect is not repainting the window

I got a polygon that is drawn whenever I press a button. I wanted to repaint the polygon as I press the button again, but when I press it, it just paints another polygon without erasing the other one: //header #define CREATETRIANGLE…
Kewyn Vieira
  • 339
  • 3
  • 9
0
votes
1 answer

Windows 7 sends unnecessary WM_PAINT messages

I have a question about strangely originating WM_PAINT messages sent to my window. It happens on Windows 7 and doesn’t happen on Windows XP. Details In my program, I have a timer that triggers GUI updates, the timer is based on this API…
Denny
  • 11
  • 3
0
votes
1 answer

WM_DRAWITEM of SysTabControl32 is overpainted?

I have to restyle our SysTabControl32, so I'm trying to use TCS_OWNERDRAWFIXED and WM_DRAWITEM. Everything works well BUT it seems that the Tabs are still overpainted by the system. Unfortunately the code is in Visual Objects which makes things…
Jay
  • 1
0
votes
1 answer

How to draw a Windows button in WM_PAINT?

I'd like to build a custom Windows button without subclassing it. I simply want to draw it, like I would draw a rectangle by calling FillRect(). How do I call the window procedure registered by the BUTTON window class that performs the…
Alex
  • 34,581
  • 26
  • 91
  • 135
0
votes
2 answers

Menubar disappears when system colors are changed while the window is minimized

My application has a toolbar type menu. I sub-classed the window procedure to allow visual enhancement, which means my application is painting the menubar. When the application window is minimized and restored, the menu repaints just fine. But, if…
makhlouf
  • 41
  • 6
0
votes
0 answers

C++ | Win32 API | Stuck awith white screen | InvalidateRect()

Dear Developers and Community, I am currently working on a Snake Game with Win32 API with GUI. I am painting the Snake in the WndProc() Function within the WM_PAINT message, then I am creating the Painting Context and drawing the Rectangles. But…
Flam3rboy
  • 95
  • 2
  • 7
0
votes
0 answers

Draw shapes in child windows

I'm working on a Win32 GUI project in which I have a main window and inside I display 3 buttons and 1 label with a BITMAP attached to it. Like this: Main window I declared an array of labels, and I attached a bitmap to each one of them, here's how i…
0
votes
1 answer

Windows Forms Button WM_PAINT flicker on FlatStyle = System

I am creating a Button and setting FlatStyle to System. Because this mode does not normally support images, to display an image along with the text, the Button's own Text is set to "" and I am painting my own image and text on top by…
James
  • 1,874
  • 1
  • 16
  • 18
0
votes
1 answer

Window glitches after redrawing with RedrawWindow or SendMessage(WM_PAINT)

I'm writing an application in C++ using the standard Windows API. It does some simple registry modification using buttons. When a button is pressed, it changes a label displayed at the bottom. To change it, I need to repaint the window (which…
JackMacWindows
  • 377
  • 5
  • 15
0
votes
3 answers

win32: WM_PAINT calls but not supposed to be!

I have a problem with WM_PAINT. Basically I want WM_PAINT to be called after a user WM_COMMAND, but for some reason it's called anyway in the main function. case WM_PAINT: { createFont(); PAINTSTRUCT ps; HBRUSH hbruzh =…
KaiserJohaan
  • 9,028
  • 20
  • 112
  • 199
0
votes
1 answer

Memory error with type L"" in Win32

Here's the code for my paint method in my Win32 project: case WM_PAINT: _tcscat_s(greeting, sizeof(greeting), LoadedFile); hdc = BeginPaint(hWnd, &ps); TextOut(hdc, 5, 5, greeting, _tcslen(greeting)); …
user6191359
  • 69
  • 1
  • 9
0
votes
0 answers

Drawing child window on main window during WM_PAINT

I have a problem, When I move my child window over the main window it is being drawed on it during WM_PAINT and it looks like this: (it disappears quickly). How can I fix this? Here is my code, WM_PAINT: case WM_PAINT: { PAINTSTRUCT ps = { 0…
Mikołaj
  • 93
  • 6
0
votes
2 answers

OpenGL4Net WM_PAINT does not exist?

I'm trying to get OpenGL4Net working with C# in Microsoft Visual Studio Comunity 2015. I've downloaded this file: https://sourceforge.net/projects/ogl4net/files/Rev.%2037/x64/ And followed these…
alan2here
  • 3,223
  • 6
  • 37
  • 62
0
votes
1 answer

Winforms Flickering While Drawing Image on Taskbar

Right now I'm drawing a small 16x16 image on the title bar of my window. It works nicely, except for an obnoxious flicker that I cant figure out how to get rid of. I'm simply drawing the image like this: Protected Overrides Sub WndProc(ByRef m As…
instantmusic
  • 608
  • 1
  • 6
  • 18