|
I use the following code to change the dialog into transparent ,but failed.The dialog is a child wnd in a CRichEditView,and it has not titlebar
m_bf.SourceConstantAlpha = 0;
m_bf.BlendOp = AC_SRC_OVER;
m_bf.BlendFlags = 0;
m_bf.AlphaFormat = 0;
m_nWidth=rc.Width ();
m_nHeight=rc.Height ();
CBitmap m_bitmap;
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
::AlphaBlend(dc, 0,0, m_nWidth, m_nHeight, dcMem, 0,0,m_nWidth, m_nHeight,m_bf);
|
|
|
|
|
I'm not sure I understand you fully, but if you want to see through some portions of your dialog I think all you do is make your brush NULL.
Maybe have to handle WM_ERASEBKGND with FALSE or TRUE too...
Look around CP there are lots of examples of Skinned sytle apps using bitmaps, regions whatever....
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
thank you for help!
If I want make alpha value of dialog is between 10 and 200.How can I?
|
|
|
|
|
I’m tired and grumpy... I’m at the end of a project and the last thing I have left is, of course, the stuff I really don’t want to do.
The application I’ve written calls for a "Search for Files" type view. Basically duplicating the "Start/Search" functionality. Don’t ask... I’ve been asking that myself and all I get is a “it’s got to be there”.
I’m not up to reinvent the freaking wheel. Given that the "Search" in Windows (XP in this case) is already there and it seems to be a simple HTA type application, how do I get it into an embedded CHtmlView? (by the way, I'm stuck with VC6 for the time being).
The alternative to that is to write a recursive search engine and fill up my own list control, implementing that obnoxious Shell ID’s crap, icons, context menus, drag & drop, you know the drill. I really don’t feel like it. Unless, of course, you have something like that already. If that’s the case, let’s talk...
Thanks,
g
|
|
|
|
|
There is an advanced CListCtrl under List controls section here at CP. The control implements drag and drop behavior and uses the system image list I think.
This isn't exactly the everything done for you, but it's a start...
Have a day!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
thank you for the reply but i have read through many of those documents. Most of these documents require physical manipulation of the listbox. what i need is to progammically select and deselect items from the list. that works great until i do not want any items in the list highted. i can not get the last item to deselect.
|
|
|
|
|
|
I just downloaded the Perl Editor by: DzSoft and I love there menus.
They look like XP style...
How is this accomplished...I have drawn many a ownerdrawn menus and cannot figure out how they get the shadow effect...? in Windows 98 anyways.
I'm thinking create your own entire menu system from Cwnd's...?
Just curious...thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
i actually don't know which shadow effect that you really would like to have.. but give this a try:
http://www.codeproject.com/useritems/MenuXP2.asp
have a nice one
bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Thanx....I'll check it out.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
|
Thats the one...I want to know how they do that under win98...I have tried everything to paint ownerdraw menus that way and cannot overwrite the edges/borders of Windows menus. So i'm assuming they don't use the default windows menus and if they do I want to know how they do it...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hello,
I have a dialog based app. It has a few controls on it and I also bitblted an image to it in OnPaint(). I have some edit boxes and other controls on the dialog that need to go on top of the image but when it gets painted the images is painted over them. I have tried sending a WM_PAINT message to the controls but this doesn't work. Any ideas?
Thank you,
Susan
|
|
|
|
|
Put an image control on the dialog. Then change the tab order as the control to become the first; resize it from code to fill the entire dialog box area and associate the bitmap to it.
Good luck!
rechi
|
|
|
|
|
Try handling the WM_ERASEBKGND message instead of OnPaint()
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
by the way..
i don't think that you normally force redrawing of anything in mfc with sending WM_PAINT - messages to the window.. you normally Invalidate that window (controls are windows too).. then it is forced to redraw itself.
m_edit.Invalidate();
i am no expert, but i think this is the proper MFC way.
Bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Make sure that you have the CS_CLIPCHILDREN style set for your dialog. When you ask for a DC for that window, it will automatically clip the children rectangles from where you are allowed to paint, and you will no longer paint over your controls.
You can set this style for your dialog after it has been created by doing this:
LONG lStyle = ::GetClassLong(hDlg, GCL_STYLE);
lStyle |= CS_CLIPCHILDREN;
::SetClassLong(hDlg, GCL_STYLE, lStyle);
By the way, you should paint the bitmap in the WM_ERASEBKGND message instead. This will reduce any flicker that may appear, and it is a fundamentally better place to perform that action.
|
|
|
|
|
I've created a dialog based application and i've put a WebBrowser control inside.
The application fails to create the dialog and i would like to know how to fix the bug.
rechi
|
|
|
|
|
Can you be a bit more specific ?
bogdan_rechi wrote:
The application fails to create the dialog
Is it in the main dialog or what ?
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I think it's interesting that we often quote each other in our sigs and attribute the quotes to "The Lounge". --- Daniel Fergusson
|
|
|
|
|
Is not about an error.
The execution of dlg.DoModal(), where dlg is the main dialog, simply has no effect.
rechi
|
|
|
|
|
When you created your app using appWizard (i'll assume) did you specify ActiveX controls...?
Did you add the control as an activeX control...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
No, i didn't specify "ActiveX controls".
Meanwhile the application has grown and i have to add the control without the wizard's support.
rechi
|
|
|
|
|
Thats probably whats causing your problems than.
It's not too much work to add activeX support though.
Create a small test app WITH activeX support and just find the functions.
AfxOleInit or something I think similar to this...probably a few more things too.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have tried this.
The only difference i found is "#include afxdisp.h" in stdafx.h, which has no effect in my current application. It has to be something else.
rechi
|
|
|
|
|
It's always a pain to add options like ActiveX after the project has been created.
I would suggest using app wizard..much quicker and easier.
Create a new project using AcitveX controls and just copy your old code over into the new project.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|