Quantcast
Channel: DDDD
Viewing all articles
Browse latest Browse all 65

Which window to CALL FORM?

$
0
0

Summary

meadow mower
Lots of windows. Engine inside. Which window to address?

To use CALL FORM I need the window-reference. I never thought about taking care of window-references and I’m not happy about to start that extra efforts. Therefore I was thinking about how to ask 4D, to receive the window-reference for a process, where I know the name of. I usually don’t know the process-name either, but there are reasonable options to derive that name with some logic. Here is a function that works:

Um CALL FORM verwenden zu können, brauche ich die Referenz des Fensters. Ich habe mir nie Gedanken um die Fensterreferenz gemacht und ich wollte jetzt nicht damit anfangen. Wie muß ich 4D fragen, um an die Fensterreferenz eines Prozesses zu kommen, von dem ich den Prozessnamen weiß bzw. dessen Namen ich mir mit einer Art von Logik ableiten kann. Das ist mein aktueller Stand:


$windowRef_L:=myFunction(„processName“)

  //  myFunction
$checkProcessName:=$1
$N:=Count user processes
For ($i;1;$N)
PROCESS PROPERTIES($i;$Prozessname;$Prozesstatus_L;$Prozesszeit_L;$modus_b;$unique_L;$source_L)
Case of
: ($source_L<0)
: ($modus_b=False) // not visible
: ($Prozessname=$checkProcessName)
$pzsIDLookingFor_L:=$i
$i:=$N+1
End case
End for

ARRAY LONGINT($t_Windows_L;0)
WINDOW LIST($t_Windows_L)
$N:=Size of array($t_Windows_L)
For ($i;1;$N)
$pzs_L:=Window process($t_Windows_L{$i})
If ($pzs_L=$pzsIDLookingFor_L)
$return_L:=$t_Windows_L{$i}
$i:=$N+1
End if
End for

$0:=$return_L


Viewing all articles
Browse latest Browse all 65

Trending Articles