C
C#15mo ago
0944

❔ 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
Jimmacle15mo ago
sleeping your UI thread will freeze your app
arion
arion15mo ago
in this case, looping infinitely will also freeze your app
SG97
SG9715mo ago
an autoclicker huh
0944
0944OP15mo ago
I was trying to create a ac in c# An*
Accord
Accord15mo 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?