Skybound Software is looking to hire experienced C# developers to work on Stylizer and other forthcoming Skybound products. Click here for details.
GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control. Download GeckoFX @ Google Code >
GeckoFX is made by Skybound Software, authors of Stylizer—the professional CSS editor with a strong focus on visual control, error-free workflow, and productivity. Learn About Stylizer >
Discuss GeckoFX, the Open-Source Gecko Control for .NET
You are not logged in.
Pages: 1
Is this the proper way to show the download manager? I'm only asking because it works and without using the navigate("javascript:") hack.
Interface:
[Guid("ca7663d5-69e3-4c4a-b754-f462bd36b05f"), ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface nsIDownloadManagerUI
{
void show(nsIInterfaceRequestor aWindowContext,uint aID,short aReason);
bool visible();
void getAttention();
}In GeckoWebBrowser.cs:
//After Region: protected override void Dispose(bool disposing)....
nsIDownloadManagerUI DLManager;
//In: protected override void OnHandleCreated(EventArgs e)...
//After: BaseWindow.Create();
DLManager = Xpcom.CreateInstance<nsIDownloadManagerUI>("@mozilla.org/download-manager-ui;1");
DLManager = Xpcom.QueryInterface<nsIDownloadManagerUI>(DLManager);
//Somewhere in GeckoWebBrowser.cs:
/// <summary>
/// Shows the download manager
/// </summary>
/// <param name="SelectedDownload">index of the download to select when the manager is shown</param>
/// <param name="Reason">the reason why the manager is being shown. pass 0 for user interacted or 1 for new download</param>
public void ShowDownloadManager(uint SelectedDownload, short Reason)
{
if (!DLManager.visible())
{
DLManager.show(null, SelectedDownload, Reason);
}
else
{
DLManager.getAttention();
}
}Offline
:)
TY ALOT i been trying 2 do this i cannot belived it worked :P
Offline
When I try this method to show the download menu I get an InvalidCaseException was unhandled and DLManager.show(null, SelectedDownload, Reason) is highlighted.
Am I missing something?
Offline
Try this:
ChromeDialog dialog = new ChromeDialog();
dialog.Name = "DownloadsForm";
dialog.Show();
dialog.WebBrowser.Navigate("chrome://mozapps/content/downloads/downloads.xul");Last edited by websfera.pl (August 22, 2009 10:50 AM)
Offline
jdogg172 wrote:
When I try this method to show the download menu I get an InvalidCaseException was unhandled and DLManager.show(null, SelectedDownload, Reason) is highlighted.
Am I missing something?
Make sure you are placing the interface declaration in nsInterfaces.cs. Also, make sure
nsIDownloadManagerUI DLManager;
isn't null - the code I provided has no error checking.
Offline
I replaced XULRunner 1.9.1 with 1.9.0 and it worked perfectly. Any reason why? I am going to try it with the new XULRunner later using your suggestions.
One issue however is that the clear list button does nothing on the download manager? Any ideas why?
Offline
jdogg172 wrote:
I replaced XULRunner 1.9.1 with 1.9.0 and it worked perfectly. Any reason why? I am going to try it with the new XULRunner later using your suggestions.
I don't know why it isn't working with later versions of xulrunner -- i've used later versions than 1.9.0 and it still worked.
jdogg172 wrote:
One issue however is that the clear list button does nothing on the download manager? Any ideas why?
My suspicion is that xulrunner isn't handling the underlying method that is called when the button is clicked. It isn't anything that can be handled externally by an application that is using GeckoFX -- unless you can hook the api call from an unmanaged dll and handle the call in your application. That would take a lot of work and unless it's worth it to you I wouldn't bother with it and call it a bug.. specially if the project is just personal.. <-- that's just my opinion .. Good luck with your project
Offline
softwerx wrote:
I don't know why it isn't working with later versions of xulrunner -- i've used later versions than 1.9.0 and it still worked.
But we're talking about 1.9.1 - download manager doesn't work as it is in 1.9.0.* versions. I'm using it under 1.9.0.13.
softwerx wrote:
My suspicion is that xulrunner isn't handling the underlying method that is called when the button is clicked. It isn't anything that can be handled externally by an application that is using GeckoFX -- unless you can hook the api call from an unmanaged dll and handle the call in your application. That would take a lot of work and unless it's worth it to you I wouldn't bother with it and call it a bug.. specially if the project is just personal.. <-- that's just my opinion .. Good luck with your project
Xulrunner soesn't handling any of XUL methods. I've tried many XUL apps, and nothing happens. Isn't it bug in GeckoFX?
Offline
Hi all.
Sorry for bumping this topic, but for some reason I can get the Download Manager to show using the code provided in the first post, but unfortunately, I can't seem to download files.
I'm using XULRunner 1.9.0.16
I have a 64-bit OS, but it shouldn't matter since I set my projects to compile only to 32-bit code.
Anyway, If I click on a download link, this dialog appears:
Any Ideas?
Thanks,
Marcello
Offline
*bump*
Is there any known way to fix it for my program?
Offline
The file you're looking for is part of the geckofx source code.
Your best bet is to DL the source and add it to your solution.
Offline
Which part of GeckoWebrowser.cs do you paste the code to can you give me the line number?
Offline
Does downloading works under 1.9.0.1 if i add this?
I want to know sure before i try :p
Greetz.
Offline
Pages: 1