I am currently working on a Win32 program where I have a picture. Depending where they click on the picture, something will happen.I just loaded the picture on the window, but how do I make it so that my program can tell when a certain area on the picture on the window is clicked? Thanks in advance.

You have to capture mouse events, which will give you the x and y coordinates of the mouse. Then just test those coordinates against the area of the window you are interested in to see if the mouse clicked inside or outside the rectangle.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.