|
Hi,
I'm working on an SDI application using MFC.
I'd like to change the background of titlebar and toolbar by adding a small bitmap image which looks like a short vertical line.
I found some source codes to change background color of titlebar.
But I don't know how to change the background of titlebar by a bitmap image.
Please let me know how to add the bitmap image as a background.
|
|
|
|
|
Look into WM_NCPAINT, LoadImage and BitBlt.
|
|
|
|
|
Hi
I am doing a project on image processing with VC++. When I try to display the bitmap(8 bit) on the screen using SetDIBitsToDevice() the actual color is not mapped correctly. The same code works fine with 24 bits bitmap.
Pls help
Thanks in advance
|
|
|
|
|
Hi guys,
I am writing a simple Windows Spy untility (like in VStudio tools),
I am having problems when dragging the cursor over different windows.I manage to draw a rectangle over them but when i move mouse to another window the retangle still stays on the previous window. I tried to store the previous windows handle and when mouse was over another window i simply called the Invalidate() function to the previous window.
For some strange reasons this worked only for 90% of the windows , but in some cases the retangle still remained over some windows.
Can anyone suggest any other way of achieving this??
Regards
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
Try calling UpdateWindow() after Invalidate(). If this doesn't work you can try hiding and then showing the window.
|
|
|
|
|
My program has to get the message from Windows, if the every user wants to save his information on hard disk, or if the every user wants to connect to my computer by local net. How I can make this function?
qqq
|
|
|
|
|
I would have a look / search for FindFirstChangeNotification . This lets you monitor any
changes to files in a directory. If that is not enough, look at FileMon on www.systinternals.com[^] and
be impressed at the amount of work that took... As I understand it, they had to write a filesystem
driver to sit below the user processes. Gnarly.
Iain.
|
|
|
|
|
i would like to compare date like
DDMMYY > DDMMYY
pls giv me some codes that can somehow do this thx
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
then you'd compare them (cTime1 > cTime2).
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
wat do u mean by construct 2 ctime object?
do u mean like
int ctime1;
int ctime2
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
like this?
if wrong pls show me how to contruct correctly so far i only contructed int,char,string ad some others basic 1 ^^ thx u
|
|
|
|
|
In this example it's compared the current time with a fixed date .
<br />
CTime ct1, ct2;<br />
ct1 = CTime::GetCurrentTime();<br />
<br />
ct2 = CTime(2005, 07, 30, 23, 01, 00);
<br />
if(ct1 > ct2)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
I hope that it's what you wanted,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
In addition to Marc's suggestion, if you'll simply put the dates in YYYYMMDD format, then you can easily compare them.
ASSERT(20050726 > 19680906);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
wat do u mean by construct 2 ctime object?
do u mean like
int ctime1;
int ctime2
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
like this?
if wrong pls show me how to contruct correctly so far i only contructed int,char,string ad some others basic 1 ^^ thx u
|
|
|
|
|
I'm sure you meant to respond to marcdev instead.
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
this is my code
it seems alrite to me but the output seem weirld since it displayed >>1.8999e-007<<wich i="" have="" no="" idea="" where="" this="" came="" from="" pls="" help
run="" it="" and="" see="" for="" urself
#include="" <iostream="">
#include <string>
#include <time.h>
#include <iomanip>
using namespace std;
int main (void)
{
float a2=5.55;
int star=0;
float sux,a3; //test
float money[6] = {1.00,0.50,0.20,0.10,0.05,0.01};//types
int moneychange[6] ;//change
for (star=0;star<6;star++)
{
moneychange[star] = a2 / money[star];
a2 = a2 - (money[star] * moneychange[star]);
cout << moneychange[star]<
|
|
|
|
|
What's wrong ? It's the result of your maths ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Ok, the problem is the way doubles are handled which causes your "bug". A rounding factor gets accumulated so to do what you want to do I think you best introduce an extra variable...
Following code works:
<code>float a2=(float)5.550;
float money[6] = {(float)1.00,(float)0.50,(float)0.20,(float)0.10,(float)0.05,(float)0.01};//types
int moneychange[6] ;//change
float accounted=0;
for (star=0;star<6&& accounted < a2;star++)
{
moneychange[star] = (a2-accounted) / money[star];
accounted += money[star] * moneychange[star];;
cout << moneychange[star]<<endl;
cout << a2-accounted<<endl;
}</code>
|
|
|
|
|
|
well.....i m a beginner n i m asiigned he task to write a code in vc++ that shoule ensure that "work ofline " option in file menu shoud remain unchecked ......... can any body help me\?????????????????????????????????
|
|
|
|
|
miss taqdees wrote:
can any body help me
Sure. What exactly do you need help with? Show us the code that is giving you trouble and I'm confident that someone here will critique it for you. If, however, you have not bothered to write any of the code yourself and are simply wanting someone to do it for you (i.e., this is the opposite of help), best of luck.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
surely i dont wish for someone to write the code for me...........its just that can somebody tell me any functions or classes that might help me............like how to access internet explorer with c++ and how to get access to file menu etc..............not CODE...only some guiging material.................thanks
|
|
|
|
|
Someone please tell me how to use lineMonitorTones(.
I want to detect ringback and dialtone.
Thank you
|
|
|
|
|
Hi,
I want to use the string in switch case statement. Can you please help me.
Thanks
|
|
|
|
|
I can only guess and believe you might want to do something like this:
<br />
switch (myString) {<br />
case "Blue":<br />
...<br />
break;<br />
case "Red":<br />
...<br />
break;<br />
...<br />
}<br />
Trouble is, the C or C++ languages don't do that. C# does. Thus, one solution is to use C#. If you want to use C/C++, you must use nested if/else clauses to emulate the same effect, something like so:
<br />
if (_tcsicmp(myString, _T("blue")) == 0) {<br />
...<br />
} else if (_tcsicmp(myString, _T("red")) == 0) {<br />
...<br />
...<br />
}<br />
Doesn't look as nice, but, compared to the above fictivious switch statement, gives you control over the comparison algorithm (e.g. use _tcsicmp for case-insensitive comparison, or _tcscmp for case-sensitive comparison), etc.
|
|
|
|
|
You cannot use a string in switch cases - the cases have to be constant numberic values.
If the strings are not known at compile time, then you have to use if...else if...else
statements.
If they are known at compile time, then you can precompute hashes of the case strings,
and switch on a hash of the string you want to switch on. Um, that wasn't very clear,
was it?
void DoSomethingDependingOnString (LPCTSTR szSwitchable)
{
switch (ComputeHash(szSwitchable))
{
case 0x4wfe:
DoFirstThing ();
break;
case 0xfg13:
DoSecondThing ();
break;
default:
DoDefaultThing ();
break;
}
}
I hope that was little clearer.
Iain.
|
|
|
|