Click here to Skip to main content
15,916,949 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalprogramming UART in Visual C++... Pin
Suhail Yousaf27-Oct-03 23:57
Suhail Yousaf27-Oct-03 23:57 
GeneralRe: programming UART in Visual C++... Pin
Mike Dimmick28-Oct-03 1:40
Mike Dimmick28-Oct-03 1:40 
GeneralFocus / Not Focused Pin
YaronNir27-Oct-03 23:12
YaronNir27-Oct-03 23:12 
GeneralRe: Focus / Not Focused Pin
Mumiozol28-Oct-03 0:03
Mumiozol28-Oct-03 0:03 
GeneralRe: Focus / Not Focused Pin
YaronNir28-Oct-03 1:05
YaronNir28-Oct-03 1:05 
GeneralRe: Focus / Not Focused Pin
Mumiozol28-Oct-03 1:42
Mumiozol28-Oct-03 1:42 
GeneralRe: Focus / Not Focused Pin
YaronNir28-Oct-03 1:43
YaronNir28-Oct-03 1:43 
Generalsome doubts about PeekMessage Pin
winewind27-Oct-03 22:05
winewind27-Oct-03 22:05 
I want to do some test about keyboard loging without using hook api. in the following codz, i hope when i press Esc key, the prog will com to an end. but it seems PeekMessage() will never work, always failed. How could it be? Thanks a lot.

#include "windows.h"
#include "stdio.h"


void main()
{
MSG msg;
char buffer[10];
int i, ch;

while(true)
{
if( PeekMessage( &msg,
NULL,
0,
0,
PM_REMOVE))
{
if( msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) break; //Esc pressed, then quit

printf( "Enter a line: " );

/* Read in single line from "stdin": */
for( i = 0; i < 9; i++ )
{
ch = getchar();
if(ch != '\n') buffer[i] = (char)ch;
}

/* Terminate string with null character: */
buffer[9] = '\0';
printf( "%s\n", buffer);
*buffer=NULL;
}
else
printf("peekmessage failed...\n");
Sleep(3000); //ensure there is enough time for keyboard operations
}
}
GeneralRe: some doubts about PeekMessage Pin
yndfcd28-Oct-03 0:08
yndfcd28-Oct-03 0:08 
GeneralRe: some doubts about PeekMessage Pin
winewind28-Oct-03 13:56
winewind28-Oct-03 13:56 
GeneralRe: some doubts about PeekMessage Pin
yndfcd29-Oct-03 16:08
yndfcd29-Oct-03 16:08 
GeneralRe: some doubts about PeekMessage Pin
winewind29-Oct-03 20:24
winewind29-Oct-03 20:24 
GeneralCFileDialog Pin
Kamesh27-Oct-03 21:08
Kamesh27-Oct-03 21:08 
Generalpath of my documents folder Pin
r i s h a b h s27-Oct-03 20:59
r i s h a b h s27-Oct-03 20:59 
GeneralRe: path of my documents folder Pin
iceage27-Oct-03 21:14
iceage27-Oct-03 21:14 
GeneralRe: path of my documents folder Pin
Neville Franks27-Oct-03 22:15
Neville Franks27-Oct-03 22:15 
GeneralRe: path of my documents folder Pin
r i s h a b h s28-Oct-03 18:31
r i s h a b h s28-Oct-03 18:31 
QuestionHow to get the current traffic bandwidth of computer? Pin
George227-Oct-03 20:31
George227-Oct-03 20:31 
AnswerRe: How to get the current traffic bandwidth of computer? Pin
Mike Dimmick28-Oct-03 1:54
Mike Dimmick28-Oct-03 1:54 
GeneralRe: How to get the current traffic bandwidth of computer? Pin
George228-Oct-03 23:51
George228-Oct-03 23:51 
Generalmmc dialog windows Pin
Colin Grealy27-Oct-03 20:06
Colin Grealy27-Oct-03 20:06 
Questionproblem cdatetimectrl in package? Pin
murali_utr27-Oct-03 19:56
murali_utr27-Oct-03 19:56 
AnswerRe: problem cdatetimectrl in package? Pin
ananth_xyz27-Oct-03 22:09
ananth_xyz27-Oct-03 22:09 
GeneralRe: problem cdatetimectrl in package? Pin
murali_utr27-Oct-03 23:00
murali_utr27-Oct-03 23:00 
QuestionHow to get HMODULE/HINSTANCE handle of a different application? Pin
kvcrajan27-Oct-03 18:45
kvcrajan27-Oct-03 18:45 

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.