Program's Focus

This is a discussion on Program's Focus within the Windows Programming forums, part of the Platform Specific Boards category; I'd like to know if I can set my whole system to lock up whenever I execute my program. What ...

  1. #1
    Addicted to the Internet netboy's Avatar
    Join Date
    Dec 2001
    Posts
    158

    Program's Focus

    I'd like to know if I can set my whole system to lock up whenever I execute my program.

    What I meant is that I don't want the mouse pointer to click anywhere other than my program. The program won't minimize or won't be able to press any button on the system (I.e. Start button) unless the user response to the program.

    Any idea? Thanks in advance!
    It's unfulfilled dreams that keep you alive.

    //netboy

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    I.e. you want to go against the entire rationale of a multitasking/multiprocessing OS. You are not going to easily do that in a user mode program - for what should be very obvious reasons.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    In the resource editors (at least in VC) for window templates there is a flag called SYSTEM MODAL. I guess that makes the system halt until the window is closed (I'd be surprised if Ctrl-Alt-Delete wouldn't work though).
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    Or the evil

    ClipCursor()

    to restrict the mouse movement to a set rectangle.

    May need SetCapture()

    Careful when debugging with this on.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> (I'd be surprised if Ctrl-Alt-Delete wouldn't work though).

    Precisely. Windows is a multitasking system. You can try to simulate the behaviour you want using some of these methods, but you won't be able to make it bullet proof in user mode.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recommend upgrade path for C programs
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-22-2007, 07:32 AM
  2. Changing focus in an MFC Application
    By rangalo in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2005, 07:21 AM
  3. Focus Messages?
    By PsychoBrat in forum Windows Programming
    Replies: 5
    Last Post: 12-30-2003, 07:14 AM
  4. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 05:42 AM
  5. Focus & Always-On-Top :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 06-13-2002, 06:44 PM

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