Cursor - Change the mouse cursor of WizardForm

From ISXKB

Jump to: navigation, search

The following function allows to change the mouse cursor of an instance of InnoSetup (useful for waiting periods with crHourGlass).

procedure SetControlCursor(control: TWinControl; cursor: TCursor);
var i:Integer;
	wc: TWinControl;
begin
  if (not (control = nil)) then begin
    control.Cursor := cursor;
    try
      for i:=0 to control.ControlCount-1 do begin
        wc := TWinControl(control.Controls[i]);
        if (NOT(wc = nil)) then
          SetControlCursor(wc, cursor)
        else
          control.Controls[i].Cursor := cursor;
      end; {for}
    finally

    end;{try}
  end;{if}
end;{procedure SetControlCursor}

You simply call the procedure with a statement like:

SetControlCursor(WizardForm, crHourGlass);

Code provided by Dicho.

Personal tools
Ads: