.net - How to suppress default browser from opening while VB.NET WebBrowser encounter SSL error (proxies) ? -
i have small issue. have application using latest installed ie engine. might encounter issue , when it's happen .net opens default browser error (that ssl has enabled connect server, i'm using proxies).
i want suppress external browsers showing because of application.
i know can start browser using process.start , stop. how recognise new process started application (is there parent of process or tree ?)
ok, here's how can retreive ppid (parent process id) of given process via wmi
wrapper system.management
first you'll have add reference system.management
obviously.
then you'll have query process in question:
dim pid int32 = process.getcurrentprocess.id dim query selectquery = new selectquery(string.format("select * win32_process processid = {0}", pid))
next need feed query managementobjectsearcher
, put results managementobjectcollection
dim mobjsearcher managementobjectsearcher = new managementobjectsearcher(query) dim mobjprocesses managementobjectcollection = mobjsearcher.get()
finally select first (and only, hopefully) process , it's parentprocessid
dim ppid int32 = mobjprocesses(0)("parentprocessid")
unfortunatly managementobjectcollection
doesn't know type of object it's enumerating, you'll eighter have , cast or satisfied late binding @ point.
there - of course - way nativly via windows api. way you'll have call ntqueryinformationprocess
ntdll.dll
when calling function you'd pass process_basic_information
struct along process handle , such.
on successfull return find parent pid in intptr inheritedfromuniqueprocessid
field of stuct (which you'd have cast int32
)
now have answered question "how retreive parent pid of process" realized that, though might in endevour identify browser process started unwillingly application... likly not eliminate underlying design flaw of said application.
it might answer x' xy problem
Comments
Post a Comment