|
Is there a way to change the text size/font used in toolbars? I have created a number of classes to custom create toolbars derived from CToolBar and they work wonderfully. The only problem I have is that I don't know how to change the fonts of the text. Anybody with any clues?
TIA
Tim Dunn
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/CustDraw/CustDraw.asp
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hey all-
I have a huge project that has dependencies on approximately 18 other projects, all which are configured correctly through the depends section so that I should be able to just hit build and everything compiles (the exe and all associated dlls). Ok, this has been working fine for one version of the project, but I downloaded a new version from a different folder in sourcesafe, and I find that the compiler hangs, and can't be quit, no matter what. It's typically been limited to one of three files, that if I compile seperately, I can get the rest of the project to compile. However, if I do a rebuild all, it'll hit a file and as I said, cl.exe just sits there. I waited an hour, but it never came back.
What's worse is that I can't *kill* cl.exe, no matter what. I've tried kill from the Resource Kit, using the -f switch, which reports it killed it, but it's still there in the task list. What's worse is that it prevents NT4(sp6) from rebooting...I have to hit the power button to reset.
I've looked in the knowledge base, even on Google, but nothing comes up. The compiler heap (/Zm switch I think) is set to the max...2000, so in theory it's got all the memory it needs. I have plenty of disk space, and the machine has 256 meg of ram, dual processor.
This is making development very difficult...any help would be appreciated.
Ron
|
|
|
|
|
Yikes, sounds like a real pain in the butt. Here are a few things to try:
*) Install latest service pack
*) Do a rebuild all
*) Double check your include file paths (in the project and in dev studio)
*) Change the precompiled header settings for the problem files. (try using automatic first, then none at all)
*) Split up the problem files into multiple files
*) Replace your hard drive (it could be a hardware problem!)
*) Replace your RAM (unless you are using ECC)
*) Remove one of your processors (doubt this is the problem, but who knows)
Hope this helps.
Chris Hafey
|
|
|
|
|
What's worse is that I can't *kill* cl.exe, no matter what.
Isn't it wonderful? Just what you'd expect from Macroshaft, and here you got it. Bend over and say "Thanks!".
Seriously, this is a design decision (IMO a serious error in the NT kernel) that Microsoft apparently don't see as an error. The easiest way you can exhibit it is to create a process (only tested win NT5 - aka W2k) that
1) CreateFile a dummy file
2) Call SetEndOfFile to be at a gig (or five, or whatever is needed to make you disk subsystem use a large amount of time to zero-fill)
Now try to kill that process while it's running step 2... Good luck. It's locked from killing since it's now in a locked kernel-call that can take forever to complete...
|
|
|
|
|
Hmm, are you sure other operating systems support killing processes that are in kernel mode? If so can you describe the mechanism? It sounds like a terribly difficult problem!
Chris Hafey
|
|
|
|
|
No. But on the other hand I'm not aware of any other operating system that has system calls that can take up to several minutes, even hours, to complete - possibly even freezing the system from the users POV.
But this shouldn't be a problem, simply a matter of aborting an I/O request. Not exactly rocket science.
|
|
|
|
|
Hello Ron.
I haven't had this particular problem lately and like you say I can't see it being a resource problem.
But, I used to have trouble with an old Windows and to save me going in and out of Windows to run nmake, I split my make file.
Then did an Nmake of mafefiles, sort of thing.
To get yourself going I would do that very thing again. Though I am a touch worried that you say the problem seems to hinge arround one of three files. I would do a build of those you suspect and at least one before (thinking of the likely order of build) with full warnings switched on , I know you have to plough through junk too with this build, but as you do consider an old type problem, where you used to get a corrupt byte in the source file that confused the compilers. Even notepad is capable of this.
Mike. Are you saying that MS have got their cl.exe running at kernal-0 level? I would find that difficult to believe, or maybe your saying that a call it happens to make hi-lights a kernal bug?
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I have an icon resource in my project. The icon has two devices (16x16 and 32x32). I have them colored different and I want the icon in my dialog to show up as the 16x16 icon not the 32x32 one. I tried commenting out the SetIcon() call where it loads the big icon to no avail. Any suggestions?
|
|
|
|
|
You need to use LoadImage() instead of LoadIcon(). LoadIcon() only loads 32x32 icons.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
You might try this..
BOOL CTimerDlg::OnInitDialog()
{
CTimerDlg::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, TRUE) <-- change the FALSE to TRUE
Hope it helps
Rob
|
|
|
|
|
|
I've implemented double-buffering in a custom CWnd-derived control with horizontal and vertical scrollbars to eliminate flickering.
The final touch to this, to keep the parent dialog from causing flicker on my control, is to set the dialog's WS_CLIPCHILDREN flag to TRUE (using the resource editor, select "Clip Children").
In doing this, though, I've found that no matter what I do, when I resize, the area usually occupied by the scrollbar buttons is a "smear" of the last contents of the new area that the buttons should occupy.
Refreshing by dragging a window over the button and away causes them to redraw again, so I get the feeling that some vital message is not being passed from the dialog to my control on resizing... but I can't figure out what that message would be!
I've been tearing my hear out on this for three days now, so it's time for me to hear from someone who has gone through this before. Any help is extremely welcome, even if it comes in the form of thought-provoking questions.
Thanks.
Tom Guyette
|
|
|
|
|
Make sure you set repaint to TRUE when you resize your child window (assuming you are using MoveWindow() here).
Chris
|
|
|
|
|
Holy shinola!
I can't believe that in a single sentence you solved five days worth of tearing my hair out. Chris, you're my hero. If there's ever anything I can do to repay the favor, please let me know.
-- Tom Guyette
guyette@alum.wpi.edu
|
|
|
|
|
How do you change the backgournd color of a console application from the default black to a different color. I looked at the few SetConsol... functions in the help but none of them seemed to deal with the background color.
<marquee>Raffi
|
|
|
|
|
Start with SetConsoleTextAttribute...
Best Regards....
and for ever
Carlos Antollini.
|
|
|
|
|
My Help Says:
The SetConsoleTextAttribute function sets the foreground (text) and background color attributes of characters written to the screen buffer.
I could be wrong but doesnt SetConsoleTextAttribut change the foreground and background of the text characters? I want to change the entire screen to a color. Can SetConsoleTextAttribute do that and I am reading it wrong?
<marquee>Raffi
|
|
|
|
|
use SetConsoleTextAttribute to change the background color
Now simulate a "CLS"
once you clear the screen, your screen will entirely be of the bg color you set
as to simulating the "CLS" the easy way is to out put 25*80 spaces; then use SetConsoleCursorPosition to position the cursor on top
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Try using FillConsoleOutputAttribute to fill the console with the preferred colorattributes
/moliate
printf("Hello World ");
HANDLE hStdout = GetStdHandle( STD_OUTPUT_HANDLE);
WORD wColor = BACKGROUND_BLUE |
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_INTENSITY;
COORD coord;
coord.X = 0;
coord.Y = 0;
FillConsoleOutputAttribute(
hStdout,
wColor,
80*50,
coord,
NULL);
|
|
|
|
|
that worked. ty very much!
<marquee>Raffi
|
|
|
|
|
i subclassed the CListBox and override this two functions
BOOL CListBoxTrans::OnEraseBkgnd(CDC* pDC)
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
return true;
//return CListBox::OnEraseBkgnd(pDC);
}
HBRUSH CListBoxTrans::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Attribute des Gerätekontexts hier ändern
// TODO: Pinsel ungleich NULL zurückgeben, falls die Behandlungsroutine des übergeordneten nicht aufgerufen werden soll
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)::GetStockObject(NULL_BRUSH);
//return NULL;
}
So now my ListBox is transparent , but if i have to scroll the box or i select an item in the box
the transparent effect is damaged . There is a really missmatch on the listbox .
What do i have to do , that selecting items and scrolling will work in my transparent ListBox ?
|
|
|
|
|
If your listbox is transparent then you should be telling the parent to repaint in the way that you require. Invalidate the rectangle in the parent where the transparent control is.
Though there is another way, rather than have your listbox transparent, which can cause you extra typing because of z order painting problems, pass the background rectangle (on move or resize of the parent) to the child (your control) and stick the background in. Then of cause you are back in a world where the listbox can take care of itself.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Hi all,
What is best way to enable or disable button in toolbar ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
CToolBarCtrl::EnableButton
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|