|
hi...
Usually the list ctrl's entire client rect is white by default.
If i want to have a different bk color when it gets the focus and also when it looses the focus.
Any help is appreciated.
Thanx
saleem
|
|
|
|
|
One solution is to derive a class from CListCtrl and do custom drawing.
Kuphryn
|
|
|
|
|
|
Michael Dunn wrote:
Ericahist updated Aug 30!
Does she know she has a stalker by the way?
--
Frivolous Theorem of Arithmetic: Almost all natural numbers are very, very, very large.
|
|
|
|
|
just call CListCtrl::Setbkcolor(RGB(255, 255, 255)); //the color you want
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I have two applications and an event in one of the applications posts a message to the other application. I'm receiving the message in my second application with OnCopyData(). The message is being received but the receiving application remains in the background behind the window for the sending application.
I want to make the receiving application become the front-most and active window when it receives the message. I tried adding this code to OnCopyData():
SetForegroundWindow();<br />
SetActiveWindow();<br />
SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
This seems to cause the receiving application's button on the Taskbar to flash but it's still visually behind the sending application's window.
What am I doing wrong here?
|
|
|
|
|
|
|
Hi!
I'm wondering what's the best way to skin my app?! I've build it with Borland's C++ Enterprise 6.
Already found a lot of ways and .classes, but everybody says something else.
For example;
http://www.codeproject.com/info/search.asp?target=skin&st=kw&qm=all
There must be a relatively easy way to do this?!
Thx 4 thinking with me.
Regards, Roland.
|
|
|
|
|
AFAIK I'm afraid not - you are on the right track with what you have found.
Skinning an application literally involves stopping windows drawing the various windows/controls and doing the drawing yourself. Many of the techniques you'll see involve taking an MFC class and modifying/overriding the code that actually draws that control - this gives you the look you want while retaining the all functionality. I particularly like the work by Davide Calabro - you can learn alot from this.
Phil
|
|
|
|
|
how to get the number of digits after the decimal point
ex :
Input : 5.1234
Expected Output : 4
i wrote this code but there are wornings..
what is wrong here ??
double input;
int x=input; // so x=the integeral part of input
int y=input-x; // so y=the fractional part
while(y>0)
{count++;
input*=10;
x=input;
y=input-x;
}
plz help me !!
elmahdy
ahmed elmahdy
|
|
|
|
|
First, this really sounds like homework. Not that such such posts are prohibited, but you may get a quicker response just reading ahead in your text book.
Anyway, two hints:
1) int s won't hold the fractional bits of a number.
2) converting a number from one type to another, when the second type is not able to correctly represent all values possible in the first, will cause compiler warnings.
Shog9
I returned and saw under the sun,
that the race is not to the swift,
nor the battle to the strong...
|
|
|
|
|
Given that 5.1234 is not going to represented exactly as such in memory (i.e., it's more than likely going to be something like 5.123999), you're going to have a hard time using your current code, assuming it even works.
elmahdy wrote:
int y=input-x; // so y=the fractional part
The problem with this is that 5.1234 - 5 = 0.1234 in memory, but only the 0 gets assigned to variable y . Make sense?
You could try converting the number to a string, but most of the conversion routines want to know how many digits to put after the decimal, which sort of defeats the purpose!
|
|
|
|
|
Where is the value of input coming from?
If you are getting it from the console, then use scanf with a string type specifier.
Get the length of that string
Start at the 0th char
Increment the index until you find the '.'
The number of decimal places is the string length - the current index (assuming you pre-increment)
|
|
|
|
|
Here is one solution, but it is fraught with problems, I will let you work out what they are!
#include <math.h><br />
#include <stdio.h><br />
<br />
int main(int argc, char* argv[])<br />
{<br />
<br />
double dVal = 5.1234,<br />
dResult = 0.9,<br />
dInt = 0.0;;<br />
<br />
int nKount = 0;<br />
<br />
while(dResult > 0.00001)<br />
{<br />
dVal *= 10.0;<br />
<br />
dResult = modf(dVal, &dInt);<br />
<br />
nKount++;<br />
}<br />
<br />
printf("Value = %d\n", nKount);<br />
return 0;<br />
}
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
What is the c++ version of this in c#?
string[][] a two diminsion string array.
I just want std c++ if possible.
Thank You
Bo Hunter
|
|
|
|
|
|
The brackets are (unfortunately) tied to the variable name instead of the type. So your example is the correct way to do it in C++.
--
Frivolous Theorem of Arithmetic: Almost all natural numbers are very, very, very large.
|
|
|
|
|
In Java, brackets can go either with variable or type. Crazy...
|
|
|
|
|
Yes its really bothering me.... I have a CTreeCtrl on a modeless dialog, When a selection is made on the list control that is on the dialog box I want another class, generic, to parse out the contents to the related file... how can I do this? I understand that I can't pass a CTreeCtrl as a return value from the generic class (CParseDocument) and I can't get the generic class to get control of the Dialog class and make it update the control.
Also I'm using another class for this to organize it and it gets really messy if I keep the parsing in the Dialog class.
Heres what I've been trying to get to work (it keeps returning NULL):
TV_INSERTSTRUCT tv_is;
tv_is.hParent = TVI_ROOT;
tv_is.hInsertAfter = TVI_LAST ;
tv_is.item.mask = TVIF_TEXT;
tv_is.item.pszText = ConvertCStringToChar(m_strSectionName);
hSectionRoot = m_cSlidOpen.m_ctrlXMLTree.InsertItem(&tv_is);
if (hSectionRoot==NULL)
{
AfxMessageBox("failed");
return;
}
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
<Hello,
How can i handle interrupts in win2k environment?
Thanks in advance...
|
|
|
|
|
I'm pretty sure that you need to run in ring 0 which means you write a device driver or similar kernel-mode code.
Brad
|
|
|
|
|
|
Hello,
I would like to create an empty folder on the disk, which command should I used in Visual C++? Thank you for your help!
Nachi
|
|
|
|