Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › How to receive input?

How to receive input?

Posts 1–13 of 13 · Page 1 of 1
aanthonyz
aanthonyz
How to receive input?
I have a command prompt application that opens certain programs and waits for certain input.

Lets say it opens Firefox, how can I make my application still receive input without having to switch over to my application
#1 · 15y ago
'Bruno
'Bruno
using
GetAsyncKeyState Function (Windows)
#2 · 15y ago
aanthonyz
aanthonyz
Does that still work even though my program isnt the main window I am working on? Lets say I am using Firefox, would it still receive everything I type?
#3 · edited 15y ago · 15y ago
MM
mmbob
Your best bet would be SetWindowsHookEx with a WH_KEYBOARD hook.
#4 · 15y ago
'Bruno
'Bruno
Quote Originally Posted by mmbob View Post
Your best bet would be SetWindowsHookEx with a WH_KEYBOARD hook.
dont complicate.

Yes GetAsyncKeyState will work without anykind of focus to the window.
#5 · 15y ago
aanthonyz
aanthonyz
Ok, thankyou
#6 · 15y ago
ғᴜᴋᴏᴊʀ
ғᴜᴋᴏᴊʀ
Quote Originally Posted by Brinuz View Post
dont complicate.

Yes GetAsyncKeyState will work without anykind of focus to the window.
The thing is with GAKS he has to check for each key being pressed, taking forever
#7 · 15y ago
master131
[MPGH]master131
[highlight=c++]for(int i = 0; i < 255; i++)
{
if(GetAsyncKeyState(i))
{
//Do some shit here
}
}[/highlight]
#8 · 15y ago
B1ackAnge1
B1ackAnge1
Not really efficient to keep calling GetAsyncKeyState in an endless for/while loop (no to mention the fact that another apps can get the recently pressed bit instead of yours). Even if you were to stick that in a thread it'd be plain ugly -

If you're wanting to log everything My vote goes for the hook (hell, I think I even made a post about a keyboard hook ages ago..)

Edit: yeah here ya go: http://www.mpgh.net/forum/31-c-c/948...rd-hook-c.html
That sample basically checks for a certain key press (page Up in this case) and does 'something'

Or something similar (full blown keyboard logger) in asm http://www.mpgh.net/forum/34-assembl...kb-logger.html
#9 · edited 15y ago · 15y ago
Hell_Demon
Hell_Demon
Thank you lord for sending back B1ackAnge1. It is a great honor for us to have him back in our sections.

In the name of Father, Son and the holy bullshit thingie, Amen.
#10 · 15y ago
why06
why06
Quote Originally Posted by Hell_Demon View Post
Thank you lord for sending back B1ackAnge1. It is a great honor for us to have him back in our sections.

In the name of Father, Son and the holy bullshit thingie, Amen.
Amen. Lord Jesus. Amen.
#11 · 15y ago
B1ackAnge1
B1ackAnge1
hahah you guys crack me up - Nice to see you guys too
#12 · 15y ago
freedompeace
freedompeace
Quote Originally Posted by Hell_Demon View Post
Thank you lord for sending back B1ackAnge1. It is a great honor for us to have him back in our sections.

In the name of Father, Son and the holy bullshit thingie, Amen.
Quote Originally Posted by why06 View Post


Amen. Lord Jesus. Amen.
Who's this B1ackAnge1? :/

Quote Originally Posted by B1ackAnge1 View Post
hahah you guys crack me up - Nice to see you guys too ;)
hello :)
#13 · 15y ago
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Tags for this Thread

None