Jul 25, 2008

Mouse Input In C Programs - using checkbox etc

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Mouse Input In C Programs - using checkbox etc

klusk
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
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.

Reply

fffanatics
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
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
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
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



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. directly reading mouse inputs from - 24.71 hr back. (1)
  2. linux c mouse console programming - 31.92 hr back. (1)
  3. how to run the graphical header file in windows mode for c programs - 38.89 hr back. (1)
  4. get mouse inputs in c - 48.12 hr back. (1)
  5. mouse input in c - 74.45 hr back. (1)
  6. c programming mouse input - 114.77 hr back. (1)
  7. mouse action programmes in c,c - 131.90 hr back. (1)
  8. c plus plus tutorials and code mouse - 147.15 hr back. (3)
  9. mouce operation in c language - 168.87 hr back. (1)
Similar Topics

Keywords : mouse input programs checkbox

  1. C++ Programmers - So Post your C++ programs here (1)
  2. 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...
  3. 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...
  4. 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 ...
  5. 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) ...
  6. 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?...
  7. 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...
  8. 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? ...
  9. 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...
  10. 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



Mouse Input In C Programs - using checkbox etc



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE