|
MFC MDI project:
I didnt name my project with the final name in mind, and now i cant seem to change the title bar of the project. In project settings i was able to give a suitable new name to the exe but the title bar still has the name of the project in it, even though I rebuilt the prj. Please tell me theres some trivial way of changing the name in the title bar....
I looked into the rc file with notepad but dont see anything I can change there, (I dont really know what I'm looking for.) Anyways is is safe to edit the rc file?
Thanks,
ns
I tried SetWindowText in mainfrms OnCreate and also in OnInitialUpdate of the view...didnt work.
Also did cs.lpSzName in PreCreateWindow....thats no good too.
|
|
|
|
|
In the resource view, open the String Table and edit the IDR_MAINFRAME caption to what you want to appear in the titlebar of your project.
You might also want to change the AFX_IDS_APP_TITLE string caption to something different as well since calling AfxMessageBox(...) will display the AFX_IDS_APP_TITLE string caption in its titlebar. That should do it.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Wow! Cant wait to try it tomorrow. Thanks so much!!!!
ns
|
|
|
|
|
nss wrote:
Thanks so much!!!!
No problem. Glad to help.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Well, that works great, but now, in the title I get:
MyGoodProjectName - OldPrjName1....sort of like thats the name of the document or view or something. I tried changing the IDR_STRAINTYPE string but thats not it apparently. So the old prj name is still sneaking in....
Ideas?
Thanks,
ns
|
|
|
|
|
By looking to IDR_STRAINTYPE, you are on the right track. That is the string that you need to change. I built a quick app named "newMFC" and I have its "TYPE" string resource below:
\nnewMFC\nnewMFC\n123 Files (*.123)\n.123\nnewMFC.Document\nnewMFC.Document
Change the first "line" or section of this string to what you want the document to be called by default. For instance, if I wanted it to show "New Document" I would change the above line to:
\nNew Document\nnewMFC\n123 Files (*.123)\n.123\nnewMFC.Document\nnewMFC.Document
DO NOT remove the new line characters (\n) in the process. That should do it.
For future reference, below is what each section is for, corresponding to the MFC App Wizard:
1) \nnewMFC - Document Type Name
2) \nnewMFC - File new short name
3) \n123 Files (*.123) - The filter name
4) \n.123 - The actual file type filter
5) \nnewMFC.Document - The file type ID
6) \nnewMFC.Document - The File type Long name
I hope that fixes things for you. If I understand your problem right, it should. Good luck with the rest of your project.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
By golly!
You have done it again!!! I had eralier tried exactly what you say to do, but I hadnt closed the editbox (after I changed the entry so the change didnt take effect) before building the proj again which is why I saw no difference. But this time I edited the resource , saved it, closed the editbox and then built and ran....viola! I appreciate your careful explanation of the various sections. It still likes to tack on a "1" at the end of the title as in : MyProject - CorrectNAme1
--- which is quite acceptable. SO, many many thanks again!
ns
|
|
|
|
|
One more thing since you mentioned it. It may or may not matter much, but I think it looks a little nicer if there is a space between the new document name and the number. This "New Document 1" instead of this "New Document1". If you would like the first effect, just insert a space after the name and MFC will tack on the number after the space which, just according to my preference, looks a bit nicer.
\nNew Document \nnewMFC... PROMPTS "AppName - New Document 1"
instead of
\nNew Document\nnewMFC... PROMPTS "AppName - New Document1"
Just thought you might be interested. Once again, good luck with your project!
ns wrote:
SO, many many thanks again!
Your welcome!
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Hello all
How do one should go about changing the background color of CDialog and its elements like buttons,group boxes etc. Pls help me with an example.
Many thanks for your help.
Hari.
|
|
|
|
|
hy, try to overwrite OnEraseBkg, and also OnCTLColor
try something like this:
HBRUSH CBaseView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
switch (nCtlColor)
{
case CTLCOLOR_STATIC:
case CTLCOLOR_LISTBOX:
case CTLCOLOR_BTN:
pDC->SetBkColor(GetSysColor(COLOR_BTNFACE));
return (HBRUSH)m_grayBrushPtr->GetSafeHandle();
break;
default:
return CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
break;
}
}
|
|
|
|
|
there is an easy was aswell
take a variable of type CBrush at class level like
CBrush m_Bursh;
initiate it in OnInitDialog like
m_Bursh.CreateSolidBrush(RGB(0,0,0));//OR ANY OTHER COLOR u WANT
override the WM_CTCOLOR message handler
and add this line to its implemention
HBRUSH CBaseView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_Brush;
}
|
|
|
|
|
Hi.
I am trying to use the CImage class from ATL to handle images in my GDI game.
I manage to make it draw the images, or at least some formats. It says in the documentation that the CImage::Draw function is supposed to support both transparency and alpha channel. But I can't seem to make that work.
I was wondering if it's just the format that I save my images in that is wrong? I have tried different PNG formats and GIF, but none work correctly. As far as I understand the documentation I am supposed to be able to create a PNG containing transparent color and alpha channel and the Draw function will take care of the rest when I call it... Is that the case?
Does anyone know what format I have to save my images in to make them work properly? I tried to save the image with transparency and alpha channel as PNG-24 (from Photoshop), but the transparent color is just semi-transparent when I render it in my game. Anyone know what's wrong?
Thanks.
|
|
|
|
|
Is it possible to bring mdi child frame to top without
activating the frame?
CChildFrame * pChildFrame = ( CChildFrame *)pView ->GetParent();
|
|
|
|
|
Hey everyone,
is it possible, unload any dll module (not my) from any strong system process e.g.
rundll32 or svchost.
How can I do it ?
Sorry for my english and thanks for advice
Mila
|
|
|
|
|
I do not know of a way of telling another process to unload its dynamicly linked binaries. In fact if you could tell any arbitrary binary to load and unload dynamic bindings outside of the process that could be an exploit (tell it to unload svchost, put the malicious version in, tell it to load it).
Why do you want to unload rundll32 or svchost? Instead of asking a specific question maybe you should step back and see what you are really trying to solve.
|
|
|
|
|
I'm trying write some little application whereby I can unloading and deleting malicious modules - dll's like keyloggers or adware components. Part of that pests are loaded when starts OS and are modules of e.g. rundll32.exe.
What can I do, to delete thats dll's ?
Mila
|
|
|
|
|
Unfortunately Windows has a habbit of locking files mapped into memory. Why it does this I'm not sure since it shouldn't matter what happens to the binary after it is read into memory.
One thing I've been meaning to look into is how to hook into the pre-boot and boot process. For instance when a kernel patch is applied to the OS you have the very same problem (you can't copy the new kernel bins while the kernel is running). What happens is you tell the boot loader to copy and configure files before the kernel is fully loaded. Especially with some classes of malware you really need a "true" single user mode where one can make manipulations to the system by hand without fully initalizing the kernel.
I like the fact that anti-virus software is starting to key into the fact that malware and spyware are just as bad as any virus (in fact one could term them as trojans). I'm not trying to discourage you but some of this stuff is real harry stuff requiring knowledge of the internals to fight.
|
|
|
|
|
Tom Larsen wrote:
Unfortunately Windows has a habbit of locking files mapped into memory. Why it does this I'm not sure since it shouldn't matter what happens to the binary after it is read into memory.
That's because windows creates a file mapping to the executables instead of reading it all into memory in one sweep.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Have you any idea, how am I do it ?
Mila
|
|
|
|
|
If you want to know how to map a file, look up the methods CreateFileMapping and MapViewOfFile in the Win32 API.
But Tom was right about your original question, you can't tell a process to unload dll's.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Most of the time I insert an Active X control on my DIalog or FormView . Now i want to create these components dynamically at run time based on an configuration file . I am unsure as to how I would write Event handlers for the same as for pre-existing objects the DDX call is hardcoded ! Please help
|
|
|
|
|
Howdy
An app I have inherited at work seems to have a strange problem, but one that may occur (it already has once)
While the app is a Windows-only program, people with unix/linux can share a folder using Samba and that can be mapped into a Windows users computer. It is also possible that a unix user has a symbolic link in a folder that points back to a parent directory, creating a looping directory structure.
On unix, I could detect this pretty easily using stat(), however on Windows, these symbolic links appear exectly the same as the original file/folder, making it possible for the app to get caught in a never ending cycle of directory scanning.
Is there any way to pick this up in windows?
Cheers
|
|
|
|
|
Hi all,
I need to know what is the future of COM in the presence of .Net architecture. Will COM survive or not? I need to know it so that I put my learning efforts in right directions.
Thanks for all those who ll take some time to answer this question.
Regards
|
|
|
|
|
Learn COM first. Once you know COM, .NET is easy.
It is similar to learning C and C++. Other high-level languages including Java, C#, VB, etc. are simple.
Kuphryn
|
|
|
|
|
kuphryn wrote:
Learn COM first. Once you know COM, .NET is easy.
I am learning COM these days. I am learning it from 2 books.
1. Inside COM
2. Inside ATL
I have not developed any COM server yet. As I am reading "Inside ATL" and other stuff on COM on web, I foung that this path will lead to MTS (Microsoft Transaction Server) programming. (I dont know whether i m right or wrong, it is only my guess.)
The thing i need to know is whether COM is alive in today world. i.e. are new projects being implemented using COM or .Net has obsoleted COM since .Net's component model is much simpler.
|
|
|
|