C# Webbrowser Programmatically Close JS Confirm Box
while using webbrowser control, I need to programmatically auto close a javascript confirm box. I used below user32.dll approach and it is working fine on OS which are based english language. [DllImport("user32.dll", CharSet = CharSet.Auto)] static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); But if the computer running non-english OS, it is not working fine as I am using "OK" as text in above method call. One approach which I suppose can work is I should detect OS language and then use translated "OK" text to use above method. Here my question is can I