开发者

Porting existing c# to java (lots of pinvoke/user32.dll) - Pitfalls?

As states we are in the process of considering porting an existin开发者_Go百科g app which uses the user32.dll quite extensively. Mainly for stuff like taking screenshots of the screen and moving the mouse around.

Using something like JNA we should be able to do the same thing, but are there limitations? Things we should be aware of

Thank you


As a first point I'd have to ask why? If you're using JNA you're losing all the cross platform nature of Java anyway, and losing the tight integration with Windows that C# gives you. There's no limitations that'd stop you doing it, but if you are just tying yourself to using native code anyway then I'd say there's not much point.

If on the other hand you're looking to gain cross platform capability and you're looking at porting, then you can take screenshots and move the mouse around using the Java Robot class easily, no native code required. If you are rewriting in Java, that's by far the approach I'd recommend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜