Using low-level keyboard for input

This is a discussion on Using low-level keyboard for input within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Bubba Yes I thought about that after posting it. PostMessage or a callback would be better. But ...

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,021
    Quote Originally Posted by Bubba View Post
    Yes I thought about that after posting it. PostMessage or a callback would be better. But it's not because any of the functions are not thread-safe per se but moreso because SendMessage is like a 'blocking' call.
    But that's also what makes it so thread unsafe. Since the other thread isn't the one that processes messages, it needs to wait until the first thread processes the message, And if the first thread somehow fails to process it, or waits from some data elsewhere, or so on, the second thread will block indefinitely.
    There may also be other unsafe functions about SendMessage.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    alrite then. I've done with my finals and now i have a long break work on this freaking thing. Yay!!!!!

    So, I've implement Bob's code and for sure it works. However, i just realized something. Say: you send the key stroke to an execute program ( such as notepad.exe), it will work because the notepad.exe process shows up in the taksmanager. What if the notepad.exe is not in the taskmanager (hidden), would this work?
    Hello, testing testing. Everthing is running perfectly...for now

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,021
    What are you hinting at? Are you trying to send keys to to some program to start it?
    You can always do that yourself from within the program.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I love how he starts talking notepad.exe and then wants to do something with "hidden" processes. lol....

  5. #20
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    I don't love it at all. I'm very suspicious of it.

    OP: Why would you want to do this?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #21
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I love it because it fits the pattern of a newbie script kiddie 1337 wannabe haxor who can bearly tie his shoes, but wants to tears it up something awful with his uber coding skillz. He asks how to do something with notepad.exe, and then jumps off to something totally in the realm of rootkits. Completely typical.

  7. #22
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    FYI, i'm hitting at a program to interact with my MMPROG game. Because gameguard hide the game process in the process window task, that's why as i understand, the program can not send any key stroke to the game. What i was asking that if the process is hidden, can the signal be send to it or is there any other way around
    Hello, testing testing. Everthing is running perfectly...for now

  8. #23
    Registered User
    Join Date
    Sep 2005
    Posts
    36
    If you want to make some sort of game macro or bot, I'd suggest using Autoit (http://www.autoitscript.com/). It's perfectly suited for this kind of thing. If you don't want to use the language itself, there is always a DLL file you can use with C++. I've used it before for the exact reason you want, worked great.

  9. #24
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    Quote Originally Posted by ryeguy View Post
    If you want to make some sort of game macro or bot, I'd suggest using Autoit (http://www.autoitscript.com/). It's perfectly suited for this kind of thing. If you don't want to use the language itself, there is always a DLL file you can use with C++. I've used it before for the exact reason you want, worked great.
    For the new gameguard engine? Are you the gameguard wont kick it out? Thanks anyways, i'm gonna try and test it out now. lol
    Hello, testing testing. Everthing is running perfectly...for now

  10. #25
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    So you want to add a bot to the game or are you trying to cheat?

    I'd like to know so I can decide whether or not to close this thread.

  11. #26
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Both - game macros are cheats in any sort of competitive multiplayer game. Gameguard is right to kick them out.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Low Level Keyboard Hook
    By sumone4life in forum C# Programming
    Replies: 3
    Last Post: 06-22-2009, 06:10 PM
  2. C/C++, low or high level?
    By Sentral in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-23-2007, 11:43 PM
  3. Low Level Hard Disk Access
    By samGwilliam in forum Tech Board
    Replies: 5
    Last Post: 04-01-2005, 06:14 PM
  4. Low Level Drive Access?
    By coldfusion244 in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2005, 08:19 AM
  5. Low level debuggers
    By Korn1699 in forum C++ Programming
    Replies: 8
    Last Post: 03-27-2002, 01:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21