Announcement

Collapse
No announcement yet.

GetOpenFilename

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bernhard Fomm
    replied
    Originally posted by Kev Peel View Post
    Try CSIDL_DRIVES
    Many Thanks!

    Leave a comment:


  • Fred Harris
    replied
    Here's a little program that dumps all the environment variables. Some of them contain useful 'informationen uber den arbeitsplatz'!

    Code:
    #Compile Exe
    #Dim All
    
    Function PBMain () As Long
      Local strData As String
      Register i As Long
    
      Console Set Screen 80,200
      Do
        Incr i
        strData=Environ$(i)
        Print Left$(strData,200)
      Loop While Len(strData)
      Waitkey$
      
      PBMain=0
    End Function

    Leave a comment:


  • Michael Mattias
    replied
    CSIDL_PERSONAL, CSIDL_DRIVES, whatever.

    My point was you should not hard-code a literal value for these special folders, since A) the name varies based on the user's language and B) they are moveable.

    Moot if this application (not described) runs only on specific computers, but still a good habit to acquire.

    Leave a comment:


  • Kev Peel
    replied
    Try CSIDL_DRIVES

    Leave a comment:


  • Bernhard Fomm
    replied
    I meant not "%CSIDL_PERSONAL". I meant with "workplace" --> "My Computer". (In German is this workplace = Arbeitsplatz.)

    Leave a comment:


  • Michael Mattias
    replied
    WRONG
    Code:
    szBuffer="C:\Documents And Settings\User\MyDocuments"
    RIGHT:
    Code:
    LOCAL szBuffer AS ASCIIZ * %MAX_PATH, iret AS LONG
    
    iRet = getSpecialFolderLocation BYVAL %NULL, %CSIDL_PERSONAL, BYVAL %NULL, %SHGFP_TYPE_CURRENT, szBuffer
    
    IF iRet = %S_OK THEN
      szBUffer contains path for this user's "My Documents" folder
    ELSE
       error handler...

    Leave a comment:


  • Fred Harris
    replied
    I wasn't sure what Bernhard meant either with 'WorkPlace', but I decided to take a stab at a generic answer.

    Leave a comment:


  • Cliff Nichols
    replied
    How can GetOpenFilename open the workplace?
    Bernard, can you expand on what you meant by "WorkPlace"? (Do you mean the current working folder? and NOT what M$ thinks is "CurDir"???) sort of thing.??

    Leave a comment:


  • Fred Harris
    replied
    Set ofn.InitialDir to the address of any fixed length string that contains a valid directory path, and that will be where the Open File Dialog Box opens...

    Local szBuffer As Asciiz*256

    szBuffer="C:\Documents And Settings\User\MyDocuments"

    ofn.InitialDir=Varptr(szBuffer)

    etc.

    There are equates for the length of the buffer that can be used such as %MAX_PATH. Here is a tutorial on the open file dialog box...

    http://www.jose.it-berater.org/smffo...p?topic=1267.0
    Last edited by Fred Harris; 13 Apr 2008, 02:56 PM.

    Leave a comment:


  • Bernhard Fomm
    started a topic GetOpenFilename

    GetOpenFilename

    GetOpenFilename starts with the parameter "ofn.InitialDir=CURDIR$" in the current folder.

    How can GetOpenFilename open the workplace?

    (The function "SHBrowseForFolder" starts also per default at the workplace.)
Working...
X