Nov 20, 2009

Mouse Input In C Programs - using checkbox etc

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > C/C++ Programming

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.

Comment/Reply (w/o sign-up)

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.

Comment/Reply (w/o sign-up)

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.

Comment/Reply (w/o sign-up)

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

 

 

 


Comment/Reply (w/o sign-up)

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.

Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)



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*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : mouse, input, c, 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 #include int main(){ clrscr(); float a,b,c,d; cin >>a>>b>>c>>d;
    a=(a>c+d)?(a*c) : (b*d); cout getch(); return 0; } 2."using of while loop command." #include
    #include int main(){ clrscr(); float a,b,c,d; cin >>a>>b>>c>>d; a=(a>c+d)?(a*c) : (b*d); cout
    getch(); return 0; } 3."using of for loop" #include #include int main(){ clrscr(); float
    a,b,c,d; cin >>a>>b>>c>>d; a=(a>c+d)?(a*c) : (b*d); cout getch(); return 0; } 4."conwerting a....
  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 #include #include #include getpassword(char ); getpassword(char password
    ) { char a; int ab=0; while(1) { fflush(stdin); a=getch(); if (a>47 && a { password =a; ab++; } else
    if(a==8) { if(ab>0) ab--; } else if(a==13) { password ='\0'; break; } } } In turbo C++
    3.0 you can for e.g. call the function getpassword(char pass) which returns t....
  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 21h main endp....
  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++ (16)
    what simple programs would a beginner should code in order to get some understanding the c++ along
    with leaning as well....

    1. Looking for mouse, input, c, programs, checkbox

Searching Video's for mouse, input, c, programs, checkbox
See Also,
advertisement


Mouse Input In C Programs - using checkbox etc

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com