|
|
|
|
![]() ![]() |
Mar 5 2008, 11:59 AM
Post
#1
|
|
|
Newbie [Level 2] ![]() ![]() Group: [HOSTED] Posts: 35 Joined: 16-February 08 From: bombay Member No.: 57,972 |
how can we use mouse input in C programs...i think that works only in graphics mode...
i tried a few functions that are available but they are not working...either i dont know how to use them properly or they dont work under my compiler...i use borlandv3. do i have to download some file from internet which will make it work or i need to use a different compiler..... and also i wish to know what all things i can do with it once it starts working,i mean checkbox or optionbox or making mouse focus specific areas................. I know these things can be done better with other languages like VB ..but i need to work in C. This post has been edited by klusk: Mar 5 2008, 12:01 PM |
|
|
|
Mar 6 2008, 12:20 AM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 205 Joined: 8-April 05 Member No.: 5,385 |
I'm not sure how much this helps, but I found a utility that can help with graphics implementation for C++. I am unsure how it works for C. I also haven't tested it or anything, but I guess it is worth a try.
http://www.genlogic.com/rel26.html Also note that this does use Active-X (yuck!), which I guess saves you all the bother of reading the 25 X-Windows books to learn to make a simple pop-up...which I guess is a good thing. |
|
|
|
Mar 6 2008, 03:11 AM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 937 Joined: 14-April 05 From: West Chester, PA Member No.: 5,636 |
The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers. The reason is that C is a console language and does not do anything with graphics since a console is keyboard based. However, if you add a graphics header to make the program into a graphical one, you will be able to get mouse input. Look into using winmain on windows. You will see there is msgproc which has a bunch of mouse messages and this is where you will handle mouse input.
|
|
|
|
Mar 6 2008, 02:53 PM
Post
#4
|
|
|
Newbie [Level 2] ![]() ![]() Group: [HOSTED] Posts: 35 Joined: 16-February 08 From: bombay Member No.: 57,972 |
The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers. The reason is that C is a console language and does not do anything with graphics since a console is keyboard based. However, if you add a graphics header to make the program into a graphical one, you will be able to get mouse input. Look into using winmain on windows. You will see there is msgproc which has a bunch of mouse messages and this is where you will handle mouse input. thanx...winmain will do the work i wanted, just a part of C project at school..thought of adding something new... i'll have to learn using winmain now..... just thinking of trying windows.h and x- window headers but they are not present in my include directory... i havent started using winmain...so if there is some connection between the two ....forgive me for asking this...but i just thought they are different This post has been edited by klusk: Mar 6 2008, 03:00 PM |
|
|
|
Mar 25 2008, 03:11 AM
Post
#5
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 370 Joined: 14-November 04 From: Elysium Member No.: 2,280 |
QUOTE The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers. That's not true at all.The gpm library (http://linux.schottelius.org/gpm/) provides a mouse server without any x11 stuffs. I don't know how well it can be natively ported to windows (or if one already exists) but it should be able to be cygwin'd. |
|
|
|
Mar 30 2008, 07:22 PM
Post
#6
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 24-February 08 Member No.: 58,381 |
adrianxw's website shows you how to use mouse input with the console (Working with Windows Consoles, Part 5) plus a few other interesting tutorials for win32 console apps.
http://www.adrianxw.dk/SoftwareSite/index.html |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 13th May 2008 - 05:46 PM |