|
That totally works!
Thankyou very much!
The MFC approach to life it a bit confusing at the moment, but I'm beginning to get the hang of it.
Next step: adding transparency!
expect me back in a few days.
Jon h
|
|
|
|
|
Just in case, this is what is really working for me since 5 yeras! Use it if you wish!
void CxxxxxxDlg::OnPaint()
{
CPaintDC dc(this);
if (IsIconic())
{
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDC memDC;
memDC.CreateCompatibleDC(NULL);
CBitmap Bitmap;
Bitmap.LoadBitmap(IDB_BITMAP_BACK);
memDC.SelectObject(&Bitmap);
CRect rect;
GetClientRect(&rect);
LPBITMAPINFOHEADER m_pBmInfoHeader;
UINT width = (UINT) m_pBmInfoHeader->biWidth;
UINT height = (UINT) m_pBmInfoHeader->biHeight;
dc.BitBlt(rect.left,
rect.top,
width,
height,
&memDC,
0,
0,
SRCCOPY);
CDialog::OnPaint();
}
}
And there has never been a need for WM_ERASEBACKGND so far!
PS. For your next questions, to prduce Transparency you must have Mask bitmaps and prepare either by writing code or yet simpler just produce a B&W version of your bitmap and then use it as a mask.
Keep in mind that if you are going to use bitmaps as a background to your dialog window, you must go some steps further than just tranparenting the bitmap, you gotta create a region from it and let that
region be the dialog drwaing clip regions/window.
Advice: Use the samples from codeguru or even here on codeproject and save yourself a lot of time!
However, Good Luck!
|
|
|
|
|
Does anyone know how to make those Title bar, Menu bar, Tool bar, Status bar disappear, so that I have more space for the document on the screen? My program is a SDI project.
Thanks
|
|
|
|
|
Hi,
I would like to associate an acclerator (for example Ctrl+S) to a button in a dialog window.
What do I have to do ?
I just have a function associated with the button ID.
Thanks.
Rob.
|
|
|
|
|
Hi
I have a small problem, which might seem ridicolous. I have an extended combobox and a toolbar om a dialogbar. To my surprise, I can't find any way to react when the user presses the enter button in the edit-part of the combobox. The action I want is the same as the one when the user presses a button on the toolbar.
Any hints?
|
|
|
|
|
search MSDN for "Subclassing a Combo Box". there is an example there showing how to catch the enter, esc, and tab keystrokes for comboboxes on a toolbar.
|
|
|
|
|
Using the Ultimate Grid (UG) very successfull for years, I now want do do some custom drawing.
Has anyone made an enhanced version (e.g. an OnDrawCell() handler, etc.) that I could buy/get/use?
Uwe Keim
See me: www.magerquark.de
|
|
|
|
|
Hi Uwe,
I think the correct way is to dereive a new class from "CUGCellType"
and overwrite the "OnDraw" method. I've done this in one of my projects.
If you need further information, don't hesitate to contact me.
Best regards
Holger
|
|
|
|
|
Hi,
I need to develop a plug-in for IE, that would be able to get the current URL (and detect it's changes).
The problem is that I don't even imagine where to begin!
Can anyone point me source code that:
- creates the toolbar under Internet explorer
- get the URL changes (automatic)
I looked @ the docs in MSDN, but they pointed me nowhere...
Tutorials are very welcome. The plug-in is in the style of the Google and Altavista style.
Thanks in advance!!
Marcelo Nogueira Magri
[Senior ASP Developer]
[Newbie VC++ Developer]
|
|
|
|
|
You can use my article and ATL Object Wizard. http://www.codeproject.com/atl/rbdeskband.asp. It's a little out dated. I have been notified of a few bugs in it, which I have fixed but have not posted the changes for. I have actually updated my codebase and will post the udpated article and content with some more helpful information about implementing each type later today. There are links on MSDN too maybe hard to follow.
Email me if you have any questions, and I'll try to answer them.
-Erik
|
|
|
|
|
I'm having problems withm a global windows hook created with SetWindowsHookEx.
The hook procedure is contained in a dll and the installation procedure for the hook is also contained in the same dll. I also have an application that links to the dll and calls the installation procedure.
When the application is running the hook works fine, but as soon as I quit the application the hook dissapears. I have not unhooked the hook, but it seems to uninstall it anyway.
I wanted to install the hook using the application and then have the application quit while the hook is still running, can I do this?
Thanks.
|
|
|
|
|
When you app exits, all DLLs it has loaded are unloaded. You'll need to keep your app running all the time, perhaps minimized to the tray.
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
Is it possible to make a dialogbox appear like a form, so that when I move the whole window I also move the dialogbox. I have tried to use forms but with forms it is difficult to switch between them by pushing a button. If anyone can be at help I would be most grateful. And if anyone would take the trouble to make a program in VC++ (I am using 6.0) that changes forms if you click different buttons (between two forms/dialogs) it is important that the forms/dialogs is a part of the window. I will be extremly happy.
my e-mail is havardg8@hotmail.com
regard howie
|
|
|
|
|
I've done this before - I used one form to hold three flex grids, only one to be shown at a time and full screen, so I used ShowWindow to show and hide the items relevant to each view, creating the illusion of multiple forms.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I need to use 100% of the screen to do drawing. However, as you know, there are "title bar, menu bar, tool bar, status bar" on the windows. How can I make them disappear? Also, because the last person doing this program started the program as SDK (single document), so I cannot open a new separate document, can someone help me?
|
|
|
|
|
There's an article in the Jan 99 Windows Developers Journal titled "Implementing Full-Screen Mode in MFC" by Adrian Hill that looks like it might help.
Or, if you just want to work in a new window, you might want to check out my Gribble1 article.
|
|
|
|
|
Can you tell me where can I find this Journal without going to library? Because I need to fix the problem now.....
Thanks
|
|
|
|
|
Well, I don't think its online - you might try Mike Blasjkdjclckw's (hope I got that right) sample FULLY.ZIP here
|
|
|
|
|
To go into a full screen mode, just resize the window so the toolbar is above the top edge, and if you have a status bar, it is below the bottom. The only problem is if a system is multi monitor and the monitors are stacks vertically (unlikely, but possible ), then the toolbar or status bar will show on the other monitor. I don't know if there is another solution, but the WJD site (www.wdj.com ) will allow you to download the source code for the month in question, so you can always have a look and see.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi,
I have created a TreeViwe control with the WS_EX_DLGMODALFRAME extended style.
The application of this style results in a horizontal scrollbar for this treeview window. The scroll thumb is also very small, making the treeview area about 10 times as wide as necessary.
How can I prevent this, and get e reasonable scrollbar, like the windows explorer?
TIA
|
|
|
|
|
Hi!
Is there any tool available that
- extracts the resources (string, dialog, ...)
- has an easy UI so that a translator can translate the separated resources
- putting the translation to the original source, besides the source language
?
I'm quite sure the is such a program but I haven't any idea what it was named...
Thank you!
Ciao,
Alex
|
|
|
|
|
I'm not sure of if this program will do everything you need but it does allow resource (de)compilation from an executable and has a easy gui.
http://www.rpi.net.au/%7Eajohnson/resourcehacker/
|
|
|
|
|
Hello, the codegurus around the world.
Now, I'm working the localization of our product.
The previous developer made some program to get the string from RC file, and get back the
translated string to the original RC file.
(I can't provide this application since this is the internal tool at our company..)
We can open RC file as text format, so we just search " " from RC file.
And I created only DLL from RC file, and load this DLL file inside EXE file
as some ppl do.
Good luck
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I'am From China.help me For Visual C++ and English.
Thank You!
Welcome to NetVc:http://netvc.6to23.com
|
|
|
|
|
errrrr
help you what?
read english?
escape from china?
learn c++?
ask clearer questions?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|