The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => The Orphanage => Topic started by: Magnum on December 10, 2010, 10:08:04 PM

Title: Hotkey example
Post by: Magnum on December 10, 2010, 10:08:04 PM
> I have searched and not had much luck.

> I would like to have a hot key that would output text.
> I can't find much source code that addresses that.

> I know how to output text to a buffer and do a Shift Insert.

> I would like to be able to select different text depending on the
> situation.

> Any source for any compiler would be appreciated.

Don't you think assembly is the wrong language for this
purpose. Even C++ or Java is much to low level, do it
in GOOGLE:
Title: Re: Hotkey example
Post by: MichaelW on December 11, 2010, 02:24:01 AM
QuoteI would like to have a hot key that would output text.

In what context?
Title: Re: Hotkey example
Post by: dedndave on December 11, 2010, 03:02:16 AM
ansi.sys   :bg
Title: Re: Hotkey example
Post by: Magnum on December 11, 2010, 03:22:36 AM
Quote from: MichaelW on December 11, 2010, 02:24:01 AM
QuoteI would like to have a hot key that would output text.

In what context?

To output text.

Ex.

Ctrl-Alt-1 would send text to either the clipboard or be pasted in a box where my cursor is. (2nd way best.)



Title: Re: Hotkey example
Post by: dedndave on December 11, 2010, 04:05:19 AM
i think sending it to the clipboard would require a shell extension

pasted in a box - like say notepad ? - or console window ?
Title: Re: Hotkey example
Post by: jj2007 on December 11, 2010, 07:11:11 AM
- check async keystate for your key (e.g. once every 100 ms)
- get the active/foreground window
- enum its children until you find the editbox or similar where you selected the text
  (note this is not trivial, especially with Firefox...)
- get the text with WM_GETTEXT
- insert it into your editbox.
Title: Re: Hotkey example
Post by: Magnum on December 11, 2010, 11:10:49 AM
Quote from: dedndave on December 11, 2010, 04:05:19 AM
i think sending it to the clipboard would require a shell extension

pasted in a box - like say notepad ? - or console window ?

Someone posted code how to put text in the clipboard.

Title: Re: Hotkey example
Post by: Magnum on December 11, 2010, 11:15:37 AM
Quote from: jj2007 on December 11, 2010, 07:11:11 AM
- check async keystate for your key (e.g. once every 100 ms)
- get the active/foreground window
- enum its children until you find the editbox or similar where you selected the text
  (note this is not trivial, especially with Firefox...)
- get the text with WM_GETTEXT
- insert it into your editbox.

Simple would be good too.

How about just sending some text to the clipboard using a hot key combination.

I have about 4 or 5 different sets of texts that I would like to assign to keys.

I could hit whatever hot key combination I needed and do a Shift Insert to "insert" it.


Title: Re: Hotkey example
Post by: Magnum on December 11, 2010, 11:35:00 AM
I found this.

http://msdn.microsoft.com/en-us/magazine/cc163867.aspx