O$5: How to open an Explorer window

Alan Grinberg omnis at alangrinberg.com
Wed Jan 21 23:30:25 EST 2015


Hi Mike,

I traced my code and the source bit you are asking about is using that DLL stuff.

On my Mac it looks like this:

X250825050 ('Shell32.dll','ShellExecuteA','JJCCCCJ') 
X250825051 ('Shell32.dll','ShellExecuteA',0,'Open',pvFolderToOpen,chr(0),chr(0),1) Returns #1

That is Register and Call DLL on the Windows machine.

So I guess that is not as clean as we would like considering what you pointed out about the future of DLL calls and 64 bit computers.

- Alan

----------------------------------------------------
Alan Grinberg
AG Systems/ZOO-INK
----------------------------------------------------




On Jan 21, 2015, at 12:59 PM, Mike Matthews wrote:

> Hello Alan,
> 
> what is in your method $openFile please, as I think that is the bit I was looking for.
> 
> Thanks
> 
> Mike
> 
> 
> 
> 
> Mike Matthews,
> Managing Director, SQLWorks Software Ltd
> 
> Tel: +44 (0)1271 375999
> 
> Email: mike.matthews at sqlworks.co.uk
> 
> Web: www.sqlworks.co.uk
> 
> SQLWorks replaces Sage, ACT!, Opera, Access, SAP
> 
> On 21 Jan 2015, at 17:12, Alan Grinberg <omnis at alangrinberg.com> wrote:
> 
>> We use this for both platforms.
>> It does a little more than what you want, but you can probably get what you need.
>> This code has been around a while.
>> 
>> 
>> ;  Parameter pvFolderPath tells it where to look
>> ;  Parameter pvIndexName tells it the name of the folder
>> 
>> ;  opens a folder via FolderPath and index name
>> ;  window to show containing files, or if single file opens it.
>> 
>> Do FileOps.$filelist(kFileOpsIncludeFiles,pvFolderPath,kFileOpsInfoName+kFileOpsInfoFullName,con(pvIndexName,'_*.*')) Returns fileList
>> If fileList.$linecount=0     ;; no files found
>> Calculate pvFolderPath as con(pvFolderPath,delim,pvIndexName)
>> Do FileOps.$filelist(kFileOpsIncludeFiles,pvFolderPath,kFileOpsInfoName+kFileOpsInfoFullName,'*.*') Returns fileList     ;; get files
>> Do FileOps.$filelist(kFileOpsIncludeDirectories,pvFolderPath,kFileOpsInfoName+kFileOpsInfoFullName,'*.*') Returns folderList     ;; get folder
>> Do folderList.$cols.$add('FOLDER',kBoolean)     ;;add a folder column so we know which entries are folders
>> Do folderList.$sendall($ref.FOLDER.$assign(1))
>> Do folderList.$merge(fileList)
>> If folderList.$linecount=0     ;; no files found
>> OK message  {Customer Files or Folder Not Found}
>> Else
>> Do $clib.$windows.LIST_FILES_WIN.$openonce(,kWindowNormal,folderList,kFalse)     ;; let the user choose
>> End If
>> 
>> Else If fileList.$linecount=1     ;; one file found. Open it
>> Do method $openFile (con(pvFolderPath,delim,fileList.1.name))
>> Else     ;; multiple files found. Open list window
>> Do $clib.$windows.LIST_FILES_WIN.$openonce(,kWindowNormal,fileList,kFalse)     ;; let the user choose
>> End If
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ----------------------------------------------------
>> Alan Grinberg
>> AG Systems/ZOO-INK
>> San Francisco, CA 
>> 
>> www.zoo-ink.com
>> www.perfectfit.net
>> alan at perfectfit.net
>> ----------------------------------------------------
>> 
>> 
>> 
>> 
>> On Jan 21, 2015, at 9:03 AM, Mike Matthews wrote:
>> 
>>> Hello All,
>>> 
>>> I an using the FilesList component to show a list of files/folders in a directory.  It hasn't been used/updated by TL for decades, but it works ok for me. The plus side is it shows the file icon, rather than using a tree and FileOps and not having the icon thumbnails. 
>>> 
>>> I am giving the user the option to open a folder on his desktop, so he can get at the files directly.
>>> 
>>> On OSX I use an applescript:
>>> Text: tell application "Finder" (Carriage return)
>>> Text: open folder "[lvPath]" (Carriage return)
>>> Text: end tell (Carriage return)
>>> 
>>> What can I use for Windows please to open a folder in Windows Explorer please from within Studio?
>>> 
>>> Thanks
>>> 
>>> Mike
>>> 
>>> 
>>> 
>>> 
>>> Mike Matthews,
>>> Managing Director, SQLWorks Software Ltd
>>> 
>>> Tel: +44 (0)1271 375999
>>> 
>>> Email: mike.matthews at sqlworks.co.uk
>>> 
>>> Web: www.sqlworks.co.uk
>>> 
>>> SQLWorks replaces Sage, ACT!, Opera, Access, SAP
>>> 
>>> 
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list