Jump to content

Stacks Docklet


Recommended Posts

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

That's strange, even though the code for that is loosely written. ¿Querés decir que haciendo click en cualquier parte del icono, no abre?

Yeah, I mean, I click on the text "open folder" but it does't open, it's very weird.

Never mind, I don't use that item.

And i still see default window's icons, sorry, and i can't see the open folder image neither

Link to comment
Works great on RK Launcher except for a small bug

is that including shortcuts?

Edit

when I tried using an icon that was outside of the RKLauncher/icons main folder, no icon showed but then when you move it into the icon folder (out of icons/more for example) the icon now shows.

For the dock icon I can use any image from my hard drive or my external hard drive without any problem.

RKLauncher 0.41 Build 239

Link to comment

All is shaping up very nicely! Some things that I'm experiencing though, some shortcuts are getting the link overlay while others aren't.

Adding multiple stacks causes a "Class already exists" error pop up. After hitting okay, it works fine but it happens every time I start RKLauncher and it's one of those things that after while...you know how it is. ;)

I'm also getting the error where icons need to be in the root image folder in order to appear. It's not a big hassle but I'm sure many out there have their icons arranged in a certain way and having to move them will get annoying.

A possible suggestion for the icon image problem. Maybe an ini file or XML database which the stack would look at for possible icon paths to use, if none are found then extract the icon. This could either look for just the file name and ignore the path (probably the best bet) or use absolute paths for the files.

Example:

firefox.exe=C:Documents and SettingsBlah blah blahfirefox.png;

VSCExpress.exe=C:Documents and Settingsblah blah blahvscexpress.png;

and so on

This could be done manually by the user (the tedious way) or a quick program could be whipped up that would allow the user some simple features, mainly drag shortcut > drag image > spit out the ini file.

Just a suggestion. :D

Link to comment
It really works fine (very smooth y fast), but the icons looks very bad. Could it be possible that they were a little small. Thanks, and sorry my english

wether they look bad or not depends on the quality of your icons. for example if you have things with 32x32 sized icons in a folder it will look stretched out and pixely, but if you have 128x128 icons they would look normal and high quality ;)

Link to comment

This is an astonishing application matonga!! My warmest congratulations to you.

You are a huge force in the emulation world and it is an honor to have you contributing so heavily.

I use generally use Mac and only recently have I found the time to install your app on one of my XP systems (Rk Launcher) and it works perfectly.

As some people have mentioned there are a few things that are not quite right but I did a back to back test with starting your app up after a cold system boot - on both an XP and a OSX system. It might interest you to know that your application fired up a tiny bit quicker on the XP machine than it did on my OS X based system

Sensational. I look forward to seeing where you go from here!!!

Link to comment

I did some updates:

Now you can sort by name, time created, time last modified, time last accesed, and kind (file extension).

Also I tried to make the animation more similar to Leopard Stacks one, based on video posted by frangio. Can't make exactly like that (gave reasons in a post above) but at least it looks as a closer emulation... maybe.

I don't know why it doesn't open shortcuts on certain systems... if anyone over there is a programmer, I have a question:

I'm using ShellExecute( ) from Windows API. Is this right? Should I use something else instead?

Ok, and I'll try to support customized folder icons to appear correctly in the stack ;) stay tuned for that.

Link to comment
I did some updates:

Now you can sort by name, time created, time last modified, time last accesed, and kind (file extension).

Also I tried to make the animation more similar to Leopard Stacks one, based on video posted by frangio. Can't make exactly like that (gave reasons in a post above) but at least it looks as a closer emulation... maybe.

I don't know why it doesn't open shortcuts on certain systems... if anyone over there is a programmer, I have a question:

I'm using ShellExecute( ) from Windows API. Is this right? Should I use something else instead?

Ok, and I'll try to support customized folder icons to appear correctly in the stack ;) stay tuned for that.

I don't know if Delphi has an equivalent but in C# I use Process.Start. This allows me to add in parameters such as the working folder (this might be the cause of some links not working correctly as I ran into this problem on Vista when links didn't have a working folder.

Link to comment

Ok, let's see:

Added Sranshaft suggestion to include the default directory, with ShellExecute call in this case.

Completely rewrote the icon extraction code. It seems to work much better! Here is a hint in c-pseudocode:

#define HKCR HKEY_CLASSES_ROOT

IImageList systemimagelist_extralarge;

void AtStartup () {
SHGetImageList (SHIL_EXTRALARGE, IID_IImageList, systemimagelist_extralarge);
}

HICON GetAssociatedIcon (String filename) {
String extension = GetExtension(filename) // debe devolver por ej. ".txt", con el punto incluido
If (registry.KeyExists (HKCR, extension)) {
String filetype = registry.ReadKeyDefaultValue (HKCR, extension);
If (registry.KeyExists (HKCR, filetype+"DefaultIcon") &&
registry.ReadKeyDefaultValue (HKCR, filetype+"DefaultIcon") == "%1") {

// SHGFI_SYSICONINDEX doesn't work with this kind of icon handlers
struct SHFileInfo fi;
SHGetFileInfo (filename, 0, fi, sizeof(fi), SHGFI_ICONLOCATION);
short index = fi.iIcon;
return ExtractAssociatedIcon (application.hInstance, fi.szDisplayName, index);
}
}

// Use SHGFI_SYSICONINDEX method
struct SHFileInfo fi;
SHGetFileInfo (filename, 0, fi, sizeof(fi), SHGFI_SYSICONINDEX);
HICON icon;
systemimagelist_extralarge.GetIcon (fi.iIcon, ILD_TRANSPARENT, icon);
return icon;
}

In case I got anyone too confused, here is the code for Delphi 5 as well ;-)

unit unitGetIcon;

// Author: Matias Moreno
// http://www.matiasmoreno.com.ar/

interface

uses Windows, SysUtils, ShellAPI, ShlObj, ComObj, ActiveX, Registry;

function GetAssociatedIcon (filename : String) : HICON;


implementation

const
{$EXTERNALSYM IID_IImageList}
IID_IImageList : TGUID = '{46EB5926-582E-4017-9FDF-E8998DAA0950}';
{$EXTERNALSYM IImageList}
type
TImageListDrawParams = record
cbSize : Integer;
himl : Cardinal;
i : Integer;
hdcDest : HDC;
x, y, cx, cy, xBitmap, yBitmap, rgbBk, rgbFg, fStyle, dwRop, fState, Frame, crEffect : Integer;
end;
TImageInfo = record
hbmImage, hbmMask : HBITMAP;
unused1, unused2 : Integer;
rcImage : TRect;
end;
IImageList = interface(IUnknown)
['{46EB5926-582E-4017-9FDF-E8998DAA0950}']
// No los puedo comentar, sino deja de andar :-)
function Add (hbmImage, hbmMask : HBITMAP; var i : Integer) : Integer; stdcall;
function ReplaceIcon (i : Integer; hIcon : HICON; var _i : Integer) : Integer; stdcall;
function SetOverlayImage (iImage, iOverlay : Integer) : Integer; stdcall;
function Replace (i : Integer; hbmImage, hbmMask : HBITMAP) : Integer; stdcall;
function AddMasked (hbmImage : HBITMAP; crMask : Integer; var i : Integer) : Integer; stdcall;
function Draw (var ildp : TImageListDrawParams) : Integer; stdcall;
function Remove (i : Integer) : Integer; stdcall;
// Bien, éste es el que quiero yo :-)
function GetIcon (i, flags : Integer; var icon : HICON) : Integer; stdcall;
{function GetImageInfo (i : Integer; var ii : TImageInfo) : Integer; stdcall;}
// ...
end;
function SHGetImageList (iImageList : Integer; const iid : TGUID; out pv) : Integer; stdcall; external shell32 index 727;
//function SHGetImageList (iImageList : Integer; const iid : TGUID; var handle : Cardinal) : Integer; stdcall; external shell32 index 727;
const
SHIL_EXTRALARGE = 2;
ILD_NORMAL = 0;
ILD_TRANSPARENT = 1;
ILD_MASK = $10;
ILD_IMAGE = $20;
ILD_ROP = $40;
ILD_BLEND25 = 2;
ILD_BLEND50 = 4;
ILD_OVERLAYMASK = $F00;

var
sil_extralarge : IImageList;
const
IID_IPersistFile : TGUID = (D1:$0000010B;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));

function GetAssociatedIcon (filename : String) : HICON;
var
fi : TSHFileInfo;
reg : TRegistry;
filetype, defaulticon : String;
index : Word;
begin
// Primero determinar si usa un icon handler
reg := TRegistry.Create;
reg.RootKey := HKEY_CLASSES_ROOT;
If reg.KeyExists (ExtractFileExt(filename)) Then
begin
reg.OpenKeyReadOnly (ExtractFileExt(filename));
filetype := reg.ReadString ('');
reg.CloseKey;
If reg.KeyExists (filetype+'DefaultIcon') Then
begin
reg.OpenKeyReadOnly (filetype+'DefaultIcon');
defaulticon := reg.ReadString ('');
reg.CloseKey;
// Entonces usar la alternativa
If defaulticon = '%1' Then
begin
reg.Destroy;
SHGetFileInfo (PChar(filename), 0, fi, sizeof(fi), SHGFI_ICONLOCATION);
index := fi.iIcon;
Result := ExtractAssociatedIcon (hInstance, fi.szDisplayName, index);
Exit;
end;
end;
end;
reg.Destroy;
SHGetFileInfo (PChar(filename), 0, fi, sizeof(fi), SHGFI_SYSICONINDEX);
sil_extralarge.GetIcon (fi.iIcon, ILD_TRANSPARENT, Result);
end;


initialization
CoInitialize (nil);
SHGetImageList (SHIL_EXTRALARGE, IID_IImageList, sil_extralarge);
finalization
sil_extralarge := nil;
CoUninitialize;
end.

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...