Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

Project - In Game Emulator GUI


vsilvalopes

Recommended Posts

Hi Everyone !

This morning I was thinking about to have some sort of a in game GUI for GameEx.

Like waht we have on modern game Consoles like Wii Menu and Xbox 360 NXE.

My ideia is prety simple.

I want to develop some sort of interface that we can access while playing a Game.

Emulators provide lots of resources , and lots of these resources we have to access using in emulator menus.

Imagine this situation....

You're playing Final Fantasy 3 for SNES.

And you know that the next Save Point is very far from were you are.

So if you are using an emulator , you can use the Save State option.

To do that you have to navigate to menus , or use keyboard shortcuts to Save your State.

On the other hand using menus to do that kills the fashion of a dedicated setup for gaming.

My idea is , build a simple program , that controls these actions.

The Basic options could be :

SAVE STATE

LOAD STATE

CHOOSE SAVE STATE SLOT

EXIT GAME

The options bellow are very clear in their meaning.

The last one "EXIT GAME" I want it to show another Menu with the dialog :

Exit Game ?

[ YES ] [NO]

Then after the exit , you go back to gameEx.

If you have an Xbox 360 you know exactly what I'm talking about.

I´ve thinking about this because sometimes I want to use some emulator functions.

And sometimes I want a confirmation before I go back to GameEx.

So I started to research on how to do this via Visual Studio Express.

I used that code to test it.

Public Class Form1

Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer

Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr

Private Const WM_SETTEXT = &HC

'Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Process.Start("notepad.exe")

'End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim windowHandle As Integer = FindWindow(vbNullString, "Untitled - Notepad")

Dim controlHandle As Integer = FindWindowEx(windowHandle, 0, "Edit", vbNullString)

SendMessage(controlHandle, WM_SETTEXT, 0, "abc")

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim windowHandle As Integer = FindWindow(vbNullString, "Untitled - Notepad")

Dim controlHandle As Integer = FindWindowEx(windowHandle, 0, "Edit", vbNullString)

SendMessage(controlHandle, WM_SETTEXT, 0, "{F1}")

End Sub

End Class

It´s a simple application that send keystrokes to an unfocused application.

It´s more or less what I will need to do to access emulator options.

As at the point that you start another application, the emulator window will lose focus.

So the main point is:

1- Start the Application WHITOUT clossing the current emulator section.

2- Make the emulator Window/Program avaiable to receive Keyboard imputs (Via the app.)

3- Exit the application and GO BACK to emulator.

If you have Visual Studio Express just copy and paste the code to see it working.

I'm not a developer , I just know how to put codes togheter and make it work.

So anyone interested to help me build it ?

Any help will be appreciated !

Link to comment
Share on other sites

Hi Everyone !

This morning I was thinking about to have some sort of a in game GUI for GameEx.

Like waht we have on modern game Consoles like Wii Menu and Xbox 360 NXE.

My ideia is prety simple.

I want to develop some sort of interface that we can access while playing a Game.

Emulators provide lots of resources , and lots of these resources we have to access using in emulator menus.

Imagine this situation....

You're playing Final Fantasy 3 for SNES.

And you know that the next Save Point is very far from were you are.

So if you are using an emulator , you can use the Save State option.

To do that you have to navigate to menus , or use keyboard shortcuts to Save your State.

On the other hand using menus to do that kills the fashion of a dedicated setup for gaming.

My idea is , build a simple program , that controls these actions.

The Basic options could be :

SAVE STATE

LOAD STATE

CHOOSE SAVE STATE SLOT

EXIT GAME

The options bellow are very clear in their meaning.

The last one "EXIT GAME" I want it to show another Menu with the dialog :

Exit Game ?

[ YES ] [NO]

Then after the exit , you go back to gameEx.

If you have an Xbox 360 you know exactly what I'm talking about.

I´ve thinking about this because sometimes I want to use some emulator functions.

And sometimes I want a confirmation before I go back to GameEx.

So I started to research on how to do this via Visual Studio Express.

I used that code to test it.

It´s a simple application that send keystrokes to an unfocused application.

It´s more or less what I will need to do to access emulator options.

As at the point that you start another application, the emulator window will lose focus.

So the main point is:

1- Start the Application WHITOUT clossing the current emulator section.

2- Make the emulator Window/Program avaiable to receive Keyboard imputs (Via the app.)

3- Exit the application and GO BACK to emulator.

If you have Visual Studio Express just copy and paste the code to see it working.

I'm not a developer , I just know how to put codes togheter and make it work.

So anyone interested to help me build it ?

Any help will be appreciated !

So... You would essentially have to use a different "app" for each emulator right? I mean, you could change the keystrokes in each emulator to match the pre-determined ones, but not all emulators allow for this. So the question really is, do you have a way to determine what emulator is running and then assign proper keystrokes to do what you want? You would almost have to make a whole new app for each emulator, and make them uniform across all systems to make it look nice. You're literally talking about at least 50 proggys to cover all the emulators people use here if you wanted to make it look like a standard-issue GameEx dashboard.

It would almost be easier to make a plugin that can be configured for each emulator based on what you tell it to send too do these things, and maybe have the user select the features they want to use (like I use screenshot keys alot for instance).

Do I have you right?

Link to comment
Share on other sites

Yeah, but HK's CP app doesn't pass commands to the emulators, does it? I thought it just more or less ran over the top of the emulator, like the two aren't really "paired", but the CP knows what emu is running and shows basically a picture containing the keys you told it to post for that emulator. It may also look at the game command to determine what game it is, but I didn't think it really sent anything to it.

Maybe I'm wrong about that... I never really figured out how to set up his CPWizard to cater to my exact layout (even though I tried a few times)...

Link to comment
Share on other sites

Maybe I'm wrong about that... I never really figured out how to set up his CPWizard to cater to my exact layout (even though I tried a few times)...

It's come along way now though, and it's cool even just to export your CP as bezels to view controls in MAME (when you pause it's overalyed as a bezel). Doing it that way you don't even need to run it all the time (an can even uninstall it). But Tom and I have been working to put some of it's features built into GameEx anyway.

Link to comment
Share on other sites

Yeah, but HK's CP app doesn't pass commands to the emulators, does it? I thought it just more or less ran over the top of the emulator, like the two aren't really "paired", but the CP knows what emu is running and shows basically a picture containing the keys you told it to post for that emulator. It may also look at the game command to determine what game it is, but I didn't think it really sent anything to it.

Maybe I'm wrong about that... I never really figured out how to set up his CPWizard to cater to my exact layout (even though I tried a few times)...

If you send me picture of the CP, and key mappings, I would set it up for you. smile.gif

Link to comment
Share on other sites

So... You would essentially have to use a different "app" for each emulator right? I mean, you could change the keystrokes in each emulator to match the pre-determined ones, but not all emulators allow for this. So the question really is, do you have a way to determine what emulator is running and then assign proper keystrokes to do what you want?

@ Adultery.

Thats the idea.

But I´ve already saw that Visual Basic Express can GET a process running.

So the main Idea is :

1- Get the Process

2- After having the process , the program will map the keys.

But YOU will have to add the keys.

Example.

Zsnes uses F3 for Save State and F4 for Loading State.

Project64 uses CTRL+F4 to save and CTRL+F6 to load.

So I can do it by a config file or directly in the program code.

The config file is more sleek. But I dont know how to use config files in VBE.

As I said I´m not a developer.

My Goal is at first make the program send keystrokes to an Unfocused window.

I´ve had a little sucess sending text to a window. But I want Keystrokes , Like ALT+F4 , CTRL+ESC and things like that.

Because almost all emulator use combinations like this.

I´m still researching , but no sucess at all... :unsure:

If anybody know a code that does this , please let me know. The rest I will learn !

Link to comment
Share on other sites

Can't you use Virtual Keys for that? There's a way to send keys through VBA. I can't remember the exact argument... sendKeys maybe?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...