xBrowse to Excel how to bring ON TOP ?

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

xBrowse to Excel how to bring ON TOP ?

Post by ukoenig »

Hello,

1. I have a browser inside a FOLDER.
2. a print and EXCEL-button from the main-dialog.

The report is shown on top but it is impossible, to bring EXCEL on top.

Image

how to bring EXCEL on top ?

@ 245, 240 BTNBMP oBtn2 OF oDlg ;
SIZE 50, 25 PIXEL;
NOBORDER ;
PROMPT "&Excel " ;
ACTION IIF( oFld:nOption = 1, oBrw1:ToExcel(,1), oBrw2:ToExcel() ) ;
FILENAME c_path1 + "Excel.Bmp" ;
FONT oFont1 2007 ;
LEFT
oBtn2:lTransparent := .t.
oBtn2:cToolTip = { "Export " + CRLF + "to EXCEL","EXPORT", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 0, )


Defined inside a FOLDER-page. oBrw1 is STATIC

@ 30, 30 XBROWSE oBrw1 SIZE 265, 173 PIXEL OF oFld:aDialogs[ 1 ] ;
COLUMNS 1, 2, 3, 4, 5, 6, 7, 8 ;
HEADERS "CHR","ASC", "CHR","ASC", "CHR","ASC", "CHR","ASC" ;
COLSIZES 50, 50, 50, 50, 50, 50, 50, 50 FONT oFont1 ;
ARRAY aPrint1 LINES FASTEDIT CELL

oBrw1:lHScroll := .F.

WITH OBJECT oBrw1
:nEditTypes := EDIT_GET
:CreateFromCode()
END
I := 1
FOR I := 1 to 8
oBrw1:aCols[ I ]:nDataStrAlign := AL_CENTER
NEXT


Best Regards
Uwe :?:
Last edited by ukoenig on Thu Jun 06, 2013 11:43 am, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: xBrowse Excel only shown iconized ?

Post by Jeff Barnes »

Hi Uwe,

I don't know if this will help but....

This is per the Microsoft Knowledge Base article #886217:
(Fix the New Program Window so that an Office program will automatically come to the front when launched.)
To resolve this issue, modify the value of the ForegroundLockTimeout registry entry in Registry Editor. To do this, follow these steps:
1 Click the Start Orb, click Run, type regedit in the Open box, and then click OK.
2 In Registry Editor, locate and then click the following registry subkey: HKEY_CURRENT_USER\Control Panel\Desktop
3 In the right pane, locate and then double-click ForegroundLockTimeout.
4 Under Base, click Decimal, type 0 in the Value data box, and then click OK. Note The default decimal value for the ForegroundLockTimeout registry entry is set as 200000.
5 Quit Registry Editor.
6 Restart your computer.
*This must be done for each User Account on the system.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse Excel only shown iconized ?

Post by ukoenig »

Hello Jeff,

Thank You very much. I will test it.
In METHOD To Excel there is a BringWindowToTop, but doesn't work in my situation.

METHOD ToExcel( bProgress, nGroupBy, aCols ) CLASS TXBrowse
...
...
oExcel:ScreenUpdating := .t.
oExcel:visible := .T.
ShowWindow( oExcel:hWnd, 3 )

BringWindowToTop( oExcel:hWnd )

return oSheet

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse to Excel is only shown iconized ?

Post by ukoenig »

Jeff,

the key didn't exist in my registry.
I added the values, but there is no difference.

Tested with sample :

Image

Best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: xBrowse to Excel is only shown iconized ?

Post by Richard Chidiak »

Uwe

Try

oExcel:Visible := .T.

without all the rest , it should be enough

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse to Excel how to bring ON TOP ?

Post by ukoenig »

Richard,

In class TXBrowse
METHOD ToExcel( bProgress, nGroupBy, aCols )
ToTop is included, but Excel moves behind the window or dialog

defined in class TXbrowse

oExcel:ScreenUpdating := .t.
oExcel:visible := .T.
ShowWindow( oExcel:hWnd, 3 )

BringWindowToTop( oExcel:hWnd )

Best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
TecniSoftware
Posts: 213
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Re: xBrowse to Excel how to bring ON TOP ?

Post by TecniSoftware »

I have the same problem with excel, try this, working for me

oBrw:ToExcel()
SysRefresh() // Add this line
BringWindowToTop( FindWindow( 0, "Microsoft Excel - Libro1" ) ) // Add this line, traslate to english ( "Microsoft Excel - Book1" or something like this )


Best Regards
Alejandro Cebolido
Buenos Aires, Argentina
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse to Excel how to bring ON TOP ?

Post by hua »

I use this

Code: Select all

  .
  .
SetFocusAfter(FindWindow( "XLMAIN", 0 ))
return nil
//---------------------------------------------------
function SetFocusAfter(hWnd)
 local oTimer
 define timer oTimer interval 500 of oWnd    ;
   action (BringWindowToTop(hWnd), oTimer:DeActivate())

 activate timer oTimer
return Nil
 
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse to Excel how to bring ON TOP ?

Post by ukoenig »

Thank You very much for the response.

I tested the function and Excel moves to TOP.
It is still funny :
1. Excel opens on TOP
2. Excel moves to BACK
3. Excel moves to TOP again

@ 245, 240 BTNBMP oBtn2 OF oDlg ;
SIZE 50, 25 PIXEL;
NOBORDER ;
PROMPT "&Excel " ;
ACTION ( IIF( oFld:nOption = 1, oBrw1:ToExcel(), oBrw2:ToExcel() ), ; // ASC or VKEYS
SETFOCUSAFTER( FINDWINDOW( "XLMAIN", 0 ) ) ) ;
FILENAME c_path1 + "Excel.Bmp" ;
FONT oFont2 2007 ;
LEFT
oBtn2:lTransparent := .t.
oBtn2:cToolTip = { "Export " + CRLF + "to EXCEL","EXPORT", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 0, )

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply