|
hi all,
i want to get window color that is appear on window border,start menu and taskbar.
how can i do this?
thanks in advance.
|
|
|
|
|
|
yes i already use this .
i am using windows 7, and set Leaf color here "Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance"
but using GetSysColor this color cant get even i chk this for all values.
please help me which value is use to get this color?
thanks.
|
|
|
|
|
|
HTHEME hTheme = ::OpenThemeData(NULL, VSCLASS_TASKBAND);
ATLASSERT(hTheme);
COLORREF clrText = 0;
if(hTheme)
{
const HRESULT hr = ::GetThemeColor(hTheme, TDP_GROUPCOUNT, 0,
TMT_BORDERCOLOR, &clrText);
ATLASSERT(SUCCEEDED(hr));
::CloseThemeData(hTheme);
}
::FillRect(pDC->m_hDC, &banner_rect, ::GetSysColorBrush(CTLCOLOR_DLG));
::DrawThemeParentBackground(obj_RecProfDlg->GetSafeHwnd(), pDC->m_hDC, &banner_rect);
but its not useful
so please help me ,what values i can use GetThemeColor
thanks.
|
|
|
|
|
hi all,
i want t draw banner and button for the dialog box according to current system theme.
please help me how can i do this.
thanks in advance.
|
|
|
|
|
For button, you can use CBitmapButton[^], and for the banner, you can use CStatic[^], where you can put there a bitmap, like banner ... of course, you can find here a derived CButton controls ...
|
|
|
|
|
i dont want to use image for this.
i want to get current system theme and its color than according to this draw the graphics.
what can i do for this?
thanks.
|
|
|
|
|
Well, then you only must setup a style for your application (setup manifest file) and you'll have a current system style on your button and CStatic. If I well understand ...
|
|
|
|
|
yes
how can use setup style?
|
|
|
|
|
Very simple: add manifest file in your project resource folder, and then open Resource.h:
#if _MSC_VER <= 1200
#ifndef IDR_MANIFEST
#define IDR_MANIFEST 1
#endif
#ifndef RT_MANIFEST
#define RT_MANIFEST 24
#endif
#endif // _MSC_VER <= 1200
if you don't have a manifest file, I could send you through email ...
Check here[^] too.
modified 16-Jan-13 4:24am.
|
|
|
|
|
Take a look at this section on MSDN[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i have written a code in C++ for employees using OOP .. and after building it ,this error message appear : "
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup "
can anybody tell me what does that mean ? & and what should i do to run the program ?
|
|
|
|
|
See here[^], a solution of your problem.
|
|
|
|
|
I'm guessing that you selected the project type as Windows Application and wrote a main function.
Windows applications expect to find WinMain instead of main .
You can either create a project of type Console Application or change main to WinMain .
|
|
|
|
|
Start here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
In case I have asked this before, but OF does not remember, accept my apology.
I believe this is pretty generic situation so I ll try to explain it without code.
I have VFW capAPI which registers a callback function and than initializes the callback rate.
The callback function allows me to modify the data before it is displayed.
I have not figured out how this display really works, but it does, non issue for now.
The callback rate is adjustable in milliseconds, and if I set it to 20 and let the callback function just return, without modifying the data, in debug mode, the display goes from good bitmap to blank pretty rapidly.
If I set the rate to 2 seconds there still are occasional blank screens.
I was under the impression that callbacks are executed by the system when data became available, but it seem that in VFW API the rate executes the callback even with no or bad data.
I did check that and one of the parameters in the callback – number of bytes actually used _ is “a lot less” than when true number of bytes used.
So even if I check for “blanks / invalid “ data I will still have problem unless I can keep track of good data and substitute them for bad ones.
I am just posting this in case someone has an experience with this behavior.
This seems to be a major issue in VFW , but replacing VFW with DirectX is not an option.
I would also like to know how to access the callback function return value.
The function is defined as global. Do I need to make it static class function to be able to use the return value?
Is it also possible that I am missing some “buffers”? I recall having a great time using another AVI. Maybe I need to shrink my bitmap.
Thanks for your time, appreciate it.
Cheers Vaclav
|
|
|
|
|
CTempLock (&(this->m_Lock));
m_Lock a CCriticalSection.
There is a variable without name? what is it?
|
|
|
|
|
yu-jian wrote: There is a variable without name? What exactly are you referring to?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
That code creates (and destroys) a temporary CTempLock object. The net effect is the call of the class constructor and destructor. Try the following code:
#include <iostream>
using std::cout;
using std::endl;
class A
{
public:
A(){cout << "ctor" << endl;}
~A(){cout << "dtor" << endl;}
};
int main()
{
A();
}
Veni, vidi, vici.
|
|
|
|
|
It's the same with my code. But i am silly why the c plus plus allow defining a variable without name?
|
|
|
|
|
For instance, this allows you writing:
vector <A> v;
v.push_back(A());
Veni, vidi, vici.
|
|
|
|
|
Do you think that it's right? ~A() will be called after A() immediately.
|
|
|
|
|
yu-jian wrote: why the c plus plus allow defining a variable without name?
It isn't doing that.
You are confusing 'variable' with 'expession'.
In the following the left 'x' is a varible while the right side is an expression. The execution of the expression is not dependent upon the variable. The variable is just where the result of the expression is stored.
x = doSomething();
|
|
|
|