Autotext for Windows 7 - winapi

'm creating a small accessibility feature in Visual C++ 2010 that I will use for myself for replacing bits of text anywhere within Windows 7. Something similar to the AutoText feature in Word. It should replace whole words only too.
For example, replace u with you but should not have you as yoyou. When the user types the first few letters of a known word or sentence that is stored in the autotext, i want to replace it with something.
I don't want a console program but a small application that runs in the background, perhaps in the tray that whenever its not needed, i can just quit it and it would stop matching.
I am learning Win32 programming and I am a fairly good at programming so any tips for me on what API/classes I can jump directly to and learn first.
Thank you.

You can probbaly get the information and events you want using CBT hooks and/or the accessability APIs.

There are tons of such programs available for such purpose already.
Try http://www.autotext-software.com or http://www.phraseexpress.com (This is a Autotext power tool). Both are free.

Related

What's the recommended tech to program Windows shell?

I am developing a small tool that can detecting which folders are being opened in windows explorer and bring it to front if a specific address has been opened.
I can use both C# and C++ and finally pick C# as it is easier than C++ to accomplish the same target. Then I googled the internet and knowing COM object SHDocVw.ShellWindows can help collect all windows being opened. Then I start looking for Microsoft document to see if any functions can help to achieve my other requirements. However, when I search shell related documents: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ff521731(v=vs.85) I am warned that "We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported." Moreover, some documents even say these techs will be deprecated in Win11 (See the following screenshot)
I am wondering what the status of these Shell related technical. If these are being deprecated. What's the alternative solution? I don't want my tool stop working when start using new Windows. Meanwhile, I am confusing in the study routine of learning Windows desktop technical. Looks like so many technical to achieve the same targets. Is there anyone can give me some road maps?
Last thing, it's really frustrating to search COM object documents at Microsoft sites. Is this tech going down?
Microsoft has been trying to kill win32/desktop applications since Windows 8. That parts of the documentation is labeled as "legacy" is not something I would worry too much about. Some of the shell functions have been marked as deprecated for 20 years but still work fine today and too many applications rely on them for Microsoft to successfully remove them.
The Internet Explorer warning is different and IE might actually go away but that does not affect IShellWindows which is also used by Explorer.exe and 3rd-party applications. Its implementation lives in a shell DLL and not in IE.

programming language for capturing keyboard input on a specific USB port

Developing this web app, my only challenge, is to capture keyboard input from a SPECIFIC usb port. I'm trying to target a BARCODE reader that emulates a keyboard and make my web app react only to input coming from the barcode reader, and not the actual keyboard.
I know this can't be done w/o the help of a win32 application with some sort of a keyboard hook, so I'm trying to pursue this and perhaps learn a bit of whatever language I need to learn just to achieve this small part that I need, but i don't know where to start.
I know there's VB, .NET, C, etc. But For my purpose, what's the easiest language to learn for this? I don't plan to learn more than what i need to to achieve this, really...
Thanks all.
If You want to start somewhere, I recommend using this link.
http://www.codeguru.com/cpp/w-p/system/keyboard/article.php/c5699/Hooking-the-Keyboard.htm
If this cannot halp, use this:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff540174(v=vs.85).aspx
The thing is, that first link is designed for hooking windows keyboard ( and also works here in my company, where my keyboard is usb-attached to my laptop ).
Perhaps the first one is enough. You must check it out.
(Recommend to dissasemle also some c-code sections in order to check, which system-calls ( irq's on windows ) are involved.
Whether VB or C# can do the same, ..... sorry, I never tried.
But c can definitely.

How to interface Windows Search with Emacs

How can I access Windows Search index data from Emacs? Knowing this would be useful for example when writing a minor mode that integrates Windows Search into anything mode or ido-mode.
By Windows Search, I mean the Windows 7 feature that lets you find documents by pressing Start and typing part of document file names (or part of document contents).
Here is a little Python script providing a command line utility for Windows Search. You need to install Python for Windows extensions to use it.
Accessing Windows Search from within emacs is going to be a bit difficult because the API Microsoft provides is strongly skewed towards the Microsoft programming environment. Judging by the MSDN docs, the easiest path would be putting together a SQL query that Windows Search will accept and sending that to a PowerShell/VB script that knows how to send that query to Windows Search. You'd then tell anything/ido/icicles to incrementally send input to such a script, parse the results, and display those.
The task that you are attempting is very difficult, and much of the difficulty comes from the fact that you are trying to get two programs from very different worlds of programming to talk to one another. Completely apart from the FSF/GNU folks actively disliking Microsoft, the design of the Windows API means that the least-effort way of dealing with Windows is to use the Microsoft toolchain. This in contrast to the Unix "API" of sending plain text through intermediary programs, pipes, and sockets.

Automate any software

A quick question. Is there any method to control or automate any Windows application, using the command line. I've tried AutoIt. Any other methods? I'm targetting to control WinCE Test Kit (CETK) to perform the test without having to go to the GUI,or click the menu, connect etc, manually.
Thanks in advance!
We use Rational Robot for this but keep in mind it's not cheap. It's also probably been renamed 27 times since we started using it so you may want to just search for Rational testing products in general.
It's fully script-able, allowing you to monitor the screen and send key presses and whatnot.
Look at SCAR, it is great for all sorts of automation and screen reading: http://freddy1990.com/index.php?page=product&name=scar
I've always used a hybrid approach. First purchase SOTI Pocket Controller Pro then just use the normal AutoIt automation tools. It's a little different because you can't actually capture popup windows like you may be used to, but it can automate clicks, and then loop and wait for things using the GetPixel methods to check it the screen is what you expect.
Being able to connect to multiple CE devices at the same time visually is also a nice touch.

Macro/Scripting language for non-developers with a simple GUI-based editor

We wish to provide people to be able to add some logic to their accounts(say, given a few arguments, how to compute a particular result). So, essentially, this would be tantamount to writing simple business rules with support for conditionals and expressions. However, the challenge is to provide them a simple online editor where they can create the logic (preferably) by completely visual means (drag/drop Expr-tree nodes maybe -- kinda like Y! pipes).
Does anybody know of a scripting/macro/domain-specific language that lets people do this? The challenge is the visual editor, since we don't wish to invest in developing the UI to do the editing. The basic requirements would be:
1. Embedded into another language, or run securely (no reboot -n or <JUNK-DANGEROUS-COMMAND> >> ~/.bashrc)
2. Easily accessible to users without coding background (no need of any advanced features)
3. Preferably have a simple GUI based editor to create the logic programs accessible to non-developers (kinda like spreadsheets)
4. Some ability to generate compile-time warnings (invalid code) would be good (Type safety?)
5. Ability to embed some data before execution which is available to the interpreter (Eg., name, birthday, amount)
Anybody tried doing something like this and got any ideas? I looked at Lua, Io, Python, Ruby and a host of others, but the challenge essentially is that I don't think non-programmers will be able to understand the code all that much. Something that could be added via "meta-programming" to say a Ruby would be good as well, if an editor could be easily developed!
As a matter fact, Microsoft is developing Oslo, which is right up your alley.
Chris Sells has been writing a lot about it recently.
It is designed to be a way to author DSLs and also to visually author these models with a graphical tool called Quadrant. Sounds very very similar to what you are looking for.
Open source wise, Ruby I think can be close, as you can see if you look at _whytheluckystiff's Try Ruby or Hackety.
I don't think you'll find anything that isn't too generic, especially regarding the GUI editor. There's no generic tools as far as I know that will be able to automatically interface with your program and be able to query data from it and interpret the script into commands in your software -- if there is I'd like to have a copy. Not being flippant, but you will have to do some (probably alot) of work to get this working. It will probably result in you writing a custom DSL.
I would take a look at PowerShell. You could surface all the activities a user would like to script in a very readable way.
There is some talk of using PowerShell to create a DSL on the PowerShell team blog and Bruce Payette, the technical lead, talks about this in his book Windows PowerShell in Action from Manning.
At the other end of the scale is to write something simple as a HyperText Application (HTA) -- assuming Windows of course -- along the lines of my Clive tool. The article on the blog doesn't mention the HTA version, but essentially I could enter VBScript-ish code into one textarea and interpret it on the spot, output going into another text area on the form.
With HTAs giving you all the form control of HTML, plus the DOM, you could come up with something interesting fairly quickly.

Resources