How to program a Windows screensaver in MX2 [SOLVED]

About Monkey 2 Forums Monkey 2 Programming Help How to program a Windows screensaver in MX2 [SOLVED]

This topic contains 7 replies, has 4 voices, and was last updated by  Diffrenzy 1 year, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9814

    Diffrenzy
    Keymaster

    [EDIT] Look below for working source code.

    Can somebody help with getting a simple framework for a Windows screensaver going?

    As I remember it from BlitzMax, the tricky things are:

    Need to have:
    Get commandline arguments. ( /c /p HWND /s )
    Draw to a windows that is a child of the preview window, when Screensaver is started with /p HWND
    Preferably use DirectX not OpenGL

    Nice To Have:
    Config dialog and a place to store settings.

    https://support.microsoft.com/en-us/help/182383/info-screen-saver-command-line-arguments

    #9822

    Diffrenzy
    Keymaster

    Getting the comandline seems to work:

    #9824

    Diffrenzy
    Keymaster

    .solved

    #9863

    Diffrenzy
    Keymaster

    I got it working with preview window and all 😀

    Code here: http://monkeycoder.co.nz/forums/topic/windows-screensaver-with-preview/

    #9866

    Mark Sibly
    Keymaster

    Woah, nice!

    Was gonna give you a speech about ‘monkey2 isn’t really meant for that’ but if you can make it work go for it!

    #9873

    DruggedBunny
    Participant

    Wow, perfect here in Win 7 64, well done.

    For anyone not sure how to test, rename the resulting yourapp.exe found in yourapp.products/Windows/ (after building) as yourapp.scr; right-click it and choose Install.

    Just deletingyourapp.scr will take it out of the screensaver list.

    Would never have imagined that would work!

    #9877

    nerobot
    Participant

    Nice!

    #9881

    Diffrenzy
    Keymaster

    Thanks and thanks for testing!

    I cleaned up the code a little and moved it to the code archive.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.