xsharp.eu • What to use for Shell.Explorer?
Page 1 of 1

What to use for Shell.Explorer?

Posted: Mon Jun 27, 2022 2:32 pm
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

What to use for Shell.Explorer?

Posted: Mon Jun 27, 2022 2:38 pm
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

What to use for Shell.Explorer?

Posted: Mon Jun 27, 2022 3:44 pm
by FFF
Robert,
i'd suppose, Dick asks for a replacement of the functionality, not the resurgence of finally dead IE...

What to use for Shell.Explorer?

Posted: Tue Jun 28, 2022 12:06 pm
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