|
how can make a cursor invisible in a certain application?
|
|
|
|
|
|
Kleser wrote: how can make a cursor invisible in a certain application?
ShowCursor( );
nave
|
|
|
|
|
Hi
Could I please get some help measuring the width of a character.
I am writing a simple app that draws text to the form and is it is possible to set the font differently for each char. It is within .NET 2003 and I am currently doing this to get the width of a character (each string is one character):
textSize = g->MeasureString(tempString, font);
This works but I have to optimise the code as much as possible and I have been informed by my C++ lecturer to 'hand write' another way to measure the width of a string/char.
Could someone please explain how this could be done by means of an example? Initial research has led me to GetCharWidth32 and GetTextExtent, but I'm buggered if I know how they work! For instance, GetCharWidth32 has 'hdc' (a handle to DC) -- That's all that MSDN tells you and I have absolutely no idea what it is!!!
Could someone please supply an example where you know what the char or string (with 1 character) is and simply get a float or int that is the width?
Thanks
|
|
|
|
|
GetTextExtent works with a device context, you need ot create a font and select it into the device context first.
Elaine
The tigress is here
|
|
|
|
|
Thanks for the reply(ies) everybody.
So it looks as though I am on the right tracks!
I would really like to be shown a little mor of how GetTextExtent works.
I have already created a font, like this:
<br />
System::Drawing::Font* font;<br />
String* fontType = S"Arial";<br />
font = new System::Drawing::Font(fontType, fontSize, FontStyle::Bold);<br />
Could somebody please explain how to 'first select the font into a device context'?
Thank you
|
|
|
|
|
GetCharABCWidths and GetCharWidth32 might be your friends
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hi together,
is it somehow possible to get the current type of the mouse cursor?
I'd like to check whether the current cursor is the context help cursor (IDC_HELP) or not.
However, I have no idea how to accomplish that
Thank you very much for your help,
Marcus.
|
|
|
|
|
GetCursor() or GetCursorInfo()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi Ryan,
thank you very much for your hint. I got it working! However, for me it wasn't that straightforward to get it run. If anybody is interested in the solution, here it is:
HCURSOR hHelpCursor = LoadCursor(NULL, IDC_HELP);
CURSORINFO ci;
ci.cbSize = sizeof(ci);
if(GetCursorInfo(&ci))
{
if(ci.hCursor == hHelpCursor)
cout << "Context help cursor active!" << endl;
} Any hints for improvement are welcome!
Thanks again,
Marcus.
|
|
|
|
|
khb wrote: Any hints for improvement are welcome!
It's exactly what I'd do
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How to check the CListCtrl's column resize cursor. I don't know that resource id.
|
|
|
|
|
I have a dll file written by MFC6.0. Now, I want to use it in MFC8.0, but I don't know how to import it to my project MFC8.0.
Can anyone help me?
|
|
|
|
|
Does LoadLibrary help?
Nibu thomas
Software Developer
|
|
|
|
|
<br />
int bignum = 123123425364347456758696679;<br />
The compiler says: intger to big for int type (or something like that)
How do i make the bignum work? (i'm guessing this is a simple question soooo be gentle )
|
|
|
|
|
Try __int64
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Not even close to being large enough. The largest value for __int64 is 263, or 264 if unsigned.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
The pattern of his number indicated to me that he had just semi-randomly typed them to indicate he needed something larger than an int.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
As he was not very specific, that's always a possibility.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
_int64
Does that mean a int thats 64 numbers long or is that defined the standard library?
nevermind........ 2 to the power or 64. I see.
Is LARGE_INTEGER in the standard library too? <--- is that C style programming?
"If you try to talk sense to a fool, he'll think your foolish"
-- modified at 14:06 Wednesday 26th April, 2006
|
|
|
|
|
__int64 is 64-bits long. I assumed you had simply typed gibberish indicating you needed a long number. If, however, the number you typed earlier (123123425364347456758696679) actually needs to be stored, __int64 isn't long enough.
LARGE_INTEGER is a Win32 thing, but it may be defined by other headers.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
you could also use LARGE_INTEGER
|
|
|
|
|
Which also has the same 263 limitation as __int64 .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Thanks for pointing that out Mr Crow. Though might I say, it has taken you two replies to say that those of us who are trying to help the OP are wrong. But you have yet to suggest an answer yourself.
|
|
|
|
|
waldermort wrote: But you have yet to suggest an answer yourself.
To suggest a way not to do something is in itself an answer. On a similar note, by eliminating all the wrong/incorrect ways of doing something, what we should be left with is the correct way. This was a philosophy used by Thomas Edison.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|