What to use for Shell.Explorer?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

What to use for Shell.Explorer?

Post by ic2 »

In VO, we have several OLE controls which can show any file format linked in Windows to a specific program with code like this:

Code: Select all

	SELF:oDCPreView:CreateEmbedding("Shell.Explorer")
	SELF:oDCPreView:InitAutoObject()
As we should replace OLE controls in DotNet, we have for example used the WebView2 where we replace the OLE control with a CustomControl and separately define a WebView2 which is assigned with SetParent using the handle of the customer control, as e.g. in https://www.xsharp.eu/forum/public-prod ... trol#21933.

This will probably work for Shell.Explorer situations but I can imagine that there are file types which can't be handled by a webbrowser while Explorer would show them, using the assigned handling program.

How should we use "CreateEmbedding("Shell.Explorer")" in X#?

Dick
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

What to use for Shell.Explorer?

Post by robert »

Dick,

Shell.Explorer = Internet Explorer
This is no longer supported by Microsoft
If you really want to use it, then have a look at the transporting of the email example in the X# help.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

What to use for Shell.Explorer?

Post by FFF »

Robert,
i'd suppose, Dick asks for a replacement of the functionality, not the resurgence of finally dead IE...
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

What to use for Shell.Explorer?

Post by ic2 »

Hello Karl,
FFF wrote:i'd suppose, Dick asks for a replacement of the functionality, not the resurgence of finally dead IE...
Indeed that is what I am looking for.
I have a document module in my program. I can connect any file with a relation and when I click on the browser with linked documents the program executes a

Code: Select all

			SELF:oPreview:CreateEmbedding("Shell.Explorer")
where oPreView is an OLE Webbrowser displayed in one of the panes of a splitwindow.

Some documents show within the control itself, like a Word document or a JPG file. Some however open in the program where the file extension is associated with, this can depend on the settings. A PDF for example always opens in PDF X Change Viewer (this is because the NPAPI they use is no longer supported in e.g. Firefox ).. An AEF would open in VoPP, an MP4 opens in VLC Media Player.

If I directly type the filepath in Firefox, I sometimes get a different behavior, in the above examples the doc(x) file opens directly in Word instead of in the browser. Firefox asks me if it should open the file in the specific software or save it.

E.g. the MP4 / PDF / JPG are directly displayed within Firefox.

Chromium based Vivaldi, which is my alternative browser, is doing the same as Firefox.

I expect a similar difference in behavior when I would use WebView2. Difficult to say which is preferable, and if any extension would work in Webview2 (directly or via the software package). Perhaps WebView2 is fine/better for all file formats. But that's why I wondered if there's a DotNet alternative to Shell.Explorer.

Finally, I think it's a but confusing that it's called Shell.Explorer.. It suggests that Windows Explorer is used, not an ancient Internet Explorer.

Dick
Post Reply