Mega Code Archive

 
Categories / Delphi / Examples
 

A shareware nag example [for shareware developers]

This here little piece of code GOT to be the quickest way to create a true shareware nag, that gives people the full functionality of the program, yet nags people big time untill they register (cruel, huh :) ) This shareware nag makes sure that the user can only execute your program once every Windows session. In your FormShow event: // From: Karsten Heitmann procedure TForm1.FormShow (Sender: TObject); var atom : integer; CRLF : string; begin if GlobalFindAtom ('THISISSOMEOBSCUREETEXT') = 0 then atom := GlobalAddAtom ('THISISSOMEOBSCUREETEXT') else begin CRLF := #10#13; ShowMessage ('This version may only be run once every Windows Session.' + CRLF + 'To run this application again, you need to restart Windows,' + CRLF + 'or purchase a license.!!'); Close end end;