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
Related
In any web browser and in the Windows file manager and in many other applications there is support for forward and backward navigation. This always (or at least most of the time) by default works with extra mouse buttons if your mouse has any.
I want to implement this in a C++ application I'm making based on WinAPI. However I wonder how one would do this? Are the mouse buttons captured "manually" in each application that has this forward/backward navigation or is there native support for it somewhere in WinAPI?
Manually capturing the buttons is probably always an option, but if there already is an existing functionality that handles this then it seems like that should be used instead. That's probably more reliable as well.
To sum up: I want my application to correctly handle/receive backward and forward clicks from a mouse that has such buttons.
The WM_APPCOMMAND message offers the APPCOMMAND_BROWSER_FORWARD ("Navigate forward") and APPCOMMAND_BROWSER_BACKWARD ("Navigate backward") navigation commands. You can handle them in your application, even if it's not a browser.
The documentation has information, how and when the WM_APPCOMMAND is generated:
DefWindowProc generates the WM_APPCOMMAND message when it processes the WM_XBUTTONUP or WM_NCXBUTTONUP message, or when the user types an application command key.
I've got a Windows 7 VM which runs my mandatory corporate communication systems (Lync and Outlook). What I'd like to do is run a process on this Windows machine which monitors the system tray and sends notifications to my host machine (Xubuntu 13.04) so I'm informed when I get an email or IM (I've already tried seamless RDP to do this but it's an ineffective solution).
Anything Linux or network oriented I can handle with relative ease, what I do not know how to do is to how to query the state of the Windows system tray (or attach an event listener for state changes). I'm comfortable with C++ and Python but I'll give any viable solution a go.
Detailed state information would be preferable but at the very minimum I need to be able to detect changes in the number of icons in the tray.
On Windows, if you install Visual Studio, among Visual Studio Tools there is a useful tool, named "Spy++", basically it's a tool that shows you all the windows and gives ability to see what messages particular window receives.
Using this tool, you can see that whole panel, that contains "Start button", shortcuts, tray, clock, etc. is "Shell_TrayWnd". You can use "Find" menu to search for a particular window just dragging an "aim" on any window.
The tray window itself is "SysPager" (000100D2 on attached image), you can log messages for this window and see what type of message this window receives when you receive mail in Outlook.
After that you can write a code that will listen to all messages that this window receives, and basing on what you have seen in "Spy++" determine what happened.
This is just for start. Writing a code that will get a window handle and listen to messages that window receives is another part, but I think it's already covered at MSDN or even at StackOverflow.
Searching for a particular window handle is done by FindWindowEx function and in order to listen to message you have to set a "hook" that is done by SetWindowsHookEx function. Hooking is described pretty good on MSDN.
may be you need Outlook inspector (http://msdn.microsoft.com/en-us/library/office/ff869356(v=office.15).aspx). As i understand it helps to watch events outlook processes.
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.
I have IWebBrowser2 ctrl embedded into my own dialog. I want to simply
display a promo banner within it from my url. How to disable all popup
menu items from the control and force it to open links in new window
(currently when I click on link in the banner, it is being opened
within the same control).
Regards
Dominik
Have a look at the following article:
WebBrowser Customization
I don't know if there is a more convenient way of doing this - but you could always intercept BeforeExplorerNavigate2(), set the out-parameter cancel to true and from there either do a new Navigate() with a different target frame name or open a new window.
As Rob pointed out, there might be problem with filtering out navigate events originating from scripts, see this question.
I am hosting a web browser control, and I don't know how to fetch hotkeys such as [F1] when the control has focus.
My primary need is displaying custom help when the user presses F1, however, generally being able to provide additionla shortcuts would be nice.
(additional information is available at my related question - I hope it was the right choice to open a second question - I guess the solutions aren't related.)
Nothing simpler; your ActiveX control should have essentially a WINPROC in it. It may be hidden by a BEGIN_MESSAGE_MAP macro list, but it's there if you have a window.
Simply handle the windows message events (i.e. WM_KEYPRESS) in the WINPROC and you're set.