|
you would have to ask the universities, if your other customers all received their emails and the uni people didnt it would seem you emails might be getting tagged at spam
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Hi,
I have a dialog with a few edit controls.
I want to set the text of one control to red and the rest should not change.
Now if I call the pDC->SetTextColor(RGB(255,0,0)) in the OnCtlColor message handler of the dialog this changes the text color for all the edit controls in the dialog.
If I call the following code:
CDC *pDC = EditToChangeTextColor.GetDC();
pDC->SetTextColor(RGB(255,0,0));
nothing changes.
Does anyone know if there is a way to change the text collor only for one control in the dialog?
Thanks.
avivhal
|
|
|
|
|
How about surrounding the call with:
if(pWnd->GetDlgCtrlID() == IDC_EDIT1)
or switch the results out.
BD
"You know "that look" women get when they want sex? Me neither."
--Steve Martin
|
|
|
|
|
it is not correct.
you must call SetTextColor() inside of OnPaint() of your control
includeh10
|
|
|
|
|
Hi
Check the MSDN fot CWnd::OnCtlColor, it even has a example of what you are asking. You just have to verify the message is for the control you want to change, otherwise do nothing.
Extracted form the MSDN
HBRUSH CZilchDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
<big>
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
hbr = m_brush;
}
return hbr;
}
Fabian
|
|
|
|
|
Thanks now its working fine,
I dont know how I missed this example in the MSDN (should have thought of it myself anyway), I only found a very general one with no reference as to the caller.
Is it possible maybe to call SetTextColor from outside OnCtlColor?
I tried it in various places and handlers but it did not seem to work(including in the OnPaint handler).
Maybe the attributes set for the DC fonts color are blocked when called from outside this segment of code...
Thanks again.
avivhal
|
|
|
|
|
hi all,
i need good docs about jpeg format, i have to create my own file format for compressing bmp file based on jpeg.
all i have are poor jpeg docs from internet.
thanks for any link to better docs of jpeg format
cheers
includeh10
|
|
|
|
|
Try:
The Programmer's File Format Collection.
http://www.wotsit.org/[^]
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
it looks useful.
thanks
includeh10
|
|
|
|
|
I forgot to mention yesterday, you can get latest info about JPEG from the organization's official site too:
http://www.jpeg.org[^]
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Can someone point me to an artical that shows you how to draw gradients on a DC?
|
|
|
|
|
Hi
Check GradientFill() on the Win32 API documentation.
Fabian
|
|
|
|
|
you can do follow:
void CBMSButton::GradientFillRect(HDC hDC, RECT& rc, COLORREF crLight, COLORREF crDark)
{
TRIVERTEX vert[2];
GRADIENT_RECT gRect;
vert [0].x = rc.left;
vert [0].y = rc.top;
vert [0].Red = GetRValue(crLight) << 8;
vert [0].Green = GetGValue(crLight) << 8;
vert [0].Blue = GetBValue(crLight) << 8;
vert [0].Alpha = 0x0000; // It's no use for GradientFill
vert [1].x = rc.right;
vert [1].y = rc.bottom;
vert [1].Red = GetRValue(crDark) << 8;
vert [1].Green = GetGValue(crDark) << 8;
vert [1].Blue = GetBValue(crDark) << 8;
vert [1].Alpha = 0x0000;
gRect.UpperLeft = 0;
gRect.LowerRight = 1;
GradientFill(hDC, vert, 2 , &gRect, 1, GRADIENT_FILL_RECT_V);
}
You must import library:
#pragma message(" Automatically linking with MSIMG32.LIB library")
#pragma comment(lib, "MSIMG32.LIB")
|
|
|
|
|
Hi Dear...Try this..
----------------------------------------
CRect rect,rcClient;
GetClientRect(rcClient);
rect = rcClient;
int r1=32,g1=108,b1=244; //Any start color
int r2=5,g2=55,b2=165; //Any stop color
for(int i=0;i<rect.width();i++)
{=""
="" int="" r,g,b;
="" r="r1" +="" (i="" *="" (r2-r1)="" rect.width());
="" g="g1" (g2-g1)="" b="b1" (b2-b1)="" pdc-="">FillSolidRect(i,0,1,rect.Height(),RGB(r,g,b));
}
-------------------------------------------
This is not mine code, I'm also user of this code...but work nice...
OK! Good Bye
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
yes, i found that artical earlier today, and i got it to work, but i had to put the code in the OnPaint overide
but there is one thing i dont get about this formula
r1 + (i * (r2-r1) / rect.Width());
i know what it does, and why its needed, but i dont understand how the writer came up with it.
|
|
|
|
|
Actually...
The writer do very nice thing in this code..
as u can see.. we ca make shading from any color to other in fix area.. this is only possible if we change color according to side of area..that is what he is doing..
change color but with eyes on area..
OK bye...
Never consider anything Impossible before trying to solve that..---Sumit Kapoor---
|
|
|
|
|
hi..
for loop in above code consider < as HTML TAG
so replace that with:
for(int i=0;i<rect.Width();i++)
---Sumit Kapoor---
|
|
|
|
|
|
Hi!
How can I create Controls in a CView Class ???
Please Help
MFG
RedDragon
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
|
you can add any controls to CView with style WS_CHILD and the CView as its parent - the control can be CDialog also if use function Create() - not DoModal().
cheers
includeh10
|
|
|
|
|
Sounds like you need a CFormView instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've solved the problem already. Thx to everyone
|
|
|
|
|
Sir,
I have developed an application using Win32.
Inside main(){
..
}
I have created a server socket and waiting to accept to connect.
How should I create an exe fom the command line.
It takes WS2_32.lib AS a parameter to give an exe.
Pls guide what can be command line parameters so that it can combine with the lib file to create exe..
|
|
|
|
|
You cannot link a library to an executable at runtime. How do you expect to compile the winsock library at runtime?
Kuphryn
|
|
|
|