xplorer2 Resource Updating and Management for Dummies

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

FrizzleFry wrote:I would like to be able to just paste folders into the fields rather than having to use that terrible folder picker but it's not something that should be changed very often.
Yeah, I know - the folder-picker is an in-built routine about which the best that could be said is that "it works", but it's far from ideal.  Like you say, it's not perfect or needed often, but the alternatives (input boxes/drag-drop etc) were maddening to integrate.  At least the folder is preserved, so you only need do it once.

Did it "automatically" locate your x2 install/version number properly?  I had trouble testing that on anything other than Win7 x64.
FrizzleFry wrote:BTW, I just love that larger User command Organize dialog... I would not mind getting res files for some other annoying tiny dialogs... hint... hint...
The one included as example has a different font with the size set to 9 (instead of nikos' 8 size), which probably clashes with your other modal dialogues, but I left it in as it is only an example after all.

Which other dialogues were you interested in?  (Yes, the object here was to inspire people to "do it themselves", but I can be accommodating... having already done them myself. :D)
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

x2RU did not find my x2 or ResHacker install folders but I do not have them in Program Files... they are on D:\tools\<program name>... so I was not surprised.

Well, I did one that has been annoying me for a while... the Change attributes dialog... the date and time fields were cut off a bit for me... probably because I'm using medium size fonts.

I can't think of any others off the top of my head right now but I like what you did with the three examples you included... I use them all the time... especially the User commands organize and properties dialogs... so it would be nice to see what you have done with some others.

A dialog that really needs work is Customize Toolbar but I doubt what I want can be accomplished by resource hacking. Basically there are way too many available buttons for one list... there should be a drop down to let you choose a category... built in, user commands, bookmarks, etc.

I have been rearranging my user commands again so I've had to deal with that monstrosity a lot lately to reset my toolbars... love that toolbar button shuffle!  :evil:
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

If you used the x2 installer to install x2 then ResUpdater should have found even the non-standard location.  If you moved it there manually, then that's a different story.

For the attributes dialogue, follow the instructions for extracting DIALOG 109 to a RES file:

(Herein lies the benefit of using the new GUI!)

1. From within x2ResUpdater just mouse over the "Base" source name [at the bottom of the window, it should highlight blue] and left-click - this will open all the resources in ResHacker so you can extract the one you want

2. Expand DIALOG 109 and highlight (click) the 2057 sub-number (this is a language identifier)

3. Then select Action -> Save Resource as a RES file.  Save it in your resource folder - use any name you wish, as long as it ends with ".RES"

4. Close ResHacker to go back to ResUpdater and click Refresh

5. Re-open the new RES file (right-click context menu in x2ResUpdater).  Replace the entire text found therein with this:

Code: Select all

109 DIALOG 0, 0, 278, 108
STYLE DS_NOFAILCREATE | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Change attributes"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
FONT 9, "Segoe UI"
{
   CONTROL "Set &Modified:", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 146, 12, 46, 8 
   CONTROL "DateTimePicker1", 1075, "SysDateTimePick32", DTS_SHORTDATEFORMAT | DTS_SHOWNONE | DTS_RIGHTALIGN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 25, 68, 9 
   CONTROL "DateTimePicker1", 1076, "SysDateTimePick32", DTS_SHORTDATEFORMAT | DTS_UPDOWN | DTS_TIMEFORMAT | DTS_RIGHTALIGN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 174, 25, 52, 9 
   CONTROL "Now", 1077, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 229, 23, 28, 13 
   CONTROL "Set &Created:", -1, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 148, 42, 62, 8 
   CONTROL "DateTimePicker1", 1078, "SysDateTimePick32", DTS_SHORTDATEFORMAT | DTS_SHOWNONE | DTS_RIGHTALIGN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 104, 55, 68, 9 
   CONTROL "DateTimePicker1", 1079, "SysDateTimePick32", DTS_SHORTDATEFORMAT | DTS_UPDOWN | DTS_TIMEFORMAT | DTS_RIGHTALIGN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 174, 55, 52, 9 
   CONTROL "Now", 1080, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 229, 53, 28, 13 
   CONTROL "&Full Read/Write access for All", 1250, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 22, 87, 117, 10 
   CONTROL "Attributes", -1, BUTTON, BS_GROUPBOX | BS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 6, 78, 73 
   CONTROL "&Archive", 1073, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 22, 18, 41, 10 
   CONTROL "&Read only", 1071, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 22, 48, 50, 10 
   CONTROL "&Hidden", 1072, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 22, 33, 41, 10 
   CONTROL "&System", 1074, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 22, 63, 41, 10 
   CONTROL "ok", 1, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 158, 85, 50, 14 
   CONTROL "cancel", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 218, 85, 50, 14 
}
Then click "Compile", and Ctrl-S to save it.  Close ResHacker, then click Rebuild in ResUpdater and you're done.  I know it's easier if I just give you the RES file, but this will show you how "centralising" resources via ResUpdater makes everything (in the long run) much simpler, if you ever wish to tinker with them yourself.

In any event, the above code will extend the boxes for larger fonts (plus a couple of other things). :wink:

Image

Unfortunately you are correct that Customise Toolbar can't be changed, but not for the reason you suggest.  The real reason is that x2 uses a built-in Windows modal for this particular window, so there actually is no resource to modify within x2.  It can be done if you want to edit the actual Windows Modals themselves (this is possible within System32), but even I do not recommend doing that. :D
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

Well that is a lot off modifications...

I just made minor changes... widened the dialog and padded out the date fields and buttons.

old...
Image

new...
Image

Is there a way to add some space between the check box and the date?
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

FrizzleFry wrote:Is there a way to add some space between the check box and the date?
Other than superfluously padding the date field in Windows date format itself (which would be a bit weird), no - this control is already DTS_RIGHTALIGNed within its scope as a Date/Time picker (which is a little unusual in itself), and that defines the field width - there is no "relative to the checkbox itself" aspect.

And before anyone asks, those "WS_CHILD | WS_VISIBLE | WS_TABSTOP" Styles/Extended-Styles which define the look/behaviour of controls or the modals themselves can indeed be edited to your heart's content, but 99% of the time you're best off leaving them as-is, unless you know what you're doing.  Describing that would be an adventure unto itself - things tend to get rather complex when (for example) someone decides "Hey, let's apply WS_THICKFRAME to the window, and that'll give it an adjustable border!"  Indeed it will, except none of the controls within it have been defined to a flexible binding "grid" so resizing the window doesn't accomplish anything.  Even if you were to go through that much modification, the modal window wouldn't "retain" its size/position upon closure, so not a tremendous amount is to be gained.

I know you didn't ask about that, but I thought I'd mention it in case any of our incredibly numerous overwhelmingly voluminous fanbase was curious. :D

Also, you may have noticed already (or perhaps not), but those "Organize" and "Properties" windows you're so happy with aren't just limited to User Commands - those changes automatically apply to Bookmarks, Folder Groups, and Custom Groups as well.  The RSPCA notwithstanding, it's nice to kill 4 birds with one stone. :wink:

The modifications I did to the Attributes layout were because I could never figure out why setting the Date and Time of a file (which most people probably don't do very often) were placed "first" in the choices, when the real attributes were left squandering in obscurity at the bottom.  Maybe Nikos was feeling biblical that day, pondering to himself "And the Least Amongst you shall be First" and all that jazz.  Anyway, made sense to put them more primary (in my mind).
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

That is a good point... how about this...

Image

I was wondering if taking out the box around the attributes would screw stuff up but it seems to work fine.
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

FrizzleFry wrote:I was wondering if taking out the box around the attributes would screw stuff up but it seems to work fine.
In this instance it's ok to remove because "grouping" (that box label) is only really aesthetic when it comes to checkboxes - however, that grouping box does have significance when it comes to Radio buttons - wherein only one can be active in any given Group - if you disturb the BS_GROUPBOX or WS_GROUP settings therein Windows MFC won't know which buttons to auto-toggle off, so don't try it with those. :D

Take Boolean Rule Definition (DIALOG 108) for example:

Original:

Image

Modified:

Image

The above also serves as another example of grammatical order: when defining a new rule, I don't know about Greek, but in English you say "I want this, and that, or that, but not this", you don't say "I want that and, that or, but this not" (unless you're taking poetic license :wink:), hence I moved the Boolean choice as prefix not as suffix.

(As you can tell, I prefer large "airy" modals rather than trying to shove as much info into as small a space as possible.  I also removed the "help" button ["?" == DS_CONTEXTHELP] in the titlebar as I find such things to be unnecessary clutter. :wink:)
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

The main post has been updated to include a small update, which fixes a few niggling annoyances, and (mainly for beginners) adds an "Auto-Extract" tab so upwards of 26 separate common Dialogs, Icons, etc., may be automatically extracted as individual RES files without needing to faff about within ResHacker's lengthy and confusing tree display.

I continue to hope in vain that somehow, someone, somewhere, will take this small project for walks in the park, feed it regularly, and learn to love the little sounds it makes as it rustles the blankets at night, dreaming of green fields and shiny plastic toys to play with. :D

At 2000+ lines of code, this little guy has grown well beyond his roots in the poor back streets of Dublin outside the gates of Mountjoy Prison walls.  Officially speaking (barring any bugs anyone finds, or significant changes in the structure of x2 resources), I pronounce this project finished.  In case anyone wonders why it has so many bells and whistles for a mere utility, keep in mind that it was largely meant as a means for me to learn the AutoIt scripting language, so I treated it as my own personal whipping post to see how stuff is done in the scripting world (dynamic dropdown menus, et al).  As it sports some built-in entertaining (if limited) GUI file-managing tasks, I feel safe in saying that anyone who who ever decides to write a real File Manager must be more than a few fries short of a Happy Meal, as they say.

We are endlessly thankful Nikos abandoned his first-life as a chemical engineer.  :D

(Of course, reflective syllogism would suggest that if he hadn't, I never would have had to write all this nonsense, and no doubt would have spent more time perfecting the noble arts of hot-wiring cars, chasing skirts, and public oratory - skills every young lad needs to conquer the big bad world - or get his head smashed in on the playground at recess - whichever destiny God doles out to the doleful first. :wink:)
User avatar
kunkel321
Gold Member
Gold Member
Posts: 534
Joined: 2008 Jan 05, 18:58

Post by kunkel321 »

Alrighty then Kilman,  
You've done a pretty good job of making this thing idiot-proof.  Unfortunately I'm an exceptional idiot....

RE the little icons on the Organize dialog
Image
I read were you mentioned making them square rather than Niko's rectangular ones.  This seems to have "cut off" the bottoms of the icons.  I think I correctly changed the shape of the dialog form (as you can see in the picture) to allow more room, but the icons still appear cut off.  Not that it really matters...  Just curious if there's a way for me to correct it...  :lol:
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

This is a DPI issue - if you use the normal default DPI settings in Windows, then the title-bar of the listview does not allow enough space for a full 14x14 square - and thus you have to limit yourself to designing within 14x12.  As I use a default DPI setting of 125, this automatically rescales the size of the bar (irrespective of font-size in the resource) to allow for the extra 2 pixels in height.  When I was designing the example resources, I forgot to take that into account (as I never saw it).

So, either buy a larger LCD and up your DPI, or just suffer the weirdness of living in a 14x12 prison cell.  You can still modify them of course, but instead of taking the bitmap from my example resource, extract it directly from the x2 binary by using the Extract tab in ResUpdater and from the Icons subset, select "Miscellaneous Icons" (Bitmap 222).  

Right-Click the new resource and select "Edit in Reshacker" then select "Action -> Save Bitmap Resources ..." which will create an .RC file (which you can ignore) and another file called Bitmap_1.BMP.  That's the one you want - it's a template of 84x12 which you can modify to your heart's content.  You can close ResHacker as you won't need it again.

Once you have the BMP edited the way you like (save it with any name you want), you can easily replace it within the resource by right-clicking on the original one in ResUpdater and selecting "Quick Image Replace" - this saves you the trouble of going back into ResHacker and doing it manually - Quick Image Replace opens up a search-dialog for you to find your new bitmap, and that's it, the resource is modified, all you need do is click ReBuild.  Like I said, you can delete the .RC file - it's unnecessary.  (".RC" files are an "uncompiled" means of storing resources, but for compound elements they can get unwieldy to manage, which is why I designed around using compiled ".RES" files instead.  They only really come into play when messing with the bitmaps.)

I know all that sounds a little confusing, but once you've done it, it's really rather simple.  And you can easily store different templates as BMP files (the filenames are irrelevant - you can use ZombieKunk.BMP if you want, rather than Bitmap_1), using Quick Image Replace to swap between them, if you feel the need to have different icons for different days of the week.  (Knowing you, you would love that sort of thing.  :wink:)  Or just create multiple .RES files - ResUpdater is intelligent enough to warn you if you have multiple conflicting resources selected - just de-select the ones you don't want to include in that particular DLL build.  (I do this all the time for the Main Icon replacement, but I'm just weird that way. :shrug:)

Sorry about the original DPI confusion - that's what I get for not checking it first.  I should probably modify the example resource for others who are less adventurous than yourself, so the same thing doesn't happen for them - or if you come up with an entertaining 84x12 set, send it to me and I'll just include that one as the example RES.  (But it better be good - no Smurfs, or Rabbits, or girly shite like that. :D)
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

In the on-going spirit of updating things, it should be noted that ResUpdater has received a small update (original post in this thread updated accordingly to 3.0.8.0) - basically just to bring it in line with x2 v2 changes and fix whatever small bugs and oversights from last time as may trouble the kingdoms of men, such as the icon tribulations above.  Full list of changes may be found at the top of the source-code file, for those feteshista-monkeys curious enough to care. :wink:
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

[admin note]:
Posts in an off-topic dis-course have been snipped from this thread and moved to the General Discussions forum.
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

All things considered, given the number of other-people's threads that I've sullied over the years with my off-topic waffle, I reckoned it was only fair to allow one of my own to sink into depravity and prostitution, like the prodigal sons they are anyway. :shrug:  I always feel guilty when you clean up my mess.

Well, ok, not really guilty as such - but perhaps something a little less than my usual smirky self. :wink:  Thankfully that feeling soon passes, and I'm free to write on the freshly cleaned walls with my crayons again!  Yay!
DougalScott
Bronze Member
Bronze Member
Posts: 77
Joined: 2009 Apr 26, 01:52
Location: Townsville, Australia

Post by DougalScott »

Kilmatead wrote:Which other dialogues were you interested in?  (Yes, the object here was to inspire people to "do it themselves", but I can be accommodating... having already done them myself. :D)
While you're offering, is there a resource for the bookmarks menu? I want to extend it so don't have to use the More option which goes and reorders them alphabetically instead of the careful order I have them in. If this is doable I will definitely jump on the reshack band wagon. :)
Edit: Couldn't help myself, I had to download so I can have a play with it - I have a very low anti-distraction quotient. :)
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Unfortunately there is no control over the aspects of MENUITEM "(dummy)" type displays (where a stored list "pops out at you") - that's hardcoded by Nikos.

I think the ergonomic point of the "More" entry is to force people into organising things they use often (at the top of the list) and things they use less-often relegated to the bottom, so you're not swamped with entries.  In this instance, we have no control over the information itself, so we're stuck with the usual "if they're important to you, stick 'em on a toolbar" philosophy.

You could, if you wanted to go through a ridiculous amount of trouble, create keyboard shortcuts for all your bookmarks (you wouldn't need to actually remember them) and then create a separate menu somewhere of bookmarks which would be composed entirely of those shortcut codes which you would have to denote manually (there is an example here of menu-building utilising this method with a couple of custom user commands).  I don't personally recommend this (largely due to the sheer amount of trouble involved if you have a lot of bookmarks), but it would work.

You might also find this amusing, to at least centralise some menu choices.
DougalScott wrote:Couldn't help myself, I had to download so I can have a play with it - I have a very low anti-distraction quotient.
Perfectly safe to play with - you can do no harm as long as you don't try to edit the .EXE directly - there's no benefit to that anyway, which is why this project was created.  (I have a low "people-telling-me-what-I-can't-do" quotient. :wink:)

There is also the Menu Column Break option in the Global tab of "Advanced Options Editor", but to be honest I'm not sure if that extends the total-displayed elements or not, but it may be worth trying.
Post Reply