control monitor for application via C++ - c++

I have an application that opens up IE browser windows at certain intervals throughout the day. I would like to control the monitor that the browser window opens up to (for example browser1 opens on monitor1 and browser2 on monitor2 and browser3 on monitor1 and browser4 on monitor2). Is there a way using C++ (app is written in C++) to control the monitor that I open the browser window on?

There are various third-party utilities that will allow a user to control this, but programatically you would have to use something like GetMonitorInfo / MoveWindow to position IE after launching it.
An alternative would be to embed an IE control in a dialog or window of your choosing which you would then have complete control over.

Related

Open a new browser tab without losing focus on current application using C++

I would like to open a new browser tab using C++ on Windows, ideally browser-independent, if that is not possible chrome is good enough.
But there are some restrictions:
The current application can not lose focus, but the browser must switch to the new tab.
The tab must be opened to a specific URL
The tab must be opened from a 3rd party application, so not from inside the browser.
I have tried using system("start <url>") but that causes the application focus to switch to the browser. I could not find a chrome:// URL to open a new tab with an initial URL.
I have also found several threads showing similar things in JavaScript, but none for C++.
Is there a way (ideally safer than using system()) to open a new browser tab without losing focus on the current application, using C++ on windows?
Additional clarification:
3 windows open: One game, the browser and a 3rd party application.
The game is in the foreground, but the 3rd party application opens the browser tab on certain events. Sadly, this means that DLL injection is not an option, due to several anti-cheat restrictions. This also means that a background application needs to open a new browser tab of a browser that is also in the background without ever losing focus on the game.

Creating a Control Panel Applet similar to built in applets

I have created a Control panel applet. The icon is placed in the control panel. When I double click my icon, it just opens a notepad application.
What I have to implement is, when I double click on my icon, it should open the GUI similar to the UI of other the Control panel (Power options of control panel.)
My question is, do I need to create a separate windows forms application? or any other way is there?
Creating address bar similar to explorer is not possible, since MS has not exposed such control.
You can take a look at the following link...
MFC: Address Bar control like Windows Explorer

C++ Win32 get activated MDI szTitle

I'm writing a notepad program in MS C++ 2010 Express with Win32. So far whenever the user opens or saves the document, it updates the status bar with the saved / opened filename. I also want to change the status bar to the current filename everytime a different MDI is activated. How would I do this?
Your MDI child windows will get WM_MDIACTIVATE messages whenever their activation state changes - you then just have to pass that notification back to your top-level window in some way (via a custom message probably - you could even send the filename at the same time) to get it to update the status bar.
By the way, the MDI concept is more or less deprecated and Microsoft advise against using it in new applications:
Many new and intermediate users find it difficult to learn to use MDI
applications. Therefore, you should consider other models for your
user interface. However, you can use MDI for applications which do not
easily fit into an existing model
For a notepad-type application the "modern" way to do this would be via a tabbed interface.
This is what you need.
Send WM_MDIGETACTIVE to the current client to ge the active client.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644915%28v=vs.85%29.aspx

Qt question to fullscreen flash application

I am using Qt to develop an application and inside we have access to select flash streaming videos like youtube. Is there a way to programmaticly full screen the flash application without requiring interaction from the user?
I am using a "QWebView" control.
try calling showFullScreen for the window where your QWebView control is hosted.
void QWidget::showFullScreen ()
Shows the widget in full-screen
mode.
Calling this function only affects
windows.
To return from full-screen mode, call
showNormal().
I would say: locate the button for the fullscreen application on the page, and send a click using QEVent. Tricky, but might work.
If the button is inside the flash application, you will have difficulties to locate it but if you succeed, you can probably send the click to the flash application area.
You can always inject javascript from Qt into your QWebPage. If there is a javascript API for forcing the flash viewer to full screen, I do not know.

Manipulating scrollbars in third-party application

I need to create an application which do the following:
At the beginning we have notepad window open with a lot of text in it.
Our application must scroll through this file and take notepad window screenshot after each scroll action.
I've tried to achieve this using SBM_GETRANGE, SBM_GETRANGE, SBM_SETPOS but it does not work for me.
Please note that emulating keyboard events (e.g. PageDown, PageUp) is not an option for me because this application should also work with other applications which may not support keyboard shortcuts for manipulating scrolls.
Thanks.
Don't try to manipulate the scrollbar directly - instead SetFocus() to the text window, then send Page Down messages. If there are applications where you must manipulate the scrollbar, you should get its window handle and send the messages there.