WinTB

DLL WinTB 2.1

Нет прав для скачивания

bunti_o4u

Мимокрокодил
It is not working properly with windows 10 latest update.

I would appreciate if you can give some of your precious time to update the wintb.
 

ffmla

Участник
Код:
SetTaskBarThumbnailClip(0, 0, WizardForm.WizardBitmapImage.Height, WizardForm.WizardBitmapImage.Width);
Это нужно когда окно без заголовка. Или например на форме слайды и нужно на миниатюре отобразить только область со слайдами
In the above attached WinTB example, have the line DisableReadyPage=yes in Setup section.When i disable this line(To enable ready page) installer popup the Cannot focus a disabled or invisible window. error message.
1.How to avoid this error in the above example?.
One more help related with wizardform.Componentslist section.
Код:
#ifndef UNICODE
  #pragma error 'Inno Setup (u) is required to compile this script'
#endif

#define MyAppName "WinTB"
#define MyAppVersion "1.0"
#define MyAppExeName "MyProg.exe"

[setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=.
DisableWelcomePage=no
DisableReadyPage=yes

[files]
Source: "tb.dll"; Flags: dontcopy nocompression;

[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: Icons; Description:Additional icons:; Types: custom; Flags: fixed
Name: Icons\CreateDesktopIcon; Description:Create a shortcut on the desktop; Types: custom;
Name: Icons\StartMenuIcon; Description:Create a shortcuts in the Start Menu; Types: custom;
#ifdef Components
Name: Lang; Description: Localization language:; Types: custom; Flags: fixed
Name: Lang/rus; Description: Russian; Flags: exclusive;
Name: Lang/eng; Description: English; Flags: exclusive;
#endif
Name: Redist; Description:Additional Software:; Types: custom; Flags: fixed
Name: Redist\Redist1; Description:Install\Update Microsoft DirectX (òðåáóåòüñÿ ñîåäèíåíèå ñ èíòåðíåòîì); Types: custom;
Name: Redist\Redist2; Description:Install\Update Microsoft Visual C++ Redist; Types: custom;

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Icons\StartMenuIcon
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Icons\CreateDesktopIcon

[code]

const
  TBPF_NOPROGRESS         = 0;
  TBPF_INDETERMINATE      = 1;
  TBPF_NORMAL             = 2;
  TBPF_ERROR              = 4;
  TBPF_PAUSED             = 8;

  MF_BYCOMMAND            = 0;
  MF_ENABLED              = 0;
  MF_GRAYED               = 1;
  MF_DISABLED             = 2;
  SC_CLOSE                = 61536;

type
  PWideChar = String;

procedure SetTaskBarThumbnailClip(left, top, bottom, right: integer); external 'SetTaskBarThumbnailClip@{tmp}\tb.dll stdcall delayload';
procedure SetTaskBarProgressValue(value: integer); external 'SetTaskBarProgressValue@{tmp}\tb.dll stdcall delayload';
procedure SetTaskBarProgressState(value: integer); external 'SetTaskBarProgressState@{tmp}\tb.dll stdcall delayload';
procedure SetTaskBarTitle(const caption: pwidechar); external 'SetTaskBarTitle@{tmp}\tb.dll stdcall delayload';
procedure SetTaskBarThumbnailTooltip(const caption: pwidechar); external 'SetTaskBarThumbnailTooltip@{tmp}\tb.dll stdcall delayload';

function GetForegroundWindow: HWND; external 'GetForegroundWindow@user32.dll stdcall delayload';
function SetForegroundWindow(hWnd: HWND): BOOL; external 'SetForegroundWindow@user32.dll stdcall delayload';
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): LongWord; external 'GetSystemMenu@user32.dll stdcall';
function EnableMenuItem(hMenu: THandle; uIDEnableItem: Longword; uEnable: Longword): Boolean; external 'EnableMenuItem@user32.dll stdcall';

procedure MShow(Sender: TObject);
begin
  MainForm.Show;
  if GetForegroundWindow = WizardForm.Handle then
    SetForegroundWindow(MainForm.Handle);
end;

procedure DirOnClick(Sender: TObject);
var
  UserSelectDir: String;
begin
  UserSelectDir:= WizardForm.DirEdit.Text;
  if BrowseForFolder(SetupMessage(msgBrowseDialogLabel), UserSelectDir, True) then
    WizardForm.DirEdit.Text:= UserSelectDir;
end;

procedure InitializeWizard();
var
  r: TRect;
begin
  ExtractTemporaryFile('tb.dll');

  SetTaskBarProgressState(TBPF_PAUSED);
  SetTaskBarProgressValue(10);
  SetTaskBarThumbnailTooltip('WinTB - Setup');
  SetTaskBarTitle('WinTB');

  //SetTaskBarThumbnailClip(0, 0, WizardForm.WizardBitmapImage.Height+26, WizardForm.WizardBitmapImage.Width+500);
  SetTaskBarThumbnailClip(0, 0, WizardForm.Height, WizardForm.Width);

  with MainForm do begin
    Width := WizardForm.Width;
    Height := WizardForm.Height;
    BorderIcons := WizardForm.BorderIcons;
    BorderStyle := WizardForm.BorderStyle;
    Position:= poScreenCenter;
    with TBitmapImage.Create(MainForm) do begin
      Parent := MainForm;
      Width := MainForm.ClientWidth;
      Height := MainForm.ClientHeight;
      with Bitmap do begin
        Width := Width;
        Height := Height;
        Canvas.Brush.Color := clWindow;
        r.Left := 0;
        r.Top := 0;
        r.Right := WizardfOrm.ClientWidth;
        r.Bottom := WizardForm.ClientHeight;
        Canvas.FillRect(r);
      end;
    end;
  end;
  with WizardForm do begin
    Left:= -10000;
    OnShow:= @MShow;
    NextButton.Parent:= MainForm;
    BackButton.Parent:= MainForm;
    CancelButton.Parent:= MainForm;
    OuterNotebook.Parent:= MainForm;
    Bevel.Parent:= MainForm;
    DirBrowseButton.OnClick:= @DirOnClick;
  end;
  with WizardForm.ComponentsList do
  begin
    Parent:=WizardForm.SelectDirPage;
    SetBounds(ScaleX(220),ScaleY(155),ScaleX(200),ScaleY(80));
    WantTabs:=True;
    Color:= WizardForm.Color;
    BorderStyle:=bsSingle//
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID=wpSelectDir then
    WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
  if CurPageID=wpFinished then
    EnableMenuItem(GetSystemMenu(MainForm.Handle, false), SC_CLOSE, MF_DISABLED or MF_BYCOMMAND);
end;
if i compile the above code in componentslist not visible.
2.How to solve this component list bug.?

Anyone help me...!

Thanks in advance...:help:
 
Последнее редактирование:

Nemko

Дилетант
Модератор
ffmla, maybe this:
Код:
[setup]
AppName=Test
AppVersion=0.1
DefaultDirName={sd}\Test
DisableWelcomePage=no

[Files]
Source: "TB.dll"; Flags: dontcopy nocompression;

[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: Icons; Description:Additional icons:; Types: custom; Flags: fixed
Name: Icons\CreateDesktopIcon; Description:Create a shortcut on the desktop; Types: custom;
Name: Icons\StartMenuIcon; Description:Create a shortcuts in the Start Menu; Types: custom;

#ifdef Components
Name: Lang; Description: Localization language:; Types: custom; Flags: fixed
Name: Lang/rus; Description: Russian; Flags: exclusive;
Name: Lang/eng; Description: English; Flags: exclusive;
#endif
Name: Redist; Description:Additional Software:; Types: custom; Flags: fixed
Name: Redist\Redist1; Description:Install\Update Microsoft DirectX; Types: custom;
Name: Redist\Redist2; Description:Install\Update Microsoft Visual C++ Redist; Types: custom;

[Code]
// Tb.dll
const
  TBPF_NOPROGRESS    = 0;
  TBPF_INDETERMINATE = 1;
  TBPF_NORMAL        = 2;
  TBPF_ERROR         = 4;
  TBPF_PAUSED        = 8;

procedure SetTaskBarThumbnailClip(Left, Top, Bottom, Right: Integer); external 'SetTaskBarThumbnailClip@files:tb.dll stdcall delayload';
procedure SetTaskBarProgressValue(Value: Integer); external 'SetTaskBarProgressValue@files:tb.dll stdcall delayload';
procedure SetTaskBarProgressState(Value: Integer); external 'SetTaskBarProgressState@files:tb.dll stdcall delayload';
procedure SetTaskBarTitle(const Caption: String); external 'SetTaskBarTitle@files:tb.dll stdcall delayload';
procedure SetTaskBarThumbnailTooltip(const Caption: String); external 'SetTaskBarThumbnailTooltip@files:tb.dll stdcall delayload';

// WinApi
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';

// Code
var
  DblNextButton: TButton;

procedure MShow(Sender: TObject);
begin
  if not MainForm.Showing then MainForm.Show;
  PostMessage(MainForm.Handle, $7, 0, 0); //WM_SETFOCUS
end;

procedure DirOnClick(Sender: TObject);
var
  UserSelectDir: String;
begin
  UserSelectDir:=WizardForm.DirEdit.Text;
  if BrowseForFolder(SetupMessage(msgBrowseDialogLabel), UserSelectDir, True) then WizardForm.DirEdit.Text:=UserSelectDir;
end;

procedure DblNextEvent(Sender: TObject);
begin
  WizardForm.NextButton.OnClick(WizardForm.NextButton);
end;

procedure InitializeWizard;
var
  r: TRect;
begin
  SetTaskBarProgressValue(50);
  SetTaskBarProgressState(TBPF_ERROR);
  SetTaskBarTitle('{#SetupSetting("AppName")}');
  SetTaskBarThumbnailTooltip('{#SetupSetting("AppName")}');
  SetTaskBarThumbnailClip(0, 0, WizardForm.Height-26, WizardForm.Width);
  //
  with MainForm do begin
    SetBounds(ScaleX(Round((GetSystemMetrics(0)-WizardForm.Width) div 2)), ScaleY(Round((GetSystemMetrics(1)-WizardForm.Height) div 2)),
    ScaleX(WizardForm.Width), ScaleY(WizardForm.Height));
    BorderIcons:=WizardForm.BorderIcons;
    BorderStyle:=WizardForm.BorderStyle;
    //Position:=poScreenCenter;
    with TBitmapImage.Create(MainForm) do begin
      Parent:=MainForm;
      Width:=MainForm.ClientWidth;
      Height:=MainForm.ClientHeight;
      with Bitmap do begin
        Width:=Width;
        Height:=Height;
        Canvas.Brush.Color:=clWindow;
        r.Right:=WizardForm.ClientWidth;
        r.Bottom:=WizardForm.ClientHeight;
        Canvas.FillRect(r);
      end;
    end;
  end;
  with WizardForm do begin
    BackButton.Parent:=MainForm;
    CancelButton.Parent:=MainForm;
    OuterNotebook.Parent:=MainForm;
    Bevel.Parent:=MainForm;
    DirBrowseButton.OnClick:=@DirOnClick;
    OnShow:=@MShow;
  end;
  DblNextButton:=TButton.Create(nil);
  with DblNextButton do begin
    SetBounds(ScaleX(WizardForm.NextButton.Left), ScaleY(WizardForm.NextButton.Top),
    ScaleX(WizardForm.NextButton.Width), ScaleY(WizardForm.NextButton.Height));
    OnClick:=@DblNextEvent;
    Parent:=MainForm;
    TabOrder:=0;
  end;
  WizardForm.BorderStyle:=bsNone;
  WizardForm.Width:=0;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  DblNextButton.Caption:=WizardForm.NextButton.Caption;
end;
P.S .: please use spoilers for a beautiful message design.
 
Последнее редактирование:

ffmla

Участник
ffmla, maybe this:
P.S .: please use spoilers for a beautiful message design.
:good:Thanks Nemko.
Whats the need of separate Next button{DblNextButton}..? Confused::scratchhead:

I have a doubt with the following attached code.{Same Question.I think}

Question 1. I have put the Component list in SelectDirPage.but it doesn't visible.What cause this? Solved with @Nemko exmple. :good:
Question 2. Which code or function create the Cannot focus a disabled or invisible window ERROR in the above code?.

PS:I think i flooded with Questions...Sorry..!
 

Вложения

Последнее редактирование:

ffmla

Участник
^^
@sergey3695
i am also try to compile this WinTB runtime library.
You guys test and report..

Library size 7 kb:good:
SetupPreview
SetTaskBarProgressValue
SetTaskBarProgressState

SetTaskBarTitle
SetTaskBarThumbnailTooltip
 

Вложения

Andreo Fadio

Старожил
@sergey3695, опечатка в приложенном iss файле. layered.dll явно не та библиотека из архива.
Код:
procedure SetTaskBarTitle(const Caption: String); external 'SetTaskBarTitle@{tmp}\layered.dll stdcall delayload';
 

sergey3695

Ветеран
Модератор
following error when 'msvcr100.dll' is not installed in system32
fixed.
Отвязал от msvcr110.dll библиотеку.
Добавил SetupHandle (нужно для работы SetTaskBar*, достаточно вызвать один раз в самом начале всего кода).
GetWindowLong(MainForm.Handle, -8) = Application.Handle
 
Последнее редактирование:

ffmla

Участник
fixed.
Отвязал от msvcr110.dll библиотеку.
Добавил SetupHandle (нужно для работы SetTaskBar*, достаточно вызвать один раз в самом начале всего кода).
FindWindowByClassName('TApplication')) = Application.Handle
^^ I have some doubts.
How can i find these functions or constant use external libraries?
How do you find this wcsstr use msvcr100 or mscvr110.dll?
is there any way to find entire David source code have external dependency?
 

sergey3695

Ветеран
Модератор
is there any way to find entire David source code have external dependency?
How do you find this wcsstr use msvcr100 or mscvr110.dll?
Configuration Properties > Linker > Input > Ignore All Default Libraries > Yes
Configuration Properties > Linker > Advanced > Entry Point > Dll Main
 
Последнее редактирование:

sergey3695

Ветеран
Модератор
Есть еще один способ (может больше) получить Application.Handle (если не расширенная версия)
Код:
function GetWindow(HWND: Longint; uCmd: cardinal): Longint; external 'GetWindow@user32.dll stdcall';

procedure InitializeWizard();
begin
// need for SetTaskBar*
  SetupHandle(GetWindow(MainForm.Handle, 2));
//
Заменил FindWindowByClassName в примерах т.к. эта функция использует FindWindow и может перехватить чужое окно.
 
Последнее редактирование:
Сверху