sergey3695
03-06-2013, 16:09
можно ли на скин наложить кнопки закрыть и свернуть через ботву? »
каким образом? изображение можно поменять на кнопках с помощью SkinBuilder.
если ты хочешь через ботву то только так
#include "botva2.iss"
#define FormPic "form.png"
#define CloseBtnPic "closebtn.png"
#define MinimizeBtnPic "minimizebtn.png"
[Setup]
AppName=Temp
AppVerName=Temp
DefaultDirName={pf}\Temp
VersionInfoCopyright=VoLT
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[Files]
Source: InstallFiles\*; DestDir: {tmp}; Flags: dontcopy sortfilesbyextension
[_code]
var
WizardImg: Longint;
hCloseBtn, hMinimizeBtn, MusicButton,
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn: HWND;
function SetWindowLong(hWnd: Longint; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetLayeredWindowAttributes(hWnd : Longint; crKey : TColor; bAlpha : byte; dwFlags : DWORD): BOOL; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
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;
//************************************************ [Начало - Вставка изображений] ***************************************************//
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 CreateWizardImage;
begin
with WizardForm do begin
BorderStyle:=bsNone;
Bevel.Hide;
InnerNotebook.Hide;
OuterNotebook.Hide;
SetBounds(ScaleX(0), ScaleY(0), ScaleX(600), ScaleY(490));
Position:=poScreenCenter;
end;
with TLabel.Create(WizardForm) do begin
Parent:=WizardForm;
AutoSize:=False;
SetBounds(ScaleX(70), ScaleY(7), ScaleX(370), ScaleY(16));
Font.Name:= 'Georgia';
Font.Size:= 9;
Transparent:=True;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
OnMouseDown:=@LabelOnMouseDown;
Caption:=WizardForm.Caption;
end;
ExtractTemporaryFile('{#FormPic}');
ExtractTemporaryFile('{#CloseBtnPic}');
ExtractTemporaryFile('{#MinimizeBtnPic}');
ExtractTemporaryFile('button.png');
WizardImg:=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,0,1);
end;
//************************************************ [Конец - Вставка изображений] ***************************************************//
//************************************************ [Начало - Текстуры кнопок] ***************************************************//
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
//sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
procedure WFBtnEnter(hBtn:HWND);
begin
//sndPlaySound(ExpandConstant('{tmp}\WFEnter.wav'),$0001);
end;
procedure ButtonsTextures;
begin
//WFButtonFont:=TFont.Create;
//WFButtonFont.Style:=[fsBold];
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,225,400,90,90,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
//BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,$b6c4c5,$ffffff,$5d4e27,$B6B6B6);
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,320,400,90,90,ExpandConstant('{tmp}\button.png'),3,False);
BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
//BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$b6c4c5,$ffffff,$5d4e27,$B6B6B6);
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,430,400,90,90,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
//BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$b6c4c5,$ffffff,$5d4e27,$B6B6B6);
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,401,202,85,85,ExpandConstant('{tmp}\button.png'),10,False );
BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
//BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$b6c4c5,$ffffff,$5d4e27,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,401,202,85,85,ExpandConstant('{tmp}\button.png'),10,Fal se);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
//BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$b6c4c5,$ffffff,$5d4e27,$B6B6B6);
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
hCloseBtn:=BtnCreate(WizardForm.Handle,516,35,16,16,ExpandConstant('{tmp}')+'\{#CloseBtnPic}',3,Fals e);
BtnSetEvent(hCloseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCloseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetEvent(hCloseBtn,BtnClickEventID,WrapBtnCallback(@CloseBtnClick,1));
BtnSetCursor(hCloseBtn,GetSysCursorHandle(32649));
hMinimizeBtn:=BtnCreate(WizardForm.Handle,498,35,16,16,ExpandConstant('{tmp}')+'\{#MinimizeBtnPic}', 3,False);
BtnSetEvent(hMinimizeBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hMinimizeBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetEvent(hMinimizeBtn,BtnClickEventID,WrapBtnCallback(@MinimizeBtnClick,1));
BtnSetCursor(hMinimizeBtn,GetSysCursorHandle(32649));
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
procedure InitializeWizard;
begin
CreateWizardImage;
ButtonsTextures;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
ImgApplyChanges(WizardForm.Handle);
end;
procedure DeinitializeSetup;
begin
gdipShutdown;
end;
Johny777
04-06-2013, 22:11
habib2302, Сокрытие месседжбокса после удаления:
[code]
const
ID_QUESTION = 65579;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
if not UninstallSilent then
begin
Exec(ExpandConstant('{uninstallexe}'), '/SILENT', '', SW_SHOW, ewNoWait, ErrorCode);
Exit;
end;
if MsgBoxEx(0, FmtMessage(SetupMessage(msgConfirmUninstall), ['{#SetupSetting("AppName")}'] ), SetupMessage(msgUninstallAppTitle), MB_YESNO, ID_QUESTION, 0) = IDYES then Result := True;
end;
El Sanchez
04-06-2013, 22:12
мне кто нибудь ответит на мое сообщение???? »
habib2302, на основе примера из шапки:
const
WM_CLOSE = $0010;
function SetTimer(hWnd: HWND; nIDEvent: UINT_PTR; uElapse: UINT; lpTimerFunc: Longint): UINT_PTR; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: HWND; uIDEvent: UINT_PTR): BOOL; external 'KillTimer@user32.dll stdcall';
var
iTimer: UINT_PTR;
//////////////////////////////////////////////////////////////////////////////
procedure TimerProc(hwnd: HWND; uMsg: UINT; idEvent: UINT_PTR; dwTime: DWORD);
var
hWindow: HWND;
begin
hWindow := FindWindowByWindowName(FmtMessage(SetupMessage(msgUninstallAppFullTitle), ['{#SetupSetting("AppName")}']));
if hWindow > 0 then
begin
PostMessage(hWindow, WM_CLOSE, 0, 0);
KillTimer(0, iTimer);
end;
end;
////////////////////////////////////////////////////////////////////
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usPostUninstall: iTimer := SetTimer(0, 0, 50, CallbackAddr('TimerProc'));
end;
end;
Johny777
05-06-2013, 12:23
Robby, по имени, с рекурсией:
procedure SearchForFolder(const RootFolder, SearchFolderName: String; var ResultPathArray: array of String);
var
NewSearchPath: String;
FindRec: TFindRec;
Len: Integer;
begin
NewSearchPath := AddBackslash(RemoveBackslash(RootFolder));
if FindFirst(NewSearchPath + '*.*', FindRec) then
try
repeat
if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
begin
if FindRec.Name = SearchFolderName then
begin
Len := GetArrayLength(ResultPathArray);
SetArrayLength(ResultPathArray, Len+1);
ResultPathArray[Len] := NewSearchPath + FindRec.Name;
end
else
SearchForFolder(NewSearchPath + FindRec.Name, SearchFolderName, ResultPathArray);
end;
until not FindNext(FindRec);
finally
FindClose(FindRec);
end;
end;
procedure InitializeWizard();
var
AArray: array of String;
i: Integer;
begin
SearchForFolder('C:\Program Files (x86)\CAPCOM', 'nativePC', AArray);
for i := 0 to GetArrayLength(AArray)-1 do MsgBox(AArray[i], mbInformation, MB_OK);
end;
[/font]
по завершении входной массив содержит пути к папкам с искомым именем
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.