#include "botva2.iss" #define FormPic "form.png" #define CloseBtnPic "closebtn.png" #define MinimizeBtnPic "minimizebtn.png" [Setup] AppName=Call of Duty Black Ops AppVerName=Call of Duty Black Ops DefaultDirName={pf}\Call of Duty Black Ops [Files] Source: Files\*; DestDir: {tmp}; Flags: dontcopy sortfilesbyextension [Code] var hMinimizeBtn,hCloseBtn: HWND; AImg: array of Longint; function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall'; function SetLayeredWindowAttributes(hwnd: hWnd; crKey: TColor; bAlpha: byte; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall'; function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall'; function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall'; function InitializeSetup:boolean; begin if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll'); if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll'); Result:=True; end; procedure CloseBtnClick(hBtn:HWND); begin WizardForm.Close; end; procedure MinimizeBtnClick(hBtn:HWND); begin SendMessage(WizardForm.Handle,$0112,61472,0); end; procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; SendMessage(WizardForm.Handle,$0112,$F012,0) end; procedure InitializeWizard; begin ExtractTemporaryFile('{#FormPic}'); ExtractTemporaryFile('{#CloseBtnPic}'); ExtractTemporaryFile('{#MinimizeBtnPic}'); with WizardForm do begin BorderStyle:=bsNone; Bevel.Hide; InnerNotebook.Hide; OuterNotebook.Hide; Width:=580; Height:=358; Position:=poScreenCenter; end; hCloseBtn:=BtnCreate(WizardForm.Handle,537,2,15,15,ExpandConstant('{tmp}')+'\{#CloseBtnPic}',3,False); BtnSetEvent(hCloseBtn,BtnClickEventID,WrapBtnCallback(@CloseBtnClick,1)); hMinimizeBtn:=BtnCreate(WizardForm.Handle,510,6,21,7,ExpandConstant('{tmp}')+'\{#MinimizeBtnPic}',3,False); BtnSetEvent(hMinimizeBtn,BtnClickEventID,WrapBtnCallback(@MinimizeBtnClick,1)); with TLabel.Create(WizardForm) do begin Parent:=WizardForm; AutoSize:=False; Top:=3; Left:=0; Width:=WizardForm.Width; Alignment:=taCenter; //Layout:=tlCenter; Transparent:=True; Font.Color:=$EEEEEE; Font.Style:=[fsBold]; Caption:=WizardForm.Caption; OnMouseDown:=@LabelOnMouseDown; end; ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}')+'\{#FormPic}',0,0,0,0,False,True); ImgApplyChanges(WizardForm.Handle); SetWindowLong(WizardForm.Handle,-20,GetWindowLong(WizardForm.Handle,-20) or $80000); SetLayeredWindowAttributes(WizardForm.Handle,$00FF00,255,1); //Создаем лейбл на всю форму, чтоб ее можно было двигать with TLabel.Create(WizardForm) do begin Parent:=WizardForm; AutoSize:=False; Top:=0; Left:=0; Width:=WizardForm.Width; Height:= WizardForm.Height Transparent:=True; OnMouseDown:=@LabelOnMouseDown; end; end; procedure DeinitializeSetup; begin gdipShutdown; SetArrayLength(AImg,0); end; |