Sending "click" Message to a Internet Explorer_Server window link - c++

Iam trying to automate a process in a little game which uses Internet Explorer_Server windows with links as "buttons".
I managed to get the handle of the window and also got the html code from it but now I struggle to send a "click" or Mousebuttonpressed event to the links. I would appreciate any help with this.

You cannot send mouse input directly to the inner controls of an IE window. What you can do instead is start with the HWND of the "Internet Explorer_Server" window, ask it for its IHTMLDocument2 interface (see here for details), and then use Internet Explorer's own DOM interfaces to find the link elements as needed and call their click() method directly.

Related

Intercepting Windows Messages from Webview2 (Edge/Chromium)

I have recently migrated a project of mine to WebView2 and the last part I can't figure out is how to intercept the Windows Messages for the webview. My code is very similar to webview/webview but I was unable to find help on their GitHub.
Previously, I was able to find the hWnd for the webview and use SetWindowSubclass to add my own wndproc to the webview. However, I've used Spy++ and tried SetWindowSubclass on all the windows that showed up there (see below) but none of them had any windows messages in my wndproc other than some window management ones I did not think were useful - The best I got was WM_PARENTYNOTIFY, but I am interested in WM_MOUSEMOVE and WM_NCHITTEST - neither of which I could find.
My goal is to create a borderless, draggable, resizeable WebView2 based app.
The problem is, that the real window that controls and gets all this input is in another process. You just see a window that shows the output in your process.
Look into Spy++. Everything below Chrome_WidgetWin_0 belongs to a new process (MSEDGEWEBVIEW2) and is not part of your process. So you can't subclass such a window with the normal techniques.
So if you want to subclass this window. You need to inject a new DLL into this new process. This DLL might subclass the real window. And this DLL might communicate with you hosting program via any IPC.

Implementing Skype like incoming call notification popup window using c++ win32

I want to implement skype like incoming call notifier popup window using win32/c++. I searched a lot and couldn't achieve it. Basically my application have audio/video calling capability so if user is working with any other application, this incoming call notification is blinking to task bar. I found some work around to bring it to foreground but that is failing for around 20% calls.
Below are the links I had already referred to below pages.
1. http://www.codeproject.com/Tips/76427/How-to-bring-window-to-top-with-SetForegroundWindo

IWebBrowser2 show window after rendering is completed

I am using IWebBrowser2 interface for rendering an IE page inside a window. I need to show the windows to the user once every thing is rendered. Now I am using DocumentComplete event, to call ShowWindow function. But the actual content shows after an initial grey screen followed by a white screen delay. I need to be able to show the window to the user avoiding these screens.
Any help is appreciated.
You need to hook up the DWebBrowserEvents event sink. This sends a DocumentComplete notification that should be a good hint that the document is ready to be displayed.
To do this, first implement DWebBrowserEvents2 as an IDispatch based object. Then query the WebBrowser object for its IConectionPointContainter interface. Ask that via FindconnectionPoint for the IConnectionPoint interface for DIID_DWebBrowserEvents2, and then call Advise on that, passing your implementation of this dispatch interface.

Getting minimize and maximize events on internet explorer

I have a legacy ActiveX component which runs embedded in IE. Now I want to perform some action when IE window minimized and maximized by the user. Can anybody provide any clue on how to do that?
I'm not an expert in this topic. But after some research what I could find was,
To sink Internet Explorer events from the activex control, you have to
set up the event sink, which means you must obtain the IWebBrowser2
interface implemented by Internet Explorer when it loads.
See this document for more info on Handling internet explorer events
In IWebBrowser2 I could find only find IWebBrowser2::FullScreen and IWebBrowser2::TheaterMode to be somewhat similar to your requirement.
However, there is another property IWebBrowser2::HWND that you can use to get the window handle of internet explorer.
On a wild thought, (I don't know whether its applicable for activeX controls) consider Using hooks.
Also found: IE add-on development: capturing keyboard input outside tabs

IWebBrowser2 and move hosting window

I use IWebBrowser2 to implement a GUI for my application. I have a custom frameless window which hosts IWebBrowser2. Javascript and window.external I use to communicate with the application.
My question is how to implement moving my host window (with IWebBrowser2 of course)?
I draw a pseudo-Header in html and I need to detect mouse-down event (this is possible)
inside and detect mouse-move event after... and I don't know how can I do it?
Thanks
Don't use IWebBrowser2 directly for this. Instead, use the Win32 API. You can get a HWND with IWebBrowser2::get_HWND. With that, it's easy to subclass its windowproc (via SetWindowLong(GWL_WNDPROC)) and intercept WM_MOUSEMOVE.