Thread: another novice need some emergency help

  1. #1
    KarateKid
    Guest

    another novice need some emergency help

    I need to write a program that draws a square with corner points (0,0) and (1,1). Prompt the user for a mouse click. If the user clicked inside the square, then show a message "Congratulations." Otherwise, show a message "You Missed."
    Any ideas how guys?

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    If you need to draw a rectangle you need to use the Windows API. One way you can do it is to create a bitmap image, display it in a window, the check if the user left-clicked. If he/she did, get the coords of the mouse and the rectangle, and use an if() statement to display the box or not. If you don't know the Win API now, you might have a little trouble doing this, but it shouldn't be very hard. Good luck!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 06-17-2005, 10:00 PM
  2. [C++] Segmentation Fault {Novice C++ Programmer}
    By INFERNO2K in forum C++ Programming
    Replies: 24
    Last Post: 06-08-2005, 07:44 PM
  3. Novice trying to learn C++
    By dead in forum C++ Programming
    Replies: 10
    Last Post: 12-01-2003, 09:25 PM
  4. Rtfm
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 03-13-2003, 05:19 PM
  5. help for a C novice
    By Unregistered in forum C Programming
    Replies: 8
    Last Post: 05-02-2002, 09:49 PM