Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

winewind

@winewind
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • some doubts about PeekMessage
    W winewind

    thank u so much^_^

    C / C++ / MFC com json question

  • some doubts about PeekMessage
    W winewind

    thank you so much. but can i use a keyboard or mouse hook api in console applications?

    C / C++ / MFC com json question

  • some doubts about PeekMessage
    W winewind

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

    C / C++ / MFC com json question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups