User input to close window

This is a discussion on User input to close window within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys, me again. I ran in to a wall today, before when I asked question I kinda knew how ...

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    38

    User input to close window

    Hey guys, me again. I ran in to a wall today, before when I asked question I kinda knew how to do it. But this time I have no clue.

    I'm trying to get a user input in min or milliseconds to close a window. The code I use to close a window
    Code:
    hWin = FindWindow(NULL,"WINDOW NAME HERE");
        SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0);
    The problem is that I want the user to be able to set a time when to close the window. EX in 2min...

    I will be really grateful if someone could help me out OR point me to somewhere. =)

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    IF it is a console program you can use the Sleep function. Otherwise, you can use the SetTimer function.

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    38
    Thanks for replying, its a win32 app not a console. Yeah I searched google a little and saw that api. But I know in a console app you can use cin>> to get the user input, how do I do this in a GUI?

    EDIT: I just tested SetTimer and it worked! =) now I need to figure out how to get the user input =\ I guess I need to create a EditBox.
    Last edited by NoFearXD; 05-09-2007 at 08:48 PM.

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 help
    By heat511 in forum Game Programming
    Replies: 4
    Last Post: 04-05-2004, 02:08 AM
  3. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 05:10 AM
  4. dont want to use all params
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 02-18-2003, 08:10 AM
  5. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 06:38 PM

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