[Setup] AppName=MyKeygen AppVerName=MyKeygen v 1.0 AppPublisher=Serega AppPublisherURL=http://www.forum.oszone.ru/member.php?userid=88670 VersionInfoDescription=MyKeygen VersionInfoVersion=1 CreateAppDir=False OutputDir=. OutputBaseFilename=MyKeygen Compression=lzma/ultra InternalCompressLevel=ultra SolidCompression=yes [Code] // Данный скрипт создан в ознакомительных целях const MB_ICONASTERISK = $00000040; // проигрывает звук "Звездочка" (SystemAsterisk) MB_ICONEXCLAMATION = $00000030; // проигрывает звук "Восклицание" (SystemExclamation) MB_ICONHAND = $00000010; // проигрывает звук "Критическая ошибка" (SystemHand) MB_ICONQUESTION = $00000020; // проигрывает звук "Вопрос" (SystemQuestion) // MB_OK = $00000000; // проигрывает звук "Стандартный звук" (SystemDefault) // Вызывает пищание системного динамика. function MessageBeep(BeepType: Word): Boolean; external 'MessageBeep@user32.dll stdcall'; var Form: TForm; lbl1, lbl2, lbl3: TLabel; edt1, edt2: TEdit; btn1, btn2: TButton; function Serial(b: Byte): string; var r,i: Integer; str: string; begin str:='AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'; for i:=1 to b do begin r:= Random(61); if r > 9 then Result:= Result + str[r-9] else Result:= Result + IntToStr(r); end; end; procedure btn1OnClick(Sender: TObject); begin MessageBeep(MB_ICONASTERISK); edt2.Text:= Serial(30); end; procedure btn2OnClick(Sender: TObject); begin MessageBeep(MB_ICONEXCLAMATION); Form.Close; end; procedure CreateComponents; begin //Form Form:= TForm.Create(Application); try with Form do begin BorderIcons:= []; BorderStyle:= bsDialog; Caption:= 'MyKeygen'; SetBounds(439,231,240,200); Color:= clBlack; Font.Color:= clWhite; Font.Height:= -11; Font.Name:= 'MS Sans Serif'; Font.Style:= []; PixelsPerInch:= 96; Position:= poScreenCenter; end; //lbl1 lbl1:= TLabel.Create(Form); with lbl1 do begin Parent:= Form; SetBounds(24,8,22,13); Caption:= 'Имя:'; end; //lbl2 lbl2:= TLabel.Create(Form); with lbl2 do begin Parent:= Form; SetBounds(24,56,86,13); Caption:= 'Серийный номер:'; end; //lbl3 lbl3:= TLabel.Create(Form); with lbl3 do begin Parent:= Form; AutoSize:= False; SetBounds(33,145,185,13); Caption:= 'MyKeygen v1.0 created by Serega'; end; //edt1 edt1:= TEdit.Create(Form); with edt1 do begin Parent:= Form; SetBounds(24,24,185,21); Color:= clBlack; Text:= GetUserNameString; TabOrder:= 0; end; //edt2 edt2:= TEdit.Create(Form); with edt2 do begin Parent:= Form; SetBounds(24,72,185,21); Color:= clBlack; Text:= Serial(30); TabOrder:= 1; end; //btn1 btn1:= TButton.Create(Form); with btn1 do begin Parent:= Form; SetBounds(24,112,90,25); Caption:= 'Генерировать'; OnClick:= @btn1OnClick; TabOrder:= 2; Cursor:= crHand; // ModalResult:= mrOk; end; //btn2 btn2:= TButton.Create(Form); with btn2 do begin Parent:= Form; SetBounds(120,112,90,25); Caption:= 'Закрыть'; OnClick:= @btn2OnClick; TabOrder:= 3; Cursor:= crHand; end; Form.ActiveControl:= edt2; Form.ShowModal; finally Form.Free; end; end; function InitializeSetup: Boolean; begin CreateComponents; end; |