Refresh/Reload a web page

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Refresh/Reload a web page

Post 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
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4941
Joined: Sun Apr 12, 2009 6:27 am

Re: Refresh/Reload a web page

Post by RASHAD »

Maybe you can use Thread to do the job every min
Egypt my love
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Refresh/Reload a web page

Post 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:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Refresh/Reload a web page

Post 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?
Hygge
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Refresh/Reload a web page

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Refresh/Reload a web page

Post 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.
Hygge
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Refresh/Reload a web page

Post 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!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Refresh/Reload a web page

Post by IdeasVacuum »

OMG! The #PB_Web_Edge flag fixed the main issue and other little issues too!

Thanks Kiffi
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply