C++ Builder

delphi package - easy access to shell apis

C++ Builder

Postby AndyBell » Tue Apr 07, 2020 2:06 pm

Hi

Are there any examples of using MadShell for C++ Builder?

I have no Pascal knowledge and the generated .hpp files aren't making any sense to me...

Andy
AndyBell
 
Posts: 1
Joined: Tue Apr 07, 2020 2:04 pm

Re: C++ Builder

Postby madshi » Wed Apr 08, 2020 10:19 am

Something like this seems to work for me:

Code: Select all
#include "madShell.h"

  _di_IShortCut shortCut = NewShortCut("D:\\Desktop\\test.exe");
  shortCut->WorkingDir = "D:\\Desktop";
  shortCut->ShowCmd    = SW_SHOWMAXIMIZED;
  shortCut->Save("D:\\desktop\\test.lnk");

Generally, madShell uses Delphi type interfaces which are reference counted and automatically freed by the compiler. So you don't have to free/release "shortCut" in the example above, it's done automatically by Delphi/C++.
madshi
Site Admin
 
Posts: 10200
Joined: Sun Mar 21, 2004 5:25 pm


Return to madShell

Who is online

Users browsing this forum: No registered users and 1 guest