Antonio Linares wrote:Frances,
Try with:
oWndFromHwnd( GetFocus() )
static oCtrlFocus
...
...
...
method GotFocus() CLASS TControl
...
..
// after ::oWnd:oCtrlFocus := Self
// Insert this line
oCtrlFocus := Self
...
...
// at the end of the module
function CtrlFocus()
return oCtrlFocus
oObj := oWinMDI:oWndClient:GetActive()
msginfo( oObj:CtrlFocus() )
nageswaragunupudi wrote:Mr Frances
In the revised control.prg, wherever you find "::oWnd:oCtlFocus = nil", also please add another line "oCtrlFocus := nil".
Now in our application, you can query for oCtrl := CtrlFocus(). If the result is not nil, then that is the control having focus.
I hope this mod be included in the next build..
nageswaragunupudi wrote:I hope this mod be included in the next build..
We don't know if Mr. Antonio has a better solution.
We can have a function to return control in focus ( or nil if none ) even without modifying the fwh libraries.
Here is the pseudo logic:
find active window.
find control in focus of that window
if that control is tpanel
find the active dialog
find the control in focus of that dialog
You may try this approach too and make a genral function and test it.
function ActiveControl()
local oWnd := oWndFromHwnd( GetFocus() )
return If( oWnd:IsKindOf( 'TCONTROL' ), oWnd, nil )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 78 guests