Im a pretty big noob to coding, I have no coding skills, but have a little understanding how it all works. I would like to tap into all of your knowledge bases' for a few seconds, if you would kindly allow me to. If my question should be directed in another community, please let me know.
Anyways, i'll keep it short and sweet.
I want to run a Virtual machine on my workstation, for simple monitoring, and I want to be able to close that program/application/window/instance/whatever-you-want-to-call-it by clicking my 5th mouse button and/or a keystroke, like alt+space, while any other program. Is this possible? I am assuming the program would have to be active in order for the keystroke to close the program, but is it possible to incorporate the keystroke as a shortcut to a macro that activates that program and closes it?
I guess in short I want a 'boss' button that I will be able to execute on any windows instance that closes a specific program, all without displaying said program's window.
Any advice would be deeply appreciated.
I am using windows 10 on the machine that I need this code for.
What sort of Virtual Machine are you thinking of? I know you can turn off a JVM with ctrl‑C or (I think) ctrl‑Z at the terminal/command line, but I don't know about other VMs.
You need to be circumspect about stopping any program suddenly; if you are in the middle of doing something, e.g. writing to a file, that task may terminate partially done and you risk corrupting a resource.
posted 3 weeks ago
you are right about the shortcut for most VMs, how about for any program? say a simple app like solitaire? data lose due to sudden disconnect is not a concern of mine, thanks for the concern though.
posted 3 weeks ago
Kyle Myers wrote:you are right . . . thanks . . . .
You've jumbled a lot of things together. A window is a GUI construct with no direct relation to a VM. I run many VMs on computers that don't even have video displays hooked up to them a lot of the time. And as Campbell has pointed out, VMs come in a lot of flavours. A JVM is essentially an application program, but something like a VMWare VM is a complete simulated computer system, possibly running multiple applications within itself. My mail VM runs the mail transfer agent (sendmail), an IMAP server, a webmail server, and several other mail-related apps, for example.
You can kill a JVM with Ctl-C, bit that, in Unix terminology is SIGKILL, and you can guess from its name that it's going to be very rude. Ctl-Z is a DOS End-of-File character, so don't expect it to do anything unless your program is looping on data from stdin. Ctrl-D is the Unix/Linux end-of-input signal (SIGEOF), and the same applies there.
You can probably attach a hotkey or other HID event to a specific instance of a JVM or machine VM to tell it to shut down cleanly, but we'd need a LOT more information about what you're running to be able to suggest anything.
An IDE is no substitute for an Intelligent Developer.