Painless Custom Toolbars (No Morphine/Tourniquets Required)

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

pj
Gold Member
Gold Member
Posts: 516
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Painless Custom Toolbars (No Morphine/Tourniquets Requir

Post by pj »

Kilmatead wrote:Yeah, it's always the little things that can trip us up. My particular problem was coming from a Comodo Security process that kept interfering - but my personal favourite was that if the user had x2's "Daily hints" thing set to show on startup, even after that hint window was dismissed it was not actually destroyed and thus left a ghost 32770 class associated with the x2 parent window.

I figured that Nikos had done that intentionally just to mess with my head, as I could find no other practical reason behind it.

For public scripts, I try and avoid using window titles as identifiers since they'd be English OS-specific, while _WinWaitChild_32770() is language agnostic. Yes, overkill for a mere script, but robustness 'twas ever was a hard-won maiden. :wink:
So will this fail the same way as LocaleSearch when certain nameless beasts are running at the same time?

Also, does the "32" in the name imply a need for a "64" version, or does this run on x32 and x64 OS's and X2 varieties?

----------------------------
PJ in (darn it's hot :lol: ) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Painless Custom Toolbars (No Morphine/Tourniquets Requir

Post by Kilmatead »

pj wrote:So will this fail the same way as LocaleSearch when certain nameless beasts are running at the same time?
Yes. Modify this source the same as the other, if your errant beasties are stubbornly ungallant. This is the best I can do while remaining linguistically agnostic, which I consider to be the higher calling. And I always follow the higher calling, when given a choice. :wink:
pj wrote:does the "32" in the name imply a need for a "64" version, or does this run on x32 and x64 OS's and X2 varieties?
It runs on anything. The 32 in the name is just a legacy class-name thing that often arises in the Win32API nomenclature (ironically differentiating it from 16-bit, not 64-bit). The contradiction-in-terms notwithstanding, I kept it as a throwback just for fun. :D

For example, if you were to drill-down into the x2 GUI (regardless of bit-type), the "ToolbarWindow32" class is contained within a RebarWindow32 class control, and so on. There actually are no specific API "64"-suffix classes, as that would be redundant, since the only real code-difference is the architecture pointer-size and the availability of 64-bit registers within (and extending) the x86 instruction set.

It's like trying to explain to people that despite appearances the System32 folder (in C:\Windows) really is the one containing 64-bit code, whereas the 32-bit binaries (traditionally called x86) are held under SysWow64. People's eyes tend to glass-over fair quick.

And just in case that sort of thing doesn't get your bitwise blood going, you can confound and amaze your drinking buddies with the Should UTF-16 be Considered Harmful? question. Even though UTF-16 is ubiquitous under Windows, it's not actually the authoritative word on understanding what Unicode compatibility really is, and how programmers might handle it.

Not everything is what it appears to be when it comes to the scary world of WinAPI. :D
pj
Gold Member
Gold Member
Posts: 516
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by pj »

Any chance this tool can be extended to copying toolbars between layouts?
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by Kilmatead »

Not possible (without lots of penicillin and quantum-gymnastics), sorry. Toolbar contents are all tucked away within x2's binary chastity belt, and messing with alternate-layout registry/INI contents is a recipe for chlamydia, syphilis, and all sorts of un-fun gifts that no knight-errant would ever wish to be granted by his wife whence returning from battle.

Some dark places are best left un-poked and un-prodded, even for the most ardent of suitors. :wink:
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by Kilmatead »

Small update to 2.0.4 for compatibility with x2 version 3.4.0.2

(Nikos really shouldn't be allowed to meddle with his own code without parental supervision anymore - he keeps changing things so insignificant that he thinks no one would ever notice, yet these changes always accumulate to upset my precision-balanced toys. Damn his tinkering. :wink:)

Use download-link in the original post above.
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by FrizzleFry »

I am getting this error

---------------------------
AutoIt Error
---------------------------
Line 15956 (File "C:\tools\x2tools\x2Toolbar32_x64.exe"):


Error: Subscript used on non-accessible variable.
---------------------------

when running x2Toolbar32_x64.exe from a toolbar button.

The error happens when I pick the toolbar.

This was the button's original command line:
>C:\tools\x2tools\x2Toolbar32_x64.exe /Menu /Plain

I also tried these:
>C:\tools\x2tools\x2Toolbar32_x64.exe /Menu
>C:\tools\x2tools\x2Toolbar32_x64.exe
but get the same error.

Running from address bar works though. Also double-clicking the exe file works

I have not run x2Toolbar32_x64 in a while so I'm not sure if this started with v6 or before.
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by Kilmatead »

FrizzleFry wrote:Running from address bar works though. Also double-clicking the exe file works
You know, had you just waited 17 days it would have been exactly 7 years since this was last updated. Symbolism matters. Sometimes I feel like a reborn cannibalistic Mayan with dysentery, especially when I revisit things I barely remember writing. :D

That said, try the link on the first post again, I updated it to 2.0.5 as I do vaguely remember some odd issues that Win10 had with it and Win7 didn't, which is always the way. If you're using Win11 (speaking of the bloody-flux!), all bets are off and I can't test anything with that.

I can't recreate your issue, even using the /Menu /Plain delimiters (how did I even think to include them years ago?), and it doesn't have anything to do with x2 v6 or even the crumbs/addressbar thingy, which was my first thought (on or off).

Considering it works for you from double-clicking (the complex thing was the funky graphical toolbar selection routine, as I recall), I have no explanation. Hopefully the gods will like the 2.0.5 sacrifice better?
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by FrizzleFry »

I get the same error with the new one except for the line number:

---------------------------
AutoIt Error
---------------------------
Line 17428 (File "C:\tools\x2tools\x2Toolbar32_x64.exe"):


Error: Subscript used on non-accessible variable.
---------------------------

I also get the error if I run x2Toolbar32 from the user command list or from a Menu++ command.

I am running Windows 10 on my current main PC but my newish PC has Windows 11 and I get the same error there.

Since you can't recreate the issue it's probably some x2 setting or something else I'm running. I'll let you know if I figure out what's causing it.
Kilmatead
Platinum Member
Platinum Member
Posts: 4842
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by Kilmatead »

The part that confuses me is that you say it works if you just click the EXE (or run from the addressbar)... that doesn't make any sense as it (obviously) has no idea how it's being invoked. I certainly have no influence over the user-command-list window itself...

Try using the "/NoMove" switch on your command, that should squelch any influence the mouse position/re-positioning might have, based on the thought that the toolbars and the menu are all at the top of the screen, maybe that has something to do with it, given mouse-pos + screen-coordinates can be array challenging...

In an attempt to overload the array I did discover a "bug" in x2 itself: x2 is happy to create up to 12 toolbars but if you try and create 13 x2 itself crashes. But my thingy had no problem with 12 bars, executed from a toolbar button itself.

I don't like bugs I can't recreate and yet are obviously there. :? As it's half-two in the morning and I've got one IDE open with a C project, and another open with this AutoIt thing (which, frankly, I'm a bit rusty at), my brain is turning to mush.
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1255
Joined: 2005 Oct 16, 19:09

Re: Painless Custom Toolbars (No Morphine/Tourniquets Required)

Post by FrizzleFry »

It was the damn pop-up info messages that were causing the problem! One of the new features in v6.
I disabled then from the advanced settings editor by searching for caption in global settings.
I guess it was working from address bar and double-clicking because they do not cause a pop-up message.

You can ignore all this rambling below now.

I still get the error using /NoMove when running from toolbar button.

I removed all x2 settings so I could test with a clean instance but I still get the error.
So it does not seem to be any of my x2 settings that is causing this error.

I'll try creating a clean install VM to see if it works there.

I agree that it is weird that it works from address bar and by double-clicking but not from toolbar button or user command list.

I ran x2 5.5.0.1 with clean settings and with my regular settings and x2Toolbar32 works from toolbar button.
So it seems that it is x2 v6 that is causing the problem for me.