|
#1
|
|||
|
|||
|
Help me about change button to image
Please help me !
How to change button (as cancel, next) to the image ![]() THank you everyone !
|
| Sponsored Links |
|
#2
|
|||
|
|||
|
Quote:
better give examples with jpg, so we do not know English well translated, we can better understand the message
|
|
#3
|
|||
|
|||
|
Quote:
![]() like this :
|
|
#4
|
||||
|
||||
|
Use botva2. Download example from krinkels.org. For this script, it will very complicated and ugly
|
| The Following 2 Users Say Thank You to Razor12911 For This Useful Post: | ||
Dante1995 (10-11-2014), minh_k43sj (10-11-2014) | ||
|
#5
|
|||
|
|||
|
example
Code:
[Files]
Source: botva2.dll; DestDir: {tmp}; Flags: dontcopy
Source: compiler:innocallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: Button.png; DestDir: {tmp}; Flags: dontcopy
[code/]
type
TButtonInfo = record ButtonName: array of TButton; Handle: array of HWND; Count: Integer; end;
TBtnEventProc = procedure(h:HWND);
const
BtnClickEventID = 1;
BtnMouseEnterEventID = 2;
BtnMouseLeaveEventID = 3;
BtnMouseMoveEventID = 4;
balLeft = 0;
balCenter = 1;
var
ButtonsBuff: TButtonInfo;
HCancelButton, HNextButton, HBackButton, HDirBrowseButton, HGroupBrowseButton: HWND;
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@files:innocallback.dll stdcall';
function BtnCreate(hParent:HWND; Left,Top,Width,Height:integer; FileName:PChar; ShadowWidth:integer; IsCheckBtn:boolean):HWND; external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetPosition(h:HWND; NewLeft, NewTop, NewWidth, NewHeight: integer); external 'BtnSetPosition@files:botva2.dll stdcall';
procedure BtnRefresh(h:HWND); external 'BtnRefresh@files:botva2.dll stdcall';
function BtnGetChecked(h:HWND):boolean; external 'BtnGetChecked@files:botva2.dll stdcall';
procedure BtnSetChecked(h:HWND; Value:boolean); external 'BtnSetChecked@files:botva2.dll stdcall';
procedure BtnSetText(h:HWND; Text:PAnsiChar); external 'BtnSetText@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetTextAlignment(h:HWND; HorIndent, VertIndent:integer; Alignment:DWORD); external 'BtnSetTextAlignment@files:botva2.dll stdcall';
procedure BtnSetVisibility(h:HWND; Value:boolean); external 'BtnSetVisibility@files:botva2.dll stdcall';
function BtnGetEnabled(h:HWND):boolean; external 'BtnGetEnabled@files:botva2.dll stdcall';
procedure BtnSetEnabled(h:HWND; Value:boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFont(h:HWND; Font:Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFontColor(h:HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor: Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEvent(h:HWND; EventID:integer; Event:Longword); external 'BtnSetEvent@files:botva2.dll stdcall';
procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@files:botva2.dll stdcall';
function GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@files:botva2.dll stdcall';
procedure gdipShutdown; external 'gdipShutdown@files:botva2.dll stdcall';
procedure UpdateButtons();
var I: integer;
begin
for I:=0 to (ButtonsBuff.Count-1) do begin
BtnSetEnabled(ButtonsBuff.Handle[I], ButtonsBuff.ButtonName[I].Enabled)
BtnSetVisibility(ButtonsBuff.Handle[I], ButtonsBuff.ButtonName[I].Visible)
BtnSetText(ButtonsBuff.Handle[I], ButtonsBuff.ButtonName[I].Caption)
BtnRefresh(ButtonsBuff.Handle[I])
end;
end;
procedure ButtonOnClick(hBtn: HWND);
var Btn: TButton; I: Integer;
begin
for I:=0 to (ButtonsBuff.Count-1) do begin
if hBtn = ButtonsBuff.Handle[I] then Btn:= ButtonsBuff.ButtonName[I];
end;
Btn.OnClick(Btn)
UpdateButtons;
end;
function EffectTextureButton(Handle: HWND; Button: TButton; ImageName: PAnsiChar; ShadowWidth: Integer; EnterEvent, MoveEvent, LeaveEvent: TbtnEventProc): HWND;
begin
Result:=BtnCreate(Handle, Button.Left-8, Button.Top-8, Button.Width+16, Button.Height+16, ImageName, ShadowWidth, False) //Размеры подобраны для текущей текстуры
BtnSetEvent(Result, BtnClickEventID, WrapBtnCallback(@ButtonOnClick, 1))
if EnterEvent <> nil then BtnSetEvent(Result, BtnMouseEnterEventID, WrapBtnCallback(EnterEvent, 1));
if MoveEvent <> nil then BtnSetEvent(Result, BtnMouseMoveEventID, WrapBtnCallback(MoveEvent, 1));
if LeaveEvent <> nil then BtnSetEvent(Result, BtnMouseLeaveEventID, WrapBtnCallback(LeaveEvent, 1));
BtnSetFont(Result, Button.Font.Handle)
BtnSetText(Result, Button.Caption);
BtnSetVisibility(Result, Button.Visible);
BtnSetFontColor(Result,clBlack,clBlack,clBlack,clGray);
BtnSetCursor(Result,GetSysCursorHandle(32649));
Button.Width:=0; Button.Height:= 0;
SetArrayLength(ButtonsBuff.Handle, ButtonsBuff.Count+1);SetArrayLength(ButtonsBuff.ButtonName, ButtonsBuff.Count+1);
ButtonsBuff.ButtonName[ButtonsBuff.Count]:= Button; ButtonsBuff.Handle[ButtonsBuff.Count]:= Result;
ButtonsBuff.Count:= ButtonsBuff.Count+1;
end;
procedure ButtonChangeFont(ButtonHandle: HWND; Font: TFont; NormalColor, FocusedColor, PressedColor, DisabledColor: Cardinal);
begin
if Font <> nil then BtnSetFont(ButtonHandle, Font.Handle);
BtnSetFontColor(ButtonHandle, NormalColor, FocusedColor, PressedColor, DisabledColor)
end;
procedure InitializeWizard();
begin
ExtractTemporaryFile('Button.png')
HNextButton:= EffectTextureButton(WizardForm.Handle, WizardForm.NextButton, ExpandConstant('{tmp}\Button.png'), 18, nil, nil, nil)
HCancelButton:= EffectTextureButton(WizardForm.Handle, WizardForm.CancelButton, ExpandConstant('{tmp}\Button.png'), 18, nil, nil, nil)
HBackButton:= EffectTextureButton(WizardForm.Handle, WizardForm.BackButton, ExpandConstant('{tmp}\Button.png'), 18, nil, nil, nil)
HDirBrowseButton:= EffectTextureButton(WizardForm.Handle, WizardForm.DirBrowseButton, ExpandConstant('{tmp}\Button.png'), 18, nil, nil, nil)
HGroupBrowseButton:= EffectTextureButton(WizardForm.Handle, WizardForm.GroupBrowseButton, ExpandConstant('{tmp}\Button.png'), 18, nil, nil, nil)
end;
procedure CurPageChanged(CurPageId: Integer);
begin
UpdateButtons
end;
procedure DeinitializeSetup();
begin
gdipShutdown
end;
Last edited by by_pbh; 10-11-2014 at 08:38. |
| The Following 3 Users Say Thank You to by_pbh For This Useful Post: | ||
|
#6
|
|||
|
|||
| The Following User Says Thank You to Dante1995 For This Useful Post: | ||
Razor12911 (10-11-2014) | ||
|
#7
|
||||
|
||||
|
Nice example by_pbh,
What a repack name Thong Repacks, the word "Thong" lol. I am sure they make explicit repacks Last edited by Razor12911; 10-11-2014 at 08:45. |
| The Following User Says Thank You to Razor12911 For This Useful Post: | ||
minh_k43sj (10-11-2014) | ||
|
#8
|
|||
|
|||
|
I think he just wants to Music button
Code:
[Setup]
AppName=MusicBtn
AppVersion=MusicBtn
DefaultDirName=MusicBtn
OutputDir=.
[Files]
Source: Files\*; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
[ Code]
const
BtnClickEventID = 1;
var
MusicPlayed: boolean;
type
TBtnEventProc = procedure (h:HWND);
var
h,MusicBtn:HWND;
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword;
external 'wrapcallbackaddr@{tmp}\CallbackCtrl.dll stdcall delayload';
function BtnCreate(hParent :HWND; Left, Top, Width, Height :integer; FileName :PAnsiChar; ShadowWidth :integer; IsCheckBtn :boolean) :HWND;
external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEvent(h :HWND; EventID :integer; Event :Longword);
external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown;
external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
function mciSendString(lpstrCommand, lpstrReturnString: PAnsiChar; uReturnLength: Cardinal; hWndCallback: HWND): Cardinal;
external '[email protected] stdcall';
procedure MusicButtonOnClick(hBtn:HWND);
begin
If MusicPlayed
then
begin
mciSendString('pause Music','',0,0);
MusicPlayed:=false;
end
else
begin
mciSendString('open '+ExpandConstant('{tmp}\AutorunMusic.mp3')+' alias Music','',0,0);
mciSendString('play Music repeat','',0,0);
MusicPlayed:=true;
end;
end;
procedure InitializeWizard();
begin
with WizardForm do begin
mciSendString('open '+ExpandConstant('{tmp}\AutorunMusic.mp3')+' alias Music','',0,0);
mciSendString('play Music repeat','',0,0);
MusicPlayed:=true;
MusicBtn:=BtnCreate(WizardForm.Handle,20,317,40,40,ExpandConstant('{tmp}')+'\MusicButton.png',0,True);
BtnSetEvent(MusicBtn,BtnClickEventID,WrapBtnCallback(@MusicButtonOnClick,1));
end;
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('musicbutton.png');
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('AutorunMusic.mp3');
Result:=True;
end;
procedure DeinitializeSetup();
begin
gdipShutdown;
end;
Last edited by Dante1995; 28-12-2014 at 20:54. |
| The Following User Says Thank You to Dante1995 For This Useful Post: | ||
minh_k43sj (10-11-2014) | ||
|
#9
|
|||
|
|||
|
Quote:
but i'am nood, if you can, please add this scrip, help me ! Last edited by minh_k43sj; 10-11-2014 at 11:11. |
|
#10
|
|||
|
|||
|
no friend! you have to commit... you already have the solution
|
| The Following User Says Thank You to Dante1995 For This Useful Post: | ||
minh_k43sj (10-11-2014) | ||
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Far Cry 2 Mini Image | Cornflake | PC Games | 1 | 08-12-2020 05:15 |
| How to make Crysis mini image | SuppA-SnipA | PC Games | 15 | 04-12-2008 21:05 |
| Backup Guide | krondike | PC Games | 3 | 11-10-2003 21:42 |
| Warcraft III working Image | ZoneMaster43 | PC Games | 4 | 19-04-2003 17:47 |
| change a nero cd-image into a dvd image? | lizardking | PS2 Games | 12 | 30-10-2002 14:55 |