लाइसेंस बॉक्स का आकार बदलना बहुत अच्छा काम नहीं करता है, इसलिए इसके बजाय हमने वर्डपैड में लाइसेंस देखने के लिए एक बटन प्रदान करना समाप्त कर दिया। यह आश्चर्यजनक रूप से अच्छी तरह से काम करता है; मैं इसे अंत में पसंद आया। कोड:
procedure ViewLicenseButtonClick(Sender: TObject);
var WordpadLoc: String;
RetCode: Integer;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE', '', WordpadLoc);
// on NT/2000 it's a REG_EXPAND_SZ, so expand constant ProgramFiles
StringChange(WordpadLoc, '%ProgramFiles%', ExpandConstant('{pf}'));
// remove " at begin and end pf string
StringChange(WordpadLoc, '"', '');
try
ExtractTemporaryFile('LicenseAgreement.rtf')
except
MsgBox('Cannot extract license file.', mbError, mb_Ok);
end;
if not Exec(WordpadLoc, '"' + ExpandConstant('{tmp}\LicenseAgreement.rtf') + '"', '', SW_SHOW, ewNoWait, RetCode) then
MsgBox('Cannot display license file.', mbError, mb_Ok);
end;
procedure CurPageChanged(CurPageID: Integer);
var ViewLicenseButton: TButton;
begin
if CurPageID = wpLicense then begin
ViewLicenseButton := TButton.Create(WizardForm.LicenseMemo.Parent);
ViewLicenseButton.Caption := '&View in WordPad';
ViewLicenseButton.Width := 120;
ViewLicenseButton.Left := WizardForm.LicenseMemo.Left +
WizardForm.LicenseMemo.Width - ViewLicenseButton.Width;
ViewLicenseButton.Top := WizardForm.LicenseMemo.Top +
WizardForm.LicenseMemo.Height + 16;
ViewLicenseButton.OnClick := @ViewLicenseButtonClick;
ViewLicenseButton.Parent := WizardForm.LicenseAcceptedRadio.Parent;
end;
end;
स्रोत
2012-01-22 10:28:09
बस यह उल्लेख करना चाहता था कि हमने अंत में इसका उपयोग नहीं किया। समस्या यह है कि यदि उपयोगकर्ता इंस्टॉलर को ले जाता है (कहें, एक अलग मॉनीटर पर), यह कोड इसे डिफ़ॉल्ट स्थिति में रीसेट करता है। जो काफी परेशान है। मैं इसे स्वीकार कर दूंगा क्योंकि यह एकमात्र उत्तर है जो प्रश्न को संबोधित करता है, लेकिन मैंने वर्डपैड बटन कोड को एक अलग उत्तर के रूप में भी पोस्ट किया है। –