Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Programming language choice

Discussion in Programming started by Detonator, Dec 3, 2011

  1. Sep 25, 2010
    Posts
    I want to create my own simple program where I can clear the clipboard, insert text into it, and then use simulated keyboard presses to paste that text.

    What language is suitable for that and what parts of that language do I need? Complexity of the language does not matter, I have the time/brains for it.

    P.S I tried AutoIt and AHK, but they are extremely unreliable.
  2. Dec 7, 2010
    Posts
    The program you've mentioned Auto Hot Key can do it. But requires some programming knowledge.
  3. Feb 17, 2011
    Posts
    VB
  4. Sep 25, 2010
    Posts
    What topics do I need to cover? I don't have to learn everything do I xD?
  5. Mar 31, 2011
    Posts
    It'd be damned easy to make if you'd like me to do it. Eh, less so when VKCodes don't match up to what they should be... hurr. It'd be easy if you could tell me what key combo you'd want to use instead of me making it for all of them.

    If you're set on doing it yourself though, I'd recommend C/C++ or the .NET framework. Both can handle what you want it a really simple manner and they're not as complex if you don't go into the advanced stuff.
  6. Sep 25, 2010
    Posts
    Ok, I think I'll take on c++. What areas do I need to know to accomplish my goal?
  7. Mar 31, 2011
    Posts
    Well first you need to find a compiler for your platform, which is Windows I presume, and then just look up MSDN / Google for examples on what you want to do.

    You'll need to play around with the Clipboard (clearing it and setting it), play around with forcing key commands (CTRL+V) and somehow create a way to activate it (which is the most annoying part).

    Personally, I use Qt from Nokia for my C++ work since it provides libraries which do half the things you need. The only problem is catching keyboard shortcuts from another application since the VK codes don't match up with Qt's,
  8. May 6, 2012
    Posts
    http://msdn.microsoft.com/en-us/library/ff468802(v=vs.85).aspx

    Use clipboard from windows api if you can't find it inside the programming language.
    VB6 you have a control called Clipboard so Clipboard.Clear() and Clipboard.SetText("blah")
    C# you also have a clipboard control which can be used the same way as vb6 http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard(v=vs.110).aspx
    C++ you will have to use windows api: http://msdn.microsoft.com/en-us/library/ff468802(v=vs.85).aspx
    Java you need the toolkit namespace http://docs.oracle.com/javase/6/docs/api/java/awt/Toolkit.html#getSystemClipboard()

    You can also replicate all function in autoit in any language above, while java might not be recommanded, it still possible.
    Best is to use the windows api to control the mouse and keyboard and autoit are simply macro based on the windows api.

    Please don't play with VK code like Novynn said... meh, while ctrl+c and ctrl+v are pretty universal for copy-paste, it not guarantied to be the same key for all regional setting on every computer.
    Meaning Chinese, korean, german, etc... they might of changed the shortcut key.
    Best to simply use the clipboard control right away

    Actually, I would be amazed that autoit doesn't support clipboard...
    http://www.autoitscript.com/autoit3/docs/functions/ClipPut.htm
    http://www.autoitscript.com/autoit3/docs/functions/ClipGet.htm
    http://www.autohotkey.com/docs/misc/Clipboard.htm

    Deto... can you elaborate on why the clipboard on autoit or ahk aren't reliable?
    I don't see why they would fail to work...
    Post Merged, Jun 10, 2014
    Oh I forgot to mention, you don't need to use the clipboard...
    If there text somewhere in an application, you can read the text right away without using the clipboard.
    While doing a mouseclick and selecting the text with mouse and sending a copy is a way to work...

    There way more efficient method which would require you to play a bit with SPY++ and learn to get the application handle and loop control on the application to get the textbox handle and simply get the text value right away from the textbox or write right away inside the textbox without having to care about the mouse at all or if the windows has focus or not.
    There also more insane stuff you can do afterward like dll injection, but you should first get to know windows api and windows handle.
    • Informative Informative x 1
    • Jan 14, 2012
      Posts
    • May 6, 2012
      Posts
      I saw something about the programming section has been opened... I believe it was on the front page...
      and felt like looking at it and only 2 threads in it, though it was new... imo

      I didn't realize i revived an old thread -_- sry