klusk
Mar 5 2008, 11:59 AM
| | 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. |
Reply
CrashCore
Mar 6 2008, 12:20 AM
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.htmlAlso 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.
Reply
fffanatics
Mar 6 2008, 03:11 AM
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.
Reply
klusk
Mar 6 2008, 02:53 PM
QUOTE(fffanatics @ Mar 6 2008, 08:41 AM)  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
Reply
osknockout
Mar 25 2008, 03:11 AM
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.
Reply
howardh
Mar 30 2008, 07:22 PM
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
Reply
Recent Queries:--
mouse c language - 4.68 hr back.
-
programs using c - 22.38 hr back.
-
windows.h mouse - 26.02 hr back.
-
how to use mouse in a c program - 93.00 hr back.
-
mouse programming in c console - 105.78 hr back.
-
c programming, mouse input - 113.87 hr back.
-
stringgrid checkbox - 131.31 hr back.
Similar Topics
Keywords : mouse, input, c, programs, checkbox
- C++ Programmers
So Post your C++ programs here (1)
Simple C++ Programs.
simple programs for beginners. (17) if you want to start c++ programing read and train this simple programs. CODE 1."using
? command." #include <iostream.h> #include <conio.h> int main(){
clrscr(); float a,b,c,d; cin >>a>>b>>c>>d;
a=(a>c+d)?(a*c) : (b*d); cout <<"a="<<a;
getch(); return 0; } [/indent] [indent] 2."using of while loop
command." #include <iostream.h> #include <conio.h> int main(){
clrscr(); floa....
Programs
for games (4) first off i would like to announce this is my first time on here, i would like to know what kind of
programs i need to edit my Pc games. i have been learning how to edit with just texts but i would
like to know what i need for the text scripts i can't read? any information can help
--thanks....
Buffer Overflow In Action Tutorial
Learn how to buffer overflow programs to change the program flow... (0) This tutorial will show you how to buffer overflow programs in order to change the flow of the
application , even if this means executing your own code. A very well explained tutorial of buffer
overflows ( not theory but practise ) + a 20 min video tutorial/demonstration + all the files needed
for the tutorial.. Buffer Overflow In Action Tutorial LINK ....
How To Input A Password In C
(0) We all know that C doesnt not provide us with any function to enter a password so that whatever we
type doesnt get on the screen. I had this problem and i have found a solution. i have made a funtion
CODE #include <stdio.h> #include <conio.h> #include <stdlib.h> #include
<string.h> getpassword(char[]); getpassword(char
password[100]) { char a; int ab=0; while(1) { fflush(stdin);
a=getch(); if (a>47 && a<123) { password[ab]=a; ab++; } else
if(a==8) ....
C/c++ Programming Experince
How long does it take before programming useful programs? (3) I've been teaching my self C++, slowly but surely. Everything I try to program is just mediocre,
and much simplier to use something already made. How long does it take before I can start
programming useful decent programs?....
Can't Compile Assembly Programs.
(2) Hi, I'm trying to learn assembly but I can't compile any "hello world" programs... And I
don'n know what I'm doing wrong... I downloaded NASM ,NASMW and TASM32. The program is like
this: EXAMP1.ASM: ;title Hello World Program ; This program displays "Hello, World!"
dosseg .model small .stack 100h .data hello_message db 'Hello,
World!',0dh,0ah,'$' .code main proc mov ax,@data mov ds,ax
mov ah,9 mov dx,offset hello_message int 21h mov ax,4C00h
int 2....
Catching Key Input And Closing Wordpad.
(0) Title practically tells all. whenever the letters "erty" are inserted in that order. i want to be
able to close the current active wordpad window. i have no idea how to do this with WinAPI functions
although i think i could use FindWindow() and CloseWindow() to close the window maybe? it's the
catching input thats bugging me. i need to be able to catch it while another window is active any
ideas? ....
Stringgrid Canvas Distorts Mouse Selection
(2) In a C++Builder project I am using a StringGrid component. When the user selects multiple cells
using a mouse, logically the StringGrid Object displays the blue selection area. Then, I have
painted every all rows so by using the following code: StringGrid1->Canvas->FillRect etc. etc. But
this caused a problem. Now the selection area (box) is not visible. And also the content of the
cells are not visible. Now I understand that the content is not visible and the canvas object has a
function to fill text. So that is not a problem, but when the user selects multiple cell....
Simple C++ Programs
programming C++ (13) what simple programs would a beginner should code in order to get some understanding the c++ along
with leaning as well....
Looking for mouse, input, c, programs, checkbox
|
|
Searching Video's for mouse, input, c, programs, checkbox
|
advertisement
|
|