Click here to Skip to main content
15,885,365 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: datagrid in C#.net Pin
Ajay.k_Singh27-Aug-08 20:15
Ajay.k_Singh27-Aug-08 20:15 
Questionvb.net datagrid cell merging Pin
mmel_g27-Aug-08 19:51
mmel_g27-Aug-08 19:51 
AnswerRe: vb.net datagrid cell merging Pin
John_Adams2-Sep-08 19:55
John_Adams2-Sep-08 19:55 
QuestionHow can I include analog clock in GUI(vc) Pin
AhsanShah22127-Aug-08 17:39
AhsanShah22127-Aug-08 17:39 
AnswerRe: How can I include analog clock in GUI(vc) Pin
Ajay.k_Singh28-Aug-08 2:15
Ajay.k_Singh28-Aug-08 2:15 
QuestionLoading a big file into the Tree Listview Pin
Soma Shekhar27-Aug-08 8:50
Soma Shekhar27-Aug-08 8:50 
AnswerRe: Loading a big file into the Tree Listview Pin
pbalaga28-Aug-08 9:51
pbalaga28-Aug-08 9:51 
QuestionApplication threading issue? Pin
humblepgmr27-Aug-08 5:44
humblepgmr27-Aug-08 5:44 
I'm not sure if this is the correct forum, but in case it's not, pls let me know where I can post for some assistance.

I'm trying to write a program that supports the following requirements:
Run while another program is running;
Get the keyboard input(s)
While on another program, my program will take the input and loop.

In other words, instead of repeatedly pressing keys, if I hold key down, my program will loop and return the key value to the active screen.

The problem I'm having right now, is that it works as a console, but when I switch to another screen, I loose focus of my application and the keyboard input is no longer being detected. I suspect I need help with threading but need some direction as well.

Here's what I've got so far.


#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;

//function prototypes
void press_any_key();
void one();
void two();
void three();

int main(){
cout << "Start";
press_any_key();
getch();
return 0;
}

void press_any_key(){
bool done;
done = true;
char input;
do{
do{
input = _getch();
if(input == '2'){
cout << "Currently holding the right key";
done = true;
}
else if(input == '+'){
cout << "Abort.";
//done = true;
exit(0);
}
else{
done = false;
}
}while (_kbhit());
}while(done == true);
cout << "Done";
}

Help pls. Thanks
AnswerRe: Application threading issue? Pin
led mike27-Aug-08 6:16
led mike27-Aug-08 6:16 
GeneralRe: Application threading issue? Pin
humblepgmr27-Aug-08 7:11
humblepgmr27-Aug-08 7:11 
QuestionProblem with mdi form controls Pin
pradeep kumarappagari27-Aug-08 4:54
pradeep kumarappagari27-Aug-08 4:54 
Questionset focus on mouse position Pin
caradri26-Aug-08 5:51
caradri26-Aug-08 5:51 
QuestionRe: set focus on mouse position Pin
led mike26-Aug-08 6:33
led mike26-Aug-08 6:33 
AnswerRe: set focus on mouse position Pin
dybs26-Aug-08 18:05
dybs26-Aug-08 18:05 
GeneralRe: set focus on mouse position Pin
caradri26-Aug-08 18:22
caradri26-Aug-08 18:22 
GeneralWrong forum Pin
led mike27-Aug-08 4:50
led mike27-Aug-08 4:50 
GeneralRe: Wrong forum Pin
caradri27-Aug-08 22:28
caradri27-Aug-08 22:28 
QuestionAdding an intelliscence into a combo box Pin
makumazan8425-Aug-08 0:39
makumazan8425-Aug-08 0:39 
AnswerRe: Adding an intelliscence into a combo box Pin
Paul Conrad25-Aug-08 7:54
professionalPaul Conrad25-Aug-08 7:54 
Questionseveral forms displayed on/off in the same main window with a main menu strip - how in C#.NET? [modified] Pin
DbIMKA24-Aug-08 22:35
DbIMKA24-Aug-08 22:35 
AnswerRe: several forms displayed on/off in the same main window with a main menu strip - how in C#.NET? Pin
Manas Bhardwaj25-Aug-08 1:48
professionalManas Bhardwaj25-Aug-08 1:48 
GeneralRe: several forms displayed on/off in the same main window with a main menu strip - how in C#.NET? Pin
DbIMKA28-Sep-08 21:40
DbIMKA28-Sep-08 21:40 
QuestionCreating Add-ons for Firefox Pin
hidayatalishah24-Aug-08 20:27
hidayatalishah24-Aug-08 20:27 
AnswerRe: Creating Add-ons for Firefox Pin
hidayatalishah25-Aug-08 1:41
hidayatalishah25-Aug-08 1:41 
GeneralRe: Creating Add-ons for Firefox Pin
hidayatalishah25-Aug-08 1:42
hidayatalishah25-Aug-08 1:42 

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.