|
Hi,
I have a main window in which I am displaying a bitmap using BitBlt in WM_PAINT.
In this window I have a 3 static controls.
I want to make them transperent ie: only their text appears.
I am using WM_CTLCOLORSTATIC for setting font and text color.
We need to return Brush from the WM_CTLCOLORSTATIC message...
I am using SetBkMode(hDC,TRANSPARENT)in this message and returning HOLLOW_BRUSH
Now in one of this static control I am changing its text using SetWindowText(...) frequently.
The problem is that all the text i m changing is looking all overlapped....
(I know this thing happens when one uses SS_SIMPLE style of static control ... I am not using this style)
what can be the problem.
Can anybody help me with this.
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I just noticed Platform SDK: January 2004 Edition is available on Microsofts website. However, when I go to download it it just shows me the old SDK. Is it not available for download yet? I desperately need to get and even if I pay for it I still have to wait 2 weeks to get the CDs.
Any information?
Thanks
[Update]
I just went to order the CD and all I see available is the order SDK's, the new one is still not there!
[/Update]
|
|
|
|
|
Hai,
I am ving two icon handles, and want to combine them. So that one will be the overlay over the another. I tried with the following code, but it is not displaying properly. Any other solutions?
HICON CAutoDocuFileDlg::CombineIcons(HICON topIcon,HICON bottomIcon)
{// begin CombineIcons
ICONINFO newIcon;
newIcon.fIcon = true;
HDC screenDC = ::GetDC(NULL);
HDC iconDC = CreateCompatibleDC(screenDC);
HDC maskDC = CreateCompatibleDC(screenDC);
newIcon.hbmColor = CreateCompatibleBitmap(screenDC,16,16);
newIcon.hbmMask = CreateCompatibleBitmap(maskDC,16,16);
HGDIOBJ oldIconDC = ::SelectObject(iconDC,newIcon.hbmColor);
HGDIOBJ oldMaskDC = ::SelectObject(maskDC,newIcon.hbmMask);
BitBlt(iconDC,0,0,16,16,NULL,0,0,BLACKNESS);
BitBlt(maskDC,0,0,16,16,NULL,0,0,WHITENESS);
DrawIconEx(iconDC,0,0,topIcon,16,16,NULL,NULL,DI_
IMAGE);
BitBlt(iconDC,0,0,16,16,NULL,0,0,DSTINVERT); //
DrawIconEx(maskDC,0,0,topIcon,16,16,NULL,NULL,DI_
MASK);
DrawIconEx(iconDC,0,0,bottomIcon,16,16,NULL,NULL,
DI_NORMAL);
BitBlt(iconDC,0,0,16,16,NULL,0,0,DSTINVERT);
DrawIconEx(maskDC,0,0,bottomIcon,16,16,NULL,NULL,
DI_MASK);
BitBlt(maskDC,0,0,16,16,NULL,0,0,DSTINVERT);
::SelectObject(iconDC,oldIconDC);
::SelectObject(maskDC,oldMaskDC);
HICON newFileIcon = CreateIconIndirect(&newIcon);
::ReleaseDC(NULL,screenDC);
DeleteDC(maskDC);
DeleteDC(iconDC);
DeleteObject(newIcon.hbmColor);
DeleteObject(newIcon.hbmMask);
DeleteObject(oldIconDC);
DeleteObject(oldMaskDC);
return newFileIcon;
}// end CombineIcons
|
|
|
|
|
if (FAILED (hr = pRs->QueryInterface (__uuidof (IADORecordBinding),
(LPVOID*)&pCirtype)))
_com_issue_error (hr);
if (FAILED (hr = pCirtype->BindToRecordset (&m_tableCirtype)))
_com_issue_error (hr);
|
|
|
|
|
I recently added the .h and .cpp files from this link:
http://www.codeproject.com/combobox/mccombobox.asp
It says in the directions to add the line #include "MultiColumnComboBox.h" in the .cpp file, but then the visual studios won't recognize variables of this type in the .h file. Besides, the demo project on the link actually includes the library in the .h file of the class using it...so I did that. Now I'm getting a linker error for every function call that I try to make with the variables I declare of type CMultiColumnComboBox. The view classes I'm using these variables in are CFormView classes. Any ideas would be appreciated...Thanks a ton!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
I can't for the life of me get 2 STATIC controls to use a white background instead of system COLOR_BTNFACE or whatever that color is.
Can someone give me the code required to change 2 named STATIC controls background color to white?
I have tried returning a white brush, but if I test the window handles to see if they match the STATIC controls inside OnCtlColor nothing happens???
I'm lost and getting mad
Any help appreciated
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Try posting the code please may be that will bemore helpfull in debuging.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
I stole this code form the MSDN article the last poster sent me...I ave no idea where m_brush comes from, but regardless the following ode doesn't work either....
I dunno if it's because I call SetDialogBkColor() in InitInstance or what, but this is pissin me off
HBRUSH hbr = CDragDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == IDC_STATIC_ACCOUNT){
pDC->SetBkMode(TRANSPARENT);
}
return hbr;
Thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
You have to return a hbursh or the pdc settings is ignored,
the m_brush is a member variable of the dialog which is created during its initialization. you wanted to make the background white rite, so create a member variable of CBrush with RGB(255,255,255) and return this brush from the OnCtlColor method.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
|
I have a memory leak in my Windows GUI program. When I go to my task manager I see the memory usage increasing by about 200k every second. I haven't been able to isolate it completely, but I notice that whenever I minimize the window, the memory usage jumps back to about 1070k and then restarts its slow ascent as it's minimized. Anybody have any idea what's happening? I have an OpenGL child window.
|
|
|
|
|
well i reckon u be allocating memory that ur not freeing
cos its happening when the window is showing i guess ur drawing stuff that requires memory to build the models
"there is no spoon" biz stuff about me
|
|
|
|
|
Read the last section of this article.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I didn't get what u mean by."Read the last section of this article"
Last section of which article shud i read ?
Can u please help me out.
|
|
|
|
|
Oops! 'this' - word is hyperlinked to the article
Sorry for my wrong assumption.!!
|
|
|
|
|
hi, im new in c++ is it posible to print colored lines in console??
thanks
u think u r so unique,
u think u have it all,
Deep down inside u r weak,
I'll shake and make u fall!
|
|
|
|
|
Hello,
SetConsoleTextAttribute function use to change the background or foreground color attribute.
With Regards,
R.Selvam
|
|
|
|
|
hi everyone,
does anyone know how to get the associated icon with this function? i need to extract the icon and put in a popup menu, so i don't quite realize how to do it, because i get an HICON and i need a CBitmap? i've tried the MSDN stuff, but nothing appears on the menu...?
any ideas would be appreciated
t1
---
kick ash.
http://sprdsoft.bigmoron.com
http://t1tan.cjb.net
|
|
|
|
|
Hello Folks!
I've tried without success to put text and bitmap in the same line inside a RichEdit control. Until now I get only the bitmap or only the text. There's a way to do that (using MFC, or not) ?
Thanks for any reply.
__________
Chulips
|
|
|
|
|
|
If I have a text file as below, I want to modify the line 3 "This is a test line3" to "Line changed.
What is the best way to do that beside creating a new file?
--------- text file -------------
This is a test line1
This is a test line2
This is a test line3
This is a test line4
This is a test line 5
----------------------------------
|
|
|
|
|
Well, if you absolutely cannot create a new file, you can read in each line of the file to an array or list object. Skip the line that needs changed. Insert text that represents the changed line. Continue reading the remaining lines from the file. Now write the entire data structure back out to the file. Make sense?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
May this helps u
http://www.codeproject.com/file/crotarylog.asp#xx726324xx
|
|
|
|
|
Hello,
use CStdioFile ReadString function and store the CStringArray .
With Regards,
R.Selvam
|
|
|
|
|
Hello,
I'm trying to map a network drive, but it seems not to appear anything in the MSDN, does anybody know how do I have to do it?
PS:
I'm doing it from the system account before starting a session and from XYNTService (you can find it here in CP).
Thank you in advance.
|
|
|
|
|