Code: Select all
static oWnd
function Main()
SetKey( VK_F2, { | cProc, nLine, cVar, x | Donde(cProc, nLine, cVar, x) } )
...
function Donde(cProc, nLine, cVar, x)
...
return nil
Code: Select all
static oWnd
function Main()
SetKey( VK_F2, { | cProc, nLine, cVar, x | Donde(cProc, nLine, cVar, x) } )
...
function Donde(cProc, nLine, cVar, x)
...
return nil
Code: Select all
#include "FiveWin.ch"
function Main()
SetKey( VK_F2, { || WhereAmI() } )
Another()
return nil
function Another()
local oDlg, cTest := Space( 20 )
DEFINE DIALOG oDlg TITLE "Test"
@ 1.5, 5 GET cTest
@ 3, 10 BUTTON "Ok"
ACTIVATE DIALOG oDlg CENTERED
return nil
function WhereAmI()
local oCtrl := oWndFromHwnd( GetFocus() )
MsgInfo( "ProcName: " + ProcName( 11 ) + CRLF + ;
"ProcLine: " + Str( ProcLine( 11 ) ) + CRLF + ;
"Focused object: " + oCtrl:ClassName() + CRLF + ;
"Dialog title: " + oCtrl:oWnd:GetText() )
return nil
Code: Select all
#include "FiveWin.ch"
#include "XBrowse.ch"
function Main()
SetKey( VK_F2, { || WhereAmI() } )
Another()
return nil
function Another()
local oDlg, oBrw, oCol
USE Customer
DEFINE DIALOG oDlg TITLE "Test"
@ 0, 0 XBROWSE oBrw OF oDlg ALIAS "Customer"
oCol = oBrw:AddCol()
oCol:bStrData = { || Customer->First }
oCol:cHeader = "First"
oBrw:CreateFromCode()
oDlg:oClient = oBrw
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT oDlg:Resize()
return nil
function WhereAmI()
local oCtrl := oWndFromHwnd( GetFocus() )
MsgInfo( "ProcName: " + ProcName( 11 ) + CRLF + ;
"ProcLine: " + Str( ProcLine( 11 ) ) + CRLF + ;
"Focused object: " + oCtrl:ClassName() + CRLF + ;
"Dialog title: " + oCtrl:oWnd:GetText() )
return nil
Antonio Linares wrote:Jorge Ignacio,
Here you have a working example:Code: Select all
#include "FiveWin.ch" ... function WhereAmI() local oCtrl := oWndFromHwnd( GetFocus() ) MsgInfo( "ProcName: " + ProcName( 11 ) + CRLF + ; "ProcLine: " + Str( ProcLine( 11 ) ) + CRLF + ; "Focused object: " + oCtrl:ClassName() + CRLF + ; "Dialog title: " + oCtrl:oWnd:GetText() ) return nil