Link to home
Start Free TrialLog in
Avatar of Ahmet Ekrem SABAN
Ahmet Ekrem SABANFlag for Austria

asked on

How to use the mouse event handler in GDI+ under C++?

Hello!

I am new to Windows programming & have no experience with GDI(+), which is a consequence of not having experience with Windows programming... I have to finish an application that is running under GDI+ by adapting an existing subprogram to the new functional specification.

The subprogram I am going to change is called INHIB, the new subprogram to be created by me is called VRAG. So, I have added a VRAG project with some minor modifications to the INHIB (e.g. by renaming the INHIB.DAT to VRAG.DAT).

INHIB is using the keyboard as the input device. The user clicks the <CR> key to proceed from one trial to the other. In VRAG, the new subprogram to be created by me, the input device must be the mouse.

I have no time to go through details of Windows programming or read a lot about GDI+, as I have to finish some primordial program till Friday next week. So, I need urgent help!

What would help me best? I simple Microsoft Visual Studio project that shows in a simple example how to draw a rectangel by using the mouse, with all #includes, DLLs, resources, but as simple as possible. A hint where I can find a RUNNABLE code would be a welcome answer. Of course, you could create your own set of project files and put them in a ZIP for me. That would be another solution and as good as the first IF it works immediately. :-)

Again, I have no time to go through tutorials that take more than 20 minutes or so...

Technically, the application is a GDI+ "game". It will not be used as such, but technically, it is like programming a non-graphic-intensive game.

Best regards to the expert!
sae1962at
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

>>Again, I have no time to go through tutorials that take more than 20 minutes or so...

Maybe you ought to have - have no understanding of what you are doing is a recipe for disaster.
Avatar of Ahmet Ekrem SABAN

ASKER

OK, you are right.  I have done this things in Java with listeners. All in all, I have more than ten years of OOP experience.
But how is the same event handling working in C++/Windows/GDI+? Any simple examples from where I can learn it in a short period?
Which tutorials are the best to learn event handling (for a mouse) on the net?
ASKER CERTIFIED SOLUTION
Avatar of Altwies
Altwies

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial