This is 1 of my list of project to move a mouse pointer in result window without any help from the library,header file or built in function and using only your logics.Please help me and please tell something that is possible in Turbo C++(I know Turbo C++ is a old version but it is prescribed to use so I really can't do anything about it).

Recommended Answers

All 5 Replies

Not possible to move the mouse without using some lib or function. There are no c functions to do that, nor are there any native MS-DOS assembly language system calls that support the mouse. Your only option is to call one of the mouse device driver's functions, assuming a device driver is installed on your computer.

nor are there any native MS-DOS assembly language system calls that support the mouse.

The int 33h interrupts were used for that, but I doubt the user is interested in those. In any case, I don't believe I've ever tried to move the mouse cursor. Usually, one wants to find out where it is.

By the user's question, I'm not sure just what is meant by...

...without any help from the library,header file or built in function...

In terms of what can be done in C/C++ without the use of libraries - darn little. You could add 2 and 2 I suppose - but you couldn't output the result. I suppose if you wanted you could find the result - 4, using a debugger!

you could try this tutorial, but it may not work under current versions of MS-Windows.

I meant to say that we cant use any inbuilt function to move the mouse like initmouse or getmouse etc.

The question has me intrigued too. I've worked with the mouse a lot both in Windows and DOS and it never occurred to me that there might be a way to programatically move the mouse. In other words - mouse output. When you look it up in MSDN there's piles of info on mouse input, but none on mouse output. The thought occurred to me to PostMessage() a WM_MOUSEMOVE message filling the WPARAM and LPARAM with the necessary data as to where you want to move the mouse cursor, but I doubt if that would work. Its designed for mouse input. I didn't try it myself.

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.