❔ App Freezed Even Added Threads.Sleep in Loop

while (this.run)
{
if (!this.run)
{
break;
}
Win32.POINT p = new Win32.POINT();
Win32.ClientToScreen(IntPtr.Zero, ref p);
Win32.mouse_event(Win32.MOUSEEVENTF_LEFTDOWN | Win32.MOUSEEVENTF_LEFTUP, (uint)p.x, (uint)p.y, 0, 0);
Thread.Sleep(1000);

}
while (this.run)
{
if (!this.run)
{
break;
}
Win32.POINT p = new Win32.POINT();
Win32.ClientToScreen(IntPtr.Zero, ref p);
Win32.mouse_event(Win32.MOUSEEVENTF_LEFTDOWN | Win32.MOUSEEVENTF_LEFTUP, (uint)p.x, (uint)p.y, 0, 0);
Thread.Sleep(1000);

}
This is my code. Its a UWP Application. The App Freeezed After This Executed I Also tried remove Clicking Part. its still freezed. Can Someone Help Me?
No description
5 Replies
Jimmacle
Jimmacle2y ago
sleeping your UI thread will freeze your app
arion
arion2y ago
in this case, looping infinitely will also freeze your app
SG97
SG972y ago
an autoclicker huh
i dont use kde plasma btw
I was trying to create a ac in c# An*
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?