|
Kornfeld Eliyahu Peter wrote: SetParent[^] can set the parent window even if it is from a different process...
Right, it's time for a career change! That seems to go completely against the whole point of a protected operating system. If I was drunk in the pub, a £50 bet would be looming. I will investigate this further.
I think I found my answer here though: Chromium Blog: Multi-process Architecture[^]
The browser process creates many renderer processes, each responsible for rendering web pages. The renderer processes contain all the complex logic for handling HTML, JavaScript, CSS, images, and so on. We achieve this using the open source WebKit rendering engine, which is also used by Apple's Safari web browser. Each renderer process is run in a sandbox, which means it has almost no direct access to your disk, network, or display. All interactions with web apps, including user input events and screen painting, must go through the browser process.
Regards,
Rob Philpott.
|
|
|
|
|
What freaks me out more is when you look at the command line for each tab in Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --enable-features="*AutofillCreditCardSigninPromo<AutofillCreditCardSigninPromo,AutomaticTabDiscarding<AutomaticTabDiscarding,BlockSmallPluginContent<PluginPowerSaverTiny,DocumentWriteEvaluator<DisallowFetchForDocWrittenScriptsInMainFrame,MaterialDesignUserManager<MaterialDesignUserManager,NonValidatingReloadOnNormalReload<NonValidatingReloadOnNormalReload,OverrideYouTubeFlashEmbed<Override YouTube Flash emed,*PreconnectMore<PreconnectMore,*TranslateUI2016Q2<TranslateUI2016Q2" --disable-features=MetricsReporting<MetricsAndCrashSampling,PointerEvent<PointerEvent,SSLPostQuantumExperiment<SSLPostQuantum,UpdateRendererPriorityOnStartup<UpdateRendererPriorityOnStartup --force-fieldtrials="*AppBannerTriggering/Control/*AutofillCreditCardSigninPromo/Default/*AutomaticTabDiscarding/Enabled_Once_10-gen2/CaptivePortalInterstitial/Enabled/*ChildAccountDetection/Disabled/*ChromeChannelStable/Enabled/*ClientSideDetectionModel/Model0/*DisallowFetchForDocWrittenScriptsInMainFrame/DocumentWriteEvaluatorGroup/EnableWin32kLockDownMimeTypes/PPAPILockdown_Enabled/ExtensionDeveloperModeWarning/Enabled/*GFE/Default/*GoogleBrandedContextMenu/default/InstanceID/Enabled/MaterialDesignDownloads/Enabled/MaterialDesignUserManager/Enabled/MetricsAndCrashSampling/OutOfReportingSample/*NetworkQualityEstimator/Enabled/*NonValidatingReloadOnNormalReload/Enabled2/*OfferUploadCreditCards/Enabled/*OmniboxBundledExperimentV1/StandardR7/*Override YouTube Flash emed/YouTubeFlashRewrite/*PasswordBranding/Disabled/*PasswordGeneration/Disabled/*PasswordManagerSettingsMigration/Enable/*PluginPowerSaverTiny/Enabled2/*PreconnectMore/Default/*QUIC/EnabledNoId/ReportCertificateErrors/ShowAndPossiblySend/SHA1IdentityUIWarning/Enabled/SHA1ToolbarUIJanuary2016/Warning/SHA1ToolbarUIJanuary2017/Error/*SRTPromptFieldTrial/BiMonthlyPrompt/SSLCommonNameMismatchHandling/Enabled/*SSLPostQuantum/disabled/*SafeBrowsingIncidentReportingService/Default/SafeBrowsingUnverifiedDownloads/DisableByParameterMostSbTypes2/*SafeBrowsingUpdateFrequency/Default/*SignInPasswordPromo/Default/*StrictSecureCookies/Default/TranslateUI2016Q2/DefaultTranslateUI2016Q2/*TriggeredResetFieldTrial/On/*UMA-Dynamic-Uniformity-Trial/Group6/*UMA-Population-Restrict/normal/*UMA-Uniformity-Trial-1-Percent/group_47/*UMA-Uniformity-Trial-10-Percent/group_07/*UMA-Uniformity-Trial-100-Percent/group_01/*UMA-Uniformity-Trial-20-Percent/group_02/*UMA-Uniformity-Trial-5-Percent/group_02/*UMA-Uniformity-Trial-50-Percent/default/WebBluetoothBlacklist/BlacklistUpdate1/*WebFontsInterventionV2/Default/" --primordial-pipe-token=40FD41B8257D2C6E312516F374A00749 --lang=en-US --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=false,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=false --enable-pinch --device-scale-factor=1.1041666269302368 --num-raster-threads=4 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553 --mojo-application-channel-token=40FD41B8257D2C6E312516F374A00749 --channel="4860.1284.267757369\20359401" --mojo-platform-channel-handle=17672 /prefetch:1
Marc
|
|
|
|
|
HOLY CRAP!
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I don't know if it's holy, but for sure it's /redacted/.
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
They still use command line arguments!? That's so 1970's! I thought Google would be more modern than that.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
Hah hah. They used command line argument to send info to those child processes?
|
|
|
|
|
Judas H. Priest.
Software Zen: delete this;
|
|
|
|
|
"Command-line arguments are limited to 32,768 characters[*], and we're gonna use them all, dammit!!"
-- Google, probably
[*] Isn't that still the case? I haven't had a need to look in decades...
|
|
|
|
|
If you ever wanted insight into the mind of a linux coder...
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Whatever else, have you ever had a look how many Chrome processes are sometimes running, even with only 1 or 2 tabs open?
I currently have 13 processes for 3 tabs.
|
|
|
|
|
Brady Kelly wrote: I currently have 13 processes for 3 tabs.
3 tabs = 3 processes
+1 for main windows
+9 for extensions (each extension runs in a separated process)
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
|
Well, this is all news to me, this SetParent() spanning processes.
I downloaded that project, and the browser opened in a separate window, not as a child of the winform. I am going to remain a skeptic until I see this properly.
Regards,
Rob Philpott.
|
|
|
|
|
Replace the exename from "iexplore" to the full path of calc.exe; once you have the handle you can set a new parent to the window. The new parent-window of the mainform does not have to be part of the application, it just needs to be an existing window handle.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Genius Eddy! I am now going to work out how to utilize this madness!
[edit: you're a y, not an ie, humble apologies]
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: Genius Eddy! Wasn't my idea to build Windows that way, but yes, great OS at some points.
One way would be by wrapping functionality (and ui) inside a new standalone-application, and launch that instead of a thread. Makes debugging easier
Or a way to hook some extra functionality inside an existing application.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Well what I wanted to do, is to try and get two independent GUI threads working in the same window hierarchy, something I always thought was impossible. This would open the possibility of a process with lots of GUI threads (possible certainly, but not in the same window hierarchy as far as I knew).
This does that, and I've done it in a single process by spawning a second thread and making it execute the message pump of a second form. Completely independent yes, but when you 'join' them together with SetParent(), although we now have two separate GUI threads, they block each other.
ie. I created a replacement for calc.exe which was a form with a button with a Sleep(10000) behind it. Demo project works fine, but when you hit the button, the 'host' process is blocked as well - you can't drag it around or anything.
This makes sense I guess as one will send a MoveWindow message or something like that to the other, which is blocked, won't respond so blocks the other.
A small glimmer of opportunity, but its seems its not to be...
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: I created a replacement for calc.exe which was a form with a button with a Sleep(10000) behind it. Demo project works fine, but when you hit the button, the 'host' process is blocked as well - you can't drag it around or anything. * Gives a stern look *
Well, your button code should not be blocking the UI-thread, as that is working the message-pump and minding it's own stuff. If you want to do something, do it from a new thread.
As soon as you block the other window too long, the process wil be reported by windows as being "unresponsive".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There is one main process, and each tab gets its own process. Chromium IPC is used to chat with each other. See Inter-process Communication (IPC) - The Chromium Projects[^]
A simple way to repro this is to have one process create a container window, and then have child processes create windows that are children of that container HWND. That said, Chrome does not really use HWNDs for its tabs, it uses WebKit. So the example I gave should not be taken literally
|
|
|
|
|
Typically, the browser frame is hosted in a process and every tab is hosted in a process. The main process (browser frame) is what you're interacting with and it delegates to the tab processes.
|
|
|
|
|
Joe Hisaishi - Dragon Boy[^]
Recently seen Spirited Away[^], great (anime) movie that I've wanted to see ever since it came out in 2001, but somehow never got around to watching.
I'm not into anime at all, but this movie is generally regarded as one of the best.
Anyway, the soundtrack is really good as well.
I like this song in particular, don't know why, but maybe because it's pretty epic
S(ound(track))OTW
|
|
|
|
|
Know what you mean about films you think that could be cool, I keep meaning to watch Howls Moving Castle! I kept hearing how good it was.
|
|
|
|
|
glennPattonWorking wrote: Howls Moving Castle I saw that one too, by sheer coincidence in the same week as Spirited Away (both movies by Miyazaki).
Howl's Moving Castle is also pretty cool, I can recommend it
|
|
|
|
|
|
Yeah, it's on my list.
Basically, I'm trying to see the entire top 250[^].
Miyazaki is in it 5 times, meaning 1/50th of the list is Miyazaki
It's fun, there's a lot of good stuff in that list, although I don't necessarily agree with it
|
|
|
|
|