Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

SHVtYW4=


Сообщения: 3451
Благодарности: 1273

Профиль | Отправить PM | Цитировать


Цитата Johny777:
только-что проверил. Кажись всё в порядке. »
читать дальше »
Код: Выделить весь код
[Setup]
AppName=My Program
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program
Compression=none
AppId=TheBestAppId
DisableWelcomePage=yes
DisableFinishedPage=yes
DisableDirPage=yes
DisableReadyPage=yes


[Components]
Name: a; Description: A


[Files]
Source: A.bmp; Flags: dontcopy nocompression


[Code]
#ifdef UNICODE
    #define A "W"
#else
    #define A "A"
#endif

const
    UNDEF_INDEX = -777;
    ALPHA_BLEND_LEVEL = 128; // max=Byte=255

    WS_EX_LAYERED = $80000;
    WS_EX_TRANSPARENT = $20;
    LWA_COLORKEY = 1;
    LWA_ALPHA = 2;
    GWL_EXSTYLE = (-20);


var
    InfoPic: TBitmapImage;
    LastIndex: Integer;
    TempPath: String;
    PicForm: TForm;


type
    COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external 'SetFocus@user32.dll stdcall';


procedure ShowPicHint(const PicFilePath: String);
var
    pt: TPoint;
begin
    if not GetCursorPos(pt) then Exit;
    InfoPic.Bitmap.LoadFromFile(PicFilePath);
    try
        with PicForm do
        begin
            SetBounds(ScaleX(pt.x + 16), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
            SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
            SetLayeredWindowAttributes(Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
            Show;
        end;
    finally
        SetFocus(WizardForm.Handle);
    end;
end;


procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
    UndefPic: String;
begin
    if Index = -1 then Exit;
    if Index = LastIndex then Exit;
    try
        case TNewCheckListBox(Sender).ItemCaption[Index] of
            'A': UndefPic := 'A.bmp';
        else
            begin
                LastIndex := UNDEF_INDEX;
                PicForm.Hide;
                Exit;
            end;
        end;
        if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
        ShowPicHint(TempPath + UndefPic);
    finally
        LastIndex := Index;
    end;
end;


procedure CompOnMouseLeave(Sender: TObject);
begin
    PicForm.Hide;
end;


procedure InitInfo();
begin
    WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
    TempPath := AddBackslash(ExpandConstant('{tmp}'));
    LastIndex := UNDEF_INDEX;
    PicForm := TForm.Create(WizardForm)
    with PicForm do
    begin
        BorderStyle := bsNone;
        FormStyle := fsStayOnTop;
        InfoPic := TBitmapImage.Create(PicForm)
        with InfoPic do
        begin
            Parent := PicForm;
            AutoSize := True;
        end;
    end;
end;


procedure InitializeWizard();
begin
    InitInfo();
end;

Да вот смотрю, в первый раз картинка появляется. Потом отвожу курсор, ещё раз навожу и уже не появляется.
При трёх компонентах нормально.

Dinvin4ester,
Если файлы разные
Код: Выделить весь код
[Files]
Source: Твой_файл1.exe; DestDir: {commondesktop}
Source: Твой_файл2.exe; DestDir: {commondesktop}
Если файл один и тот же
Код: Выделить весь код
[Files]
Source: Твой_файл.exe; DestDir: {commondesktop}; DestName: Твой_файл1.exe
Source: Твой_файл.exe; DestDir: {commondesktop}; DestName: Твой_файл2.exe

-------
09a468a9b4293cd82adf6d6c60a9da82 | Tm9yZGVr
В связи со сменой железа и переходом на LInux с полным отказом от Windows - посещение на форуме будет редким.

Это сообщение посчитали полезным следующие участники:

Отправлено: 23:16, 05-12-2013 | #1630