Hi Everybody,
I am trying to find a way to create a macro for the end user of my application.
I would like to have them do someting like press F5 and have the text "HELLO" inserted into a get.
Any Ideas?
Thanks,
Jeff
Auto insert data
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Auto insert data
Try something like this
POSTSTRING( oGet:hWnd, "HELLO" )
where POSTSTRING() is:
EMG
POSTSTRING( oGet:hWnd, "HELLO" )
where POSTSTRING() is:
Code: Select all
FUNCTION POSTSTRING( hWnd, cString )
LOCAL i, c
DEFAULT hWnd := GETACTIVEWINDOW()
FOR i = 1 TO LEN( cString )
c = SUBSTR( cString, i, 1 )
IF c > " "
POSTMESSAGE( hWnd, WM_CHAR, ASC( c ) )
ELSE
POSTMESSAGE( hWnd, WM_KEYDOWN, ASC( c ) )
ENDIF
SYSREFRESH()
NEXT
RETURN NIL
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Enrico,
>Much simpler. The only drawback is that it alters the clipboard, if I'm not wrong.
I don't believe so. If cText is NOT passed then it pastes from the clipboard, but if cText is passed, then cText is used instead. Either way the clipboard is left as is.
It also handles numeric and date types in addition to string.
James
>Much simpler. The only drawback is that it alters the clipboard, if I'm not wrong.
I don't believe so. If cText is NOT passed then it pastes from the clipboard, but if cText is passed, then cText is used instead. Either way the clipboard is left as is.
It also handles numeric and date types in addition to string.
James
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact: