|
How to put an icon on a popup menu in application using document/view created by wizard.
|
|
|
|
|
Search on CP you will find very useful articles (BCMenu is one of them)
A. Riazi
|
|
|
|
|
Hi, all
How do you print a text to the right side of a console line? In other words how do you print right aligned text in a console? I do not want to use Windows console function because this process should also work in ms-dos.
Aidman » over and out
|
|
|
|
|
If you assume that each row is 80 columns wide, then pad each row with spaces at the beginning to get the right-aligned effect.
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
but how does this work when the screen size is changed, wich can be done in XP/2000?
And when I try to compile this with VC++ it says:
: error C2065: 'setw' : undeclared identifier
What besides iostream.h do I need to include?
Aidman » over and out
|
|
|
|
|
OK, I think its time we have a discussion about Microsoft's UI as it relates to its new controls in XP. If you were to go Start->ControlPanel you will note a nice collapsable bar on the left side, and a clean right side with a faint image in the background.
The left side bar has kinda been covered on CodeProject in articles:
http://www.codeproject.com/miscctrl/jobwnd.asp#xx395129xx[^]
http://www.codeproject.com/useritems/MenuWithDescription.asp[^]
and
http://www.codeproject.com/cs/miscctrl/collapsiblepanelbar.asp[^]
The last one is by far my favorite, as Derek really did a good job on the look, theming etc. Of course... its in C# which doesn't help me.
Anyways, in my quest to learn more of using these new UI features in XP and the future Windows Server 2003, I am finding it difficult to get the right TERMINOLOGY on what the controls are actually officially CALLED. And I still can't fathem why these controls are NOT accessable programatically to us.
So, would anyone like to start a discussion on:
a) What is the official name of the control on the left side on the Control Panel window? Is there an actual control we can use/get access to?
b) What is the official name of the control on the right side? (Please don't guess and say its just an IE window... Windows Spy isn't able to say everything about the darn thing) If it is simply an HTML control... that is an interesting way to deal with colors and the background. Anyone actually do this themselves?
c) Does anyone have any MSDN references to these controls?
There has been some hacks at this, and I think Derek got the closest. But I wonder why we need to reinvent the wheel here. Is that supposed to be a standard widget in XP? If so... why isn't there any info in VS .NET about it. If it isn't, why not?
I can't justify another MSDN incident to call MS to try to find this out, in case I get another "sorry that information is not available" as I have been getting lately on other things.
This topic seems to be an interesting point for discussion. Anyone like to throw the first electrons into the pot?
- Dana
|
|
|
|
|
Hi,
Does anybody know if there is an easy way to assign a shortcut key to a menu item, and if there isn't an easy way, is there a way that doesn't go through PreTranslateMessage function?
Cheers
Dor
|
|
|
|
|
|
Hello,
I am writing a program that draws a lot of lines (up to about 30000 lines/seconds) and some text (it is a kind of chart).
In order to do this, I am using GDI. I draw everything in a backbuffer and I use BitBlt to copy it to the front buffer (which is the device context of a CDialog on a dialog based VC++ 6 project). The result is that my program is very slow, use a lot of cpu time and slow down when I drag the mouse over it!
Since i want to increase the speed of my code, I would like to use DirectX, OpenGL or something else.
Does anybody know wich one would be the fastest to draw a lot of lines and some text with double buffering, and what would be the approximative gain of speed?
Thanks for your attention (and sorry for my bad english!).
TV
|
|
|
|
|
It sounds like you draw in the backbuffer and blit it to your frontbuffer, as you call it, every time WM_PAINT is called.
If the window is not resized or scrolled, you could just blit your backbuffer to your frontbuffer, without doing all the drawing, because nothing have changed in the view...
I hope you understand what I mean, I might have been drinking too much redvine to explain propely
BTW, if all the lines you are drawing only are horizontal or vertical, it's way faster to bitblt a small bitmap as the line, than using LineTo()...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
Actually I am using a timer to redraw every 20 milliseconds my drawing because I am aquiring point from some sensors.
I agree with your remark about vertical or horizontal lines, but it is rarely (never...) the case, I have always non-horizontal nor vertical lines.
|
|
|
|
|
An earlier version of DX will give you DirectDraw, a 2D API which will be much easier to use that OpenGL.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Can I get the number of currently used handles on a Win98/ME system? With XP I use taskman to view it. I'd like to verify on Windows ME how much handles are overall in use, while running my network code (I heard Winsock itself grabs a lot, e.g. for repeated hostname resolutions).
Thanks, Moak
|
|
|
|
|
You should be able to get the handle information from a tool Mark Russinovich wrote over at SysInternals called Handle[^].
From their website (unabridged):
Handle is a utility that displays information about open handles for any process in the system, and it works on 9x/Me/NT/etc. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
I think this should do exactly what you want.
Good luck!
- Dana
|
|
|
|
|
|
I've spent an evening trying to find asolution to this (probabley very simple) problem.
How do you get an OnFileOpen() command to display a list of valid file extentions?
I've tried over riding the default function, and have a dialog open up:
CFileDialog dlg(TRUE, "mid", "AnyMidiFile",OFN_EXPLORER );
But since my application is not opening a file of serialised classes, how do I create my view and document objects and pass the info in the file specifed from the dialog to them?
People must do this all the time, but I just can't seem to get it. HELP!!!!!!!!!!!!
|
|
|
|
|
There is a way to make the single filter name opens more than one extension at the same time in SDI and MDI.
In the string table you will find an entry of id IDR_MAINFRAME . This string will somthing like this
[windowTitle]\n[docName]\n[fileNewName]\n[Filter Name] (*.ext)\n.ext\n[regFileTypeId].Document\n[regFileTypeName].Document
to make the single filter name opens more than one type, go after the forth \n and add the files extension as .ext separated by semi columns like this
[windowTitle]\n[docName]\n[fileNewName]\n[Filter Name] (*.ext)\n.ext;.doc;.bmp\n[regFileTypeId].Document\n[regFileTypeName].Document
Note, you may change the text after third \n to [Filter Name] (*.ext, *.doc, *.bmp) to display the extensions in the file open dialog.
In MDI the string table entry id will be that of the document rather than IDR_MAINFRAME , somthing like IDR_DOCTYPE .
On last thing, there is another way but am not sure if it can suit, which is to register a new document template with new ID but same view and document class. This will allow more than one filter to displayed in the file extensions list , but might not be easy to handle.
Check CMultiDocTemplate and CSingleDocTemplate in the MSDN for more information
|
|
|
|
|
Thanks MAAK,
Exactly what I needed. I knew it would be something fairly simple, but I spent ages in MSDN with no success.
Thanks again!!
|
|
|
|
|
i've created a class derived from a CStatic that sets the background transparent and sets the font color, size, etc, I am creating the static dynamically with
CStats m_comps = new CStats;
m_comps.Create("Name",WS_VISIBLE,srect,this,ID_COMPS);
m_comps.RedrawWindow();
works great, can set color and transparent but when i SetWindowText, all font formatting and transparency are gone, i tried to intercept on command and pretranslate message with no luck, tried to RedrawWindow, no luck, just a newbie of sorts here so sorry if its just a simple one i don't see
shotgun
|
|
|
|
|
How to hide the web browser control in MFC application (Dialog based) ?
I tried :
SetVisible(0) but did not work
also tried ShowWindow() .. It hides the control but gives a debug assertion failure (m_hWnd=0) !!!
Can you help ?
|
|
|
|
|
|
Thank you but I already have :
m_web.Navigate(TEXT("www.microsoft.com"),NULL,NULL,NULL,NULL);
in OnInitDialog !!!
|
|
|
|
|
What the heck does exit code 136 (The system tried to delete the JOIN of a drive that is not joined.) mean?
I keep getting this in an app I've written in VC7. It also crashes on win98 (not XP) when you exit.
I've posted a link to the code and a request for testing here[^] if anyone is interested.
Thanks!
Jason Henderson "You must be the change you wish to see in the world." - Gandhi
articles profile
|
|
|
|
|
Just a short question.
I I have a Control (CTabCtrl) in a Dialog. In the derived class I handle a WM_CONTEXT message and display a contextmenu. How can I send the picked MenuEntry to my parent (Dialog) so that ít is possible to handle the choosen command.
When I handle the the Message IDC_MENU1 on my Dialog nothing happend. It only works when I handle the message in my Tab-Class....
|
|
|
|
|
Maybe...
Try handling all the messages in the tab class like this:
HWND dialog = GetParent(this);
PostMessage(dialog, themessage);
you can get themessage since it is specific to the handler in ur tabcontrol.
I wouldnt know though it's just a guess.
Kuniva
--------------------------------------------
|
|
|
|