Thread: Hiding prompt screen

  1. #1
    Registered User Utopus's Avatar
    Join Date
    Jun 2007
    Location
    beautiful place
    Posts
    26

    Hiding prompt screen

    when compiling this program and executing, it pops up a message box on yes/no choices. However, I do not want the prompt screen to appear on the screen.

    I only want the message box to appear when the file is executed.

    Can someone give me an advice on this?

    Code:
    #include <windows.h>
    
    int main(void) {
    
    	int back;
    
    	back = MessageBox(NULL, "Is it sunny outside?", "Question", MB_YESNO | MB_ICONQUESTION);
    
    	return 0;
    }

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Don't use a console app? Is the easiest way.

    Otherwise, hide the window as soon as it appears, search around MSDN for such things like FindWindow() Show() or whatnot.

  3. #3
    Registered User Utopus's Avatar
    Join Date
    Jun 2007
    Location
    beautiful place
    Posts
    26
    Hello zacs7, been while.

    what's a console application?

    I'd like the prompt screen to not appear at all when the file is executed. And I quite don't know how and when I should be using FindWindow() nor Show().... ?

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Well, what IDE / compiler are you using?

    The best option is to use a Win32 Application (Or whatever), that way no window is created

  5. #5
    Registered User Utopus's Avatar
    Join Date
    Jun 2007
    Location
    beautiful place
    Posts
    26
    Hmm! I've got it! Thank you, zacs7.
    Last edited by Utopus; 07-26-2007 at 03:15 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  2. Hiding Command Prompt
    By BIt_toRreNt in forum C++ Programming
    Replies: 4
    Last Post: 02-15-2005, 10:35 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM