Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to use excel automation to join multiple excel file in a single excel file? Pin
enhzflep7-Jan-12 15:58
enhzflep7-Jan-12 15:58 
AnswerRe: how to use excel automation to join multiple excel file in a single excel file? Pin
Orjan Westin8-Jan-12 23:32
professionalOrjan Westin8-Jan-12 23:32 
QuestionRe: how to use excel automation to join multiple excel file in a single excel file? Pin
David Crow9-Jan-12 4:28
David Crow9-Jan-12 4:28 
QuestionHow to clear registry using API. (VC6.0 MFC) SOLVED Pin
Vaclav_5-Jan-12 8:43
Vaclav_5-Jan-12 8:43 
QuestionRe: How to clear registry using API. (VC6.0 MFC) Pin
David Crow5-Jan-12 8:48
David Crow5-Jan-12 8:48 
AnswerRe: How to clear registry using API. (VC6.0 MFC) Pin
Chuck O'Toole5-Jan-12 11:10
Chuck O'Toole5-Jan-12 11:10 
GeneralRe: How to clear registry using API. (VC6.0 MFC) SOLVED Pin
Vaclav_5-Jan-12 11:43
Vaclav_5-Jan-12 11:43 
QuestionTransparent bitmap on owner-draw button with win32 API Pin
Lianqing5-Jan-12 6:02
Lianqing5-Jan-12 6:02 
I am writing a dialog box using VS resource editor. In the dialog, I put a search control that is expected to be the same as IE8's search box: a line edit control and a BS_OWNERDRAW style push-button control sitting side by side. I use the bitmap file Search.bmp in VS2008ImageLibrary directory. My problem is the bitmap is not drawn transparently. It's pink background is drawn on the button. This takes on an ugly apperance. How can I remove the pink background? Here is code I use to draw the bitmap:

case WM_INITDIALOG:

// Load image for search button
hBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_SEARCH));

case WM_DRAWITEM:
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam;
HDC hDC = lpDIS->hDC;
RECT rectItem = lpDIS->rcItem;

// Draw the bitmap on button
if ( hBitmap != NULL ) {
RECT rcImage;
BITMAP bm;
LONG cxBitmap, cyBitmap;
if ( GetObject(hBitmap, sizeof(bm), &bm) ) {
cxBitmap = bm.bmWidth;
cyBitmap = bm.bmHeight;
}

// Center image horizontally
CopyRect(&rcImage, &rectItem);
LONG image_width = rcImage.right - rcImage.left;
LONG image_height = rcImage.bottom - rcImage.top;
rcImage.left = (image_width - cxBitmap)/2;
rcImage.top = (image_height - cyBitmap)/2;
DrawState(hDC, NULL, NULL, (LPARAM)hBitmap, 0,
rcImage.left, rcImage.top,
rcImage.right - rcImage.left,
rcImage.bottom - rcImage.top,
(bIsDisabled ? DSS_DISABLED : DSS_NORMAL) | DST_BITMAP);
}
QuestionRe: Transparent bitmap on owner-draw button with win32 API Pin
Code-o-mat5-Jan-12 8:02
Code-o-mat5-Jan-12 8:02 
AnswerRe: Transparent bitmap on owner-draw button with win32 API Pin
Lianqing6-Jan-12 6:03
Lianqing6-Jan-12 6:03 
GeneralRe: Transparent bitmap on owner-draw button with win32 API Pin
Randor 6-Jan-12 7:48
professional Randor 6-Jan-12 7:48 
GeneralRe: Transparent bitmap on owner-draw button with win32 API Pin
Lianqing6-Jan-12 13:28
Lianqing6-Jan-12 13:28 
GeneralRe: Transparent bitmap on owner-draw button with win32 API Pin
Lianqing7-Jan-12 6:43
Lianqing7-Jan-12 6:43 
AnswerRe: Transparent bitmap on owner-draw button with win32 API Pin
JackDingler6-Jan-12 5:54
JackDingler6-Jan-12 5:54 
QuestionHow to get driver icon Pin
yu-jian5-Jan-12 4:32
yu-jian5-Jan-12 4:32 
AnswerRe: How to get driver icon Pin
Luc Pattyn5-Jan-12 8:40
sitebuilderLuc Pattyn5-Jan-12 8:40 
QuestionYou can use deleaker Pin
Mast Avalons4-Jan-12 7:34
Mast Avalons4-Jan-12 7:34 
AnswerRe: You can use deleaker Pin
Richard MacCutchan4-Jan-12 7:41
mveRichard MacCutchan4-Jan-12 7:41 
GeneralRe: You can use deleaker Pin
Vaclav_4-Jan-12 8:23
Vaclav_4-Jan-12 8:23 
QuestionAccelerators not working in MFC dll Pin
ncitom3-Jan-12 14:17
ncitom3-Jan-12 14:17 
AnswerRe: Accelerators not working in MFC dll Pin
Satheesh15463-Jan-12 16:37
Satheesh15463-Jan-12 16:37 
GeneralRe: Accelerators not working in MFC dll Pin
ncitom4-Jan-12 6:06
ncitom4-Jan-12 6:06 
AnswerRe: Accelerators not working in MFC dll Pin
patup93-Jan-12 21:22
patup93-Jan-12 21:22 
GeneralRe: Accelerators not working in MFC dll Pin
ncitom4-Jan-12 6:18
ncitom4-Jan-12 6:18 
GeneralRe: Accelerators not working in MFC dll Pin
Randor 4-Jan-12 7:21
professional Randor 4-Jan-12 7:21 

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.