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?
Well the webbrowser control is an ActiveX, so it implements IOleControl::OnAmbientPropertyChange. The host can call the method to notify the webbrowser control about the property change after the browser window is created. The list of ambient properties can be found in the walkall sample, the most useful ones are DISPID_AMBIENT_USERMODE (which VB6 supports), DISPID_AMBIENT_DLCONTROL and DISPID_AMBIENT_USERAGENT. The documentation of other ambient properties can be found in the documentation of CComControlBase’s GetAmbient Property Methods
Note the knowledge base article PRB: WebBrowser Control Clients Share Global Settings also says DISPID_AMBIENT_USERAGENT cannot be used to alter the user agent string in DOM or when the navigation is from code. Changing the user agent string in registry, of course, can change the behavior but will also have global effect.