window size and mouse sensitivity

This is a discussion on window size and mouse sensitivity within the C Programming forums, part of the General Programming Boards category; Hey, I'm a complete noob to the world of non-command-line programming, and I want to write a couple of my ...

  1. #1
    Dogbert B-Con's Avatar
    Join Date
    Mar 2004
    Posts
    25

    window size and mouse sensitivity

    Hey, I'm a complete noob to the world of non-command-line programming, and I want to write a couple of my own screensavers. But I need a way to force the program to take up the whole screen, and a way to detect when the mouse is moved (or a key is pushed).

    I don't need the exact code written for me, just enough information to get going..... anybody know how to do this, or know of a good tutorial? Thanx


    BTW: It could also be in C++, I just chose C because that's what I'm most comfortable in.....
    Last edited by B-Con; 04-20-2004 at 06:47 PM.
    "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    85
    If you don't know about the screensaver part, I found this:

    Windows .SCR screen savers
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    SCR files are nothing more complex than .EXE files with the
    extension SCR. Windows calls the .SCR file with two command-line
    options:

    /s to launch the screensaver
    /c to configure the screensaver

    For the windows control panel to recognise the screensaver, the program's module description string must begin with SCRNSAVE: (in uppercase). So, if writing a Visual Basic screensaver, simply set the application title to something like "SCRNSAVE:Test Screensaver"

    To create a new screen saver simply write a program that checks the
    command-line option when starting and performs the appropriate
    action. The display should use a full-screen window (usually with a
    black background) and should end when any key is pressed or when the
    mouse is moved.

    When the program is compiled, rename the .EXE to .SCR and put it
    into the Windows directory so it can be found by the screensaver
    selection dialog in Windows.

    Happy screensaving!

    -----------------------------------------------------------------
    Paul Oliver with thanks to Michael Poxon.
    8th December 1996

  3. #3
    Dogbert B-Con's Avatar
    Join Date
    Mar 2004
    Posts
    25
    Thanx for the info, was wondering how to create the configuration part.....
    "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started.

  4. #4
    Dogbert B-Con's Avatar
    Join Date
    Mar 2004
    Posts
    25
    OK, how do I recognize the two different command-line options?

    I assume it'll be passed in and recognized by the program using the standard "main" argument *argv[] ? If so, then it would come in as the second argument, so I would be looking at the value of *argv[1] ? Is this right?

    ------
    [edit]
    Never mind, I got it, I was right.....


    I still need help with the full-screen and mouse-dection, tho......
    Last edited by B-Con; 04-21-2004 at 04:56 AM.
    "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started.

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Your screen saver should be a Windows App. The configuration dialog can be built as a resource. You then need to flesh out a ScreenSaverConfigureDialog() function to handle it, then serialise the parameters selected, normally in the registry, but a file I suppose would do. You also need to have a RegisterDialogClasses() routine, however, generally, that is just a placeholder with a return 1; statement.

    The module has to have an icon associated as a resource and a title string, which is limited to 24 characters.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You may want to check out this screensaver framework that was posted by hartwork. A sample screen saver is included.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  3. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21