|
Here is what I have so far in the ChildFrm.cpp file(this is an MDI program).
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
//create the status bar
m_StatusBar.Create(this);
m_StatusBar2.Create(this);
//width of text we want to display
CRect textRect;
CRect textRect2;
CClientDC aDC(&m_StatusBar);
CClientDC aDC2(&m_StatusBar2);
aDC.SelectObject(m_StatusBar.GetFont());
aDC.SelectObject(m_StatusBar2.GetFont());
aDC2.DrawText("Line #: ", -1, textRect2, DT_CALCRECT);
aDC.DrawText("File: ", -1, textRect, DT_CALCRECT);
//set up status bar big enough to take the text
int width = textRect.Width();
m_StatusBar.GetStatusBarCtrl().SetParts(1, &width);
int width2 = textRect2.Width();
m_StatusBar2.GetStatusBarCtrl().SetParts(1, &width2);
//Initialize the text for the status bar
m_StatusBar2.GetStatusBarCtrl().SetText("Line #: ",0,0);
m_StatusBar.GetStatusBarCtrl().SetText("File: ", 0,0);
return 0;
}
I need to display the open file name in the status bar. Right now, I get:
Line #:
File:
Is there a command for this? I haven't found one.
Thanks for any hints.
Best,
John Soares
support@onlinescamreports.com
|
|
|
|
|
Fill a string (maybe use CString::Format) with the text you want to display ("File:" + filename) and then output that. You're setting the text as 'File:' but nowhere are you specifying that you want the filename itself to be output as well.
This reminds me of that song "My boomerang won't come back". The answer "first you have to throw it".
cheers,
Chris Maunder
I spent a minute looking at my own code by accident. I was thinking "What the hell is this guy doing?" - @Logan
|
|
|
|
|
I've been mucking about with screen savers and need to add multi-monitor support to it. How would I go about it? Surely there needs to be a
Switch (<<Some Message>>)
Case <<some keyword>>:
break;
<br>
Case <<other keyword>>:
<br>
break;
Any help would be greatly appreciated.
"If at first you don't succeed.....you must be installing Windows..."
Windoze CP - Windows without the cr*p (Now with automatic bug eliminator!)
Hey so what if I'm a geek! Byte me!
|
|
|
|
|
Use GetSystemMetrics ( or GetDeviceCaps, I forget ) and ask for the size of the virtual screen. Something like SM_CXVIRTUALSCREEN. I'm making this up, but whatever the flag is, that is how I did it and it works great.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Could anyone who is going to get irrational about me quoting their posts here please insert the following notice into their signature:
I am a whiny pussy
|
|
|
|
|
I've used the Multi-Screen code from Ben Bryants screensaver to get the points but I need to know the messages that tell the app what setup the client has at runtime. There must be some message or flag that tells the app whether or not there is more than one monitor and for that message I can implement my point variables.
"If at first you don't succeed.....you must be installing Windows..."
Windoze CP - Windows without the cr*p (Now with automatic bug eliminator!)
Hey so what if I'm a geek! Byte me!
|
|
|
|
|
I don't think so, I never found it. I just queried the system for the virtual desktop and worked out the screen dimensions from that.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Could anyone who is going to get irrational about me quoting their posts here please insert the following notice into their signature:
I am a whiny pussy
|
|
|
|
|
|
I just learned how to create help files using rtf and hcw.exe, but the process seems a bit clumsy to me. A quick check at www.downloads.com reveals that there are many programms to aid in the creation of help files.
My question is what is the best way to create help files for windows applications. Should I use rtf or html help? Should I use notepad or a specialized program? If the latter is the case, what is the best program to use.
Any suggestions would be appreciated.
|
|
|
|
|
I've always used rtf (edit with Microsoft Word or WordPad) and hcw.exe but
for new application, I believe it's neat to use html help. But if you have a
lot of money, you may want to check for RoboHelp Office 2002!
By the way, Microsoft Html help compiler is free. A quick search at MSDN, you will
find everything you need.
Last Article:
Client/Server Socket class
|
|
|
|
|
Thanks I think I will give html help a try.
|
|
|
|
|
i have HBITMAP and destination HDC how use Scretchblt
|
|
|
|
|
1. Create a memory DC. Preferrably one compatible with the target DC.
2. Select your bitmap into this DC.
3. Blit.
Done (modulo cleaning up after yourself).
|
|
|
|
|
Also, if the result looks bad, call SetStretchBltMode on the target DC, with a value of COLORONCOLOR.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Could anyone who is going to get irrational about me quoting their posts here please insert the following notice into their signature:
I am a whiny pussy
|
|
|
|
|
Is COLORONCOLOR better than HALFTONE ?
--------
Have you hugged your monitor today? --Shog9 --
|
|
|
|
|
To be honest, I can't tell the difference, but I could not remember HALFTONE and I could remember COLORONCOLOR. In theory, one is better, but I can't see it.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Remember that amateurs built the ark. Professionals built the Titanic.
|
|
|
|
|
Look:
HANDLE h=CreateMutex(NULL, FALSE, "q123");
WaitForSingleObject(h, INFINITE);
h is used only in this piece of code - from some MFC dialog based application - with no effect.
Any ideea why?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
Any ideea why?
Yes. From MSDN
The state of a mutex object is signaled when it is not owned by any thread.
that is, since you created it with FALSE (not owning the mutext) it has nothing to wait upon since no one currently owns it. Alas, it returns immediately.
What have happened to the art of reading docs?
|
|
|
|
|
The mutex is in fact a binary semaphore. Owning means working with it in non-signaled state as no other thread to have access to the shared resources.
I've used it before in the same manner and it worked.
And by the way: if what you say is true, how could you gain the ownership to the thread, once it is created with FALSE?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
I've used it before in the same manner and it worked.
If you say so. Then it must be either the global name or something else in your setup that has changed. I mean, since you already have used it, it has got to work. Right?
And by the way: if what you say is true,
It's not me saying this, it's the MSDN documentation. If that's wrong (wouldn't be the first time), we all know what company to blame and also how much use it is complaining to them.
how could you gain the ownership to the thread, once it is created with FALSE?
Ehhh, say again? You haven't created no thread that I've seen, you've created a mutex.
It seems to me there's something you're not telling us here...
|
|
|
|
|
It has to work, of course. I use mutexes in the same application for some modules and it works ok. That's why it seems so strange to me. I begin to question myself on that stuff.
About your last two sentences: you allways have the main thread in every Windows program.
rechi
|
|
|
|
|
Hi,
I'm trying to write a program that will make real time dsp of cd audio songs (something like the winamp dsp plugins that make
surround sound).
1. How can i 'capture' the sound signal before it comes to the sound card?
2. Where can i find tutorials regarding this prob and subject?
tnx
|
|
|
|
|
Eran wrote:
How can i 'capture' the sound signal before it comes to the sound card?
I assume you neither have the source-code nor a plugin-interface to/for the player, in case this would have been a non-issue.
For sounds going "out" from an application and to the soundcard, you can't. Well, at least not without writing a (kernel mode device-) driver to do it. Actually, This is exacly what Microsoft wants to prohibit anyone from doing by "locking down" Windows and make everything "DRM enabled" (i.e. taking over your machine and taking away your rights).
|
|
|
|
|
Well, what about message hook?
Can i use this stuff?
Anyway, It can be done, cuase non Microsoft's programmers did kind of stuff.
How can i make real time dsp of cd audio?
Any idea?
|
|
|
|
|
Well, what about message hook?
For real-time stuff like audio data?! LOL. No, seriously, I don't think this is anything to suggest (especially since IIRC thread switching is done at most every ~10ms, Win95 is even worse at about 250ms).
Anyway, It can be done, cuase non Microsoft's programmers did kind of stuff.
Where? Really, I'd really like to see a plain application that can intercept any other applications wave audio output to any Win32 exposed wave-audio device (not to mention replacing that output with its own modified signal).
How can i make real time dsp of cd audio?
Now you're switching to a completely different matter; real-time modification of sound input.
What direction of stream is it you really want to intercept? Please try to be as specific as you can be.
|
|
|
|
|
files of cda format (*.cda).
I'm not sure but, does the player convert it to wav?
|
|
|
|