List View of Folders

char buf[MAX_PATH] = "C:\\";
DlgDirList(buf,
IDC_LIST2,
0,
DDL_DIRECTORY);
 


Folder selection Dialog

char szPath[MAX_PATH];
BROWSEINFO lpbi;
::ZeroMemory(&lpbi,sizeof(BROWSEINFO));

ITEMIDLIST *folder = ::SHBrowseForFolder (&lpbi);

::SHGetPathFromIDList(folder,szPath);

or
http://www.codeguru.com/cpp/w-p/files/browserfunctionsdialogs/article.php/c4465/


A set of functions which does string manipulation and splits up the path of selected file into . File .Folder . Dir....

http://www.codeproject.com/file/SplitPath.asp


String appending in CString

CString strReg;
strReg = "test1;
strReg = strReg + "test2";
 


http://simplesamples.info/ Simple C++ and MFC samples


How to add tray icons

http://www.codeproject.com/shell/systemtray.asp?df=100&forumid=88&exp=0&select=1505598


Show the yellow balloon without tooltip pointing to tray icon

http://msdn.microsoft.com/msdnmag/issues/02/11/CQA/


 

To access the registry ( read , write )

char szVal[MAX_PATH]={0};

unsigned long lSize = sizeof(szVal);
DWORD cbData = 10;
LPBYTE dat;
dat = (LPBYTE) malloc( cbData );
LPTSTR buffer;

HKEY key;

if ( ::RegOpenKeyEx( HKEY_CURRENT_USER,"Software\\Widcomm\\BtConfig\\General",0,KEY_READ | KEY_SET_VALUE,&key ) == ERROR_SUCCESS )
{
if ( ::RegQueryValueEx(key,"DeviceName",NULL, NULL,dat,&lSize)== ERROR_SUCCESS )
{
// here szVal eqaul to the value of the stirng
MessageBox("val read",NULL,MB_OK);
buffer = "stilltesting";

// Set value
if(::RegSetValueEx(key,"DeviceName",0,REG_SZ,(LPBYTE)buffer ,(DWORD) (lstrlen(buffer)+1) * sizeof(TCHAR)) == ERROR_SUCCESS)
{
MessageBox("success",NULL,MB_OK);
// Error handling;
}
}

}

::RegCloseKey( key ); // Close key


Hosted by www.Geocities.ws

1