Solved

iDeskBand2 in delphi

Posted on 2010-08-31
44
1,781 Views
Last Modified: 2013-11-23
I am looking for a way to implement the iDeskBand2 feature into delphi, ive managed to get th ideskband to work but i need the ideskband 2 to work, for transparency in windows 7.

ive read through this:

http://msdn.microsoft.com/en-us/library/bb762064%28v=VS.85%29.aspx

but i still cannot get it to work, any help would be greatly appreciated.
0
Comment
Question by:flexiwebsw
  • 22
  • 16
  • 3
44 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 33572528
[IDeskBand2 may be altered or unavailable in subsequent versions of the operating system or product.]
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33588964
thanks for the comment, i just need it to work because i cannot get the ideskband to work in wondows 7 but ideskband 2 works, but i cannot find a way with delphi.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 33589160
Do you need an iDeskband2 solution or a work-around solution?  From the (posted) Microsoft comment, it might not be possible to use iDeskband2.
 
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33589201
either one i dont mind, i just need the deskband in delphi to work wityh windows 7, ive tried it in xp and it works fine, and i can get it to work in internet explorer in windows 7 just not windows 7 deskband, ive tried it with a clean install too with no luck.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 33589380
If no other Delphi expert comments in this thread, click the Request Attention link and ask for greater visibility amongst the Delphi experts.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33589429
ok will do thanks
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33631487
Most any expert here could help if you could answer a couple questions.
Does it really work under Win7?
Have you seen code claiming to work explicitly for WIN7?

Considering the massive taskbar changes in Win7, it would not surprise me if it nolonger works.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33631526
i know that ideskband 2 works fine in windows 7 because ive got an example of an application written in C that uses a mixture of ideskband for older windows versions and ideskband 2 for use with windows vista and onwards. so it is possible and ive gotten the ideskband working in windows xp just not windows 7 and i dont know how to implement ideskband 2 into delphi.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33631592
Have you run the c code on Win7 ?
the implementation would not be any different, if it is a valid object.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33631686
yes i have i said that in the previous post, i said it works fine in windows 7 cause ive got some c code that works,

ive tried it in windows 7 and it works just how id expect, i just dont knkow how to implement it in delphi, im after some example delphi code. or some help with converting the c code to delphi.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33637387
>> some help with converting the c code to delphi

Attach or Post the C code .
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33638662
I dont know which files i need to send for you to convert it, but here is the link to rapidshare where the C example is:

http://rapidshare.com/files/418081821/CalendarDeskBand.zip
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33638736
My corporate proxy blocks that site.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33638968
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33640461
if you got Deskband to work on XP is should work on Win7.

http://msdn.microsoft.com/en-us/library/bb762064(VS.85).aspx
States; "The IDeskBand2 interface inherits from IDeskBand. "
So if Deskband2 exists on Win7 then Deskband exists on Win7.
"How do I make it work"  is too vague for me for me to answer.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33641437
i got deskband to work in xp, but it does not work inwindows 7 and i dont know why, its exactly the sane dll, ive registerd it in the same way, it shows up in internet explorer in windows 7 but not the taskbar however it shows up on the taskbar in windows xp.

Here is the one im tryig to test out.
SearchBarBand.dll
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33649296
Did you see this;  http://msdn.microsoft.com/en-us/library/dd378460(VS.85).aspx
Deskbands
In versions of Windows prior to Windows 7, something similar to thumbnail toolbar functionality could be achieved through a deskband—a toolbar hosted in the taskbar. For instance, Windows Media Player could minimize to the taskbar as a set of transport controls rather than a standard button. In Windows 7, deskbands can still be implemented and thumbnail toolbars are not intended to replace them all. Not all applications will lend themselves to a thumbnail toolbar, and another solution such as a deskband or a task in a destination list might be the right answer for your application; you must decide which solution works best for your application as part of your development cycle. However, be aware that deskbands must support Windows Aero with translucency ("glass") enabled and the IDeskBand2 interface.
So if you code is only implementing IDeskBand it will not work on Win7 taskbar.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33654315
yes and that is why i asked about the ideskband2, the C sample i posted implements both the ideskband and the ideskband2 interface to allow usage in windows 7 and earlier versiona of windows.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33661171
If you know how to implement ideskband  in Delphi, I don't understand why you wouldn't know how to implement ideskband2? If you haven't implemented ideskband either then you have a *much bigger* learning curve. I suppose you could upload your project.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33662546
iDeskband/2 is defined in the ShlObj.pas file. In my Delphi 2007 ShlObj file there is no iDeskband2 definition.In my Delphi XE ShlObj file there *is* a iDeskband2.   :) Make the changes to include I compiled your demo on DelphiXE and it works fine on Win7-32bit AND WinXP 32bit.I'm not willing to try to hack  the new ShlObj.pas file into my D2007 but here it is if you want to try it.Or maybe just take iDeskBand2 references.
0
Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

 
LVL 5

Expert Comment

by:briangochnauer
ID: 33662889
I guess it was a deskband demo I downloaded from embarcadero
http://cc.embarcadero.com/Item/23879
 
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33672097
shlobj additions something like  ;-)
...

{$HPPEMIT 'DECLARE_DINTERFACE_TYPE_UUID("79D16DE4-ABEE-4021-8D9D-9169B261D657", IDeskBand2)'}

...

SID_IDeskBand2  = '{79D16DE4-ABEE-4021-8D9D-9169B261D657}';

...

  IID_IDeskBand2: TGUID  = SID_IDeskBand2;

  {$EXTERNALSYM IID_IDeskBand2}



...

{ interface IDeskBand2 }

  IDeskBand2 = interface(IDeskBand) 

    [SID_IDeskBand2]

    function CanRenderComposited(

      var pfCanRenderComposited: BOOL): HRESULT; stdcall;

    function SetCompositionState(fCompositionEnabled: BOOL): HRESULT; stdcall;

    function GetCompositionState(var pfCompositionEnabled: BOOL): HRESULT; stdcall;

  end;

  {$EXTERNALSYM IDeskBand2}

Open in new window

0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33681109
I got the ideskband from an example prject from the web, however i cannot implement the ideskband 2, as i do not know how.

and im jealous, i wish i had delphi XE its 2.5 grand lol.

as EE doesnt like most delphi project filed, or all that coem with the project ive uploaded it to rapidshare for you to look at, perhaps you could implement the ideskband2 then send it back.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33681486
Work had maintenance agreement. <2.5g  :)
If it isn't too many hours.
Like before the site is blocked by corp proxy I was able to get to fwsw.co.uk/secure/
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33681555
hmm lucky you :D

and sorry about that, i forgot, i even forgot to send the rapid link =}, here it is on my site:

http://www.fwsw.co.uk/secure/Toolband.zip
0
 
LVL 5

Accepted Solution

by:
briangochnauer earned 500 total points
ID: 33682310
I've uploaded the needed file but for those wishing to implement otherwise may find this code snippet useful;

// ****************** INSERT all these lines just before  other types/classes
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE_UUID("79D16DE4-ABEE-4021-8D9D-9169B261D657", IDeskBand2)'}

const
  SID_IDeskBand2  = '{79D16DE4-ABEE-4021-8D9D-9169B261D657}';

  IID_IDeskBand2: TGUID  = SID_IDeskBand2;
  {$EXTERNALSYM IID_IDeskBand2}

type
  { interface IDeskBand2 }
  IDeskBand2 = interface(IDeskBand)
    [SID_IDeskBand2]
    function CanRenderComposited(
      var pfCanRenderComposited: BOOL): HRESULT; stdcall;
    function SetCompositionState(fCompositionEnabled: BOOL): HRESULT; stdcall;
    function GetCompositionState(var pfCompositionEnabled: BOOL): HRESULT; stdcall;
  end;
  {$EXTERNALSYM IDeskBand2}

//*********** ORIG CODE -->
  TDelphiBandFactory = class(TComObjectFactory)
...  
 
///************* NEXT *ADD*  "IDeskBand2" to class statement
 
    TDelphiBand = class(TComObject, IDeskBand, IDeskband2,
                         IPersist, IPersistStreamInit, IObjectWithSite,
                          IContextMenu, IInputObject)
...

/// ************** NEXT ADD METHODS
// ORIG -->
    function GetBandInfo(dwBandID, dwViewMode: DWORD; var pdbi: TDeskBandInfo): HResult; stdcall;
//NEW ONES    
    function CanRenderComposited(var pfCanRenderComposited: BOOL): HRESULT; stdcall;
    function SetCompositionState(fCompositionEnabled: BOOL): HRESULT; stdcall;
    function GetCompositionState(var pfCompositionEnabled: BOOL): HRESULT; stdcall;
//ORIG -->  
    function ShowDW(fShow: BOOL): HResult; stdcall;
...

// IMPLEMENTATION of METHODS - Incomplete functionality - but compiles

function TDelphiBand.SetCompositionState(fCompositionEnabled: BOOL): HRESULT;
begin
  BandForm.AlphaBlend := fCompositionEnabled;
  Result := NOERROR;
end;
function TDelphiBand.GetCompositionState( var pfCompositionEnabled: BOOL): HRESULT;
begin
  pfCompositionEnabled := BandForm.AlphaBlend;
  Result := NOERROR;
end;
//ORIG -->  
function TDelphiBand.GetBandInfo(dwBandID, dwViewMode: DWORD; var pdbi: TDeskBandInfo):
...


-DelphiBand.pas
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33682374
btw,
I tested the compiled DLL on both  XP 32bit and Win7 32-bit. both worked.
Win7 64b did not work, of course.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33682619
thanks it works, but how do i get it to work in windows 7 64-bit, the C example posted above allows it to work in there how come the delphi code wont?
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33682701
I'm assuming it's because there is no 64-bit Delphi compiler... yet.
Didn't you have to compile the C code in 64bit to get it to work?
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33682776
i only tried the pre-compiled C code i didnt compile any myself

so i have to find a way of compiling delphi in 64-bit if i want it to work in windows 64-bit?
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33683327
The calendarDeskband.zip file you sent me had no pre-compiled  dll in it.??
There is no 64bit compiler for Delphi if you load Delphi onto a 64bit Windows machine is still compiles 32bit..
If the c code does work on all 3 version then there *must be* a way to register the DLL to get it to work on 64bit.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33683575
the VC project you sent shows two compiler environments for 32 and 64 bit.
Can you verify that it runs on all three platforms??
...
            <Configuration
                  Name="Release|Win32"
...
and
...
            <Configuration
                  Name="Release|x64"
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33683795
btw,
Embarcadero has just published the new RAD Studio Roadmap. http://edn.embarcadero.com/article/39934
This Roadmap includes information on the upcoming Delphi Fulcrum, supporting both Windows and Mac OS X application development, Delphi Wheelhouse (adding Linux support), the 64-bits Compiler Preview (early 2011), Delphi Commodore (the full 64-bits version) and project Chromium.
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33694330
it does run on all three, and hmm that seems interesting i will defenatly check it out.
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33704808
can you post the compiled dll
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33704847
btw,
Did you get in to compile and run on Win7 32 bit?
0
 
LVL 4

Author Comment

by:flexiwebsw
ID: 33705337
i dont have an active win7 32 but ill install on in vmware tomorrow and see if it works

nd here is the compiled C code that works in 64-bit.
CalendarDeskBand.dll
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33715644
That DLL is 64-bit, it would not register on either Win7 32-bit or XP 32-bit.
As I suspected you have to either target 32-bit or 64-bit, since currently there is only a 32-bit compiler for Delphi you can not target 64-bit systems.
I still suspect there is a way to get a 32-bit DLL to run on a 64-bit system since there are many 32-bit DLLs in SYSWOW64 (32-bit System) directory.
How clever of Microsoft;  to call the 64-bit system directory 'System32' and the 32-bit system directory 'SysWOW64' and ONLY on 64-bit OS !!!  
 
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33716762
Sorry, No 32-bit Explorer shell support on 64-bit OS.
http://www.techsupportalert.com/content/how-windows7-vista64-support-32bit-applications.htm
"Under 64 bit Windows it is not possible to inject 32 bit code into a 64 bit process, nor is it possible to inject 64 bit code into a 32 bit process. This explains why most 32 bit shell extensions do not work under Windows 7 64."
0
 
LVL 5

Expert Comment

by:briangochnauer
ID: 33753348
flexiwebsw,
Did you resolve the issue?
The implementation of iDeskband I gave you resolved the issue of running on XP and Win7, if only on 32-bit.
0
 
LVL 4

Author Closing Comment

by:flexiwebsw
ID: 33753599
Not exactly what i was after but i will have to put up with it untill delphi make a 64-bit compiler.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now