http://krinkels.org/resources/botva2.47/
Во вложении пример.
Код:
;Created by South.Tver 02.2010
;пример работы с BtnGetText, BtnSetText, BtnSetFontColor, BtnSetTextAlignment
#include "Modules\botva2.iss"
[Setup]
AppName=BtnPrint by South.Tver
AppVerName=BtnPrint by South.Tver
DefaultDirName={pf}\BtnPrint
OutputBaseFilename=setup
[Files]
Source: Files\*; Flags: dontcopy
[Code]
var
hBtn:HWND;
Form: TSetupForm;
procedure BtnClick(hBtn:HWND);
begin
Form.ShowModal;
end;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
if not FileExists(ExpandConstant('{tmp}\button2.png')) then ExtractTemporaryFile('button2.png');
if not FileExists(ExpandConstant('{tmp}\1.png')) then ExtractTemporaryFile('1.png');
Result:=True;
end;
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
GWL_WNDPROC = -4;
WM_NCLBUTTONDOWN = $00A1;
type
LPARAM = Integer;
WPARAM = Integer;
LRESULT = Integer;
TFNWndProc = Integer;
var
OldWindowProc: Longint;
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function CallWindowProc(lpPrevWndFunc: TFNWndProc; hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; external 'CallWindowProc{#A}@user32.dll stdcall';
function WindowProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
case Msg of
WM_NCLBUTTONDOWN:
begin
Msg := 0;
if Form.Visible then
Form.Close;
end;
end;
Result := CallWindowProc(OldWindowProc, hWnd, Msg, wParam, lParam);
end;
procedure InitializeWizard;
begin
with WizardForm do begin
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
Width:= ScaleX(700);
Height:= ScaleY(700);
NextButton.Top:=ClientHeight-ScaleY(50);
CancelButton.Top:=ClientHeight-ScaleY(50);
end;
Form := CreateCustomForm;
with Form do
begin
Width := ScaleX(750);
Height := ScaleY(375);
CenterInsideControl(WizardForm, False);
end;
CreateFormFromImage(Form.Handle,ExpandConstant('{tmp}\1.png'));
ImgApplyChanges(Form.Handle);
OldWindowProc := SetWindowLong(Form.Handle, GWL_WNDPROC, CallbackAddr('WindowProc'));
hBtn:= BtnCreate(WizardForm.Handle,-50,-50,WizardForm.ClientWidth+100,WizardForm.ClientHeight+100,ExpandConstant('{tmp}\button2.png'),18,True);
BtnSetFontColor(hBtn,$DAE369,$FF0000,$00FF00,$0000FF);
BtnSetEvent(hBtn,BtnClickEventID,WrapBtnCallback(@BtnClick,1));
end;
procedure DeinitializeSetup;
begin
SetWindowlong(Form.Handle, GWL_WNDPROC, OldWindowProc);
gdipShutdown;
end;
Вложения
-
286.9 KB Просмотры: 54
Последнее редактирование: