xBrowse to Excel how to bring ON TOP ?

xBrowse to Excel how to bring ON TOP ?

Postby ukoenig » Wed Jun 05, 2013 12:59 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xBrowse Excel only shown iconized ?

Postby Jeff Barnes » Wed Jun 05, 2013 1:26 pm

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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: xBrowse Excel only shown iconized ?

Postby ukoenig » Wed Jun 05, 2013 1:46 pm

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: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xBrowse to Excel is only shown iconized ?

Postby ukoenig » Thu Jun 06, 2013 9:52 am

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xBrowse to Excel is only shown iconized ?

Postby Richard Chidiak » Thu Jun 06, 2013 12:08 pm

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: xBrowse to Excel how to bring ON TOP ?

Postby ukoenig » Thu Jun 06, 2013 1:32 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xBrowse to Excel how to bring ON TOP ?

Postby TecniSoftware » Wed Jun 19, 2013 2:41 pm

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
User avatar
TecniSoftware
 
Posts: 235
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Re: xBrowse to Excel how to bring ON TOP ?

Postby hua » Thu Jun 20, 2013 2:18 am

I use this
Code: Select all  Expand view  RUN

  .
  .
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.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse to Excel how to bring ON TOP ?

Postby ukoenig » Thu Jun 20, 2013 5:11 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 42 guests