Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

call explorer

How can I open a folder in windows explorer for the user to see.

Comments

  • edited October 2019
    i worked this out:
    SRP_Run_Command("explorer ":MainPath,"DOS")

    but the dos window flashes up.
    Is there a neater way. (or another parameter/option)
  • You want to use ShellExplorer (which is a direct WinAPI call). I think it's already defined in OI. Here's some code the opens the users folder:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    Compile Function Test(VOID)
     
    Declare function Get_Property
    Declare subroutine ShellExecute
     
    hWnd = Get_Property(@Window, "HANDLE")
    Operation = "explore":\00\
    File = "C:\Users\":\00\
    Parameters = \00\
    Directory = \00\
    ShowCmd = 1
    ShellExecute(hWnd, Operation, File, Parameters, Directory, ShowCmd)
         
    Return 1
  • I assume you don't need to use this as a file/folder picker? If not, go with Kevin's solution.
  • Yep, that was exactly as needed.
    Thank you
  • "I assume you don't need to use this as a file/folder picker? If not, go with Kevin's solution. " - is there a function that will act as a file/folder picker? RTI_OS_Directory does not display the files in a folder, GETFILES will return what user has selected as a directory but I will have to display in a popup, its not a folder/file picker.
  • I was only thinking of the CHOOSEFILE service and the CHOOSEDIR service.
  • edited December 2019
    Yes, tried and true, but was reviewing the option above as an alternative, see which option provides the most for a user. I need a custom IMPORT/EXPORT function for a client, a lot of the factors will be unknown, so flushing out the best option I can give them, it seems like I keep returning to UTILITY, just want to try something fresh. Client not allowing a lot of standardization with the IMPORT, I understand their perspective. I will probably go with UTILITY for Phase I and try a lot more of the customization for Phase II. Thanks Don.
Sign In or Register to comment.