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
Related
I have a modeless dialog which I would like to hide for a split second then take a screenshot, then show again. I have tried a few methods like moving the dialog off the screen using the MoveWindow() api call as well as the SetWindowPos() and even ShowWindow(SW_HIDE) none of these seem to be giving me the results I want because my dialog is still contained in the screenshot. If I launch solution during a non remote desktop session, my dialog hides, and it takes the screenshot perfectly. Is there something I am missing when it comes to remote desktop sessions and the win32 api calls? I have also tried using InvalidateRect() followed by UpdateWindow() and have tried RedrawWindow() to no avail. I am using ATL.
I'm writing a plugin for a big x64 application in C++. I want the plugin to open a dialog and show a web view of my site.
I'm been able to use WKWebView in macOS and it works well. On Windows I'm evaluating CEF https://bitbucket.org/chromiumembedded/cef (please let me know of any alternative, ideally I would like it to be Webkit-based).
Let's say the application framework that is hosting my plugin has already created a window for my plugin and has it's own message loop, so I can only receive events in a sort of WindowProc. I can also get the HWND of the window.
My implementation is inspired by cefsimple example, because cefclient is way too complicated. I've implemented the subprocess architecture with the external executable and everything works fine until it's rendering the client area of the window. Then I have problems with closing the window (it crashes) and resizing the window interactively (the window frame is resized but the web view in the client area does not resize).
I've tried all possible combinations, but I've run out of ideas. Namely:
If I use CefRunMessageLoop() the web view is rendered correctly but the main application does not process the UI events like close window button. Resize does not work.
If I call CefDoMessageLoopWork() myself once in a while (from WindowProc) the web view is rendered correctly and it processes the close button, but it crashes. Resize does not work.
If I use settings.multi_threaded_message_loop = true the web view is rendered correctly and I can close the window without crash. The destructor of the window calls CefShutdown(). But if I try to reopen the window it crashes! Are CefInitialize and CefShutdown allowed to be called only once?
And resizing still does not work. I don't understand why in the cefsimple example resizing works and in my window it does not work.
Besides message processing issues, probably I'm not closing the browser correctly, any advice? Why is so complicated? WKWebView is so straighforward!
There is no error message, no stack trace, no source code, no OS/CEF version - I doubt this question can be answered.
I can only tell you how to close browser cleanly: call CefShutdown at the right time (see cefclient/cefsimple examples) and do not keep any references to CEF objects when calling shutdown.
I'm trying to use SendMessage to post mouse clicks to a background window (Chrome), which works fine, but brings the window to front after every click. Is there any way to avoid that?
Before anyone says this is a duplicate question, please make sure that the other topic actually mentions not activating the target window, because I couldn't find any.
Update: aha, hiding the window does the trick, almost. It receives simulated mouse/keyboard events as intended, and doesn't show up on screen. However, I can just barely use my own mouse to navigate around the computer, and keyboard input is completely disrupted.
So my question is, how does sending messages to a window affect other applications? Since I'm not actually simulating mouse/keyboard events, shouldn't the other windows be completely oblivious to this?
Is it possibly related to the window calling SetCapture when it receives WM_LBUTTONDOWN? And how would I avoid that, other than hooking the API call (which would be very, very ugly for such a small task)?
The default handling provided by the system (via DefWindowProc) causes windows to come to the front (when clicked on) as a response to the WM_MOUSEACTIVATE message, not WM_LBUTTONDOWN.
The fact that Chrome comes to the front in response to WM_LBUTTONDOWN suggests that it's something Chrome is specifically doing, rather than default system behaviour that you might be able to prevent in some way.
The source code to Chrome is available; I suggest you have a look at it and see if it is indeed something Chrome is doing itself. If so, the only practical way you would be able to prevent it (short of compiling your own version of Chrome) is to inject code into Chrome's process and sub-class its main window procedure.
I'm trying to work around this issue: https://bugs.launchpad.net/unity/+bug/998073
According to the gtk documentation, and application should receive a window-state-event notification when the main window is minimized. The window's state should also indicate that it is now iconified. Unity does not deliver this notification to the application or change the window's state to indicate that it has happened.
As the bug report describes, Unity is not generating GDK_WINDOW_STATE_ICONIFIED when a window is minimized via the GUI.
Basically, I've got a master window and a slave window (which has no title bar). I need the slave window to minimize and unminimize itself along with the master. In other window managers, the code I have works fine because as it's written it depends on the iconify signal, which other window managers are so kind as to deliver to my application when the user attempts to minimize them.
I've searched all over the interwebs and have not found any workarounds. Does anyone have relevant hints, tips, experience, or workarounds?
I try to send a mouse click event to a game application. First, i use Spy++ to find what message the application receive. I see something like : WM_MOUSEACTIVATE, WM_WINDOWPOSCHANGING, WM_ACTIVATEAPP, WM_ACTIVATE, WM_SETFOCUS, ...
i try to send the same as i see on Spy++ but it doesn't work. How to send mouse click to a game application without give it focus? . it's run in window mode. Thanks in advance.
You want WM_LMOUSEDOWN. You can always check MSDN for the documentation on which messages mean what.
The best way to automate applications and games is via SendInput. While in theory it should be possible to drive an application via WM_LUBTTONDOWN etc, many applications read the key state directly via lower level APIs (such as GetAsyncKeyState) which don't change their state to reflect the messages processed from the message queue.
Using SendInput requires actually setting the game to the foreground as the input events are synthesized at a low level and are thus delivered to the active/focused window.