Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hey I need some advice on this issue

I am building a windows emulator And I need to know where I need to start

What I have built so far I do not want to give my code out right now so any advice without code examples would be better for me thanks...


I have built a simple launcher in c# that can run any foreign exe inside of the parent winform in visual studio So I am going to the right track but I need to know how to get a windows os to boot on the winform that I built inside of the parent winform...

I think that other emulators use something like freedos to install and emulate os's inside of the parent winform but they also emulate hardware also so I wander if there's a easier way to do this without a lot of coding. I just want to save a lot of time on this without having to take a long time coding lines and lines of code I know that I need to code some things but I don't want to spend to much time so Any advice would be very appreciated.....

What I have tried:

I have built a launcher that can run any foreign exe inside of the parent winform in visual studio 2017
Posted
Updated 8-Mar-18 6:42am
v2
Comments
BillWoodruff 6-Mar-18 21:56pm    
"I need to know how to get a windows os to boot on the winform that I built inside of the parent winform"

Have you looked at Docker ?
John Nay 6-Mar-18 22:12pm    
Yeah I do not like that option...
Dave Kreskowiak 6-Mar-18 23:36pm    
So how did you write this "launcher" and get the executable window to show up in your own form?

To me, it sounds like you just wrote the code around a Process instance to launch the target executable and just re-parented the main window of the application with a call to the Win32 function, SetParent.
John Nay 6-Mar-18 23:52pm    
I used this demo as a base point you can get it here https://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project

Then I choosed a menustrip and added a open function to the menustrip then I wrote this kind of c# code to call a exe to run inside of the parent windows form..

Process p = Process.Start("C:\\Program Files (x86)\\DOSBox-0.74\\DOSBox.exe");
Thread.Sleep(500);
p.WaitForInputIdle();
SetParent(p.MainWindowHandle, this.Handle);

And it calls the exe and loads it in my winform launcher which has the application_control tool from the toolbox that came with the download I sent you above on that link hope this answers your question...

Also I made sure that I had the isMidiContainer is set to true
Richard MacCutchan 7-Mar-18 5:06am    
Using Process.Start is a million miles from being a Windows OS emulator. You need to understand how to allocate memory space for the new process, how to load it into memory with its associated libraries, and how to link in to its main starting point. And that is just a tiny part of the end product.

1 solution

Your talking about "hosting virtual machines".

VM Box; Hyper-V; "Parallels".

At a minimum, you need to trap all "Windows API" calls via your "hypervisor".

So, one could start by looking at "hypervisor architecture" for VM's.
 
Share this answer
 
Comments
John Nay 8-Mar-18 13:24pm    
Thank you so much for taking the time to help me out really appreciate it thank you you helped me more than the others that posted so really thank you that advice is good
[no name] 8-Mar-18 14:15pm    
You're welcome.

(Oracle's) VM Box is also open-source; if you want to look at code.
John Nay 8-Mar-18 14:48pm    
Alright thanks for the advice...
[no name] 8-Mar-18 14:52pm    
Here are MS specs for creating a windows compatible hypervisor:

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
Maciej Los 8-Mar-18 14:53pm    
5ed!

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