The way the system is readied for another guild wars instance is the "kill mutex" button which calls a function that iterates through the nt process list looking at all active guild wars instances. For each instance it finds, it attempts to find/kill the mutex handle which would prevent more gw instances from opening.
Putting the mutex killing functionality in a timer would eat up unnecessary cpu cycles. That mutex does not just get created randomly by guild wars, it only happens during the initialization function when guild wars starts. One just needs to make sure to hit the button once after a new gw instance is created to be ready to launch another. I would have liked better integration with Texmod but since that is a closed source product and I am not aware of it accepting command arguments, you are correct in assuming that it basically just launches it. It was mainly added as a convenience to the user. On another note, check out HandleManager.cs. I spent the majority my coding time on that file. Partly due to the fact that it P/invokes into Nt kernel api functions which are not well documented by Microsoft. Had to look at several sources to get the required constants and applicable functions. It contains the core mutex killing code which makes this application possible. All the other code is really just utility and gui. |
I'm also impressed at the neat code, an art form I can't seem to master...