Click here to Skip to main content
16,016,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVirtual Keys :: MFC Pin
valikac17-Mar-02 6:23
valikac17-Mar-02 6:23 
GeneralRe: Virtual Keys :: MFC Pin
Michael Dunn17-Mar-02 6:59
sitebuilderMichael Dunn17-Mar-02 6:59 
GeneralRe: Virtual Keys :: MFC Pin
valikac17-Mar-02 12:51
valikac17-Mar-02 12:51 
GeneralRe: Virtual Keys :: MFC Pin
Michael Dunn17-Mar-02 12:55
sitebuilderMichael Dunn17-Mar-02 12:55 
GeneralRe: Virtual Keys :: MFC Pin
valikac17-Mar-02 13:21
valikac17-Mar-02 13:21 
GeneralRe: Virtual Keys :: MFC Pin
Michael Dunn17-Mar-02 13:28
sitebuilderMichael Dunn17-Mar-02 13:28 
GeneralBitmaps Pin
17-Mar-02 6:15
suss17-Mar-02 6:15 
GeneralRe: Bitmaps Pin
Paul M Watt17-Mar-02 7:36
mentorPaul M Watt17-Mar-02 7:36 
Handle the WM_ERASEBKGND message. The WPARAM will contain an HDC, you should use this value to create a memDC that you can select your bitmap into, then blt the bitmap into the HDC from WPARAM.

Here is an example assuming that you have the bitmap preloaded in hBitmap, and the dimensions of your bitmap have been cached in a BITMAP structure called bm.
//Create the compatible DC.
HDC hdc = (HDC)wParam;
HDC hdcMem = ::CreateCompatibleDC(hdc);
//Select the bitmap into the DC.
::SelectObject(hBitmap);
//Blt the bitmap onto the target DC, which is also the background of your dialog.
::BitBlt(hdc, 0,0, bm.bmWidht, bm.bmHeight, hdcMem, 0,0,SRCCOPY);
//free the memDC.
::DeleteDC(hdcMem);

//This is how a return result is set in a dialog procedure.
::SetWindowLong(hWnd, DWL_MESGRESULT, TRUE);

//Return true signifying that you handled the message in the dialog procedure.
return TRUE;


If you have any more questions feel free to ask.
GeneralRe: Bitmaps Pin
Paul M Watt18-Mar-02 5:29
mentorPaul M Watt18-Mar-02 5:29 
QuestionRestrict Multiple Instance of an Exe? Pin
17-Mar-02 5:04
suss17-Mar-02 5:04 
AnswerRe: Restrict Multiple Instance of an Exe? Pin
Tim Smith17-Mar-02 6:01
Tim Smith17-Mar-02 6:01 
GeneralMy Copy Constructor bug problem Pin
John Cruz17-Mar-02 3:37
John Cruz17-Mar-02 3:37 
GeneralRe: My Copy Constructor bug problem Pin
Paul M Watt17-Mar-02 7:39
mentorPaul M Watt17-Mar-02 7:39 
GeneralRe: My Copy Constructor bug problem Pin
John Cruz17-Mar-02 10:56
John Cruz17-Mar-02 10:56 
GeneralRe: My Copy Constructor bug problem Pin
Alexandru Savescu17-Mar-02 11:51
Alexandru Savescu17-Mar-02 11:51 
GeneralRe: My Copy Constructor bug problem Pin
John Cruz17-Mar-02 12:19
John Cruz17-Mar-02 12:19 
GeneralRe: My Copy Constructor bug problem Pin
John Cruz17-Mar-02 12:27
John Cruz17-Mar-02 12:27 
GeneralRe: My Copy Constructor bug problem Pin
Andrew Peace17-Mar-02 12:41
Andrew Peace17-Mar-02 12:41 
GeneralRe: My Copy Constructor bug problem Pin
John Cruz17-Mar-02 12:56
John Cruz17-Mar-02 12:56 
GeneralRe: My Copy Constructor bug problem Pin
Tim Smith17-Mar-02 13:14
Tim Smith17-Mar-02 13:14 
Generaldisable client-container menu.... Pin
Atila17-Mar-02 2:55
Atila17-Mar-02 2:55 
GeneralOnChar() problem ! Pin
Hadi Rezaee16-Mar-02 23:47
Hadi Rezaee16-Mar-02 23:47 
GeneralRe: OnChar() problem ! Pin
Christian Graus17-Mar-02 0:00
protectorChristian Graus17-Mar-02 0:00 
GeneralRe: OnChar() problem ! Pin
Hadi Rezaee17-Mar-02 3:10
Hadi Rezaee17-Mar-02 3:10 
GeneralHelp finding a Copy Constructor bug... Pin
John Cruz16-Mar-02 21:44
John Cruz16-Mar-02 21:44 

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.