|
Documentation component by D.Glodt (c)2001-2002 |
Appendix A: QRun |
|
|
|
|
Field |
Type |
R/W |
Default |
|
|
|
|
|
|
Method |
Type |
Description |
Params |
|
|
|
|
|
|
FindApplication |
FUNCTION(FileName$) AS STRING |
Return the name and path of associated application. |
1 |
|
FileRun |
SUB(FileName$,cmdShow%) |
Run a associated file or an exe file. |
2 |
|
ExeRun |
SUB(ExeName$,Param$,cmdShow%) |
Run an exe file with parameters. |
3 |
|
EnumWindow |
FUNCTION(All&) As Boolean |
The desktop windows will be returned by event OnEnumWindows if the parameter All is at false , only visibles windows will be returned.The method return true if there is find windows |
1 |
|
FindChild |
FUNCTION(handle&,class$,name$) As Boolean |
Return handle of children control by arguments following: handle& is the parent handle , class$ is the class name of search control , name$ is the title of control. |
3 |
|
EnumFromPoint |
FUNCTION(X&,Y&) As Boolean |
Return the window at the position x,y by event OnEnumFromPoint. The method return true if there is a find window. |
2 |
|
Close |
SUB(handle&) |
Close window identify by handle parameter. |
1 |
|
Minimize |
SUB(handle&) |
Minimize window identify by handle parameter. |
1 |
|
Maximize |
SUB(handle&) |
Maximize window identify by handle parameter. |
1 |
|
Restore |
SUB(handle&) |
1 |
|
|
SetFocus |
SUB(handle&) |
Set focus on control identify by handle parameter. |
1 |
|
SetTopMost |
SUB(handle&,flag&) |
Put the window identify by handle parameter to the top level of Z order if parameter flag is at true |
2 |
QRun Events
|
Event |
Type |
Occurs when... |
Params |
|
|
|
|
|
|
OnEnumWindows |
(handle&,name$,ClassName$) |
On execution of the method EnumWindow |
3 |
|
OnEnumFromPoint |
On execution of the method EnumFromPoint |
3 |
QRun Exemple 1
$typecheck on
$INCLUDE "Rapidq.inc"
$INCLUDE "Object\QRun.inc"
declare sub OuvrirClick
declare sub QuitterClick
dim App as QRun
CREATE Form AS QFORM
Caption ="Execute"
Width = 200
Height = 200
Center
CREATE Menu AS QMAINMENU
CREATE item1 AS QMENUITEM
Caption="&Fichier"
CREATE item2 AS QMENUITEM
Caption="&Ouvrir"
OnClick=OuvrirClick
END CREATE
CREATE item5 AS QMENUITEM
Caption="-"
END CREATE
CREATE item6 AS QMENUITEM
Caption="&Quitter"
OnClick=QuitterClick
END CREATE
END CREATE
END CREATE
END CREATE
Form.ShowModal
sub OuvrirClick
dim file as QOPENDIALOG
file.Filter="Fichiers(*.*)|*.*"
file.InitialDir=CurDir$
if file.Execute then
if App.FindApplication(file.fileName)<>"" then
App.fileRun(file.fileName,SW_SHOW)
end if
end if
end sub
sub QuitterClick
Form.Close
end subQRun Exemple 2
$typecheck on
$include "rapidq.inc"
$include "QFuncLib.inc"
$include "Object\QRun.inc"
declare sub rout1
declare sub rout2(handle as Long,name as string,ClassName as string)
dim app as QRun
app.OnEnumWindows=rout2
create form as qform
center
caption="Enum windows"
width=600
height=400
create lb as qlistbox
width=300
height=200
end create
create bt as qbutton
caption="Enum"
onclick=rout1
left=340
end create
end create
form.showmodal
sub rout1
lb.clear
app.enumWindow false
end sub
sub rout2(handle as Long,name as string,ClassName as string)
if handle<>form.handle and handle<>application.handle then
lb.additems name
lb.additems ClassName
end if
end sub