Posted in 2009

How to force popup window to navigate in the same window in a webbrowser control

When clicking on an link that targets a new window,  the default behavior of a webbrowser control host application is to open a new window in Internet Explorer. User ben_lai wants to know how to handle the click and navigate to the same window.

There are three events that notifies a new window, NewWindow (The current documentation of this event is wong, check http://support.microsoft.com/kb/185538/EN-US/ for the parameters of the event), NewWindow2 and NewWindow3, each one has a cancel parameter to stop the new window being created, though for NewWindow2, it requires cooperation of BeforeNavigate2 to get the url of the new window. After getting the url, the navigation can be carried out in the original window by calling Navigate2. The obsolete NewWindow Event has the url right in the parameter so you can cancel the navigation and call the navigation methods of the webbrowser control with the new url.

Read more ...


Getting local FTP home directory from IIS programmatically

User xiaoc1026 wants to know how to access IIS to get the home directory of the FTP web site in Visual C++.

Before IIS6 you need to access the metadata in IIS configuration via IMSAdminBase::GetData. The hard part to find the path of the IIS setting. Before IIS 6, the metadata isn’t saved in XML. However you can search the path of a property though the admin script. You can find the path property from the IIS metadata propertiy reference documentation.

Read more ...


Visual Studio 2010: Class Wizard重返Visual C++… Control Shift X.

image

在消失4个版本之后,类向导终于重返Visual C++。新的功能:搜索现在可以部分匹配而不是从字符串开始匹配。

测试版还是存在一些问题,向导不是总能找到现存的函数,以致删除函数功能不是总有效。在打开很多文档的时候尝试打开Class Wizard会出现“value does not fall in expected range” 错误。再就是性能问题,打开的文档越多,类向导启动所需的时间就越长。

Read more ...


Intercept the download dialog in webbrowser control

User rsd102 looks already find the solution to his question when he posted the question to CSDN, except for one missing piece. The sample he found is for overriding the global download manager, and what he need is a process wide override.

It looks like rsd102 is loving research. He found more than he can understand initially. After being suggested twice with the vague IE SDK documentation he decided to post the sample code he was working on. And when the final answer was given he had problem adopting it.

Read more ...


Make the webbrowser control styled the same way as the hosting application

User wtx_sonery wants to know whether it is possible to style the webbrowser control with the rest of the application.

The answer is yes, you can implement IDocHostUIHandler’s GetHostInfo method and return DOCHOSTUIFLAG_THEME in the host flags.

Read more ...


How to change the user agent and download control flags in a webbrowser control host

User vnetvvv wants to know how to change the user agent string in a VB6 webbrowser control.

The knowledge base article PRB: WebBrowser Control Clients Share Global Settings provides the necessary code for changing the user agent of the webbrowser control when the webbrowser ask for it. But how to have the webbrowser control ask for the user agent?

Read more ...


How to disable navigation sound in webbrowser control

User kill211 does not like the click sound when he calls WebBrowser.Navigate. He wonders if there is a way to disable it without modifying HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating, which has effect on other applications.

Unfortunately, the API for disabling sound is introduced in IE7. The FEATURE_DISABLE_NAVIGATION_SOUNDS feature can be toggled using registry or the CoInternetSetFeatureEnabled API.

Read more ...


the Windows Server 2008 SP2 and Windows Vista SP2 Beta program has concluded.

Nice run uninstalling pre-release SP and installing the RTM version…

Read more ...


Talking about Windows XP APIs

Photobucket has deactivated the accounts of all free users and I have no idea what was in there now. Therefore I cannot find what this post was talking about. Probably the API for various parts of Windows.

image1 http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss` <http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss>`__` <http://feed728.photobucket.com/flash/rss_slideshow.swf?rssFeed=http://feed728.photobucket.com/albums/ww283/jiangsheng/Windows%2520XP/feed.rss>`__image2image3

Read more ...


Walkaround for Error : An add-on for this website failed to run. When opening Visual C++’s Add Variable Wizard after IE 8 is installed

Update: it looks like a lot of people are hitting this page by mistake. If you don’t write software for a living then this page is not for you.

The program is lost, but what it does is basically copying the entries from the restricted zone to the 1000 zone (custom zone of VC++ Wizards engine). In addition it has a REG_DWORD value set to 0 for name “1207”. IE security zone settings are stored in the registry path HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones

Read more ...


415 Unsupported Media Type when WSE is NOT configured

I have a web service that runs fine on my Windows XP. However, when I deploy to the production server, the web service returns 415 Unsupported Media Type when calling.

I have seen this error when WSE is not enabled on the client. The problem is, the web service is NOT using WSE. so I did the usual, uninstall ASP.Net, reinstalling, adding asmx extension to IIS, same error.

Now I need to fire a debugger to see what’s going on. Surprisingly, Microsoft.Web.Services3.dll is loaded even when there is no trace of it in my projects. Now I probably know what’s going on. There is another web service in a different virtual directory that uses WSE.

OK, I will isolate my web service to a new application pool. Well, that does not help. In the end I have to add WSE configuration to both my web service and my Windows client.

Read more ...


Links

Today’s link spam:

New warning message in MFC9:Warning: Creating dialog from within a COleControlModule application is not a supported scenario. Comments: when people takes the time to add a warning, there must be a reason.

Read more ...


Microsoft MVP, MSDN Forum Influencer

今年微软最有价值专家的奖品好重,是一个很大的水晶奖杯

20090129234731

后面那个红红的忘记是去年的最有价值专家还是最有影响力开发者的奖杯了,前后脚到的。微软中国也比较浪费,不同项目的奖品也不一起邮寄。

刚刚又收到英文MSDN论坛的通知说我是MSDN Forum Influencer,奖励一个背包,我的2004年MVP奖的那个背包要挂了,正好能用上。

Read more ...