View Single Post
  #10  
Old 13-10-2020, 09:47
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
@Sergey3695, your script example.
Quote:
// need for SetTaskBar*
SetupHandle(FindWindowByClassName('TApplication')) ;
//
I don't know if this is the best way to get the handle of the taskbar button.
It may be possible to get the handle of another Inno Setup application if run at the same time (I'm not sure).

I think this is the most correct way to avoid getting the handle of another instance of the Inno Setup installer.


Code:
const
  GWL_HWNDPARENT = (-8);

function GetWindowLong(hWnd, nIndex: Integer): Longint;
  external 'GetWindowLongW@user32 stdcall';

procedure InitializeWizard();
begin
  ExtractTemporaryFile('wintb.dll');
// need for SetTaskBar*
  SetupHandle(GetWindowLong(MainForm.Handle, GWL_HWNDPARENT));
//
//...
Reply With Quote
The Following 3 Users Say Thank You to Cesar82 For This Useful Post:
Cuttlas (13-10-2020), ffmla (21-10-2020), Sergey3695 (13-10-2020)