logo elektroda
logo elektroda
X
logo elektroda

Mouse Movement Program: Prevent Screensaver Activation with Time-Based, Adjustable Twitches

yacor 30770 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 8812174
    yacor
    Level 10  
    Hello, I need a program to move around, twitch the mouse every now and then, for example every five minutes. The point is that the screen saver should not be activated, for example. (The screensaver cannot be turned off). Anyone seen the trick applet?
  • ADVERTISEMENT
  • #2 8812231
    youzeq
    Level 14  
    Suggested solutions:

    1) Check if screen blanking is not enabled in BIOS.
    2) Try any "mouse recording" program. You record the movement with the mouse / click / button, you set what, how much should work or how many times it should work and it's ready.

    For starters, try the small, free WinMakro v1.2. You can easily Google both the program and the Polish manual.
  • ADVERTISEMENT
  • #3 8812289
    yacor
    Level 10  
    More like an .exe microprogram, written in anything, a few lines of code and fired with a click or on Autostart.
  • Helpful post
    #4 9562261
    Sliter
    Level 2  
    A simple C ++ exe in this case is very simple :) .

    First of all, a loop that will keep the program running forever:
    Code: text
    Log in, to see the code

    In the middle of the loop you get the cursor position (in this case, to px and py):
    Code: text
    Log in, to see the code

    If you want, the program can write these items to the screen:
    [syntax=cpp]cout
  • Helpful post
    #6 9566612
    Sliter
    Level 2  
    Ok, I made this app.
    Its operation step by step:

    1. Get the cursor position (x, y).
    2. Place the cursor in the x + 100, y position.
    3. Wait a minute.
    4. Place the cursor in the x, y position.
    5. Go back to 1.

    For those interested - the program code:
    Code: text
    Log in, to see the code


    For the rest - the program is attached. After starting the console window (it's so nice, black, not needed by anyone) can be minimized.
    Attachments:
  • ADVERTISEMENT
  • Helpful post
    #7 9567865
    LED5W
    Level 34  
    Sliter You don't have to move the mouse at all. The author wanted the screensaver not to turn on and that the computer should not go to sleep.
    For this, you can use the SendInput function by pretending to be a button press, but without specifying what button it is. The program is attached, I will provide the code on request.
    And as for your program - did you check whether entering the current mouse position in SetCursorPos is not enough?
    Attachments:
  • ADVERTISEMENT
  • #8 9567906
    LED5W
    Level 34  
    Sliter wrote:
    After starting the console window (it's so nice, black, not needed by anyone) can be minimized.
    And this window can be disabled with the FreeConsole () function. ;)
  • #9 9567933
    Sliter
    Level 2  
    In fact, I did not check if it is enough to just enter the position, but if so, you can remove 2 lines from the code. The author of the topic wanted to bring up this I made a move.
    As for SendInput - I just didn't think about it :) .

    Oh you see, I have never used FreeConsole () (I had no such need). But thanks for the info, maybe someday in some more ambitious program it will be useful to me.

Topic summary

A user seeks a program to periodically move the mouse cursor to prevent screensaver activation, as disabling the screensaver is not an option. Various solutions are proposed, including checking BIOS settings, using mouse recording software like WinMakro, and creating a simple executable program in C++. The suggested C++ code involves a loop that retrieves the cursor position, moves it slightly, and waits before returning it to the original position. Alternatives such as using the SendInput function to simulate key presses without moving the mouse are also discussed. The conversation includes technical insights on program optimization and console window management.
Summary generated by the language model.
ADVERTISEMENT