Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Plugins Page: 1  Previous   Next
How to get the current opened database name?
Author Message
DVD Profiler Unlimited RegistrantWhiler
Registered: January 26, 2011
Posts: 12
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
As a user can manage several databases, I'd like to be able to get the Name of the opened database...

Please, can you tell me how can I get it?

I've seen the event EVENTID_DatabaseOpened but it is only triggered when the user changes his current DB.. when the application is launched, this event is not lauched (or my plugin is not yet started to catch it... )

Is there a property I can get from a specific function to get it?
DVD Profiler Unlimited RegistrantStar ContributorTomGaines
Registered Sept. 24, 2001
Registered: March 13, 2007
Reputation: High Rating
Germany Posts: 2,005
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Besides the event (which you say doesn't fire at application launch) I also didn't see a function.
As a workaround you could use IDVDInfo::GetCoverImageFilename() which returns the cover file path to the cover image. And as the "Image" folder for covers is a subfolder of the database folder, you could retrieve the database this way.
By the way, you should ask plugin development questions in the Plugin Development subforum.


DVD Profiler Unlimited RegistrantWhiler
Registered: January 26, 2011
Posts: 12
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Thank you for the answer!
Long time I haven't played with the plugins.. I haven't choose the good forum 
Sorry...

Your idea is good!

BTW, I have coded this which fits the need:
function GetCurrentDatabase: string;
var
  reg: tregistry;
begin
  reg := TRegistry.Create;
  try
    reg.RootKey:=HKEY_CURRENT_USER;
    reg.OpenKeyReadOnly('Software\Invelos Software\DVD Profiler');
    Result := reg.ReadString('CurrentDatabase');
  finally
    reg.Free;
  end;
end;


As I don't see any way to move myself my topic to the good forum section, if a moderator wants to move it, do not hesitate 
 Last edited: by Whiler
    Invelos Forums->DVD Profiler: Plugins Page: 1  Previous   Next