Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Hello, and is there a way to 'sendmessage'?

Author
Message
Mr Spider
5
Years of Service
User Offline
Joined: 1st Jul 2018
Location:
Posted: 13th Apr 2023 15:22
Hello out there wonderful people!

I wonder if someone can help. Is there a method to do something similar to the "sendmessage" function outlined here?

Basically, if a variable "p" =1 then I want to send a keystroke of "q" to another app on windows, if the same variable p=2 then send a "w" keystroke to the same app, a p=3 would send a "e" and so on.

Is there a way to do this with AGK

If anyone can help me do this I'll be grateful enough to ply you with plenty of coffee at some point, thank you.
blink0k
Moderator
10
Years of Service
Recently Online
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Apr 2023 22:25 Edited at: 13th Apr 2023 22:29

Attachments

Login to view attachments
Mr Spider
5
Years of Service
User Offline
Joined: 1st Jul 2018
Location:
Posted: 15th Apr 2023 20:12
Thank you for the response. I'm going through that now and seeing if there is anything that might work. Mr Madbit seems like something of a coding prodigy, so this could be useful indeed.

I love the syntax and elegance of AppGameKit and I really don't want to have to try learning C# or something just for this.
Raven
18
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 15th Apr 2023 22:01
What you can do is use the Multiplayer (Network) Functionality as a "Global" Messaging System.
Using a Local IP instead of a Public IP., will limit it to the Local Area Network and using a Reserved Port will restrict further to JUST that Device.
Mr Spider
5
Years of Service
User Offline
Joined: 1st Jul 2018
Location:
Posted: 18th Apr 2023 09:12
Thank you for the help Raven.

Is there a place where I can find a good example of the Multiplayer functionality working? The AppGameKit site is a little light on a demonstrations.
Virtual Nomad
Moderator
17
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Mr Spider
5
Years of Service
User Offline
Joined: 1st Jul 2018
Location:
Posted: 19th Apr 2023 09:49
I had a look at that. It didn't really cover the multiplayer function.

I did play about a bit with the "ConsoleWrite" function Mr Madbit made, but I lack the knowledge to see any other way to send a simulated keystroke to another app running on the same system that isn't the console using that code.

Autohotkey has the functionality, but it lacks the ability to set up a lot of conditions like AGK. I'm thinking of trying to mesh the two at this point.
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 28th Jun 2023 03:43
Quote: "Autohotkey has the functionality, but it lacks the ability to set up a lot of conditions like AGK. I'm thinking of trying to mesh the two at this point."


is it a game... the sender app??

if not then AutoIT is probably a better solution it has "SendKeys" functionality built in, a small plugin for AppGameKit exposing SendMessage would only take 10 mins to write if that

infact you can expose a few functions to achieve what you want using my Library Plugin

something like this should work
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
smerf
18
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 4th Jul 2023 17:56
multiplayer is the same a single player. But you want to handle the messages on a scan rate and not per client. so generally as messages come in or go out they should go into a queue and then 1 message per client is sent each scan.

Qugurun
Valued Member
8
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 22nd Jul 2023 08:44
I'm sure I've seen a plugin that allows you to call almost all possible WinAPI functions here on the forum.

Login to post a reply

Server time is: 2023-12-04 18:55:14
Your offset time is: 2023-12-04 18:55:14