Thanks Razzak! These little gems wouldn't be possible without your
willingness to listen to mine and others suggestions on subtle ways to
improve the product.
Thanks to you and the "worker bees" at RBTI that breathe life into the
ideas..
----- Original Message -----
From: "A. Razzak Memon" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Sunday, March 15, 2009 12:11 PM
Subject: [RBASE-L] - Re: Form Focus Question
At 01:31 PM 3/14/2009, Mike Byerley wrote:
OK.. Here is the RBASE Only solution {TESTED}:
1. In your CallingMDI forms onBefore declare the following Vars and
STDCALL declaration:
Set var vCallerHWND integer = 0
SET VAR vforegrnd INTEGER = 0
{This will return the HWND of whatever window you have clicked
on or setFocus to}
IF (chkfunc('GetForegroundWindow')) = 0 THEN
STDCALL function 'GetForegroundWindow' () : integer
ENDIF
2. In your CallingMDI forms OnAfter:
-- Get the window handle of this form
SET VAR vThisWndtxt TEXT = NULL
GETPROPERTY RBASE_FORM HANDLE 'vThisWndtxt'
SET VAR vCallerHWND = (INT(.vThisWndtxt))
recalc variables
3. In your CallingMDI forms Timer event:
{This will return the HWND of whatever window you have clicked
on or setFocus to}
SET VAR vforegrnd = (dlcall('user32.dll', 'GetForegroundWindow'))
RECALC VARIABLES
IF vforegrnd = .vcallerhwnd THEN
SETFOCUS mditimer
ENDIF
So eloquent and a perfect R:BASE solution, Mike!
Your tireless efforts and willingness to share your R:BASE knowledge
is unprecedented.
Those who take advantage of this solution should consider themselves
privileged to be part of such a fine group of R:BASE Users/Developers
on this R:BASE list.
Very Best R:egards,
Razzak.