Thread: creating macros

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    18

    creating macros

    Hi, Im Johnathan and im begining my first year of programming at my high school, the class will teach c++ but moves at a slow rate, so me and a few buddies work ahead of the class to get to the fun stuff. What i want to know is how to create a macro that will click on an image that i choose. Am i supposed to find a way to upload the image into the program so it knows what to click on? and how do i write it to where it simulates mouse clicks on the image???

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    How far ahead exactly are you? Have you created real windows yet?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    the class is at the basic loops, for loops, while loops, and do while loops, but i know up to making functions, is what im asking too far ahead of me? im using one of my classes to to be an independent study class where i can work on myown time on anything that i want to learn to program and what ive chosen to work on is creating a macro...

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    As long as you're still using the console, you can't display images.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    As CornedBee said, you can't display images on the terminal. At least not in a portable way.

    You can do simple image manipulation if you're using a Windows console. This is adrianx's console tutorial site.
    http://www.adrianxw.dk/SoftwareSite/index.html

  6. #6
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    all i want the program to do is click on image if it appears on the computer... i already have a bitmap of the image i want it to click on...guess im just getting ahead of myself, im still just a beginner to C++

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    So you want to constantly scan the screen for a bitmap and when it appears simulate a mouse click? That's indeed ahead of yourself.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    omg, it takes that much skill to do it? i thought that i could just like write whatever i needed to make the mouse click on the image and then just find a way to make the program know what image to click.....wow... i thought it was something easy... im not givin up though, ill find some way to do it, ill need a bit of help though

  9. #9
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343
    As my experience, schools only teach DOS programming, as essential C++ skills. Windows programming is something you need to learn on your own time, like books form the lib rary or surfing the MSDN (Microsoft Developer Network) http://msdn.microsoft.com

    familiarize yourself with the basic functions then get into Windows programming, its almost an entire language in its own, but still uses some of those basic keywords like "sizeof" and functions.

    a good place to seriously START windows programming with a site that explains everything in a tutorial type manner is www.sunlightd.com , go there to START, but dont live there as its pretty dated and has some wrong ways of teaching, but liek i said, a great place to start since the code is simple to understand and downloadable.
    Last edited by DarkViper; 01-08-2004 at 02:04 PM.
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  10. #10
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    okay, ill start learning some windows programming then. I was about to ask if, since this is obviously harder than i thought it could be, where i should start but i believe u answered that with windows programming... Thanks alot, ill be posting in this topic at a later date if i have further questioning, thanks so much to everyone that replied, everyone here knows so much and it makes this message board rock when you want help.

  11. #11
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    viper, there not teachin dos anymore, instead we use borland c++...however soon there all going to start teaching java instead

  12. #12
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by DarkViper
    As my experience, schools only teach DOS programming, as essential C++ skills.
    That's because it isn't possible to do any GUI programming with just C++, you'll need third-party libraries to be able to do anyhting useful.
    Once you know the language and how program, learning an API should be very easy, though.
    .however soon there all going to start teaching java instead
    That is a wise decision.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  13. #13
    Registered User
    Join Date
    Jan 2004
    Posts
    18
    yea....too bad i wont be around to enjoy it though, i graduate this year

  14. #14
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343

    Thumbs down

    i hate Java, i dont know, i have actually programmed it, made a simple ATM machine, and a small game (trashed it a while back), but i just HATE the language, and i have my own reasons for it too. I know it needs a compiler, but for some reason, it REALLY feels to like it shouldn't need it, especially something as huge as Microsoft J++. (i know the compilers essential, leave me alone about it )

    the language in itself is stressful to me. It stresses me out on just how simplistic and how complex it can be at the same damn time.

    hence:

    Code:
    public void actionPerformed(ActionEvent e)
    {
    if (e.getSource() == button1)
    {
    label1.setText("You clicked button 1!");
    label1.show();
    showStatus(label1.getText());
    label2.hide();
    }
    if (e.getSource() == button2)
    {
    label2.setText("You clicked button 2!");
    label2.show();
    showStatus(label2.getText());
    label1.hide();
    }
    }
    but then again, you have to name alot of things the EXACT same name! How retarded is that? you need to name the .class the same thing, the project, the class itself, everything the same name. Annoying, and WONT compile at all if not properly, if theres a simple CaseSensitive mistake in the nameing. (hell, even the FOLDER has to be the same name)


    and Borland C++ is a compiler, youll still be physically taught DOS programming, since the Windows.h and everything associate with it, feels almost like a language in its own
    Last edited by DarkViper; 01-09-2004 at 04:45 PM.
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  15. #15
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    i hate Java
    I started out disliking Java too, for exactly the same reason. But by now I'm quite comfortable with it. Swing simply rules every C++ windowing library I've seen so far.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Order of execution of preprocessor macros
    By DL1 in forum C Programming
    Replies: 2
    Last Post: 04-02-2009, 06:52 PM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Macros inside of macros
    By Chewie8 in forum C Programming
    Replies: 2
    Last Post: 02-24-2008, 03:51 AM
  4. Creating a rain effect...
    By Raigne in forum Game Programming
    Replies: 11
    Last Post: 12-04-2007, 05:30 PM
  5. Visual C++ and UNICODE - _t macros
    By nvoigt in forum Windows Programming
    Replies: 2
    Last Post: 04-22-2005, 07:42 AM