Kbase P116998: How to access Windows Explorer using Shell Automation Application Object Model?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  26/06/2006 |
|
Status: Unverified
GOAL:
How to access Windows Explorer using Shell Automation Application Object Model?
GOAL:
Is there a way to interface to MS Windows Explorer using OLE automation?
GOAL:
How to access Windows Explorer using COM automation objects?
FIX:
1. The following code snippet creates a "Shell.Application" object and uses its Open method to open a specific directory using the Windows Explorer:
DEFINE VARIABLE hShell AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cDirectory AS CHARACTER NO-UNDO.
CREATE "Shell.Application" hShell.
ASSIGN
cDirectory = "C:\Documents and Settings\yshanshi\My Documents".
hShell:Open(cDirectory).
2. The following code snippet creates a "Shell.Application" object and uses its Explore method to start exploring a specific directory using the Windows Explorer:
DEFINE VARIABLE hShell AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cDirectory AS CHARACTER NO-UNDO.
CREATE "Shell.Application" hShell.
ASSIGN
cDirectory = "C:\Documents and Settings\yshanshi\My Documents".
hShell:Explore(cDirectory).
3. The following code snippet creates a "Shell.Application" object and uses its FindFiles method to start the windows file search dialog:
DEFINE VARIABLE hShell AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cDirectory AS CHARACTER NO-UNDO.
CREATE "Shell.Application" hShell.
ASSIGN
cDirectory = "C:\Documents and Settings\yshanshi\My Documents".
hShell:Explore(cDirectory).