Coordinates of a browser page

Coordinates of a browser page

Postby Natter » Sun Jun 19, 2022 7:37 am

Hi,

The browser is expanded to full screen. Is it possible to determine the screen coordinates of a browser page ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Coordinates of a browser page

Postby Antonio Linares » Sun Jun 19, 2022 7:39 am

Dear Yuri,

Do you mean using WebView ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Coordinates of a browser page

Postby Natter » Sun Jun 19, 2022 7:49 am

Since there is no FW with WebView support yet, I use PowerShell :?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Coordinates of a browser page

Postby Antonio Linares » Sun Jun 19, 2022 7:58 am

And what do you do from powershell ?

Please explain it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Coordinates of a browser page

Postby Natter » Sun Jun 19, 2022 8:11 am

From my FW program, I do a screen grabber via PS. Everything works. But when creating a screenshot via .CopyFromScreen I would like to receive only the working application window/browser page (without title, menu, frames, etc.)
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Coordinates of a browser page

Postby Antonio Linares » Sun Jun 19, 2022 8:15 am

> From my FW program, I do a screen grabber via PS. Everything works.

How you do it ? please explain it :-)

> But when creating a screenshot via .CopyFromScreen I would like to receive only the working application window/browser page (without title, menu, frames, etc.)

What is CopyFromScreen ? Is it a PS command ? Please explain it in detail so we can help
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Coordinates of a browser page

Postby Natter » Sun Jun 19, 2022 8:39 am

Through Enum I get a list of visible application windows and through WMI the process name for each window.
In the loop, I bring the windows to the foreground and maximize them. At this moment I am executing a PS script in which by means of the PS method .CopyFromScreen I take a screenshot, which I save to a file
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Coordinates of a browser page

Postby Antonio Linares » Sun Jun 19, 2022 8:44 am

could you please copy the code here to test it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Coordinates of a browser page

Postby Natter » Sun Jun 19, 2022 8:49 am

Sorry Antonio, I didn't understand - the code of what.. PS-script ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Coordinates of a browser page

Postby Jimmy » Sun Jun 19, 2022 4:16 pm

hi

i do use VK_SNAPSHOT

Code: Select all  Expand view  RUN
  System.EmptyClipboard
   SENDKEY( VK_SNAPSHOT )

   // Wait to get hBitmap
   hBitmap1 := 0
   DO WHILE hBitmap1 = 0


---

to get Result of PowerShell i use " | CLIP "
Code: Select all  Expand view  RUN

LOCAL cStep1   := "Get-SmbServerConfiguration "
LOCAL cClip    := " | CLIP "
LOCAL cRun     := "PowerShell.EXE "
LOCAL cPara    := "-ExecutionPolicy Bypass -Command "
LOCAL cFile1   := HB_DirBase() + "GETSMB.PS1"

   nHandle := FCREATE( cFile1, FC_NORMAL )
   IF nHandle == - 1
      MsgInfo( "Error create File : " + cFile1, STR( FERROR() ) )
      RETURN
   ELSE
      FWRITE( nHandle, cStep1 + cClip )
      FWRITE( nHandle, CRLF + "EXIT" )
      FCLOSE( nHandle )
   ENDIF

   cMore := cPara + cFile1
   IF ShellExecute( 0, "open", cRun, cMore,, SW_HIDE ) > 32
      nCount := 0
      DO WHILE EMPTY( System.Clipboard )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Coordinates of a browser page

Postby Antonio Linares » Sun Jun 19, 2022 6:56 pm

Dear Yuri,

> Sorry Antonio, I didn't understand - the code of what.. PS-script ?

Yes, all the process you are doing, to reproduce it here and see how we can help you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests