Page 1 of 1
How to return the focus for my application?
Posted: Wed Dec 19, 2007 3:43 pm
by vilian
Hi,
When I call another application, I execute oDlg:Disable()
When to another application she is closed, I I execute oDlg:Enable and oDlg:SetFocus(), but my application does not receive the focus!
Posted: Wed Dec 19, 2007 5:56 pm
by James Bott
Vilian,
Try:
setForeGroundWindow(hWnd)
James
Posted: Wed Dec 19, 2007 6:49 pm
by Antonio Linares
James missed the oDlg: (you could also try with the main oWnd)
SetForeGroundWindow(oDlg:hWnd)
Posted: Wed Dec 19, 2007 8:42 pm
by vilian
Antonio,
Why when use oDlg:Disable(), exactly using later oDlg:Enable() clauses VALID of the GETS leaves to function?
Posted: Wed Dec 19, 2007 9:14 pm
by Antonio Linares
Vilian,
This test works fine:
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg, cTest := "hello world"
DEFINE DIALOG oDlg
@ 1, 2 GET cTest VALID ( MsgInfo( "ok" ), .T. )
@ 3, 2 BUTTON "Disable" ACTION ( oDlg:Disable(), MsgInfo( "disabled" ), oDlg:Enable() )
ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Want to end ?" )
return nil
Please provide a sample, thanks
Posted: Thu Dec 20, 2007 1:45 pm
by vilian
Antonio,
I Sended for you e-mail.
Posted: Thu Dec 20, 2007 7:00 pm
by vilian
Antonio,
You it received the Memory.zip archive?
Posted: Thu Dec 20, 2007 11:45 pm
by Antonio Linares
Vilian,
yes I got it, thanks, but had no time to review it yet