BranchViewExtended wfx-plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

You were right, sorry.
I haven't Files|Internal Associations in my custom menu. So I confused with "Associate with..." command.

I have no idea why TC doesn't show internal icons :(
I'm not sure whether it possible at all
#213083 Single user license
BranchViewExtended
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Here my copy of FsExtractCustomIconW function (I removed some specific to my virtual system blocks):

Code: Select all

int __stdcall FsExtractCustomIconW(WCHAR* RemoteName, int ExtractFlags, HICON* TheIcon) {
	int l=lstrlen(RemoteName), result=FS_ICON_USEDEFAULT;
	if (l>=4&&!lstrcmp(RemoteName+l-4, L"\\..\\")) return result;
	...
	if (<virtual file can't be found>) return result;
	...
	bool script=*name=='<', exists=!*name || script || GetFileAttributes(name)!=INVALID_FILE_ATTRIBUTES, has_own_icon=0;

	if (!exists) {
		bool folder=(fd.Data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0;
		*TheIcon=vfile_icon[folder ? fit_FolderRemoved : fit_FileRemoved][ExtractFlags&FS_ICONFLAG_SMALL ? 0 : 1];
		if (*TheIcon) lstrcpy(RemoteName, folder ? L".\\?" : L".?");
		return *TheIcon ? FS_ICON_EXTRACTED : FS_ICON_USEDEFAULT;
	}

	if (!script&&l>4) {
		if (!strbegini(name+l-4, L".exe") || !strbegini(name+l-4, L".lnk")) has_own_icon=1;
	}

	if (ExtractFlags&FS_ICONFLAG_BACKGROUND) {
		if (script) {
			...
			if (p&&ExtractFileIcon(p, ExtractFlags&FS_ICONFLAG_SMALL ? 0 : TheIcon, ExtractFlags&FS_ICONFLAG_SMALL ? TheIcon : 0)) return FS_ICON_EXTRACTED_DESTROY;
		}
		else {
			SHFILEINFO sfi;
			if (!SHGetFileInfo(name, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_ADDOVERLAYS|(ExtractFlags&FS_ICONFLAG_SMALL ? SHGFI_SMALLICON : 0))) return FS_ICON_USEDEFAULT;
			*TheIcon=sfi.hIcon;
			result=FS_ICON_EXTRACTED_DESTROY;
		}
	}
	else if (script || has_own_icon) return FS_ICON_DELAYED;

	if (script) {
		*TheIcon=vfile_icon[fit_Command][ExtractFlags&FS_ICONFLAG_SMALL ? 0 : 1];
		if (TheIcon) { lstrcpy(RemoteName, L".>"); return FS_ICON_EXTRACTED; }
	}
	else if (!l&&(fd.Data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
		*TheIcon=vfile_icon[fit_Folder][ExtractFlags&FS_ICONFLAG_SMALL ? 0 : 1];
		if (TheIcon) { lstrcpy(RemoteName, L".\\"); return FS_ICON_EXTRACTED; }
	}

	return result;
}
(I have some special classes - deleted file/folder, script and virtual folder, icon handles for theese classes are in vfile_icon array)

Hope it helps. BTW here you can see how to extract icons from EXE and LNK files (they are extracted when TC calls function from background thread, so don't forget about synchronization).
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

version 1.02 released:
http://cid-9a15473c9a985119.office.live.com/self.aspx/!work/BranchViewEx.wfx

Changes:
+ Added temporary file plugin functions
+ Added VERSION_INFO
#213083 Single user license
BranchViewExtended
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

2MVV
Does it work for internal icons?
#213083 Single user license
BranchViewExtended
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Yes, of course, I wrote more than twice about it in your topic. :)


Little suggestion - you can compress plugin to ZIP, RAR or 7Z to reduce distributive size, and add to archive self-installation file pluginst.inf like this one:

Code: Select all

[plugininstall]
description=BranchViewEx 1.02: Branch view with subfolder sizes (http://www.ghisler.ch/board/viewtopic.php?t=24238)
type=wfx
file=BranchViewEx.wfx
defaultdir=BranchViewEx
So when user will enter archive, TC will suggest to install/update plugin. :)
+ Added temporary file plugin functions
Great, now it is possible to view properfies of file(s) and to view/edit files directly from plugin panel.
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

kotlomoy wrote:version 1.02 released:
http://cid-9a15473c9a985119.office.live.com/self.aspx/!work/BranchViewEx.wfx

Changes:
+ Added temporary file plugin functions
+ Added VERSION_INFO
Link points to version 1.01 please update.
Can you also check that v.1.02 deals with file type .ico properly? It should, but double-checking is good.
File type .ico icons should display as the actual icon graphics.
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

sgp wrote:
kotlomoy wrote:version 1.02 released:
http://cid-9a15473c9a985119.office.live.com/self.aspx/!work/BranchViewEx.wfx

Changes:
+ Added temporary file plugin functions
+ Added VERSION_INFO
Link points to version 1.01 please update.
Can you also check that v.1.02 deals with file type .ico properly? It should, but double-checking is good.
File type .ico icons should display as the actual icon graphics.
Icons problem is not solved in version 1.02.

.exe and .ico problem will be solved in version 1.03.
The only problem is internal associated icons now
#213083 Single user license
BranchViewExtended
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

2sqp
Indeed, it's the same link. But now it points to version 1.02.
Version 1.01 moved to here: http://cid-9a15473c9a985119.office.live.com/self.aspx/!work/BranchViewEx%5E_1.01.wfx
#213083 Single user license
BranchViewExtended
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

MVV wrote:Little suggestion - you can compress plugin to ZIP, RAR or 7Z to reduce distributive size, and add to archive self-installation file pluginst.inf like this one:
My plugin is one 80k file. So "reduce distributive size" is not very actual problem, I think.
#213083 Single user license
BranchViewExtended
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Anyway automatic installation is required. We are in 21th century! :)
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

kotlomoy wrote:2sqp
Indeed, it's the same link. But now it points to version 1.02.
it does not. it points to a copy of 1.01. please update. thanks.
dll version info says: name=BranchViewExtended file system plugin for Total Commander; product version=1, 0, 1, 0
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

kotlomoy wrote:2MVV
Does it work for internal icons?
MVV wrote:Yes, of course, I wrote more than twice about it in your topic. Smile
I've added icons for .gid, .bak and .mnu types:

Image: http://img710.imageshack.us/img710/21/88006439.png

What I saw (my test dir), left - TC, right - Virtual Panel:
Image: http://img189.imageshack.us/img189/4159/86675854.png

No icons for .gid and .bak, default icons for .mnu

:?:

ps. I see no way to extract internal assigned icons via SHFileGetInfo. So how?
#213083 Single user license
BranchViewExtended
User avatar
kotlomoy
Member
Member
Posts: 100
Joined: 2008-03-09, 07:27 UTC

Post by *kotlomoy »

sgp wrote:
kotlomoy wrote:2sqp
Indeed, it's the same link. But now it points to version 1.02.
it does not. it points to a copy of 1.01. please update. thanks.
dll version info says: name=BranchViewExtended file system plugin for Total Commander; product version=1, 0, 1, 0
I've made a little typo in dll version, sorry :oops:
It's version 1.02 with wrong VERSION_INFO

(version 1.01 doesn't have VERSION_INFO at all)
#213083 Single user license
BranchViewExtended
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It works perfectly for me in TC 7.55rc3 (VirtualPanel shows internally associated icons). Look onto the screenshot (I set icons for *.bak *.gid *.mnu using internal associations).

BTW, when I tested it under 7.50pb6, in my VirtualPanel icons for internal associations wasn't right - just as for you. According to history.txt:

Code: Select all

20.01.10 Release Total Commander 7.51 beta 1
...
22.12.09 Added: Temp panel plugin: Show icons for internal associations and per file associations if the plugin returns FS_ICON_USEDEFAULT
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

kotlomoy wrote: What I saw (my test dir), left - TC, right - Virtual Panel:
Image: http://img189.imageshack.us/img189/4159/86675854.png

No icons for .gid and .bak, default icons for .mnu
I can confirm that internally associated icons display OK for me in MVV's virtual panel.
Post Reply