google chrome - Open URL with ShellExecute - SW_SHOWMAXIMIZED dont active window in C++ -
i used function open new tab in chrome , active it:
shellexecutea(0,0,"chrome.exe","http://google.com --incognito",0,sw_showmaximized); but chrome open new tab doesnt active window.
(i call function global keyboard-hook of application no user interface, if user press specified key).
how can fix it?
looks bug in chrome.exe. repro shellexecute call simple console app, if regular (non-incognito) chrome.exe session running , no incognito session running. in other words, if new incognito chrome session needed spawned, regular session did not appear correctly propagate showwindow flags spawned incognito process. factor activation failure required regular chrome session active before test app ran. if other app active (say notepad.exe), activation of incognito session succeeded. same behavior occurs shellexecuteex , createprocess. observing in process explorer (from sysinternals), it's clear chrome.exe forking child process necessary , terminating itself. makes difficult intercept hprocess or processid in order call setactivewindow.
Comments
Post a Comment