Freeprocess SendMessage() questions

BlitzMax Forums/BlitzMax Programming/Freeprocess SendMessage() questions

Hezkore(Posted 2012) [#1]
I was just wondering how SendMessage() in Freeprocess works.
It takes two parameters, both "objects", which confuses me...

I'd like to send keystrokes to my started processes.
Has anyone used this?


Hezkore(Posted 2012) [#2]
No one has anything to say?

Does anyone know how to select starting folder for a started application then, or possibly how to hide started applications?


col(Posted 2012) [#3]
Hiya,

The FreeProcess module is BMax doesnt have SendMessage()? Unless I'm looking in the wrong places :/ or misunderstanding what youre asking?
So we can assume youre using Windows being as you mention the SendMessage() window function?

There are a couple of ways to send data from one process to another. The most common method is usually to use some sort of named pipe client/server setup. You could use sockets or even find the window and send messages to it through the system via the windows SendMessage() function, again assuming youre using Windows.

Freeprocess in BMax seems to have some sort pipe commands. I've not used them, although I have made my own named pipe server setup for a project for someone else which worked very well as a client/server. It turned out that that project needed more than just that though.


Noobody(Posted 2012) [#4]
I think you're referring to SendMessage defined in Object. It is supposed to be a generic message passing interface, but I don't think FreeProcess implements it.

or possibly how to hide started applications?

CreateProcess has a parameter flags. Pass HIDECONSOLE into it to hide the launched console.


Does anyone know how to select starting folder for a started application then

I'm not entirely sure about this, but you can try to ChangeDir into the folder the application should launch in and then use CreateProcess.


Hezkore(Posted 2012) [#5]
This is what I'm talking about:
Local MyProcess:TProcess = CreateProcess("notepad.exe")

MyProcess.SendMessage(Message:Object, Context:Object) '< This

While MyProcess.Status()
	
Wend
What's all that about then?

Thanks for the heads up on the Flags though Noobody.
Any where I could find a list of all the Flags supported? (Googles...)
And ChangeDir() actually does seem to do the trick when using CreateProcess(), very nice, thanks again.

Last edited 2012


ziggy(Posted 2012) [#6]
AFAIK this is void on freeprocess.
MyProcess.SendMessage(Message:Object, Context:Object) '< This
It's not implemented in the freeprocess class. This is shared by all object in BlitzMax, but it does not have any functionality unless implemented to perform something speciffic on a class.
What are you trying to do exactly?


Hezkore(Posted 2012) [#7]
Ahh, okay...

Well I'm making a frontend for my Arcade Machine, It's supposed to lunch a bunch of emulators and such.
And a lot of emulators can't remap hotkeys, like Save State and fast forward, so I want to send key commands to the process if you press a joypad button.
Like JoyHit(Button 12 or whatever) then MyProcess.SendCommand("Key_F5")