Jump to content

Recommended Posts

Posted

Hi All,

I've a application where i want to fill in a datafield.

The application is written in Centura (dont know if that is relevant info)

I like to have a value in this edit field in the following structure 23/12/1979.

I tried already a couple of combination without any success..

I use the following command:

ControlSend("Patiënt","", "[CLASS:Edit; INSTANCE:18]", "23/12/1979")

result > 97/9/1

it looks like i have to send my chars backwards

ControlSend("Patiënt","", "[CLASS:Edit; INSTANCE:18]", "9791/21/32")

result > 23/12/19

than it looks like the i have to delete the /

ControlSend("Patiënt","", "[CLASS:Edit; INSTANCE:18]", "97912132")

result > 23/1/2

So that also doesn't look good...

WindowInfo from this field:

Basic Window Info

Title: Patient

Class: Centura:AccFrame

Advanced(class) [CLASS:Edit; INSTANCE:18]

Style 0x50830080

ExStyle 0x00000200

Handle 0x00150410

Anybody who can help me on this?

Posted

Maybe something like this works?

#include <SendMessage.au3>
Global Const $DTM_SETFORMAT_ = 0x1032
Global Const $sDateStyle = "dd/MM/yyyy"
$hWnd_Ctrl = ControlGetHandle("Patiënt","", "[CLASS:Edit; INSTANCE:18]")
_SendMessage($hWnd_Ctrl,$DTM_SETFORMAT_,0, $sDateStyle)
ControlSend("Patiënt","", "[CLASS:Edit; INSTANCE:18]", "23/12/1979")
Posted

Do you really need to re-adjust the control, or might re-formatting the input string be enough?

$s_DateString = "23/12/1979"
ControlSend("Patiënt", "", "[CLASS:Edit; INSTANCE:18]", StringTrimLeft(StringRegExpReplace($s_DateString, '(\d{2})/(\d{2})/(\d{4})', '$3/$2/$1'), 2))
Posted

thats the same for me...

I just need to insert as new date in this field :s

the way how i insert this doesn't matter (at this moment)

Posted
Posted

Sorry.. the correct format is MM/dd/YYYY

if i click in this field and enter the following number

'1' '2' '2' '3' '1' '9' '7' '9'

I get the following date filled in this edit-field

12/23/1979 (23 dec 1979)

Posted (edited)
Posted (edited)

AHA! Eureka...

Correct syntax:

ControlSetText("Patiënt","","[CLASS:Edit; INSTANCE:18]","10/11/1979")

Thanks KaFU!!

Edited by Mooner

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...