|
I'd like to have my tabbed dialog application using XP themes like "My Computer-> properties" in the win XP - the dialog inside the TAB control should use gradient background.
My problem is that static controls and check box buttons are not drawn properly -> background of the text is erased by default dialog background color (text background has OPAQUE mode). I've tried to handle the WM_CTLCOLOR message in the dialog, but this solved only the problem with text static controls, not with the group rectangle static box (it's text was drawn over the rectangle line when I've set text background mode to TRANSPARENT).
I hope there is some easier way than to code my own owner drawn controls, when windows GUI is using this.
Any suggestions ?
Thanks !
rrrado
|
|
|
|
|
Looks strange because when an XP theme is active, all text labels are drawn transparently; in fact, no WM_CTLCOLOR handling is necessary. Does your app have a manifest resource in it that enables theming (the XP look) when a theme is active?
The gradient that you see in "My Computer-> properties" is NOT a feature of a themed Tab control, it's how the theme handles property sheets - it applies a gradient background to each of the dialog in the sheet. If you create your own tabbed dialog, you can do it by handling WM_ERASEBKGND in each of your dialogs.
Consider the following code excerpt; perhaps you will get some ideas on your group boxes (BTW, they belong to window class BUTTON, not STATIC):
BOOL myGroupBox::OnEraseBkgnd(CDC* pDC)
{
CRect rcCtrl;
GetClientRect(rcCtrl);
if (GetUXThemeState().IsThemeActive())
pDC->FillSolidRect(rcCtrl, ColorAdjustLuma(afxData.clrBtnFace, 750, TRUE));
else
pDC->FillSolidRect(rcCtrl, afxData.clrBtnFace);
PrintClient(pDC, PRF_CLIENT);
return 1;
}
void myGroupBox::OnPaint()
{
PAINTSTRUCT ps = {0};
::BeginPaint(m_hWnd, &ps);
::EndPaint(m_hWnd, &ps);
}
One always gets the deserved.
http://www.silveragesoftware.com/hffr.html Update your source code with my tool HandyFile Find And Replace!
|
|
|
|
|
Thank you very much for your response. I'll try your code. I don't use property sheets besause of it's limitations. I have tab control which has child dialogs. I'm handling the child dialog's onEraseBackgroud where I do nothing, so oridinal tab control's background remains.
I have manifest file in my resources, so all buttons, group boxes, etc. looks like in Win XP theme.
So I don't know why my static controls are not drawn transparently by default
I'm also calling InitCommonControls(); in the app's InitInstance() as recommended ...
rrrado
|
|
|
|
|
Could you make a small screenshot of the text label portion of a group box and give a link? this can make the native Windows drawing procedure more clear.
Oh... I think all you have to do is give your group boxes sensible ID's (other than -1 /IDC_STATIC /), check them in the WM_CTLCOLOR handler, call pdc->SetBkColor() for these ID's and return a brush of a proper color. Do not set the background mode to TRANSPARENT .
One always gets the deserved.
http://www.silveragesoftware.com/hffr.html Update your source code with my tool HandyFile Find And Replace!
|
|
|
|
|
I create some functions in vcpp. i want to use these function in vb.
for ex. i wrote a DrawArrow function which takes 2
parameters(point1,point2); ... i want to use this in VB. So i want to
create an Activex control for this, can i use MFC Activex controls.
And similary i create one dialog based form in vc++. and i want to
create entire application into an Activex control can i to that.
i wrote all the methods to resize that dialog and different event.
but i have to create a ocx control to use in VB 6.0.
so plz help me
thanks in Advance.
Surya prakash.
|
|
|
|
|
|
Does anyone of you know how to develop a tool like tcpview(by sysinternals.com)? My requirement is to not just listing (as in TCPview) but to monitor and end a process before it actually starts. For example, i want to filter all applications passing through port 80 except Internet Explorer. so if some clicks any pdf file on Internet, he will not be allowed to do so? how do i proceed? i m really clueless and need some ideas.
Thanking u,
|
|
|
|
|
hai,
thanks Alok , i use the message map macro ON_COMMAND_RANGE( ...)
the above gives only the single mouse lclick funtions.. can u give the remaining for double click and left and rigth mouse clicks.. and mouse moves.
i want other macros that give the id of button , which will be invoke when user double click on the ranged buttons. need help ,,
thanks in advance ...
Surya prakash.
|
|
|
|
|
adarisurya@yahoo.co.in wrote:
can u give the remaining for double click
Look For these messages in wNotifyCode of ON_COMMAND_RANGE
BN_DBLCLK : For Button Double Click
adarisurya@yahoo.co.in wrote:
i want other macros that give the id of button , which will be invoke when user double click on the ranged buttons. need help ,,
wParam
The low-order word contains the button's control identifier. (USE LOWORD macro here)
The high-order word specifies the notification message.
(USE HIWORD macro here)
lParam
Handle to the button
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Does anyone of you know how to develop a tool like tcpview(by sysinternals.com)? My requirement is to not just listing (as in TCPview) but to monitor and end a process before it actually starts. For example, i want to filter all applications passing through port 80 except Internet Explorer. so if some clicks any pdf file on Internet, he will not be allowed to do so? how do i proceed? i m really clueless and need some ideas.
Thanking u,
|
|
|
|
|
First Show You Identity.
Then ask your question.
Why People Don't Show there Identity while asking Question.
Is asking Question harm there Respect.
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Ok.. i have not registered to code-project. will register now itelf and resend the mail. my mail was not in anyway trying to hurt any1. if i violated the etiquttes of the group, then i am sorry.
|
|
|
|
|
Anonymous wrote:
then i am sorry.
I do not mean that, no need for Sorry, but I just want to convey if you post by Identity, you will get better Response from other user.
Anonymous wrote:
if I violated the etiquettes of the group
That depends upon the Group Moderator
Anonymous wrote:
i have not registered to code-project.
Go and register, its free.
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Friends,
I've CListCtrl on the dialog. I am getting huge amount of data from network that i am displaying in this ListControl (Report Style).
Now, i want that whenever new item is added, the CListCtrl should automatically scroll down to show the latest added item. How can i do so.
Imtiaz
|
|
|
|
|
|
Hi!
Plese tell me that in which function do i need to pass LVM_ENSUREVISIBLE
|
|
|
|
|
use this macro ListView_EnsureVisible if in win32/MFC both or
use LVM_ENSUREVISIBLE in ClistCtrl::Create if using MFC
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
ThatsAlok wrote:
use LVM_ENSUREVISIBLE in ClistCtrl::Create if using MFC
LVM_ENSUREVISIBLE is a message not a style.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
in my application i have used MS-access database to log events. Now i want to automatically rotate the log. i.e after a week say the log should be backed up. and then after some time deleted. how do i do it?
|
|
|
|
|
two options
1) have another DB file and when the time is up, copy all the recordsets from the current to the backed up
and empty the current
2) import an empty database in ur Exe and when the time comes copy the DB to DBBkup directory and spit out the empty DB from the Exe File (FindResource will help)
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
hi,
i want to delete the database evrery monday morning. how do i do it? can u give me some link
|
|
|
|
|
One way would be to put del ...\mydatabase.mdb in a batch file and create a scheduled task that would run the batch file every Monday. Other ways exist, too.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi all,
I want to set the WindowSize of MFC Dialog..(800 pixel width and 600 pixel height)..What is the way to do it?
If any one know this,please reply me..
Thanks in advance..
|
|
|
|
|
See SetWindowPos() and MoveWindow() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|