|
Hi I wanted to create a function that takes 3 integer color values, between 0-255. The function uses a variable of the type COLORREF which is a hexadecimal value. How can I can convert the three decimal values into a COLORREF value;
How can I make decimal 255, 0, 255 into 0x00ff00ff
Thank you,
SAK
|
|
|
|
|
The RGB macro converts three unsigned chars into a COLORREF value. The GetRValue, GetGValue, GetBValue macros pull them out again.
COLORREF magenta = RGB(255,0,255);
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
|
I wouldn't make that into a function. Just use the macro as if it was a function.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
I wouldn't make that into a function. Just use the macro as if it was a function.
He's saying he's written a function which takes three unsgined chars and *uses* a COLORREF, not that it's point of existence is to create one. At least, I *hope* that was what he was saying....
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Okay, sounds strange. I have an MDI app that has forms for child windows. I thought using cs.style|= DS_CONTEXTHELP in CChildFrame::PreCreateWindow would display the little ? icon in the top right corner in the top right of the window. No luck.
Any ideas? The frame is set as a WS_DLGFRAME.
Giles
|
|
|
|
|
|
They only way I know of implementing context help in this regard is to use the standard MFC context help button that by default would be in your toolbar if you enabled it in your MFC app. If its not there, you fcan add a toolbar button with the ID of ID_CONTEXT_HELP.
This will get the basic context help working for your form. If you individual item help for controls. Its a bitmore involved than this. I originally worked through this problem with Bill Heffner on the CodeGuru question board middle of last year and we got to a solution. The URL for the thread is:
http://63.236.73.79/cgi-bin/bbs/wt/showpost.pl?Board=vc&Number=298883&page=1&view=collapsed&mode=threaded&sb=5&category=
Sorry to reference you to a CodeGuru thread, but I don;t really have the time at the moment to work through the whole problem again. If you get stuck, I should be able to help further, but try looking at the thread first and trying whats in it.
HTH
Roger Allen
Sonork 100.10016
|
|
|
|
|
Thanks Roger, I'll give it a whirl.
Giles
|
|
|
|
|
I am working on an addin for VS and I am having trouble debugging it. Since the addin runs from within VS, I am choosing MSDEV.EXE as my executeable for the debugging session, but of course it doesn't have any debug info. It won't stop on my breakpoints or anything. Has anyone done this or have any ideas? Thanks.
|
|
|
|
|
I haven't tried this with an addin, but it works for a service. Add a call to DebugBreak() to your code where you want the breakpoint, then build it. Start MSDEV, and locate the process in Task Manager. Right-click it, select Debug and attach the debugger. Now, when you execute the code with the DebugBreak, you'll get an error message. You should be able to open the Stack Window, find your code and place breakpoints whereever you like.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi,
I have tried to get the GetThemeColor() function to work.
I have the latest Platform SDK, and I'm running Win XP Prof, but I _can't_ get it to work.
All I want is the different colors for different controls under the current color theme.
Anyone have had any success with GetThemeColor()?
Or maybe a sample that works...
My main problem is that it looks like the values for the "iPropId" parameter not is defined anywhere.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
If all you want is for the current theme use GetSysColor(...)
Brad
|
|
|
|
|
I know about GetSysColor(), and have used it a lot. But, there's a lot of colors in WinXP that you can't get, the values of, using GetSysColor...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I need a way to search through the registry and delete all occurances of a string from the registry. Any help would be greatly appreciated.
Thanks,
Derek Smigelski
|
|
|
|
|
This is not hard, there are several API calls that allow you to enumerate registry keys/values, which could be done recursively.
I'd be debugging on a spare machine though, sounds like a program that could easily bring your machine a beggin' to it's knees.....
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Not sure search the entire registry recursively and remove a string whenever it is found. What is the best way to do this?
Derek
|
|
|
|
|
If you search for registry sample in MSDN you'll find an example, but you can use RegEnumKey to enumerate the keys, and the RegEnumValue to step through the strings under a key.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I need to write a spy utility to spy on objects in Internet Explorer. Can you offer any help/guidance.
Thank you,
SAK
|
|
|
|
|
Hi!
Can some one tell me how to get the CPU utilization for a process under Windows 2000? I am trying to get this information through my code, so examples of instrumenting the performance monitor might not help.
thanks!
avneesh
|
|
|
|
|
I want to write componemt to connect to "Microsoft ADO Data control"
How can I make connection to it and get Recorsets?
Thanks
|
|
|
|
|
here or Here you can find samples...
Regrards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Is it possible to make a gorillaserver.com name instead of the IP on a Win98 system?
I have a CLient/Server app and I don't want to type in a IP every time, a name instead of numbers is much more funnier!!!
IS IT POSSIBLE
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
IS IT POSSIBLE
It is. The function to use is gethostbyname , which returns the IP address corresponding to a symbolic name. Of course, the success of this function depends on the resolution mechanism available (DNS most of the times).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
But how will I do that with that function??
You said something
Joaquín M López Muñoz wrote:
Of course, the success of this function depends on the resolution mechanism available (DNS most of the times).
What do you mean... can you tell me in big steps how to go through this!?
YES YOU CAN!!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|