How can i show the open, save, and color dialog?

I know to get the open i used
VB Code:
  1. void OpenF(HWND hwnd,char *vFilen)
  2. {
  3.         OPENFILENAME ofn;
  4.     char szFileName1[MAX_PATH] = "";
  5.  
  6.     ZeroMemory(&ofn, sizeof(ofn));
  7.  
  8.     ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
  9.     ofn.hwndOwner = hwnd;
  10.     ofn.lpstrTitle = "Open";
  11.     ofn.lpstrFilter = "Ini File (*.ini)\0*.txt\0All Files (*.*)\0*.*\0";
  12.     ofn.lpstrFile = szFileName1;
  13.     ofn.nMaxFile = MAX_PATH;
  14.     ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
  15.     ofn.lpstrDefExt = "ini";
  16.  
  17.     if(GetOpenFileName(&ofn))
  18.     {
  19.         vFilen = szFileName1;
  20.         // Do something usefull with the filename stored in szFileName1
  21.     }
  22.  
  23. }

But i get a cancel error. How do i do this so i can intercept the cancel error and how do i show the save and color alos thanks in advance