Board index » delphi » Showmessage during DLL load

Showmessage during DLL load

I have seen adverti{*word*224}ts for shareware DLL's with a registration
inducement that work as follows:

The developer can include the DLL with his program even if he hasn't
registered it (in the shareware sense), but the DLL will display a message
as it's being loaded along the lines of "FOO.DLL by Joe Blow."  If the
developer registers, that message will not be displayed when the DLL loads
on the end-user's machine.

Getting the message to display during load would be easy to do, I assume
just by including the appropriate routine in the DLL's initialization
section.  But how does one suppress it?

No, I'm not trying to crack someone else's DLL protection-scheme.  I want to
include this scheme in a DLL I'm writing.  (I.e., you can pay a
registration/license fee or use it without payment if you don't mind a brief
adverti{*word*224}t for it appearing.)

--
David Howorth

 

Re:Showmessage during DLL load


David,
  The easiest way would be to have a condition in the DLL's code itself that
would read a LIC file or registry key to see is this particular user is
authorized to use the control. Having done that, you would then pass that as
a paramter to any internal DLL functions. For example:

  Function doThis(x:integer;Y:integer;okay_to_use:boolean):integer;stdcall;
   begin
      if okay_to_use=true then result:=x+y
      else
        begin
          Showmessage('please register this control');
          result:=x+y;
       end;
  end;

Hope that helps!
         Good Luck!!
    -Dave
http://www.erols.com/dparsons

Quote
David Howorth wrote in message ...
>I have seen adverti{*word*224}ts for shareware DLL's with a registration
>inducement that work as follows:

>The developer can include the DLL with his program even if he hasn't
>registered it (in the shareware sense), but the DLL will display a message
>as it's being loaded along the lines of "FOO.DLL by Joe Blow."  If the
>developer registers, that message will not be displayed when the DLL loads
>on the end-user's machine.

>Getting the message to display during load would be easy to do, I assume
>just by including the appropriate routine in the DLL's initialization
>section.  But how does one suppress it?

>No, I'm not trying to crack someone else's DLL protection-scheme.  I want
to
>include this scheme in a DLL I'm writing.  (I.e., you can pay a
>registration/license fee or use it without payment if you don't mind a
brief
>adverti{*word*224}t for it appearing.)

>--
>David Howorth

Re:Showmessage during DLL load


Not quite what I'm trying to do, unless I misunderstand what you're
suggesting.

It's not the end-users of the DLL from whom I'll be seeking registration
fees -- it's the programmer who distributes the DLL with his program.  So
upon registration, he (the programmer) would receive something that would
enable him to include code in his program that would suppress the start-up
message.

I can figure out sort of kludgey ways to do it.  (Have a brief delay before
the message appears -- if a particular function in the DLL is called with
the correct parameters before the message fires, it would not go off.)  But
I'm wondering if there's a more elegant approach.  Probably not, I guess.

--
David Howorth

Quote
Dave Parsons wrote in message <76jv5l$g8...@winter.news.rcn.net>...
>David,
>  The easiest way would be to have a condition in the DLL's code itself
that
>would read a LIC file or registry key to see is this particular user is
>authorized to use the control. Having done that, you would then pass that
as
>a paramter to any internal DLL functions. For example:

>  Function doThis(x:integer;Y:integer;okay_to_use:boolean):integer;stdcall;
>   begin
>      if okay_to_use=true then result:=x+y
>      else
>        begin
>          Showmessage('please register this control');
>          result:=x+y;
>       end;
>  end;

>Hope that helps!
>         Good Luck!!
>    -Dave
>http://www.erols.com/dparsons

>David Howorth wrote in message ...
>>I have seen adverti{*word*224}ts for shareware DLL's with a registration
>>inducement that work as follows:

>>The developer can include the DLL with his program even if he hasn't
>>registered it (in the shareware sense), but the DLL will display a message
>>as it's being loaded along the lines of "FOO.DLL by Joe Blow."  If the
>>developer registers, that message will not be displayed when the DLL loads
>>on the end-user's machine.

>>Getting the message to display during load would be easy to do, I assume
>>just by including the appropriate routine in the DLL's initialization
>>section.  But how does one suppress it?

>>No, I'm not trying to crack someone else's DLL protection-scheme.  I want
>to
>>include this scheme in a DLL I'm writing.  (I.e., you can pay a
>>registration/license fee or use it without payment if you don't mind a
>brief
>>adverti{*word*224}t for it appearing.)

>>--
>>David Howorth

Re:Showmessage during DLL load


Hi David,

Here's a suggestion:

Create a global (unit-wide) Boolean in the DLL - something like
IsRegistered. In the DLL's initialization section, set it to
False.

Add an exported function that is _not_ called something like
'RegisterThisDLL' or 'DisableRegistrationNag'. :-) Have it
accept a specific numeric value (eg., 18438910023). When it
receives this value, it sets IsRegistered to True.

When a programmer registers, you give them the above number, and
tell them that, immediately upon loading your DLL, they have to
call the function with that number.

In each DLL routine, add a check for the value of IsRegistered -
if it's True, you just go ahead. If it's False, you show the nag
screen.

I'd move the nag screen stuff into a non-exported function that
you can just call from any of the other routines.

If any of this is unclear, drop me a note and I'll try to throw
together a quick example.

HTH

Ken
--
Ken White

Clipper Functions for Delphi
http://members.aol.com/clipfunc

Quote
David Howorth wrote:

> Not quite what I'm trying to do, unless I misunderstand what you're
> suggesting.

> It's not the end-users of the DLL from whom I'll be seeking registration
> fees -- it's the programmer who distributes the DLL with his program.  So
> upon registration, he (the programmer) would receive something that would
> enable him to include code in his program that would suppress the start-up
> message.

> I can figure out sort of kludgey ways to do it.  (Have a brief delay before
> the message appears -- if a particular function in the DLL is called with
> the correct parameters before the message fires, it would not go off.)  But
> I'm wondering if there's a more elegant approach.  Probably not, I guess.

> --
> David Howorth
> Dave Parsons wrote in message <76jv5l$g8...@winter.news.rcn.net>...
> >David,
> >  The easiest way would be to have a condition in the DLL's code itself
> that
> >would read a LIC file or registry key to see is this particular user is
> >authorized to use the control. Having done that, you would then pass that
> as
> >a paramter to any internal DLL functions. For example:

> >  Function doThis(x:integer;Y:integer;okay_to_use:boolean):integer;stdcall;
> >   begin
> >      if okay_to_use=true then result:=x+y
> >      else
> >        begin
> >          Showmessage('please register this control');
> >          result:=x+y;
> >       end;
> >  end;

> >Hope that helps!
> >         Good Luck!!
> >    -Dave
> >http://www.erols.com/dparsons

> >David Howorth wrote in message ...
> >>I have seen adverti{*word*224}ts for shareware DLL's with a registration
> >>inducement that work as follows:

> >>The developer can include the DLL with his program even if he hasn't
> >>registered it (in the shareware sense), but the DLL will display a message
> >>as it's being loaded along the lines of "FOO.DLL by Joe Blow."  If the
> >>developer registers, that message will not be displayed when the DLL loads
> >>on the end-user's machine.

> >>Getting the message to display during load would be easy to do, I assume
> >>just by including the appropriate routine in the DLL's initialization
> >>section.  But how does one suppress it?

> >>No, I'm not trying to crack someone else's DLL protection-scheme.  I want
> >to
> >>include this scheme in a DLL I'm writing.  (I.e., you can pay a
> >>registration/license fee or use it without payment if you don't mind a
> >brief
> >>adverti{*word*224}t for it appearing.)

> >>--
> >>David Howorth

Other Threads