Page 1 of 1

ActiveX window runs minimized

Posted: Wed Sep 26, 2007 5:32 pm
by cdmmaui
I am having a problem with the following code. When the window is activated it displays for a brief second then goes to the task bar (minimized); I then need to click the task bar item for the window to reappear. What can I do so the window does not run minimized? I have tried the following with no luck.

ACTIVATE WINDOW oWnd2 ON INIT BringWindowToTop( oWnd2:hWnd )
ACTIVATE WINDOW oWnd2 ON INIT ShowWindow( oWnd2, 1)
ACTIVATE WINDOW oWnd2 ON INIT ShowWindow( oWnd2, 5 )
ACTIVATE WINDOW oWnd2 ON INIT ShowWindow( oWnd2, 9)
ACTIVATE WINDOW oWnd2 NORMAL

// Source below...
MENU oMenu
MENUITEM "&Close" ACTION ( oWnd2:End() )
ENDMENU

DEFINE WINDOW oWnd2 FROM 0, 0 TO 40, 85 MENU oMenu

oActiveX = TActiveX():New( oWnd2, "Shell.Explorer" )
oWnd2:oClient = oActiveX
oActiveX:Do( "Navigate2", cAesdd + cHan )

ACTIVATE WINDOW oWnd2 NORMAL

Thank you,

Posted: Thu Sep 27, 2007 6:12 pm
by James Bott
Darrell,

I don't know if either of these will work, but you can try:

SetForeGroundWindow( hWnd )

Or,

SetActiveWindow( hWnd )

You might also try a sysRefresh() afterward.

James

Posted: Thu Sep 27, 2007 6:37 pm
by cdmmaui
Hi James,

Thank you, I will try to use these two with ON INIT

Posted: Thu Sep 27, 2007 8:27 pm
by Antonio Linares
Darrell,

You may also try:

ACTIVATE WINDOW oWnd2 NORMAL ;
ON INIT SetFocus( oWnd2:hWnd )

Posted: Thu Sep 27, 2007 8:37 pm
by cdmmaui
Thank you James and Antonio; I tried all three with and without sysrefresh() and it did not work. Any chance it has something to do wiht IE7?

Posted: Thu Sep 27, 2007 8:40 pm
by Antonio Linares
Darrell,

Could you provide a small and self contained sample to test it here ? thanks

Posted: Thu Sep 27, 2007 10:46 pm
by James Bott
Darrell,

This works for fine here (and it is visible):

Code: Select all

// Test ActiveX

#include "fivewin.ch"

function main()
   local oWnd,oActiveX

   DEFINE WINDOW oWnd

   oActiveX = TActiveX():New( oWnd, "Shell.Explorer" )
   oWnd:oClient = oActiveX
   oActiveX:Do( "Navigate2", "www.microsoft.com" )

   ACTIVATE WINDOW oWnd

return nil