|
antonaras wrote: ...when i post the message my spaces where removed.
Use ampersand nbsp; in your post.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have created a small project in vc++6 with a editable list control. I took the help of some of the articles found here.
I wanted the listview's edit box to have some background colour when that box is being edited. I intergrated another class I found in CodeProject. But the box doese'nt behave properly. I do not know how to correct it, or what I should change.
Can somebody help me out. I can e-mail the project to you so that you can see it and tell me what I must add or change.
Thanks.
Tara
Fortitudine Vinsinues!
|
|
|
|
|
use WM_CTLCOLOREDIT message in your class(derived CListCtrl) and use
<br />
HDC hdc=(HDC)wParam)<br />
::SetBkColor(hdc,RGB(53,197,200));<br />
whitesky
|
|
|
|
|
I have added that to the class. But this is what is happening:
When I click on a cell in the listview the background changes color. After that, when I start typing the color changes back to white and the corners remain yellow...
Please help!
Thanks.
Tara
Fortitudine Vinsinues!
|
|
|
|
|
Hope I understood your question
WM_CTLCOLOREDIT is a message notify
you can see in MSDN(this explain)
"This message notifies the parent window of an edit control when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control."
see this code maybe it is some helpful to you :
<br />
BEGIN_MESSAGE_MAP(CAnswerView,CListView)<br />
ON_MESSAGE(WM_CTLCOLOREDIT, OnColorEdit)<br />
END_MESSAGE_MAP()<br />
...<br />
...<br />
LRESULT CAnswerView::OnColorEdit(WPARAM wParam,LPARAM lParam)<br />
{<br />
HDC hdc=(HDC)wParam;<br />
SetBkColor(hdc,RGB(53,97,200));<br />
SetTextColor(hdc,RGB(255,255,255));<br />
return (LRESULT)m_Brush->m_hObject;<br />
}<br />
whitesky
|
|
|
|
|
pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
as we know, this is a simple way to create and load the frame with its resouces,
and we notice that the pContext is NULL. And we get a bug:
if pContext is NULL, it will fire CView::OnInitalUpdate Twice!
Here is My explain:
BOOL CFrameWnd::LoadFrame(...)
{
...
if ( !Create(...) ) /// it will fire CView::OnInitialUpdate()
{
return FALSE;
}
...
if ( pContext == NULL )
{
/// it will fire CView::OnInitialUpdate() again
SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);
}
return TRUE;
}
So, why these four lines:
if ( pContext == NULL )
{
SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);
}
Can anyone help me or fix it?
Thanks!
-- modified at 4:14 Sunday 11th June, 2006
|
|
|
|
|
I am facing problem in finding how can we list all the deleted files in a directory??? I mean is there no way of doing it by some function rather than making a function urself????Can FindFirstFile,FindNextFile can be useful???
|
|
|
|
|
You can enumerate the contents of the Recycle Bin and look at the original location of the files. The only other alternative would be to parse the file system structures (similar to what ScanDisk and NDD do) and look for directory entries marked as deleted. (But even then, the file's data may have been overwritten.)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
See Here[^]maybe it is some helpful to you
whitesky
|
|
|
|
|
Hi All.
I need to know how can i write some function that getting Folder path and return me list of all file in this folder.
The function will be something like this
void func(CString sFolderPath , CString sFileList)
{
...
...
...
While(bFileExist){
sFileList += File.Name;
sFileList += '\n';
bFileExist = FindNextFile(....);
}
}
Thanks for any help.
|
|
|
|
|
use the shell api SHBrowseForFolder once you select a folder use FindFirstFile and then FindNextFile to retrieve all the files under that folder.
hope this helps
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
See
<br />
(1)<br />
TCHAR lpt[260];<br />
lpt[0]='\0';<br />
strcat(lpt,"c:\\");<br />
GetCurrentDirectory(sizeof(lpt),lpt);<br />
DlgDirList(lpt,IDC_LIST2,NULL,DDL_DIRECTORY|DDL_ARCHIVE);
-----------------------------<br />
(2)<br />
WIN32_FIND_DATA find;<br />
HANDLE handle=FindFirstFile("*.*",&find);<br />
while(FindNextFile(handle,&find)!=0)<br />
m_List2.AddString(find.cFileName);
FindClose(handle);
whitesky
|
|
|
|
|
Hey folks!
I'm installing an Internet application which requires a cookie to authenticate. Because it's a low-risk application, I'm using persistent sesssions.
I'd like users to have to enter a login/password to access the service.
There are a bunch of issues with this (checking for valid input, not letting users advance in the installation if they can't enter their login/pass correctly, grabbing the cookie back from the response) and I'd like to know if there are any *free* (not GPL or LPGL) classes or projects, which would allow me to plugin this feature into my application. i.e. i'm looking for login functionality like you might see such as with MSN Messenger.
C++ / MFC is available, but no .NET.
waiting hopefully :P,
chasetoys
-- modified at 2:29 Sunday 11th June, 2006
|
|
|
|
|
I've seen controls that look like Oscopes, Histograms and Volt Meters.... but I am looking for one that looks like a thermometer to report back temperarture... for use in C++/MFC application
Does anyone have any like that or can point me to something.
Regards and thanks in advance
Pierre
|
|
|
|
|
|
Those are slider controls... not thermometers
but thanks for trying
Regards
Pierre
|
|
|
|
|
pblais wrote: I've seen controls that look like Oscopes, Histograms and Volt Meters.... but I am looking for one that looks like a thermometer to report back temperarture...
That is something that looks like a thermometer.
If you couldn't find what you want, it shouldn't be too hard to modify it so that it reports temperature.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Those are sliders.... They give input to the application... they don't report anything... And, to be honest, they don't look like thermometers at all
Regards
Pierre
|
|
|
|
|
hi all,
i'm working on my project for exams and i have made a chat application
i have problem in making the client talk or send the other client but i make the client send to the server and the server send the same message to me again,
can any one help me in that please
|
|
|
|
|
Me doing your homework? No.
Helping you with specific problems and unexpected behaviour of your code? Yes.
Post what you have, tell us what doesn't work and you will get tons of replies. To THIS question, this probably will be the only reply.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hallo
I'd like to add a menu to a propertysheet. The menu has the same look for all bags (only different Functions)
THX
Timen
|
|
|
|
|
I'm getting errors about something called RTC. What does it do, and what library can I find the functions for it in?
__________________________________________
Let's push Satan
|
|
|
|
|
search MSDN for : The Microsoft Real-Time Communications (RTC)
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I used GetPrivateProfileSectionNames to retrieve a list of the section names. The only problem is that I now have all the names stored into one char array seperated by \0s. What would be the best/easiest way to split the string up into individual char arrays. Also note that there won't be a set number of section names. Thanks for any help.
|
|
|
|
|
The easiest way is to use one of the container classes and one of the string classes, I recommend std::vector and std::string. Then simply copy the strings from the input buffer.
std::vector<std::string> names
char * ptr = buffer;
while (*ptr)
{
names.push_back(ptr);
ptr += strlen(ptr) + 1;
}
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|