Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
Richard MacCutchan6-Apr-20 21:42
mveRichard MacCutchan6-Apr-20 21:42 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
PotatoSoup9-Apr-20 8:50
PotatoSoup9-Apr-20 8:50 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
Victor Nijegorodov9-Apr-20 22:12
Victor Nijegorodov9-Apr-20 22:12 
AnswerRe: How do I add listboxes to a back buffer and use that? Pin
PotatoSoup6-Apr-20 11:59
PotatoSoup6-Apr-20 11:59 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
leon de boer6-Apr-20 20:42
leon de boer6-Apr-20 20:42 
AnswerRe: How do I add listboxes to a back buffer and use that? Pin
leon de boer6-Apr-20 20:31
leon de boer6-Apr-20 20:31 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
PotatoSoup7-Apr-20 18:08
PotatoSoup7-Apr-20 18:08 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
leon de boer7-Apr-20 19:05
leon de boer7-Apr-20 19:05 
You are making a mountain out of a molehill.

First it was pre-compiled in the debug directory, you didn't have to compile anything
Second main.ccp is stock standard C++ code will compile on any C++ windows compiler
Third you can also just rename main.cpp to a main.c file remove a couple of "::" and it would compile on any C windows compiler

What I do now know is your level of programming knowledge which is useful if you want me to try and help you.

So basically I am reading your bitmap paint is drawing over the top of the listboxes and other windows, it would be useful to see the original code that creates the parent window. I am basically thinking you are trying to draw a bitmap where the coloured gradient occurs on my sample is that correct? Notice my listboxes draw over the top of that gradient and I could turn it to a bitmap if that helps you. I might throw up a sample doing that, note I will put just the main.c and the exe this time.

Update: new sample that draws the beatyy.jpg image under the listboxes .. is that what you are trying to do?
Just run the pre-compiled exe file to test
GitHub - LdB-ECM/ListPlayBmp: Windows list with background Image sample[^]
Or the more generic example
Windows_Samples/ListJpg1 at master · LdB-ECM/Windows_Samples · GitHub[^]

Anyhow lets take a couple of stabs at this

1) Check you have the WS_CLIPCHILDREN flags set on the parent window ... read what it does
Window Styles (Winuser.h) - Win32 apps | Microsoft Docs[^]

2.) If all else fails because you really have cocked something just invalidate them after you paint the background (that probably means after EndPaint in your WM_PAINT message handler).
Here hwnd refers to the handle of the child listbox window etc
InvalidateRect(hwnd, NULL, TRUE);

This explains why it forces the redraw to happen but don't use it unless you have to because it will cause the listbox to flash as it redraws and is a horrible hack.
InvalidateRect function (winuser.h) - Win32 apps | Microsoft Docs[^]

Now if you have to use 2 you have a horrible structural issue with your code and I will try to explain how to fix it because we need to get the bitmap background draw much earlier on in the paint process.
In vino veritas


modified 8-Apr-20 4:59am.

GeneralRe: How do I add listboxes to a back buffer and use that? Pin
Richard MacCutchan7-Apr-20 21:58
mveRichard MacCutchan7-Apr-20 21:58 
QuestionRe: How do I add listboxes to a back buffer and use that? Pin
David Crow8-Apr-20 1:58
David Crow8-Apr-20 1:58 
AnswerRe: How do I add listboxes to a back buffer and use that? Pin
leon de boer8-Apr-20 4:03
leon de boer8-Apr-20 4:03 
GeneralRe: How do I add listboxes to a back buffer and use that? Pin
David Crow8-Apr-20 4:25
David Crow8-Apr-20 4:25 
Questionbasic MFC app Pin
Calin Negru6-Apr-20 0:30
Calin Negru6-Apr-20 0:30 
AnswerRe: basic MFC app Pin
Richard MacCutchan6-Apr-20 0:49
mveRichard MacCutchan6-Apr-20 0:49 
GeneralRe: basic MFC app Pin
Calin Negru6-Apr-20 1:02
Calin Negru6-Apr-20 1:02 
GeneralRe: basic MFC app Pin
Richard MacCutchan6-Apr-20 1:49
mveRichard MacCutchan6-Apr-20 1:49 
AnswerRe: basic MFC app Pin
Victor Nijegorodov6-Apr-20 3:07
Victor Nijegorodov6-Apr-20 3:07 
AnswerRe: basic MFC app Pin
Victor Nijegorodov6-Apr-20 3:17
Victor Nijegorodov6-Apr-20 3:17 
GeneralRe: basic MFC app Pin
Calin Negru6-Apr-20 3:46
Calin Negru6-Apr-20 3:46 
GeneralRe: basic MFC app Pin
Richard MacCutchan6-Apr-20 3:58
mveRichard MacCutchan6-Apr-20 3:58 
GeneralRe: basic MFC app Pin
Calin Negru6-Apr-20 20:52
Calin Negru6-Apr-20 20:52 
GeneralRe: basic MFC app Pin
Richard MacCutchan6-Apr-20 21:45
mveRichard MacCutchan6-Apr-20 21:45 
GeneralRe: basic MFC app Pin
Calin Negru6-Apr-20 22:55
Calin Negru6-Apr-20 22:55 
GeneralRe: basic MFC app Pin
Richard MacCutchan6-Apr-20 23:07
mveRichard MacCutchan6-Apr-20 23:07 
GeneralRe: basic MFC app Pin
Calin Negru6-Apr-20 23:28
Calin Negru6-Apr-20 23:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.