© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
hi

❔ 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?
devenv_b17OBB7ZAG.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Threads in c#
C#CC# / help
3y ago
freeze winform app until loop exits
C#CC# / help
2y ago
❔ Xamarin Long lasting out of app threads/services??
C#CC# / help
3y ago
Thread.sleep in a constructor
C#CC# / help
2y ago