[Bug 49935] mismatch behavior in API function GetOpenFileName

WineHQ Bugzilla wine-bugs at winehq.org
Thu Oct 22 05:11:45 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=49935

--- Comment #3 from Christian PANEL <ch.panel at free.fr> ---
sorry not used to bugzilla...

here is the simple code : 
I create 3 files in D:\
TEXT1.TXT
TEXT2.TXT
ANOTHER.TXT
3 files are shown with wine
only the first 2 with windows

    #include <windows.h>
    #include <Commdlg.h>
    // 
    // Gobal Variables and declarations.
    // 
    OPENFILENAME ofn ;
    // a another memory buffer to contain the file name
    char szFile[100] ="TEXT*.TXT" ;
    int WINAPI WinMain( HINSTANCE hInstance , HINSTANCE hPrevInstance , LPSTR
lpCmdLine , int nCmdShow )
    {

        // open a file name
        ZeroMemory( &ofn , sizeof( ofn));
        ofn.lStructSize = sizeof ( ofn );
        ofn.hwndOwner = NULL  ;
        ofn.lpstrFile = szFile ;
        //ofn.lpstrFile[0] = '\0';
        ofn.nMaxFile = sizeof( szFile );
        ofn.lpstrFilter = "Special Text\0*.TXT\0";
        ofn.nFilterIndex =0;
        ofn.lpstrFileTitle = NULL ;
        ofn.nMaxFileTitle = 0 ;
        ofn.lpstrInitialDir="D:\\" ;
        ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;
        GetOpenFileName( &ofn );

        // Now simpley display the file name 
        MessageBox ( NULL , ofn.lpstrFile , "File Name" , MB_OK);
        return 0;
    }


thanks for all wine team for his wonderful work

christian

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list