Click here to Skip to main content
15,917,321 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to read the contents of a VARIANT ? Pin
LindeA5-Feb-09 21:19
LindeA5-Feb-09 21:19 
AnswerRe: How to read the contents of a VARIANT ? Pin
prasad_som5-Feb-09 4:20
prasad_som5-Feb-09 4:20 
Questionconnecting to mysql server in remote location .. Pin
Thilek5-Feb-09 2:34
Thilek5-Feb-09 2:34 
AnswerRe: connecting to mysql server in remote location .. Pin
Stuart Dootson5-Feb-09 4:02
professionalStuart Dootson5-Feb-09 4:02 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 5:30
Thilek5-Feb-09 5:30 
GeneralRe: connecting to mysql server in remote location .. Pin
Stuart Dootson5-Feb-09 6:13
professionalStuart Dootson5-Feb-09 6:13 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 23:18
Thilek5-Feb-09 23:18 
QuestionIShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum5-Feb-09 2:26
ab4rum5-Feb-09 2:26 
Hi everybody,
can anyone help me ?
i'm developing a MFC Dialog based app which can <u>simulate 'Windows Desktop' upto limited functionalities</u>,
using Shell API, IContexMenu etc.
While Renaming a file or folder onto desktop, all i could do is; just rename Virtual folders.
When attempting to rename normal files, folders, or link onto desktop, it renames '<b>My Computer</b>' only.
Rename operation executing into 'LVN_ENDLABELEDIT' with appropriate handler

My code snap-shot are:
<pre></pre>
void CClinckDlg::OnRenameLabelEnd(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);

LPCWSTR pwStrNewItem = T2CW(pDispInfo->item.pszText);
LPITEMIDLIST pidlNewItem = NULL;
IShellFolder *pshFolder ;
HRESULT hr = NULL ;
SHGetDesktopFolder( &pshFolder ) ;
DWORD dwAttrFlag = SFGAO_CANRENAME;

// m_pidlOldItem was stored as current PIDL, while Right-click onto ClistCtrl item

hr = pshFolder->GetAttributesOf( 1, (LPCITEMIDLIST*)&m_pidlOldItem, &dwAttrFlag ) ;
if( ( dwAttrFlag & SFGAO_CANRENAME ) == 0 )
{
::MessageBox(NULL,
_T("IShellFolder::GetAttributesOf failed, File/Folder can not 'Rename'"),_T("Error"),MB_OK);
return ;
}

hr = pshFolder->SetNameOf(NULL, m_pidlOldItem, pwstr, /*0*/ SHGDN_FOREDITING, &pidlNewItem);
if( FAILED(hr) || (pidlNewItem==NULL) )
{
::MessageBox(NULL,
_T("IShellFolder::SetNameOf failed"),_T("Error"),MB_OK);
return ;
}

// Notify, that item has been renamed successfully
SHChangeNotify( SHCNE_RENAMEFOLDER, SHCNF_IDLIST | SHCNF_FLUSH, m_pidlOldItem, pidlNewItem ) ;

// Set the new PIDL structure
......... .........
..

pshFolder->Release() ;
}
<pre></pre>
Properties of my CListCtrl are,
View = Icon
Edit Labels = True

Thanks a lot in Advance !!

ab4rum
AnswerRe: IShellFolder::SetNameOf() setting only virtual folders Pin
Stuart Dootson5-Feb-09 6:23
professionalStuart Dootson5-Feb-09 6:23 
GeneralRe: IShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum7-Feb-09 0:28
ab4rum7-Feb-09 0:28 
QuestionNeed help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 2:13
John5025-Feb-09 2:13 
AnswerRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 3:03
professionalStuart Dootson5-Feb-09 3:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 20:04
John5025-Feb-09 20:04 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 21:34
professionalStuart Dootson5-Feb-09 21:34 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 5:13
John5026-Feb-09 5:13 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 5:50
professionalStuart Dootson6-Feb-09 5:50 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 6:24
John5026-Feb-09 6:24 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 7:16
professionalStuart Dootson6-Feb-09 7:16 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 7:35
John5026-Feb-09 7:35 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 8:03
professionalStuart Dootson6-Feb-09 8:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 4:14
John5028-Feb-09 4:14 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 6:38
professionalStuart Dootson8-Feb-09 6:38 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 7:05
John5028-Feb-09 7:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 8:01
professionalStuart Dootson8-Feb-09 8:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 9:59
John5028-Feb-09 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.