Click here to Skip to main content
15,881,413 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: i/o registers that control cash drawer Pin
Member 1060107320-Feb-14 9:16
Member 1060107320-Feb-14 9:16 
GeneralRe: i/o registers that control cash drawer Pin
enhzflep20-Feb-14 16:40
enhzflep20-Feb-14 16:40 
GeneralRe: i/o registers that control cash drawer Pin
Member 1060107320-Feb-14 20:01
Member 1060107320-Feb-14 20:01 
GeneralRe: i/o registers that control cash drawer Pin
enhzflep20-Feb-14 20:17
enhzflep20-Feb-14 20:17 
QuestionHandling mouse using OS interrupts Pin
myth199015-Feb-14 18:03
myth199015-Feb-14 18:03 
AnswerRe: Handling mouse using OS interrupts Pin
Richard MacCutchan15-Feb-14 21:29
mveRichard MacCutchan15-Feb-14 21:29 
GeneralRe: Handling mouse using OS interrupts Pin
myth199015-Feb-14 22:31
myth199015-Feb-14 22:31 
GeneralRe: Handling mouse using OS interrupts Pin
Software_Developer16-Feb-14 2:01
Software_Developer16-Feb-14 2:01 
OS interrupts are only used in 16-bit MSDOS apps. More [here ]




You can try this code for a WIN32 console app.

C++
#include <windows.h>
#include <iostream>
using namespace std;

int main()
{
    HANDLE hIn;
    HANDLE hOut;
    COORD KeyWhere;
    COORD MouseWhere;
    COORD EndWhere;
    bool Continue = TRUE;
    int KeyEvents = 0;
    int MouseEvents = 0;
    INPUT_RECORD InRec;
    DWORD NumRead;

    hIn = GetStdHandle(STD_INPUT_HANDLE);
    hOut = GetStdHandle(STD_OUTPUT_HANDLE);

    cout << "Key Events   : " << endl;
    cout << "Mouse Events : " << flush;

    KeyWhere.X = 15;
    KeyWhere.Y = 0;
    MouseWhere.X = 15;
    MouseWhere.Y = 1;
    EndWhere.X = 0;
    EndWhere.Y = 3;

    while (Continue)
    {
        ReadConsoleInput(hIn,
                         &InRec,
                         1,
                         &NumRead);

        switch (InRec.EventType)
        {
        case KEY_EVENT:
            ++KeyEvents;
            SetConsoleCursorPosition(hOut,
                                     KeyWhere);
            cout << KeyEvents << flush;
            if (InRec.Event.KeyEvent.uChar.AsciiChar == 'x')
            {
                SetConsoleCursorPosition(hOut,
                                         EndWhere);
                cout << "Exiting..." << endl;
                Continue = FALSE;
            }
            break;

        case MOUSE_EVENT:
            ++MouseEvents;
            SetConsoleCursorPosition(hOut,
                                     MouseWhere);
            cout << MouseEvents << flush;
            break;
        }
    }

    return 0;
}



More : [here ]
GeneralRe: Handling mouse using OS interrupts Pin
myth199016-Feb-14 2:13
myth199016-Feb-14 2:13 
GeneralRe: Handling mouse using OS interrupts Pin
Software_Developer16-Feb-14 3:28
Software_Developer16-Feb-14 3:28 
GeneralRe: Handling mouse using OS interrupts Pin
myth199017-Feb-14 2:29
myth199017-Feb-14 2:29 
GeneralRe: Handling mouse using OS interrupts Pin
myth199022-Feb-14 17:59
myth199022-Feb-14 17:59 
GeneralRe: Handling mouse using OS interrupts Pin
Richard MacCutchan16-Feb-14 2:15
mveRichard MacCutchan16-Feb-14 2:15 
GeneralRe: Handling mouse using OS interrupts Pin
myth199016-Feb-14 2:21
myth199016-Feb-14 2:21 
GeneralRe: Handling mouse using OS interrupts Pin
Richard MacCutchan16-Feb-14 2:28
mveRichard MacCutchan16-Feb-14 2:28 
GeneralRe: Handling mouse using OS interrupts Pin
myth199016-Feb-14 2:32
myth199016-Feb-14 2:32 
Questionredirecting output of CMD with administrator privileges Pin
camillo8715-Feb-14 1:29
camillo8715-Feb-14 1:29 
AnswerRe: redirecting output of CMD with administrator privileges Pin
Richard Andrew x6415-Feb-14 10:23
professionalRichard Andrew x6415-Feb-14 10:23 
SuggestionRe: redirecting output of CMD with administrator privileges Pin
David Crow15-Feb-14 11:10
David Crow15-Feb-14 11:10 
Questionhow to read character by character from text file in c++? Pin
sajedevahedi14-Feb-14 10:32
sajedevahedi14-Feb-14 10:32 
AnswerRe: how to read character by character from text file in c++? Pin
jeron114-Feb-14 10:56
jeron114-Feb-14 10:56 
GeneralRe: how to read character by character from text file in c++? Pin
sajedevahedi14-Feb-14 11:18
sajedevahedi14-Feb-14 11:18 
GeneralRe: how to read character by character from text file in c++? Pin
jeron114-Feb-14 11:30
jeron114-Feb-14 11:30 
AnswerRe: how to read character by character from text file in c++? Pin
Richard MacCutchan14-Feb-14 22:43
mveRichard MacCutchan14-Feb-14 22:43 
AnswerRe: Just put the 'file.get' into a 'while' statement. Pin
Software_Developer15-Feb-14 1:51
Software_Developer15-Feb-14 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.