InfoTip Shell Extension
From: Damjan Vengušt (damjan.vengust_at_guest.arnes.si)
Date: 01/14/05
- Next message: AlanGLLoyd: "Re: OnPaint Procedure call"
- Previous message: Rob Kennedy: "Re: TobjectList to TObjectList communication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 Jan 2005 22:49:51 +0100
Hey !
I know how to make and run InfoTip Shell extension, but...
I have created new dll project(InfoTipEx.dll) and add another unit
(InfoTip_Impl.pas)
In project file we need to export some functions which are called by
windows Shell. Those functions are:
exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer;
OK. Lets focus to the problem now. There is a TMyInfoTip class defined
in unit mentioned before (InfoTip_Impl.pas). This class implements
IQueryInfo interface. According to the IQueryInfo interface
specification there are two functions (GetInfoTip And GetInfoFlags) that
need to be implemented.
GetInfoTip has a PWideChar parameter passed by reference. This parameter
contains the actual string that would appear when this extension is lunched.
Ok. My extension works fine, when I set this parameter inside the
function GetInfoTip.
!!!!!! Pay attention to comments inside the function.!!!!!!!
// --------------------------------------------------------------------
function TMyInfoTip.GetInfoTip ( dwFlags : DWORD; var ppwszTip :
PWideChar) : HResult; stdcall;
Var
sInfoText : String;
begin
Result := S_OK;
sInfoText := 'Testing my extension';
// sInfoText is now fixed.
// Here I would like to implement some sort of CallBack function which
// would return string to display as InfoTip.
// I would like to create a non-visual component. The programmer
// should be able to set file extension this extension is registered
// to AND a callback function which will produce the infotip string.
// Something like this:
// if Assigned( FMyBuildInfoTipString ) Then
// sInfoText := FMyBuildInfoTipString();
ppwszTip := pMalloc.Alloc( sizeof(WideChar)*(Length(sInfoText)+1) );
if ( ppwszTip <> nil ) Then
ppwszTip := StringToWideChar(sInfoText, ppwszTip,
sizeof(WideChar)*Length(sInfoText)+1 );
end;
// --------------------------------------------------------------------
OK. My idea may be very bad, but I really don't know how to do it.
Let's make a short summary of text above.
I would like to create a component which represents Infotip shell
extension. User should be able to set filetype (e.g. TXT) this extension
is registered to. The most important part is that the user is able to
write his own code to produce InfoTip String. Keep in mind that user can
register several filetypes (TXT, PAS, DFM, EXE,...) so there should be
implemented BuildString function for each extension.
Also possible: One component - one extension.
I hope you understand my problem and have an Idea of solving it.
Thanks,
Damjan
- Next message: AlanGLLoyd: "Re: OnPaint Procedure call"
- Previous message: Rob Kennedy: "Re: TobjectList to TObjectList communication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|