Hello, all...
I've been working on a few tools, as some of the available tools either don't fit my needs or are outdated. (Just to clarify, I am in no way denoting anyone's work or making accusations of inadequacy. I simply needed something tailored a bit more to my needs and something that works a bit better with the 7.4 files.) Currently I am working on a gm tool and ran into a bit of an issue. I know there are a few very talented C# programmers in this community who have achieved this in the past and thought I might give it a shot. (please don't flame... I am at least trying which is more than you can say for most of the help threads in this forum.) Here is my issue:
The GM-Tool passes strings to Herlock using "sendmessage", as seen here:
This works fine, however, I tried using "sendkeys" to pass the enter keystroke which, as you know, will only effect the active window.
Code:
SendKeys.Send("{ENTER}");
Someone suggested looking into spy++ and using "WM_KEYDOWN". Unfortunately I cannot afford a legit version of Visual studio and was wondering if anyone would be willing to share their insights or methods used in the past.
I will, of course, share everything once I am finished. Thanks in advance.
This Code will send the message to each Gameserver wich is running in Backround/Foreground.
Worked perfectly... Thanks a ton, Raskim. In the end I don't think i will use "foreach", as I may use an xml file to define the process, so that people with more than one server can simply customize the xml file and use the tool independently for each server. Thanks again for your help and quick reply!
I'll be sure to include your name in the credits when I release my work.
Also, for anyone else that may have been looking for this solution, you will also need the following:
Code:
using System.Runtime.InteropServices;
PS:
@ Raskim and Xijezu
You're both brilliant. My GM tool's layout is based on your's, Xijezu. Not trying to copy you or "jock your style", but it was layed out brilliantly. Hope you don't mind but if you do shoot me a pm.
I have to agree. Atleast in comparison to c#, vb falls a bit short. Easier to learn but limited as far as how extensible. It's not a bad language, but doesn't compare with C#
Well, for some reason I'm always discussing about C# and vb... xD
Err, basically VB & C# is the same, they just have a different syntax.
Both of them need the .NET Framework, which has, orly?, the same content in vb aswell in c#.
The only difference is at a standard-"include": Microsoft.CSharp & Microsoft.VisualBasic.
For sure you can add both into your project, but usually just the necessary one is included.
Why I hate vb? Because this is not a good "Syntax" <.<
I wouldn't say they're the same. VB has some pretty severe limitations and while technically you can do the same with VB what you can do with C#, it will take jumping through some hoops to get some functionality in VB that you can get from C# out of the box.
Also, VB will let you code "wrong" and not worry about it, which is why novice and beginner types flock to it.
And yes, I do dislike VB for its syntax too.
I wouldn't say they're the same. VB has some pretty severe limitations and while technically you can do the same with VB what you can do with C#, it will take jumping through some hoops to get some functionality in VB that you can get from C# out of the box.
Also, VB will let you code "wrong" and not worry about it, which is why novice and beginner types flock to it.
And yes, I do dislike VB for its syntax too.
Yeah... You have to reinvent the wheel to get anything worthwhile working. C# is definitely worth the little extra time to learn... Though I'm probably not a great example. XD