CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2001
    Location
    Pune-India
    Posts
    251

    File OPen Dialog

    Hi Gurus
    I am using following code for File Open Dialog.

    OPENFILENAME ofn;
    char szFile[1024]= "\0";
    HANDLE hf;
    ZeroMemory(&ofn, sizeof(OPENFILENAME));
    ofn.lpstrTitle = dialogTitle;
    ofn.lStructSize = sizeof(OPENFILENAME);
    ofn.hwndOwner = GetForegroundWindow();
    ofn.lpstrFile = szFile;
    ofn.nMaxFile = sizeof(szFile);
    ofn.lpstrFilter = fileType;
    ofn.nFilterIndex = 1;
    ofn.lpstrFileTitle = NULL;
    ofn.lpstrInitialDir = defaultFolder;
    ofn.nMaxFileTitle = 1;
    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

    if (GetOpenFileName(&ofn)==FALSE)
    {
    return 0;
    }
    hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
    0, (LPSECURITY_ATTRIBUTES) NULL,
    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
    (HANDLE) NULL);

    strcpy(FolderPathName,ofn.lpstrFile);
    CloseHandle(hf);

    my problem is CAN I SHOW MY OWN STRING ON THIS STANDARD DIALOG?.....as per my understanding you can only change the header of this dialog. but for my application i want to add one string on this dialog?.....

    Plz reply to this post.... if possibel with code
    Regards
    nagesh

  2. #2
    Join Date
    Jun 2002
    Posts
    1,417
    CAN I SHOW MY OWN STRING ON THIS STANDARD DIALOG?.....
    What string? Do you want to add a custom static label to display some other information ? Or customize the way the file names are displayed ? Did you read the MSDN articles about Explorer-Style Custom Templates
    Last edited by stober; July 27th, 2002 at 06:12 AM.

  3. #3
    Join Date
    Jul 2001
    Location
    Pune-India
    Posts
    251

    Custom Label on File Open Dailog

    Hi Stober
    Thanx for repling....well Sir i want to show custom static label to display some information on the dialog. Thats the main thing i want to do .....
    Please Help me to sort out this problem............
    Regards
    Nagesh

  4. #4
    Join Date
    Jun 2002
    Posts
    1,417
    As far as I know you cannot modify its dialog box directly, but you can create another dialog box that is appended to the bottom of theirs to extend its functionality. There is an example of doing that on the MSDN CD #1 that comes with the VC6 compiler. Look in the \examples directory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured