Page 1 of 1

Check if Edge ist installed

Posted: Fri Jun 13, 2025 10:32 am
by Oliver13
Hi all,

I'm using PB on Windows and would like to force the Edge mode when using the webgagdet.

Is the following approach fail-safe, meaning that no system error message boxes will appear in case Edge is not properly installed ?

Code: Select all

wg= WebGadget(#PB_Any, 0, 00, 780, 510, "",#PB_Web_Edge)
    If IsGadget(wgt)=false
    wg= WebGadget(#PB_Any, 0, 00, 780, 510, ""); Edge not installed, use normal mode
endif

Re: Check if Edge ist installed

Posted: Fri Jun 13, 2025 10:58 am
by Fred
No your check is wrong. If you use PB_Any, you need to check directly the return value with 0 (as IsGadget(0) can actually returns true if you have a numbered gadget 0):

Code: Select all

wg= WebGadget(#PB_Any, 0, 00, 780, 510, "",#PB_Web_Edge)
If wg = 0
    wg = WebGadget(#PB_Any, 0, 00, 780, 510, ""); Edge not installed, use normal mode
endif

Re: Check if Edge ist installed

Posted: Fri Jun 13, 2025 4:31 pm
by jacdelad
Also wg<>wgt!

Re: Check if Edge ist installed

Posted: Fri Jun 13, 2025 6:20 pm
by Oliver13
Thank you for confirmation, great. I was a little bit in doubt, whether a missing Edge would rise an system error message when initalising a webgadget with flag #PB_Web_Edge