Here are examples of the proposed layout as the thumbnail Gifs that I would import into the DLL file.
Main Topics
Browse All TopicsHello Experts
The Windows Picture and Fax Viewer runs from the "Preview" or "Open" command for image file types:
rundll32.exe C:\WINDOWS\system32\shimgv
When I "Preview" an image in the Windows XP (SP3 with IE7) Windows Picture and Fax Viewer, the "Print" option open the "Photo Printing Wizard". I am pretty sure this function is built-in rather than being from one of the XP PowerToys.
Although these processes are crearly tied in with Windows Explorer, The UI elements (or most of them) for the "Photo Printing Wizard" seems to be loaded from the resources in:
%SystemRoot%\system32\phot
Those who have used this wizard will be aware that on the 4th screen of the dialog, ie. after you are welcomed, select your image(s), and select the printer, you are offered various "templates" as "available layouts":
Full Page Fax Print
Full Page Photo Print
Contact Sheet
20 x 25cm Cutout Print
13 x 18cm Cutout Prints
10 x 15cm Cutout Prints
10 x 15cm Album Prints
9 x 13cm Cutout Prints
Wallet Prints
These templates are completely independent of any other options offered by the default printer or other virtual printers, and are loaded from the internal resources of %SystemRoot%\system32\phot
I have copied out the XML code from that resource by viewing the contents of the *.DLL in "Resource Hacker", and pasted the code into the Code Snippet.
I am pretty dumb at *.XML coding. I can understand some of it, but tend to get lost. I can see, however, that each template layout is specified using x and y coordinates, and also width and height parameters.
I was curious to see if I could add a new layout of 6 equally sized images to the page, as this handy one isn't given as an option. I can easily modify any of the XML code within Resource Hacker and then recompile the code, and also create a new *.gif image to try and import into the resources. I am well used to experimenting in this way, but I don't know enough about XML to figure it out.
Looking at the XML code, does this seem possible to any experts well acquainted with XML?
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hey BillDL - the xml isn't that difficult to read, but to determine if what you're trying is possible, you'd simply have to 'try' it...
I wish I had the present environment to try and test this myself, but life has gotten too hectic as of late for me.
However, here's what I'm reading from the file, along with some possibly attempts for you...
Taking one section, the Wallet prints definition, I first see that it has its own unique guid. If that's merely a reference for the definition to be located in the configuration, or a pointer to some other storage location for further description (i.e. the registry), I don't know.
I did a quick scan of my XP device's registry, though this one is still xp2 and ie6, and didn't come up with a registry reference.
So, if it's simply an internal reference, I'd say you could try creating your own unique guid and proceed from there.
<template-def guid="{ac4fb6e0-81a0-47f7-
The next several attributes are fairly self-explanatory (group, title, description, etc).
group="Wallet Prints"
title="Wallet prints:"
description="cropped and rotated to fit"
repeat-photos="no"
use-thumbnails-for-printin
print-filename="no"
can-crop="yes"
can-rotate="yes">
This next section also leaves me a bit confused - perhaps someone else has better insight, but it appears to be another external reference of some sort, but may also be simply configurable references...
<!-- _locID@group="Wallet Prints"-->
<!-- _locID@title="Wallet prints:"-->
<!-- _locID@description="croppe
Next, I'd suppose you'd need to apply a thumbnail image to point to here, replacing the gif filename with yours above perhaps...
<preview-image res-name="thumbwallet.gif"
The 'meat' of the definition is in the layout group:
<layout>
You have the main area defined first:
<imageable-area x="0" y="0" w="77500" h="100000"/>
Then you'll see three sub-groups: the first starting at pos (0,0) with the width/height shown, the next starts at vertical position 26250, the final at 52500
<image-def x="0" y="0" w="25000" h="32500"/>
<image-def x="26250" y="0" w="25000" h="32500"/>
<image-def x="52500" y="0" w="25000" h="32500"/>
The next row would contain the same three columns, but starting at horizontal position 33750:
<image-def x="0" y="33750" w="25000" h="32500"/>
<image-def x="26250" y="33750" w="25000" h="32500"/>
<image-def x="52500" y="33750" w="25000" h="32500"/>
and then finally at horizontal 67500:
<image-def x="0" y="67500" w="25000" h="32500"/>
<image-def x="26250" y="67500" w="25000" h="32500"/>
<image-def x="52500" y="67500" w="25000" h="32500"/>
So, the attempt that I would try would be something like the following, hopefully providing what you're looking for.
If not - I had fun trying. :^) Good luck!
Thank you sirbounty
Yes, I had considered the unique GUIDs and searched the registry for them. It would appear to only be an internal thing, because none are stored in the registry. I also checked for temporary registry values and temporary files created at runtime, but can't find any external references to the GUIDs (with or without the hyphens). Obviously there may be implications if other program files are hard-coded with the GUIDs that are in the XML code, and may not recognise one I may try to add myself.
I was also puzzled by the _locID@group=" lines, and assumed that because they seemed to be enclosed in <!-- "--> like JavaScript style, that they were programmers' comments.
You have explained the way the rows and columns are defined very well and it falls right into place with a more visual representation as I look at it now, thanks to your breakdown.
One of the reasons I was trying to create a different layout was to try and avoid the cropping of images. That's the annoyance of the "Photo Printing Wizard" with some layouts. I've tested the printing using a virtual pdf printer and it hacks off significant slices of some images, depending on the layout.
For the full page single image prints, there are two options. One centres and only rotates to fit the page orientation, but the other crops and rotates to fit the page orientation. Fair enough, just use the one that doesn't crop anything, but for the multi-image page layouts (except the contact sheet), they all crop images.
That's obviously dictated by the instruction:
can-crop="yes"
and this occurs (obviously) for those layout types with the description=" " lines: "cropped to fit" and "cropped and rotated to fit".
I would hope to get a layout that doesn't crop anything, but I suppose that experimentation with images created using standard digital camera image sizes will obviously yield the best layout parameters if I can get this working.
In the end it looks like the program just isn't capable of RESIZING images to fit. The Contact Sheet layout is the only one with the instruction:
use-thumbnails-for-printin
All others say "no". It's probably extracting the actal thumbnail in the image metadata to use for the purpose and it doesn't matter about resizing degradation because the printed thumbnails are tiny anyway.
I have noticed one annoyance with this Photo Printing Wizard. When choosing the "Contact Sheet: 35 Prints per page" layout, you would expect to be able to change the "number of times to use each picture" to "35" and have it display the preview at the right to reflect this after a short delay. Not so. That field can only accept "15" as the maximum number. It will only scroll up to 15 using the clickable up arrow, and if you directly enter and overwrite 15 with 35, it reverts back to 15 after a short delay. Pressing Enter to try and force the value in the field (like MS Word font sizes below 8 or MS Word custom zoom size) just operates as an OK or Next command and prints. The Print Preview panel at the right never shows more than 15 thumbnail images, and the printout matches the preview. Very annoying.
This is pretty stange, given that the definitions in the dll's internal XML page clearly show 5 columns (0, 16250, 32500, 48750, 65000) x 7 rows (0, 14285, 28570, 42855, 57140, 71425, 85710) = 35 for the "Contact Sheet Prints" layout template.
Going back to the <!-- _locID@description="whatev
<!-- _locID@description="40 prints per page"-->
From that, I assume that these lines are just programmers' comments and that 40 per page was one of the originally tested layouts and the comment wasn't changed after they decided on 35 instead.
Anyway, I am going to do some experimentation after I figure out how to stop the original C:\WINDOWS\system32\dllcac
Thanks again for your insight. I'll leave this open for a few days or a week until I get the chance to mess with it.
You're probably right now that I look at those lines - they do appear as comments.
No problem if you want this one deleted - after I read through it, I was intrigued by it and thought I'd spend a few moments trying to dissect it. Again, it's not something I've ever done, and would have little experience on - so most of my comments are just my own interpretations/theories.
Best of luck to you - have fun! :^)
Aaaah, but your "interpretations and theories" are invaluable, and thanks for your time dissecting it.
Out of interest, what did you use to inspect it? Visual Studio? Or did you just use the Resource Hacker program I used?
I was intrigued like you when I discovered the guts of that particular DLL and wondered if it was possible to improve it. I have inspected, modified, and recompiled a lot of Windows dll, exe, cpl, and ocx files over the years with that handy little resource hacker tool, and learned quite a few things in the process.
For example, I was ticked off at the fact that Windows XP's MSConfig dialog isn't wide enough to make it useful in the Boot.ini and Startup tabs, so I modified and widened it.
I keep meaning to install Visual Studio Express and try to learn something useful from scratch, but I never seem to have the time.
For anyone interested in the Windows File Protection issue.
<disclaimer>
Given that this DLL is not one that is crucial to whether Windows will boot and run normally, I determined that it wasn't too risky to mess with it. Any other Windows System File would obviously have to be evaluated for importance.
</disclaimer>
Move C:\Windows\system32\dllcac
Modify the C:\Windows\System32\photow
You are informed that an important protected system file has been screwed with and needs to be restored, but seeing as it can't find it in the "dlcache" folder, it will prompt for the Windows setp CD. Click the Cancel button and it will ask you for a final confirmation about whether you wish to keep the potentially "unsafe" file version. Say yes.
Make a copy of the modified photowiz.dll file, Right-Click on it and choose "Properties". Under the "General" tab, click the "Advanced" button. Check the box entitled "Compress contents to ave disc space". Click "OK", then click "Apply" in the file properties dialog. Click OK to close the properties dialog.
Move that modified and compressed file to the C:\Windows\system32\dllcac
If C:\Windows\System32\photow
Hi sirbounty
Well, i's working fine with the new layout template. It was trial and error and looks as though the new definition tags have to be placed in the XML file in alphabetic order to match the name of the GIF resource. Because my GIF was named "CUSTOM.GIF", it came at the top of the resources in the Resource Hacker as can be seen by the first screenshot.
To get it to work, I needed to add the new layout definitions block as the very first set of definitions in the XML File (Attached as a *.txt file).
I have attached two screenshots:
1. Shows the new layout template in use when using the "Photo Printing Wizard" from the Windows Picture and Fax Viewer
2. Shows the "print" rendered using my virtual PDF Printer and opened in Foxit PDF Reader using the layout as printed (ie. not rotated).
It's clear that it does not crop the images, it only resizes to fit. The original image was a 1600 x 1200 *.jpg image, but I have tested also using 2400 x 1200 images, 1024 x 768, 800 x 600, etc, and none are cropped. This is because I modified the XML resource where it defined the following:
can-crop="yes"
can-rotate="yes"
to
can-crop="no"
can-rotate="yes"
You will see from my example image in my original question showing two examples of GIF "layout" thumbnails that I created one with 6 vertically orientated images and the other showing them horizontally. Your modification created the template for horizontally orientated images, so I used the GIF to match the printed layout.
My next attempt will be to try and create a new set of definitions so I have a template to match the 6 vertically orientated images in the other GIF file. Maths was not, and still isn't, my strong point. In fact I'm really pretty bad at working out this type of "array" structure and visualising it, but I'll have a go at it.
So, thanks for helping with a proof of concept and a working and useful modification. You'll see from my last screenshot that I quite like modifying programs. Look at the arrow ;-)
Thank you
Bill
Oh by the way, it would seem that the GUIDs are not related to anything outside of the program. I did search regedit and "all files containing text" for the new GUID you gave, and for the other ones already in the XML file. None were found, so I was confident that there would be no conflicts, but I don't think it would matter. Better to try and avoid duplicated usage though, just in case.
Nah, I've seen your photo, so I knew it wasn't you. :^)
The GUID above was generated from .Net (System.Guid.NewGuid.ToStr
Great work here - you're more persistent than I would have been, but I suppose necessity is the mother of all inventions, eh? Thanx for the grade - glad I could help (what little I think I did!).
Hmmm. That's an old photo now, when I had hair and a 70's porn-star moustache, if it's the one Pete Long has in his "rogues gallery" along with your own mugshot. Maybe it's time to update my photo and give you a fright.
You read my mind about GUIDs. I was just sitting thinking about whether there is some worldwide database of previously used GUIDs that programmers look up. Every time I look at the Class Identifiers (CLSID) keys and values while checking out things in Regedit or in *.reg files, I wonder why program setup packages don't sometimes overwrite existing values or keys in the registry.
I don't have Visual Studio .NET installed, so I can't test the generation of new GUIDs. Given that it appears to be a featue new to .NET it won't be available from a VB Script, and I'm sure the presence of the .NET Framework doesn't qualify as a library souce.
Hey, I am enjoying. Quite amazing really. I should have studied all this stuff a long while ago. Many thanks for that additional information. I'm sure I'll find a use for it some day soon, but it's very handy to keep a note of for informational purposes even if not.
If you want some interesting reading, here's some real meaty stuff to digest:
http://en.wikipedia.org/wi
http://en.wikipedia.org/wi
http://blogs.msdn.com/oldn
Happy reading, and see you in my next question which will be:
(a) how to convert time stamps in the registry to normal time
or
(b) how in a batch file to convert a comma-separated string, that is a file size in Bytes, into KB or MB
Actually (b) is a live one under my consideration right now at http://www.experts-exchang
Cheers
Bill
I gave up, for the most part, trying to pull blood from a stone using batch files. It used to be fun, and I know for some of the site's batch experts it still is. But once you learn how to do things in vbscript/wsh/wmi, etc, it's almost comical to think I wasted so much brainpower on batch file conversions..
And we've got enough of those experts still hanging around that when I do see one that interests me, I don't even try because I know it'll take much more testing for me to formulate a working function than those that still eat and breathe batch scripts. :^)
Business Accounts
Answer for Membership
by: BillDLPosted on 2009-03-22 at 06:18:29ID: 23951400
Oh yes, and before you ask, yes I do have several other ways to do multi-page prints (Paint Shop Pro, an Epson program, etc). This is just a challenge to see if I can keep it all in one place using what Windows XP has available.