|
Hi, I'm wan't to get the color windows is using at run time. Every object in windows use these color, to draw the back ground of a view, the color of the frame, text, title bar, button color etc. So it's the color that we set in the control panel\Display\Appearance.
I wan't to access these color to let my application to be like any other window program, so... someone can tell me what familly of function or witch class or library. It must be simple, I can think something else that simple...
thanks
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
I think you want to look at the docs for GetSysColor.
|
|
|
|
|
Thank you!!! It is what I'm seraching for!!!
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
Don't forget that some miracle come from hell
|
|
|
|
|
I think what you may be looking for is
GetSysColor(COLOR_BTNFACE) which will return the COLORREF for the buttons face colour.
If you have a look at the help topic for that API it will list the other colours you retrieve with it.
Happy programming!!
|
|
|
|
|
Microsofts documentation says that this function returns 0 (AVIERR_OK)if successful, or an error otherwise. I'm trying to figure out why this paste operation fails in my code, but I can't find anything out about the errors this function returns or what causes them. Any ideas?
Thanks,
Jake
|
|
|
|
|
After my CMainFrame calls goes through OnCreate(), I need to display a dialog window. Where can I do that from so that the main frame is completely loaded before I show this window?
|
|
|
|
|
How about after the UpdateWindow call in your InitInstance?
|
|
|
|
|
Hello there,
I have an ActiveX control that contains a TreeCtrl. However, I don't seem to be able to catch the Backspace Key event. I can catch DELETE or ESCAPE, but even when I watch the action using SPY++, there appears to be no messages sent to the TreeCtrl when the backspace key is pressed.
Could anyone enlighten me on this problem?
thanks
|
|
|
|
|
We have a DebugBreak call at the start of one of our VC++ programs. When it is hit it brings up a dialog box telling you so.
Only problem is, on one machine the dialog box has an Ok and Cancel button. On another machine only the Ok button is displayed. No Cancel button - no debugger.
Both machines are nearly identical in hardware and software. NT 4, Visual C++, Visual Basic, etc. We are looking at environment settings, project settings, etc.
Any ideas on where the cancel button is?
Thanks,
David
"I don't have a catchy saying to put here yet."
|
|
|
|
|
This is from Enabling Just-in-Time (JIT) Debugging
Editing the Registry
The Just-in-Time debugging settings are stored in the registry, under \\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug\. The two relevant keys in this directory are Debugger and Auto.
The Debugger key's value shows the name of the debugger specified to analyze application errors. The Auto key is either zero or one.
When an unhandled application error occurs, Windows checks to see if the Debugger and Auto keys exist.
If the Auto key equals zero and the Debugger value contains the name of a valid debugger (such as WinDbg or NTSD), the message box will have two buttons: OK and Cancel. If the OK button is pressed, the application is terminated. If the Cancel button is pressed, the debugger specified in the Debugger key is started.
If the Auto key equals zero, but the Debugger key value is empty, the message box will have only an OK button and no debugger will start.
If the Auto key equals one, no message box appears. The debugger referred to in the Debugger key is automatically started.
|
|
|
|
|
That worked great! Many thanks. Did some searching on MSDN etc. and no luck. I figured somebody out in Codeproject land would know (and in 6 minutes!).
Thanks Again!
David
|
|
|
|
|
We never sleep!
Actually, I just realized that the article quoted is not in the MSDN help - I found it in the help file under Debugging Tools (aka WinDbg) - installed from the platform SDK, I think.
If you've got the MSDN CDs, might want to check it out.
And thanks for the thanks!
|
|
|
|
|
Does anyone know a quick way of determining the IP address in use on a network (i.e. for all IP devices). There are many article that use WNetEnumResource but this will miss Routers, Switches etc...
I have been able to scan the IP range and ping each device to see if it is present but this is slow and inefficient.
Any help would be appreciated.
Thanks in advance.
Antony Kancidrowski
|
|
|
|
|
Hello
In a float variable I have stored the value 1.15.
When I want to printf it upto only one precision then it should print 1.2 by rounding the precision. But it prints 1.1.
This happens with 1.15 only. It works fine for other numbers like 1.25, 1.35 etc. For these numbers outputs are like 1.3, 1.4 sequentially.
I will like to know why it happens with the 1.15 only.
Any suggestions or solutions are welcome.
Thanx in advance,
Vikram.
|
|
|
|
|
From a quick look at the docs, this is a common problem.
One work around is to add a small number before formatting - 1e-10 works for doubles:
#include <iostream>
#include <iomanip>
using namespace std;
int main(int , char* )
{
cout << "Testing prec\n";
double f[] = {1.15, 1.25, 1.35, 1.45, 11.15 };
cout << setiosflags( ios::fixed ) << setprecision(1);
for (int i = 0; i < sizeof(f)/sizeof(double); ++i) {
cout << f[i] + 1e-10 << " ";
}
{
int x;
cin >> x;
}
return 0;
}
You might need a different modifier for floats.
|
|
|
|
|
hello Tim
Thanx a lot for solution.
I'll try out for float.
Vikram.
|
|
|
|
|
Hi
Does anyone know why when I send a HTTP Post, using SendRequest I get an exception which when I catch says "operation timed out" with an error number of 12002?
This happens after about 10secs. I have set the timouts for the session such as INTERNET_OPTION_RECEIVE_TIMEOUT and INTERNET_OPTION_CONNECT_TIMEOUT to be 600 secs. (They seem to make no difference changing them at all!)
Thanks in advance
Neil
|
|
|
|
|
Hi,
I'm trying to make a menu to luanch Games and Aplications. But I dont know the Code for luanching a program like run("C:\test\test.exe"); if you get my point
thanks
|
|
|
|
|
Look at ShellExecute, CreateProcess, _spawn functions.
HTH
Jignesh
|
|
|
|
|
Hello,
From what I have read this code is out of date and its better practice to use shellexec.. I still use it every once and a while and it works fine..
WinExec("C:\\test\\test.exe",SW_SHOW);
RobJones
|
|
|
|
|
If I have a Connection set up, how do I attach it to a Recordset ? I've opened a file on disk, now I want to use that Connection with a Recordset.
Thanks.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
You could use your connection object as the ActiveConnection argument in the RecordSet Open method.
|
|
|
|
|
Thanks - I thought so, but when I tried this it did not work. I am enough of a rank beginner with ADO that I needed a sanity check to make sure I was headed in the right direction. Now I know I was, I'll have another look & see what I was doing wrong.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
In my view I've placed a grid control. The view is derived from CFormView. When I run the application I get an small border around the grid control even that I've dragged the grid control till the edges of the form when I created it.
|
|
|
|
|
How do I add full DDX support to a class I have created based on an existing MFC class?
I have a class that is derived from CButton. I have overridden the PreSubClass.. function to ensure that it is owner drawn, which in turn enables the subclassing through DDX_Control. However, with it being a button the user could add a member variable through ClassWizard, such as a boolean for a checkbox. How do I enable the support for DDX_Check and DDX_Radio?
Derek Lakin.
Salamander Software Ltd.
|
|
|
|