Page 1 of 1

Refresh/Reload a web page

Posted: Thu Mar 14, 2024 10:23 am
by IdeasVacuum
I need to programmatically Refresh/Reload a web page (a page that is not mine) in a Browser (I use Firefox or Opera). Currently I do this by mouse click, but the refresh needs to be repeated every minute and the programmatic mouse click therefore renders the actual mouse useless - I want to leave the Browser on one screen and get on with other tasks on my other screen.

Code: Select all

Procedure RefreshWebPage()
;#------------------------
;Programmatic Mouse Click on Web Page Refresh/Reload Button

Protected      In.INPUT
               In\type = #INPUT_MOUSE
               In\mi\dwFlags  = #MOUSEEVENTF_LEFTDOWN

               SetCursorPos_(igCurPosX, igCurPosY) ;center of button in relation to screen

               SendInput_(1,@In,SizeOf(INPUT))
               In\mi\dwFlags  = #MOUSEEVENTF_LEFTUP
               SendInput_(1,@In,SizeOf(INPUT))
EndProcedure

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 11:40 am
by RASHAD
Maybe you can use Thread to do the job every min

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 1:03 pm
by IdeasVacuum
Hi Rashad

I'll try that. Ideal solution would be to use the WebGadget but it draws the web pages very badly :mrgreen:

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 1:39 pm
by Kiffi
IdeasVacuum wrote: Thu Mar 14, 2024 1:03 pmIdeal solution would be to use the WebGadget but it draws the web pages very badly :mrgreen:
even the new one?

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 6:43 pm
by IdeasVacuum
Hi Kiffi

Yes, if by new one you mean PB6.04 LTS. It renders a 6 image x 6 image arrangement as a 1 x 36 arrangement (1 huge column).

I thought WebKit was going to be used for Windows too, but apparently it is still Internet Explorer 4.0?

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 7:18 pm
by Kiffi
IdeasVacuum wrote: Thu Mar 14, 2024 6:43 pmYes, if by new one you mean PB6.04 LTS.
No, I mean the WebGadget that is delivered with version 6.10. If you add the #PB_Web_Edge flag there, WebView2 is used (under Windows). This is pretty much the most modern browser engine you can use.

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 7:24 pm
by IdeasVacuum
Wow, I didn't know that as I hardly use PB these days - I was just going to implement the registry code here:

https://www.purebasic.fr/english/viewtopic.php?t=56157

So, I'd better install PB 6.10 then!

Re: Refresh/Reload a web page

Posted: Thu Mar 14, 2024 8:42 pm
by IdeasVacuum
OMG! The #PB_Web_Edge flag fixed the main issue and other little issues too!

Thanks Kiffi