Lost universe of Programing
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Lost universe of Programing

USERNAME :- Forum Post:-114
 
HomePortalGalleryLatest imagesRegisterLog in

 

 SEND TO FOLDER

Go down 
AuthorMessage
Administrator
Admin
Admin
Administrator


Male
Number of posts : 160
Age : 38
Location : Lucknow
Job/hobbies : Software Engeener
What U like To do ? : Because Its Rock with me.
Registration date : 2008-01-06

SEND TO FOLDER Empty
PostSubject: SEND TO FOLDER   SEND TO FOLDER I_icon_minitime3/13/2008, 8:33 pm

Quote :
when u run the programm the send to folder will be opened.
Code:
/*************************************************************************
*****
*
*
* sf.c
*
* Simple program that opens the "Send to" folder of the current user.
The
* location of this folder can be obtained from
SHGetSpecialFolderLocation().
* Then sf tries to convert the Item Identifier to a string using
* SHGetPathFromIDList() and opens the folder using ShellExecute().
*
*
*                                                    (c) Florian
Balmer
1999
*
[url=http://aspx.forumotion.com/mailto:textview@bluewin.ch]textview@bluewin.ch[/url]
*
[url=http://www.flos-freeware.ch]http://www.flos-freeware.ch[/url]
*
*
**************************************************************************
****/

#include <windows.h>
#include <shellapi.h>
#include <shlobj.h>

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,
                  LPSTR lpCmdLine,int nCmdShow)
{
  LPITEMIDLIST pidl;
  LPMALLOC    lpMalloc;
  char        sz[MAX_PATH];
  char        *pErrMsg  = "Error opening "Send to" folder.";
  char        *pCaption = "Send to";
  if (NOERROR == SHGetSpecialFolderLocation(
                  NULL,CSIDL_SENDTO,&pidl))
  {
    SHGetPathFromIDList(pidl,sz);
    if (NOERROR == SHGetMalloc(&lpMalloc))
    {
      lpMalloc->lpVtbl->Free(lpMalloc,pidl);
      lpMalloc->lpVtbl->Release(lpMalloc);
    }
    if (32 >=
(int)ShellExecute(NULL,"open",sz,NULL,NULL,SW_SHOWNORMAL))
      MessageBox(NULL,pErrMsg,pCaption,MB_ICONEXCLAMATION);
  }
  else
    MessageBox(NULL,pErrMsg,pCaption,MB_ICONEXCLAMATION);
  return(0);
}

// End of sf.c
Back to top Go down
https://aspx.forumotion.com
 
SEND TO FOLDER
Back to top 
Page 1 of 1
 Similar topics
-
» HOW TO create Folder
» UPLOADER Contol in C#, Making folder and Copy the file into

Permissions in this forum:You cannot reply to topics in this forum
Lost universe of Programing :: --=| SOURCE CODE |=-- :: C/C++ SOURCE CODE-
Jump to: