Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Making a macro

Making a macro

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MeterMan
    wrote on last edited by
    #1

    Just curious does anyone have a tutorial on how to make a macro in visual c++. I have this program called total recorder that records streaming audio and i have a radio show that comes on early in the morning. I'm usually not away so i wanted to write a c++ program that would launch total recorder say with shellexecute that part is easy. I just can't figure out how to make it click the mouse like a macro. Thanks for your help. Talk to me like a baby cause when it comes to programming i still wear a training pants :) Win32newb "Making windows programs worse than they already are"

    C S 2 Replies Last reply
    0
    • M MeterMan

      Just curious does anyone have a tutorial on how to make a macro in visual c++. I have this program called total recorder that records streaming audio and i have a radio show that comes on early in the morning. I'm usually not away so i wanted to write a c++ program that would launch total recorder say with shellexecute that part is easy. I just can't figure out how to make it click the mouse like a macro. Thanks for your help. Talk to me like a baby cause when it comes to programming i still wear a training pants :) Win32newb "Making windows programs worse than they already are"

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to look into SendMessage, perhaps. It sounds messy to me though. I thought you wanted to create a macro in C++, as in #define, I was ready to read you the riot act :-) Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

      1 Reply Last reply
      0
      • M MeterMan

        Just curious does anyone have a tutorial on how to make a macro in visual c++. I have this program called total recorder that records streaming audio and i have a radio show that comes on early in the morning. I'm usually not away so i wanted to write a c++ program that would launch total recorder say with shellexecute that part is easy. I just can't figure out how to make it click the mouse like a macro. Thanks for your help. Talk to me like a baby cause when it comes to programming i still wear a training pants :) Win32newb "Making windows programs worse than they already are"

        S Offline
        S Offline
        SiddharthAtw
        wrote on last edited by
        #3

        I think I can help U in it. But definately it needs detailed discussion. Time being. Every Microsoft windows has a class name and window text. and at any given instance Desktop will be parent of all windows. U can find these using Spy++ in windows. So just iterate from desktop as root windows using treeView to Ur target message. Using SendMessage or Postmessage pass WM_BCLICK or WM_LBUTTONDOWN or what ever. hope it helps

        M 1 Reply Last reply
        0
        • S SiddharthAtw

          I think I can help U in it. But definately it needs detailed discussion. Time being. Every Microsoft windows has a class name and window text. and at any given instance Desktop will be parent of all windows. U can find these using Spy++ in windows. So just iterate from desktop as root windows using treeView to Ur target message. Using SendMessage or Postmessage pass WM_BCLICK or WM_LBUTTONDOWN or what ever. hope it helps

          M Offline
          M Offline
          MeterMan
          wrote on last edited by
          #4

          I looked up SendMessage and post message but wasn't too clear on it. How do i tell it which window to send it to? I opened up spy++ and i found my message. I'm assuming i need to the window handle say 004f3c or whatever. so would i put PostMessage(WM_LBUTTONDOWN,004f3c,NULL); Sorry but confused i kinda understand what your saying but its new to me so i'm kinda lost. thanks for the help by the way. Win32newb "Making windows programs worse than they already are"

          S 1 Reply Last reply
          0
          • M MeterMan

            I looked up SendMessage and post message but wasn't too clear on it. How do i tell it which window to send it to? I opened up spy++ and i found my message. I'm assuming i need to the window handle say 004f3c or whatever. so would i put PostMessage(WM_LBUTTONDOWN,004f3c,NULL); Sorry but confused i kinda understand what your saying but its new to me so i'm kinda lost. thanks for the help by the way. Win32newb "Making windows programs worse than they already are"

            S Offline
            S Offline
            SiddharthAtw
            wrote on last edited by
            #5

            U can't depend upon handle as they R dynmaic. So derive Windows handle from FindWindow(class name, WinText) kind of API. Use this handle in Ur SendMessage. Now U must be Pretty clear I think. Mind U there is no standard method of doing this. I derived this method after 2 months of shuffling with Charles Perzolt book. Highly recommended. One more just read the query posted by codeCharmer "Enumerating Dialog Controls". U have to adopt almost similar Algo. cheers Siddharth

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups