|
.
I genralized it.
|
|
|
|
|
Hi All,
I need to write some GUI application that uses CTreeView control.
I writing it with using ATL and use method like TreeView_SetItemState, TreeView_InsertItem and extra.
I'm using control attribute of check box --> each item have check box with some string.
I found out that in case of double click on some item i have problem on identify the current item.
What i mean is that in case the double click is on the string that describe the selected item than all work find and i getting the right HTREEITEM --- but in case the double click is on the check box of the selected item then i getting wrong HTREEITEM (!!!).
The method that getting the event return me LPNMHDR pnmh type -- with this type i do casting to
NMTREEVIEW* that will hold me
TVITEM itemOld;
TVITEM itemNew;
None of them are not hold me the info of the right HTREEITEM .
I must have the right HTREEITEM to know which item was selected in case of click event or/and double click event.
I will be happy to get any help to find out the problem.
Thanks.
|
|
|
|
|
Can you show(code), how you are doing this?
|
|
|
|
|
In the first column,I have put the image. And in the second column I have used both text and image
when user insert item in the list, but it's display only the name of file.The image is not display, Please Look at the source code.
LvItem.iItem=0; <br />
LvItem.iSubItem=0;<br />
if(metaFileReaderEnc->m_bIsDRM)<br />
{<br />
ImageList_AddIcon(hSmall, hIcon);<br />
LvItem.iImage=2;<br />
LvItem.mask =LVIF_IMAGE; <br />
}else<br />
{<br />
LvItem.pszText=_T(""); <br />
LvItem.mask =LVIF_TEXT;<br />
}<br />
<br />
SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&LvItem);
ImageList_AddIcon(hSmall, hIcon);<br />
if(directory==true)<br />
{<br />
size_t pos = ListviewFolder.find_last_of("\\"); <br />
ListviewFolder=ListviewFolder.substr(pos+1,ListviewFolder.length());<br />
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,ListviewFolder.c_str(),(int)(ListviewFolder.length() + 1),w_ListviewFolder,MAX_PATH);<br />
LvItem.iSubItem=1; <br />
LvItem.iImage=1;<br />
LvItem.pszText=w_ListviewFolder;<br />
}else<br />
{<br />
LvItem.iImage=0;<br />
LvItem.iSubItem=1;<br />
LvItem.pszText=w_onlyfilename;<br />
}<br />
LvItem.mask = LVIF_TEXT|LVIF_IMAGE;<br />
SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem);<br />
I want to add three more things .
1)I want to display my first column's image on right side(right alingement)
2)for second column when it control goes in else part actually shown image in second column but it displays that image in fist column only display the text in second(Actually should display the fileicon and name) .
3) Now When i close this application I have written xml file . for First column it only image then how can i check the item?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Did u set the image list to the list view using the LVM_SETIMAGELIST function?
amitmistry_petlad wrote: ImageList_AddIcon(hSmall, hIcon);
did u check the above function return success?
amitmistry_petlad wrote: 1)I want to display my first column's image on right side(right alingement)
If you want to do so, you have to do custom draw( by handling NM_CUSTOMDRAW notification)
2- i didnt understand
3. if a cell have only image, and if you call Getitem, the pszText member of the LVITEM will be having 0 length.
nave
|
|
|
|
|
Naveen R wrote: 2- i didnt understand
2- is in second column I need image and text both but i got only text.the image didn't display.
That image is display in column one which i want to display with text.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
if you want image in the subitems you ned to set the LVS_EX_SUBITEMIMAGES extended style.
ListView_SetExtendedListViewStyleEx( hWndList, LVS_EX_SUBITEMIMAGES ,LVS_EX_SUBITEMIMAGES );
nave
|
|
|
|
|
Hi
How to destroy the PropertySheet and hence finish the
wizard by sending a PSN_WIZFINISH Notification from
the PropertyPage to handle the ON_BN_CLICKED event on
any custom button other than the finish button?
With Regards
Neeraj Sinha
Netstudio
Pune
|
|
|
|
|
Neeraj Sinha wrote: How to destroy the PropertySheet and hence finish the
wizard by sending a PSN_WIZFINISH Notification from
Do this:
pMySheet->PressButton (PSBTN_FINISH );
where pMySheet is pointer to the class that is derived from CPropertySheet..
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi everyone
how can generate 100,000 unrepeated 16 digital serial numbers that dont be consecutive.
please give me your ideas
|
|
|
|
|
|
I am working for ATM domain,We r using C,C++ here.My problem is that my application which is involved in showing screens like wlecome to This BAnk, Then Select Language, slows down when it comes up after power failure.What could be the prolem?
Anjali
|
|
|
|
|
how to get the information from Win32_NetworkAdapterConfiguration in mfc. i need to get ipaddress subnetmask dns values for the system etc. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
how to increse tabs in tab control at run time .plz hlep me.
|
|
|
|
|
prathuraj wrote: increse tabs in tab control
If you want to add tabs, then look CTabCtrl::InsertItem(..)
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
i want to increase tab at runtime along with dialog also
|
|
|
|
|
prathuraj wrote: runtime along with dialog
Create instanse for the dialog class and use it..
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
hi
I have one MFC drawing application.Now I want to set that exe in openwith list of .bmp
file.
I want when I doubel ckick on .bmp file it should be open in my application.
can any body help me?
Thanks,
Rushiraj
|
|
|
|
|
This[^] link should help you.
[Edit]
I re-read your post. I guess, link provided by will help you only partialy.
[/Edit]
|
|
|
|
|
Please refer this[^].
Hope this will help you.
Regards,
Paresh.
|
|
|
|
|
|
toxcct wrote: The Complete Idiot's Guide to Writing Shell Extensions - Part I[^] by Mike Dunn. don't hesitate to read the other articles of the series
I wonder, if OP's issue addressed in any of them. Where as link given in Paresh's reply(previous to yours) seems to be appropriate.
|
|
|
|
|
why doesn't it ?
Shell Extensions can associate a program to a file type... and that's what the OP's looking for, no ?
|
|
|
|
|
toxcct wrote: why doesn't it ?
I said, I could not find such article in that series.
toxcct wrote: Shell Extensions can associate a program to a file type... and that's what the OP's looking for, no ?
If you look at link given by Paresh(in reply previous to you), I think, this is what he is looking for.
|
|
|
|
|
Hi
Im using ADO and Datagird to add,edit,delete the contents in database.
How to print the values in Data Grid,
If any one knows the sample code link.Pls proivde me..
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|