自動ロック防止コード

1676 ワード

  class Work

    {

        [DllImport("user32.dll")]

        static extern void mouse_event(MouseEventFlag flags, int dx, int dy, uint data, UIntPtr extraInfo);



        enum MouseEventFlag : uint

        {

            Move = 0x0001,

        }



        public static void DoWork()

        {

            while (true)

            {

                mouse_event(MouseEventFlag.Move, 0, 0, 0, UIntPtr.Zero);

                Thread.Sleep(480000);

            }



        }

    }