Try:
sClass= WIN.Class("WindowName")
window.show("c="++ sClass)
"WindowName" can be:
"=exename" -> "=explorer"
"Window Caption" -> "Window Caption"
"c=classname" -> "c=ExploreWClass"
For fun ...
; Save the following to WinInfoToDebug.powerpro
; and double click or run from Explorer's Tiny Run box:
; "pathToPowerPro\PowerPro.exe" .WinInfoToDebug
LOCAL msg= ?"Click/Activate on next window to collect info..."
EXEC Windowinfo
EVENT.Message(30,"",msg,msg,1)
WAIT.For(20000, VISIBLEWINDOW(msg))
WIN.Show(msg)
WAIT.For(NOT ACTIVEWINDOW(msg))
IF(ANYWINDOW(msg))
WINDOW.Close2_(msg)
EXEC Windowinfo
LOCAL tmp, xmse= xmouse
LOCAL ymse= ymouse
LOCAL handle= WIN.Mainhandlefrompoint(xmse, ymse)
LOCAL hChild= WIN.Handlefrompoint(xmse, ymse)
DEBUG
WIN.Debug("********** from: "++ scriptname++ " **********")
LOCAL space= " "
WIN.Show("Powerpro Debug")
WIN.Debug(xmse++ ", "++ ymse)
WIN.Debug(?#WIN.Mouse("Screen "++ xmouse++ ", "++ ymouse )#)
WIN.Debug(space++ "MOUSE Screen "++ xmse++ " "++ ymse)
DEBUG
IF(hChild!=handle)DO
WIN.Debug(hChild)
WIN.Debug(space++ "CHILD HANDLE: hChild= "++ ;;+
"WIN.Handlefrompoint(xmse, ymse)= "++ hChild)
Tmp= WIN.Gettext(hChild)
IF(tmp!="")DO
WIN.Debug(tmp)
WIN.Debug(space++ "WIN.Gettext(handle)")
ENDIF
ENDIF
WIN.Debug(handle)
WIN.Debug(space++ "PARENT HANDLE: handle= "++ ;;+
"WIN.Mainhandlefrompoint(xmouse, ymouse)= "++ handle)
LOCAL exe= "="++ WIN.Exename(handle)
LOCAL sWorkDir= WIN.getworkingdir(handle)
DEBUG
WIN.Debug(sWorkDir)
WIN.Debug(?#"#++ WIN.Exepath("=powerpro")++ ;;+
?#" EXEC Explorer2 #++ sWorkDir)
WIN.Debug(?#explorer.exe /e, "#++ sWorkDir++ ?#"#)
WIN.Debug(space++ "Commandlines:")
WIN.Debug(space++ "GETWORKINGDIR: WIN.getworkingdir"++ ;;+
?#(handle) OR WIN.getworkingdir("#++ exe++ ?#")#)
DEBUG
LOCAL sExePath= WIN.Exepath(handle)
WIN.Debug(sExePath)
WIN.Debug(?#"#++ WIN.Exepath("=powerpro")++ ;;+
?#" EXEC Explorer2 #++ sExePath)
WIN.Debug(?#explorer.exe /e, /select, "#++ ;;+
FILE.Folder(sExePath))
WIN.Debug(space++ "Commandlines:")
WIN.Debug(space++ "EXEPATH: WIN.Exepath(handle) OR"++ ;;+
?# WIN.Exepath("#++ exe++ ?#")#)
WIN.Debug(exe)
WIN.Debug(space++ "EXENAME: WIN.Exename(handle) OR"++ ;;+
?# WIN.Exename("#++ exe++ ?#")#)
LOCAL sClass= "c="++ WIN.Class(handle)
DEBUG
WIN.Debug(sClass)
WIN.Debug(space++ "CLASS: WIN.Class(handle) OR"++ ;;+
?# WIN.Class("#++ exe++ ?#")#)
LOCAL cap= WIN.Caption(handle)
DEBUG
WIN.Debug(cap)
WIN.Debug(space++ "CAPTION: WIN.Caption(handle)"++ ;;+
?# OR WIN.Caption("#++ exe++ ?#")#)
DEBUG
LOCAL xy= WIN.Left(handle)++ ", "++ WIN.Top(handle)
LOCAL wh= WIN.Width(handle)++ ", "++ WIN.Height(handle)
Tmp= xy++ ", "++ wh
WIN.Debug(tmp)
WIN.Debug(?#WINDOW.Position_("=", "=", #++ wh++ ?#, "#++ ;;+
Exe++ ?#")# )
WIN.Debug(?#WIN.Size("#++ Exe++ ?#", #++ wh++ ")" )
DEBUG
WIN.Debug("WINDOW.Position_("++ xy++ ?#, "=", "=", "#++ ;;+
Exe++ ?#")# )
WIN.Debug(?#WIN.Move("#++ Exe++ ?#", #++ xy++ ")" )
DEBUG
WIN.Debug("WINDOW.Position_("++ tmp++ ?#, "#++ ;;+
Exe++ ?#")# )
WIN.Debug("WINDOW.Position_("++ tmp++ ?#, "#++ ;;+
sClass++ ?#")# )
WIN.Debug(space++ "POSITIONING:")
DEBUG
WIN.Debug(?#WINDOW.Show_("#++ Exe++ ?#")# )
WIN.Debug(?#WINDOW.Show_("#++ sClass++ ?#")# )
WIN.Debug("WINDOW Show "++ sClass )
QUIT
Ted
--- In [email protected], "JESUS PEREZ DE ARRILUCEA" wrote:
>
> Hi!
>
>
> Is there a way by which I can refer to a window by its class
> name? I need to do this:
>
> I need to open a certain window with the show command, let say,
> window.show ("WindowName"), store its class name in a given
> variable (windowclassname), and refer to that window by its
> class name, something like windows.show(windowsclassname).
>
> How can I accomplish this?
>
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/