|
This is really nice class, but a problem is when i select the dialog (hold down the left mouse) then there's a dotted-rectangle border around the dialog. I see that other skinned app don't have this. How to HIDE this rect????
Vũ Nãng Lực
|
|
|
|
|
in
BOOL CDialogSK::OnEraseBkgnd(CDC* pDC)
{
...
pbmpOldBmp = (HBITMAP)::SelectObject(dc.m_hDC, m_hBitmap);
...
::SelectObject(dc.m_hDC, m_hBitmap);
return bRetValue;
}
should be ...
BOOL CDialogSK::OnEraseBkgnd(CDC* pDC)
{
...
pbmpOldBmp = (HBITMAP)::SelectObject(dc.m_hDC, m_hBitmap);
...
::SelectObject(dc.m_hDC, pbmpOldBmp);
return bRetValue;
}
|
|
|
|
|
Yes this is a bug. Thanks for pointing this out...
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
Nothing to thank about ...
i have to thank for this very useful and easy to use class ...
i was looking for a class that does exact what this class does (<< stupid sentence)
Greets and Regards from Germany
.: LegoLas :.
|
|
|
|
|
How can I change dialog skin dynamically using your class. I want to give user, the option to change skins at runtime, (similar to Windows Media Player etc). Can you please guide me to do that. Which dialog handler should call SetBitmap method etc.
ARSALAN MALIK
|
|
|
|
|
Add a another public function named ChangeSkin, that takes the name of a skin file. In that add paths for the background bitmap, color to be made transparent, etc...
Then in ChangeSkin read the file, retrieve the values and call SetBitmap(...), SetTransparentColor(...) and at the end Invalidate the dialog. This will force a repaint and hence the new skin will get applied.
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
Thankyou. One problem I faced while compiling was AFX_EXT_CLASS , I removed it and every thing worked. Can you tell me what does it mean?;)
ARSALAN MALIK
|
|
|
|
|
I guess you saw my message "Bug in code" below.
AFX_EXT_CLASS is required if you build the class as a seperate DLL. In my original work I used to build all of my controls like CDialogSK, CButtonSK, CUrl as seperate DLLs and use it for my application. If you use static linking this gives a error....
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
Abhinaba this is a great little class and I will be using a derivative of it in my own screen capture application, Many thanks.
Chris.
|
|
|
|
|
I was wondering if there was a simple way to not use this if the OS is Win98? Perhaps I'll create separate downloads, or perhaps I'll have 2 dialogs to call, one if the OS is Win98, one if the dialog is Win2K/XP.
|
|
|
|
|
you can always do this. Yu can either query the windows version and then choose the dialog to use. Otherwise you can go ahead with the call
g_pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)
GetProcAddress(hUser32, "SetLayeredWindowAttributes");
if(g_pSetLayeredWindowAttributes != NULL)
else
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
|
What do you mean by a child dialog? If you are talking about a dialog popped from a SDI, MDI or any other Dialog based application then you will be able to do this without any issues by deriving that dialog class from CDialogSK instead of CDialog.
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
Not a popup dialog, but an embedded dialog (like a form)... Look at the link in my previous posting and see what I mean.
The problem with a child dialog is that it's class doesn't include an OnInitDialog()...
|
|
|
|
|
How can I make this work in Win98?
Jay
|
|
|
|
|
Sorry this code uses some Win2K/XP specific layerinig calls. These calls are fundamental to the way the class works in implementing transparency. So you will not be able to port it to Win98. Win98 would require a completely different transparency mechanism involving creating regions with the shape of the skin and then attaching the region to the dialog window. I thought of writing a similar stuff for Win98 but was not sure about its requirement as almost everyone has already or is planning to Upgrade to a newer version on Windows.
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
Hi abhinaba,
I've been getting some help from Paolo Messina trying to get your class and his ResizableLib to play nicely with one another. I think this would be very useful, as most people who want to create a skinnable dialog would most likely want it to be resizable as well.
The problem is that if you set the dialog to resizable, you can't get rid of the frame border which looks bad around a transparent or non-rectangular window, yet without setting WS_THICKFRAME, it won't be resizable.
The ideal situation would be to hide the border (make it transparent or something), and add a resizable grip somewhere on the skin, most likely in the bottom right-hand corner.
He's pretty sure that by capturing the left mouse button on the grip, it's possible to call ::PostMessage(hDlg, WM_SYSCOMMAND, SC_SIZE, 0) and that may let you resize the window. However, you're already handling the left-mouse button, so I'm trying to figure out how to determine whether the hit was on the nontransparent part of the bitmap, or on the resizing grip.
Do you think you could join in on our conversation and provide a little insight? That would be awesome. Like I said, I think this could be very useful information to a lot of people.
http://www.codeproject.com/dialog/ResizableDialog.asp#xx625414xx[^]
Thanks,
Don
|
|
|
|
|
|
veryyyyyyy sorry. I overlooked the notice that got inserted in the file using some scripts. I no longer work with the company whose notice was inserted. So I cannot remove it now.
Anyway the CDialogSK.cpp file does not have any notice so you can use it Just write your own CDialogSK.h files
==========================
AB => Code and let code
Go to my home
==========================
|
|
|
|
|
This is wonderful, exactly what i was looking for - well, not exactly, but close enough..
I have pretty much combined this class with Davide Pizzolato's CXSkinButton class to give me a pretty good dialog skinning library for myself.
If anyone reading this knows of some good skinning classes for other controls, please let me know
- Right now looking for a skinnable treectrl, and DBGrid control
Leon
|
|
|
|
|
The src has a bug. I created the CDialogSK to build as a dll but while putting up the source here forgot to remove the dll specific macro.
To fix this go to the "class AFX_EXT_CLASS CDialogSK : public CDialog" line in CDialogSK.h and remove "AFX_EXT_CLASS"
After this the code should build fine with your application
==========================
AB -> Code and let code
==========================
|
|
|
|
|
There are no exit button, context menu, or any such mechanism by which one can get it to go away. Getting it to go away is not the same as "hiding" it. I'm talking about ending it.
I had to go into Task Manager and from the "Process" tab I had to look for it and then click "End Process", because it didn't even show up on the "Application" tab.
So how do you get it to go away (other than the way I've just described)?
William
Fortes in fide et opere!
|
|
|
|
|
The application is just a demo that shows how to use CDialogSK. Since the class is inherited from CDialog it has the same characteriztics. For this particular application just hit the escape (Esc) key.
You can add your own OK buttons on it.
==========================
AB -> Enjoy!!
==========================
|
|
|
|
|
Nice piece of code, neat interface, my 5.
Regards,
Vitaly Tomilov
Professional tooltips for all development platforms available on www.Tooltips.NET
|
|
|
|