How to suppress SaveFileDialog from WebBrowser?
![](https://techprofile.blob.core.windows.net/images/PKYH8VB1GEakKfKumq6eaw.png?8D9FC3)
Mattia Fanti
356
Reputation points
I'm working with a WebBrowser control on a website that download files, but unfortunately it open a savefiledialog automatically. I looked for this problem online and I only found This SO topic where the code reported in c# is
GetClassName(hWnd, ClassName, ClassName.Capacity);
GetWindowText(hWnd, DialogTitle, DialogTitle.Capacity);
DialogHandle = FindWindow(DIALOG_CLASS, DialogTitle.ToString());
if (ClassName.ToString() == DIALOG_CLASS && DialogTitle.ToString().Contains(TempFilename))
{
ReturnValue = SendMessage(DialogHandle, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
}
How can I Actually use it on vb.net? I've tried to converted it on vb.net through a c# to vb.net converter but they seems not to work for this code.
Thanks