How to apply changed settings from regtry to running AxWebBrowser control?

A

Andy Chen

Hi,

I am using AxWebBrowser control and I met a problem. I need to browse
several different languages page. I have to change the default IE language
setting at runtime.
This can be done by change the key value of
HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\International\AcceptLanguage. But the new setting won't apply to
the current AxWebBrowser control instance unless I close and reopen the
program or hit the OK button on IE Internet options dialog. Anyone have any
ideas on this?

Thanks very much!
Andy
 
N

Nicholas Paldino [.NET/C# MVP]

Andy,

I would use Spy++ and monitor the messages that are sent to the
webbrowser control when you make the change and hit OK to the dialog. I
would be willing to bet that a windows message is sent to all top level
windows which indicates that a change has occured. Spy++ will help you
determine what it is.

Hope this helps.
 
A

Andy Chen

Thank you for your response!
I tried Spy++ on IE window and found a WM_SETTINGCHANGE message was sent to
the IE window after hitting OK button.
I used the following code to sent this message in my program (some of the
parameters are not listed):

USER32.SendMessageTimeout(pHWnd, (uint)USER32.WM_SETTINGCHANGE, pwParam,
plParam, USER32.SendMessageTimeoutFlags.SMTO_BLOCK,
5000, out pResult);

According to the descritption on MSDN for SendMessageTimeout method, this
message should be sent to all top-level window, but when I use Spy++ to
monitor one of the IE window, I found it didn't received this message. I
don't know why.

Nicholas Paldino said:
Andy,

I would use Spy++ and monitor the messages that are sent to the
webbrowser control when you make the change and hit OK to the dialog. I
would be willing to bet that a windows message is sent to all top level
windows which indicates that a change has occured. Spy++ will help you
determine what it is.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andy Chen said:
Hi,

I am using AxWebBrowser control and I met a problem. I need to browse
several different languages page. I have to change the default IE
language setting at runtime.
This can be done by change the key value of
HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\International\AcceptLanguage. But the new setting won't apply to
the current AxWebBrowser control instance unless I close and reopen the
program or hit the OK button on IE Internet options dialog. Anyone have
any ideas on this?

Thanks very much!
Andy
 
A

Andy Chen

I have resolve this problem. Thank you very much!
Sorry, I made a mistake just now. I have to set the lParam to "intl" and the
SendMessageTimeoutFlags works.

Andy Chen said:
Thank you for your response!
I tried Spy++ on IE window and found a WM_SETTINGCHANGE message was sent
to the IE window after hitting OK button.
I used the following code to sent this message in my program (some of the
parameters are not listed):

USER32.SendMessageTimeout(pHWnd, (uint)USER32.WM_SETTINGCHANGE, pwParam,
plParam, USER32.SendMessageTimeoutFlags.SMTO_BLOCK,
5000, out pResult);

According to the descritption on MSDN for SendMessageTimeout method, this
message should be sent to all top-level window, but when I use Spy++ to
monitor one of the IE window, I found it didn't received this message. I
don't know why.

Nicholas Paldino said:
Andy,

I would use Spy++ and monitor the messages that are sent to the
webbrowser control when you make the change and hit OK to the dialog. I
would be willing to bet that a windows message is sent to all top level
windows which indicates that a change has occured. Spy++ will help you
determine what it is.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Andy Chen said:
Hi,

I am using AxWebBrowser control and I met a problem. I need to browse
several different languages page. I have to change the default IE
language setting at runtime.
This can be done by change the key value of
HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\International\AcceptLanguage. But the new setting won't apply
to the current AxWebBrowser control instance unless I close and reopen
the program or hit the OK button on IE Internet options dialog. Anyone
have any ideas on this?

Thanks very much!
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top