На видео показано рисование через поток и рисование без потока
CE Native Thread
<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;"><iframe src="https://www.youtube.com/embed/r-iUjxTQAeA?rel=0" style="top: 0; left: 0; width: 100%; height: 100%; position: absolute; border: 0;" allowfullscreen scrolling="no" allow="accelerometer *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *; web-share *;" referrerpolicy="strict-origin"></iframe></div>
Когда происходит рисование без потока, то окно нельзя подвинуть, не работает кнопка и даже не возможно работать с Cheat Engine
function FilledWithPixels()
while true do
::begin::
UDF1.repaint()
for x=1,UDF1.Canvas.Width do
for y=1,UDF1.Canvas.Height do
local min = math.random(1, 0xFFFF)
local max = math.random(0xFFFF, 0x00FFFFFF)
UDF1.Canvas.SetPixel(x,y, math.random (min, max))
if(needReUpdate) then
needReUpdate = false
goto begin
end
end
end
t.suspend()
end
end
t = createNativeThreadSuspended(FilledWithPixels)
t.name = 'New thread 1'
needReUpdate = true
UDF1 = createForm()
UDF1.Width = 400
UDF1.Height = 200
btn = createButton(UDF1)
btn.OnClick = function (sender)
needReUpdate = true
t.resume()
end