Page 1 of 1

Change the value

Posted: Thu Nov 19, 2020 2:54 pm
by Natter
Hi.

There are 2 apps on FW. App1 and App2. App1 has a dialog box with the TGet control. I use a timer to check the TGet value for changes. I want to change the value of this TGet from App2.

hWn:=FindWindow( ,"The dialog title") //Handle of the dialog App1
hGt:=FindWindowEx( hWn, 0, "Edit" , nil ) //Handle of the TGet App1

SetWindowText(hGt, "2") //changing the TGet value

The GetWindowText(hGt) function determines that the TGet value has changed. However, checking in App1 doesn't see any changes. If I use TSay, then everything is fine. Why is this ?

Re: Change the value

Posted: Fri Nov 20, 2020 5:44 am
by anserkk
What about copying the value of TGet of App1 to ClipBoard and then in the App2 read the value from the clipboard and then paste into the corresponding TGet ? Just an idea

Re: Change the value

Posted: Fri Nov 20, 2020 7:26 am
by Natter
Hi, Anserkk !

Yes, I can also use the clipboard. In this case, I wanted to use TGet as an indicator of accesses to App1. I solved it this way - inserted the handling of requests from App2 in the HandleEvent method of the App1 dialog box. Everything works