[Solved] Delphi, How to make a shape stop moving

Try the following code (assign OnCreate and OnPaint of the form and set the timer to 30 millisecond intervals): unit Unit5; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls; type TVector = record X, Y: real; end; TForm5 = class(TForm) Timer1: TTimer; procedure FormPaint(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); … Read more

[Solved] AccessViolationException in Delphi – impossible (check it, unbelievable…)

Try changing PBoolean to PBOOL function(IsEnabled: PBOOL): HRESULT; stdcall; var Flag: BOOL; PBoolean is a pointer to a Pascal Boolean which is 1 byte in size. PBOOL is a pointer to a Windows (C based) BOOL, which is 4 bytes in size. You need to match the size expected by windows. In general, when translating … Read more