Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #5323
| From | "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: SendInput - Calculator and putting numbers |
| Date | 2013-06-04 18:07 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <kol33g$p13$1@dont-email.me> (permalink) |
| References | <ko76fn$d87$1@dont-email.me> <kohu8i$bqv$1@news.m-online.net> <koi0is$4e2$1@news.m-online.net> |
Hi Gerhard,
very nice.
I tried wm_settext with the main window of the calculator and got only a
different caption.
The
hWnd := FindWindowEx(hwnd, 0, String2Psz("Edit"), NULL_PSZ)
is a nice trick.
Thank you
Arne
"Gerhard Bunzel" <g.bunzel@domonet.de> schrieb im Newsbeitrag
news:koi0is$4e2$1@news.m-online.net...
> Hi Arne,
>
> have done a smal test with a german windows:
>
> Set text in in calculator:
> LOCAL hWnd AS PTR
> LOCAL cText AS STRING
>
> hWnd := FindWindow(String2Psz("SciCalc"), String2Psz("Rechner"))
> hWnd := FindWindowEx(hwnd, 0, String2Psz("Edit"), NULL_PSZ)
>
> cText := "1234,789"
>
> iRet := SendMessage(hwnd, WM_SETTEXT, 0, LONG(_CAST, String2Psz(cText)))
>
>
> Get text from calculator:
> LOCAL hWnd AS PTR
> LOCAL cText AS STRING
> LOCAL iLen AS LONG
> LOCAL iRet AS LONG
> LOCAL pBuff AS PTR
>
> hWnd := FindWindow(String2Psz("SciCalc"), String2Psz("Rechner"))
> hWnd := FindWindowEx(hwnd, 0, String2Psz("Edit"), NULL_PSZ)
>
> // First, get the text lenght.
> iLen := SendMessage( hWnd, WM_GETTEXTLENGTH, 0, 0L )
>
> IF iLen > 0
> pBuff := MemAlloc( iLen + 1 )
> IF pBuff <> NULL_PTR
> iRet := SendMessage(hWnd, WM_GETTEXT, DWORD(_CAST, iLen), LONG(_CAST,
> pBuff))
> IF iRet > 0
> cText := Psz2String( pBuff )
> ENDIF
> MemFree( pBuff )
> ENDIF
> ENDIF
>
>
> HTH
>
> Gerhard
>
>
>
> "Gerhard Bunzel" <g.bunzel@domonet.de> schrieb im Newsbeitrag
> news:kohu8i$bqv$1@news.m-online.net...
>> Arne,
>>
>> here you will find a vb.net-sample to get the Windows Calc value with
>> Win32-Standard-API.
>> With SetWindowText() it should be possible, to send your number.
>>
>> http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/e9b2c76c-c96e-46a8-b5cc-d26798e831ae/
>>
>> http://msdn.microsoft.com/en-us/library/windows/desktop/ms633546(v=vs.85).aspx
>>
>>
>> hth
>>
>> Gerhard
>>
>>
>> "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> schrieb im Newsbeitrag
>> news:ko76fn$d87$1@dont-email.me...
>>> Has someone already used the WinAPI function Sendinput?
>>>
>>> I have to call the windows calculator from my program and send a number.
>>> With wm_settext and wm_paste it is not possible to put a number. Now I
>>> want to simulate key strokes.
>>>
>>> Arne Ortlinghaus
>>> ACS Data Systems
>>
>>
>
>
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
SendInput - Calculator and putting numbers "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2013-05-30 11:39 +0200
Re: SendInput - Calculator and putting numbers dlzc <dlzc1@cox.net> - 2013-05-30 07:10 -0700
Re: SendInput - Calculator and putting numbers "Jamal" <jamal@examples.net> - 2013-05-31 12:57 -0400
Re: SendInput - Calculator and putting numbers "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2013-06-03 12:10 +0200
Re: SendInput - Calculator and putting numbers "Gerhard Bunzel" <g.bunzel@domonet.de> - 2013-06-03 13:21 +0200
Re: SendInput - Calculator and putting numbers "Gerhard Bunzel" <g.bunzel@domonet.de> - 2013-06-03 14:01 +0200
Re: SendInput - Calculator and putting numbers "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2013-06-04 18:07 +0200
csiph-web