Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hey I was wondering does anybody know how to run a pc game any pc game really inside of a winform in c# with a panel control Ive seen others run roms inside of a winform with a use of a panel control in visual studio so it has to be able to be done I mean instead of the user running the rom they just run the exe on the panel

What I have tried:

I have not tried anything yet!!
Posted
Updated 16-Mar-18 0:20am
v2
Comments
OriginalGriff 16-Mar-18 4:29am    
Don't "bump" your question - it's rude and it doesn't help you get a faster response. Quite the reverse: it annoys people and that can slow a response.

By all means add information, but just editing it to move it to the top of the queue is just saying "I'm more important than all the others" which is untrue.
John Nay 16-Mar-18 14:24pm    
What Are you talking about I did not bumb my question at the top frankly I do not even think that's possible I mean really
F-ES Sitecore 16-Mar-18 5:19am    
Can't help with the specifics but I believe the general concept is to set the parent of the child process to the handle of your panel, so when the code issues its various draw commands and queries its dimensions it uses your panel to do so. If this technique is supported is probably going to depend on how the child process works.

1 solution

You're going to need to look into Windows DLLs to find the handle of the .exe which acts as a unique identifier, then set the parent of that to the panel's handle. That way, the .exe is effectively embedded in the form.

You'll be needing the SetParent function in user32.dll to do this.

Also it sounds far better to say 'programmer' as opposed to 'coder'.
 
Share this answer
 
v3
Comments
John Nay 16-Mar-18 14:26pm    
Thanks you helped me out on this.
[no name] 16-Mar-18 14:28pm    
No problem, don't forget to let us know how it goes; your findings can always help other people who come across this thread in the future c:
John Nay 16-Mar-18 16:19pm    
will do thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900