|
|
Dear Moonen,
thanks for ur reply,
As iam a begginer of MFC i want to know how to override the control
|
|
|
|
|
As far as I can see there are 4 areas an Icon can be displayed: windows explorer, System tray, Taskbar and Title bar. I know it's possible to customize the icons for explorer, the sys-tray and for the title-bar, but is it possible to set an icon for the task-bar? i.e. I want to show a different icon in all four locations. At the whatever icon is show on the title-bar is the same as that of the task bar.
|
|
|
|
|
|
Thanks for the link Rage, but its partly because of this article that I asked the question. I have used his idea and implemented it into a class of mine. Now I don't mind the Titlebar icon to animate, but the Taskbar becomes a little annoying after a while. So I thought it useful to have the option of disabling it.
his article doesn't have my answer. Setting the icon for one, sets the icon for both. I have yet to find a way to adjust one without affecting the other.
|
|
|
|
|
waldermort wrote: Setting the icon for one, sets the icon for both
Now this is something I did not realize. I'll try and have another look at your problem.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I'm thinking maybe I would have to hook a dll/function call somewhere to prevent the taskbar from locating the icon in the default place. I will take a better look at it when I have some time.
|
|
|
|
|
I'm starting to think the taskbar keeps a cache of the icons. I removed/replaced all the icons in my project, yet each time I manage to disable the icon, the first icon is displayed on the taskbar. How is this possible when it is no longer in my exe? I tried changing the apps name, class name etc.. but it's still there.
I have even subclassed the titlebar itself to disable it from there, but no!!! I can remove the icon from both the taskbar and the titlebar, but that damn first icon always re-appears.
Since I have subclassed the title bar, I think the only thing left to try is to do all the repainting myself.
|
|
|
|
|
Whick message is generated when minimize button of a widow is pressed?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: Whick message is generated when minimize button of a widow is pressed?
You definitely would like to spell it correctly.
have you seen this post below ?
|
|
|
|
|
Scroll down a little, I asked the very same question just a few hours ago.
Still here?
WM_SYSCOMMAND with SC_MINIMIZE in the wParam. You should bitwise AND (&) the wParam with 0xfff0 to get an accurate result.
|
|
|
|
|
kiran.pinjarla wrote: Whick message is generated when minimize button of a widow is pressed?
Sorry guys. I didnt see the same question posted bellow and created another thread.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
<br />
void CAnswer::OnSysCommand(UINT nID, LPARAM lParam)<br />
{<br />
switch(nID)<br />
{<br />
case SC_MINIMIZE:<br />
MessageBox("Min");<br />
break;<br />
case SC_MAXIMIZE:<br />
MessageBox("Max");<br />
break;<br />
}<br />
|
|
|
|
|
From the docs on MSDN:
"In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used internally by the system. To obtain the correct result when testing the value of wParam, an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator."
I know simply comparing the values works, but it could lead to a future bug in the application.
|
|
|
|
|
Iam developing a dialog based application in which user has to select a file to continue for next step.There he needs to enter the file with correct extension,so i have to validate the file extensions which he has provided.
he needs to enter different files in different steps.
how can i validate the file extensions he has provided is correct or wrong.
so that he can go for the next operation.
|
|
|
|
|
'need help urgent' is hardly a descriptive subject.
You can use the Substring method of CString to check if the file extension is what you hoped, and you can set a file selection dialog to only allow selection of existing files.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
reddy harish wrote: validate the file extensions
You can take the file name and check it with the files existing in the directories using FindFirstFile(),FindNextFile() API's.YOu can also check for the extension using these API's
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
i have created a two menubuttons which will draw a Circle,and another one for
Rectangle.i have wriiten in the onMouseMove message handeler.now my problem is that if i choose the circle to draw the previous one is removeing from window.i want to keep all draws in window.i have tryed with the method
Invalidate(false); but it is not working .plz give me the sugetions.
|
|
|
|
|
Sounds like you're not drawing them in your OnPaint handler, and, ironically, your Invalidate call is what would be forcing them to erase.
Post some code if you want further advice.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
void CNEWWINDOWView::OnLButtonDown(UINT nFlags, CPoint point)
{
if(nFlags==MK_LBUTTON ){
x1=point.x;
y1=point.y;
}
Invalidate();
CView::OnLButtonDown(nFlags, point);
}
void CNEWWINDOWView::OnMouseMove(UINT nFlags, CPoint point)
{
if(nFlags==MK_LBUTTON ){
x2=point.x;
y2=point.y;
}
Invalidate();
CView::OnMouseMove(nFlags, point);
}
And in OnDraw i Have written as follow
void CNEWWINDOWView::OnDraw(CDC* pDC)
{
CBrush brush;
if(m_colour!=-1)
{
if(m_hatch>=0 && m_hatch<=5)
brush.CreateHatchBrush(m_hatch,m_colour);
else
brush.CreateSolidBrush(m_colour);
pDC->SelectObject(&brush);
pDC->TextOut(300,10,"COLOUR::");
CPen pen(PS_SOLID,2,m_colour);
pDC->SelectObject(&pen);
}
if(m_Element==LINE)
{
pDC->MoveTo(x1,y1);
pDC->LineTo(x2,y2);
}
else if(m_Element==RECTANGLE)
{
CRect* rect=new CRect(x1,y1,x2,y2);
pDC->Rectangle(rect);
//pDC->FillSolidRect(rect,RGB(255,255,255);
rect->NormalizeRect();
}
else if(m_Element==CIRCLE)
{
long radius =
static_cast(sqrt(static_cast((x2-x1)*(x2-x1-x1)+
(y2-y1)*(y2-y1))));
CRect m_EnclosingRect = CRect(x1 - radius, y1 - radius,
x1 + radius, y1 + radius);
pDC->Ellipse(m_EnclosingRect);
}
|
|
|
|
|
As I guess that when you draw a circle ,earlier drawn figures are being erased.Right?
Have a look at SetROP2().
This method helps working with the Raster Operations performing XOR,AND etc operations on bits while drawing.
You can use the R2_XXX option for the drawing modes.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi _AnShUmAn_
i have tried with the setRop2();what u have guessed is true.but all parameters of this function for set the pen and brush colour.i havent find any thing which wil solve my problem.plz give me sample code.
|
|
|
|
|
Here's a sample code that I use in OnMouseMove
pDC->SetROP2(R2_NOTXORPEN);
pDC->MoveTo(pStart);
pDC->LineTo(pEnd);
pDC->SetROP2(R2_NOTXORPEN);
pDC->MoveTo(pStart);
pDC->LineTo(point);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i hope that u will get an idea by seeing my code.
void CNEWWINDOWView::OnLButtonDown(UINT nFlags, CPoint point)
{
if(nFlags==MK_LBUTTON ){
x1=point.x;
y1=point.y;
}
Invalidate();
CView::OnLButtonDown(nFlags, point);
}
void CNEWWINDOWView::OnMouseMove(UINT nFlags, CPoint point)
{
if(nFlags==MK_LBUTTON ){
x2=point.x;
y2=point.y;
}
Invalidate();
CView::OnMouseMove(nFlags, point);
}
/* After the i have written in the on Draw method to draw Rectangle,circle ,Line by clicking on that buttons.*/
void CNEWWINDOWView::OnDraw(CDC* pDC)
{
if(m_Element==LINE)
{
pDC->MoveTo(x1,y1);
pDC->LineTo(x2,y2);
}
else if(m_Element==RECTANGLE)
{
CRect* rect=new CRect(x1,y1,x2,y2);
pDC->Rectangle(rect);
rect->NormalizeRect();
}
else if(m_Element==CIRCLE)
{
long radius =
static_cast<long>(sqrt(static_cast<double>((x2-x1)*(x2-x1-x1)+
(y2-y1)*(y2-y1))));
CRect m_EnclosingRect = CRect(x1 - radius, y1 - radius,
x1 + radius, y1 + radius);
pDC->Ellipse(m_EnclosingRect);
}
but it is not restore the privious draws.
|
|
|
|