Novic programmer need help

This is a discussion on Novic programmer need help within the C Programming forums, part of the General Programming Boards category; ok im pretty novice at C programming. my questions are: 1. i want to check the color at some pixel. ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    4

    Novic programmer need help

    ok im pretty novice at C programming.

    my questions are:
    1. i want to check the color at some pixel.
    i tought of using graphics.h getpixel yet it only suppoets 16 colors
    while i need 32 million colors.
    and in how do i check for the color in hexa?
    so someone told me to use windows.h win32 api
    yet i cant manage to find a good working library anywhere and i dont know how to use the commands in there.
    2. second question: how do i send keystrokes or mousestrokes into a certain program?
    3. who do i monitor keystrokes, meanning i want to know whether someone is pressing the Enter button (but not in my program but while running another program and mine is in the background).

    i really hope u can help me
    thanks in advance

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    All three things you want cannot be done in standard C alone. You will need to use whatever features the operating system you are using provides. For windows that would be the windows api. There are a few libraries that you could use, wxwindows and qt spring to mind but again the learning curve for these is as steep as the learning curve for windows. We have covered beginning windows programming many times a board search will turn up a list of recommended books and web tuts etc.
    btw. If your compiler supports graphics.h then you will almost certainly need a better compiler as that is a relic from ages past.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    4
    i have also visual c++
    abnd borland c++6
    yet i dont know how to use them
    i learned C to dos consol using the old turbo borland C
    can u help me more?

    will borland c 4.5 work?

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    >>will borland c 4.5 work
    yes but it is not a good compiler. For windows visual C would be better. The command line verson of msvc7.1 is available freely on M$ site.

    As for beginning windows programming you could start here otherwise as I have said do a board search.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    4
    i have visual c++ 6
    but i dont even know where the console is
    i cant build there even the most simple program such as
    Code:
    void main()
    {
    printf ("hello world");
    }

  6. #6
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    start new project. Look at the templates on msvc6 one of them is windows32 console application. thats the one you want for "dos" or a win32 application for windows. Cant remember for sure not used 6 in a few years.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    4
    ok thanks ive managed to do somethings in it
    yet i still dont know which library to use for the getpixel and the other stuff i wanted.
    also for some reason i dont have the MSDN files

  8. #8
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    MSDN is browsable online.
    For things like GetPixel dont try to run before you can walk. Follow your way through the tuts at winprog. Learn how to make a window, add controls to it, paint it etc. It will not take too long before you are comfortable enough with that to move onto more intensive stuff.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  9. #9
    Prying open my third eye.
    Join Date
    Jun 2005
    Posts
    45
    I think the best way to learn C is through Linux, makes me understand things a lot easier at least.
    "So you're one of those condescending UNIX computer users?"

    "Here's a nickel, kid. Get yourself a better computer."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What game programmer should I be? need some advice.
    By m3rk in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-20-2009, 11:12 PM
  2. Replies: 2
    Last Post: 07-12-2008, 11:06 AM
  3. When are you REALLY a programmer?
    By m.mixon in forum C Programming
    Replies: 5
    Last Post: 07-19-2006, 09:08 PM
  4. SONY RootKit programmer got info from an Online Forum.
    By novacain in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 11-13-2005, 08:34 PM
  5. I need to interview professional programmer.....please
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2002, 01:46 PM

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