Windows xp Change Wallpaper to Webpage - windows

To do this manual i just pick a html file in the change wallpaper dialog and tada works..
but if i want to do this from code what api calls / reg keys must i change?
Iv tryed this SystemParametersInfo (WinAPI) didnt work and i have found out that "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\Wallpaper" and "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme\Wallpaper" are changed to the html page.. but just editing those to from code does not change the wallpaper..

In order to use HTML as wallpaper, ActiveDesktop needs to be enabled first. Assuming that is already the case, then the IActiveDesktop interface has a SetWallpaper() method available. Have a look at MSDN's "Using the Active Desktop Object" article for how to access IActiveDesktop.

Related

How to change the title/caption of MFC SDI documentless application

I can't find a working solution to change the title of my MFC SDI application. I don't use document/view. I need to change the title according to internal state of the applicaiton.
I've tried CMainFrame::SetWindowText from my main app module in InitInstance - with no luck.
I've tried to change CMainFrame::m_strTitle member variable and call OnUpdateFrameTitle(TRUE) after that - still no luck.
Inside OnTimer procedure - calling AfxGetMainWnd()->SetWindowText(_T("title from OnTimer")); - it does not work either.
What am I missing? That should be a common and simple task, shouldn't it?
EDIT: I'm sorry, it seems SetWindowText is working, just need to properly compile my app.
That's all my fault.
Overwrite CMainFrame::PreCreateWindow.
Clear the style FWS_ADDTOTITLE
cs.style &= ~(LONG)FWS_ADDTOTITLE;
Now it should be possible the window caption in any way you like.
The Default window caption is taken from the string resource with the ID AFX_IDS_APP_TITLE.

Use Firefox 'print' or 'save as' features using Selenium WebDriver

I would like to programatically instruct Firefox to visit a list of URLs (defined in a text file, for instance) and for each of them save the page to disk or print it.
I know Selenium provides a feature to capture a screenshot of the page, but I would like to know if it's possible to use browser's native saving and printing features.
If Selenium does not provide such features, would any other tool allow me to define a script to be executed by Firefox and achieve similar results?
It is possible to enable silent printing in firefox to print to the default printer, bypassing the print dialog.
The required firefox preference is print.always_print_silent, and can be setup with selenium like so:
import org.openqa.selenium.JavascriptExecutor;
/* ... */
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("print.always_print_silent", true);
WebDriver driver = new FirefoxDriver(profile);
Now simply navigate to a web page and call print using javascript:
driver.get("http://www.google.com");
((JavascriptExecutor)driver).executeScript("window.print();");
Additionally, couple this with a free PDF printer such as novaPDF to print without displaying the Save as dialog and automatically save a PDF to a predefined location.
If you are fine with png format, you can take full page screenshot.
import selenium.webdriver
import selenium.common
options = selenium.webdriver.firefox.options.Options()
# options.headless = True
with selenium.webdriver.Firefox(options=options) as driver:
driver.get('http://google.com')
time.sleep(2)
root=driver.find_element_by_tag_name('html')
root.screenshot('full page screenshot.png')
Normally you would do this using Sikuli API. The open source community (a.k.a. Mozilla foundation) is working on a project called Marionette that supposedly will enable you do do these things without using screenshot matching but it's still alpha and they are still working on it and Chrome and IE haven't signed onto it yet.
It should be noted that on native file downloads, you don't really need to test the browser functionality of the already well tested save-as dialog. What Selenium testers usually do is just download the file with Apache HttpUtils or something similar and just bypass the browser on the download step. Then you don't need to use the Save-As dialog and it will work cross-browser. Just use selenium to get the download URL and download it with Java code instead.
Maybe this can helps you...
https://stackoverflow.com/a/64987078/6003328
I made this using python...
Basically, I change the about:config settings for each print, adjusting the filename of the pdf to be created, and setting the printer as always_print_silent: true...

ActiveX component to display in-memory MHTML in Windows

I'm creating a small Windows application (C++) which create some windows an such (CreateWindowEx and the like). And in one window I want to add a control that shows MHTML loaded from memory, i.e. the whole MHTML content is in a string, not in a file.
I already tried the Shell.Explorer component, but I can't find a way to inject to it anything other than HTML (see AtlAxCreateControl).
Is it possible to use the Shell.Explorer component or any other to show in-memory MHTML??
That is, without writing the content to a file and then giving the file path. That works, but it's not optimal and it'll have to be the last alternative if I can't do it any other way.
PS: If this can be done in another language or environment like C#, JS, VBS, WSH, HTAs, I'm all ears as well.
A bit late to answer, but still - there is a way to do it : use Microsoft's WebBrowser control (COM component, can be used in .Net apps as well).
Take a look an what the proposed solutions here - How to load mht from stream/string into a WebBrowser control? and here - How to display the string html contents into webbrowser control?. some of them refer to mhtml content but the solutions are applicable to ordinary html files as well.
Good luck.

Use ApplicationBar Icons from other assemblies?

I have a Page in a Windows Phone class library. This page has an appbar. I would prefer everything this page needs to be included within the class library so the setup list for consumers of this page / assembly is minimal.
However, When I set ApplicationBar icons, they get added to the class library project under the folder 'icons' just like normal, they show up fine in Blend, but at runtime they are no where to be found!
When I put the icons in the Windows Phone Application project all is well. However this is not my desired scenario as it is additional configuration / setup by the application author to use my pages.
I tried using the resource pathing using /{AssemblyName};component/icons/{IconName} but of course the AppBar needs them to be of type "Content" not "Resource". So I am thinking this is impossible but I wanted to know if anybody out there figured out how to do this.
Sorry guys. I just figured it out. I changed the newly added icons from "Resource" to "Content" but I forgot to set "Copy if newer" so they weren't getting outputted to the Bin\Debug\icons folder of the windows Phone Application. something to keep an eye on I guess.

Manifest or Theme/Style for a IWebBrowser2 control?

The IWebBrowser2 control has password edit boxes which are squares. This happened many years ago if you were on an XP machine, and you had a password edit field without a manifest file, you would get squares (no character found for the * they put in there with that font). My application has a manifest file. However I don't know how to give a manifest or set the theme or style of the control that is created. Any ideas?
Thanks!
Specify DOCHOSTUIFLAG_THEME in your implementation of IDocHostUIHandler.

Resources