none
Best way to create multi-functional overlay? RRS feed

  • Question

  • Hey, 

    I have been trying to create an overlay program that lets you navigate through previously made file trees.

    What Framework/environment/language/tool do I need for this?

    Basically, I want the overlay to be used to show visuals, play sounds, start programs and navigate folders just by moving your mouse. To give you an idea on how it will look: Here's a quick mockup image of what I want: 
    Edit: My account isn't verified yet, can't post links or images. Too bad. The imgur link ends in /a/15F97Jq.

    Now, I wouldn't be asking here if I didn't already try. I started out creating a Win32API project with the main goal of getting more comfortable with c++.

    Creating the first window, where you create these file trees and save them as profiles, mostly worked out. Creating an invisible window for the actual overlay also worked out. However, I got stuck as soon as I tried displaying any visuals that aren't bmps and I still needed them to support transparency, since as you can see, I want to draw those images and even animations over games and other applications.

    After finding out that win32api, withits age, isn't really meant to handle such things without heavy use of external libraries (which would also go against my premise of getting comfortable with the "basic" stuff c++ has to offer), my professor (yes, this is for a university project) told me to check out UWP or WPF, as these would  make me learn something more useful in c++ as they are more recent. 

    Completely restarting the project in c++ UWP, I only realized that invisible windows are not possible after quite some work was done again, and that UWP is absolutely unusable for overlays like this, even with its new shiny "acrylic" stuff.

    Now, researching WPF and Windows Forms has lead me to the conclusion that it is also not well suited for this task, as Microsoft seems to offer the c++ compatibility as a means of porting old projects, not to create new ones in that language.

    Now, what should I do? What can I use to create such an application for windows?  Should I not use c++ at all?

    All the things I think I need are:
    -invisible/transparent windows or drawing to the screen
    -capability to display visuals like images, videos, gifs, etc in those windows
    -capability to read mouse movement without making full-screen applications/games lose focus
    ->maybe even reserve mouse input only for the overlay to not send bad inputs to the application/game
    -read keyboard input (to show overlay after key combination is pressed)
    -all this preferably without noticeably impacting performance 

    I now have wasted most of this semester on code that I can throw away - but at least I got a very good insight and some valuable experiences with the win32api and UWP. Now I only have less than 2 months left and have no good idea on how to continue without running into a new dead, which would probably result in me failing the semester as I can then not deliver any functional project.

    Thank you in advance for answering my wall of text, as I am currently desperate; not only because my "mentor" professor doesn't seem to be available as he doesn't answer my emails, but also because I WANT to learn, I WANT to work, but keep getting stuck, having to restart over and over again without reaching any results. Please help. Thanks.

    Friday, December 13, 2019 4:20 AM

Answers

  • Hello,

    Thank you for posting here.

    >>My account isn't verified yet, can't post links or images. 

    Please check this link to verify your account:https://social.technet.microsoft.com/Forums/en-US/dc4002e4-e3de-4b1e-9a97-3702387886cc/verify-account-42?forum=reportabug

    The following content is based on Win32.

    >>invisible/transparent windows or drawing to the screen

    use this function:SetLayeredWindowAttributes function to set the opacity and transparency color key of a layered window.

    >>capability to display visuals like images, videos, gifs, etc in those windows

    How about using GDI+ to display images and gifs, and use DirectShow to display videos.

    >>capability to read mouse movement without making full-screen applications/games lose focus

    >>maybe even reserve mouse input only for the overlay to not send bad inputs to the application/game

    Get the handle of the game/application, intercept the mouse message in your program, and send other required messages to the game/application through the handle.

    >>read keyboard input (to show overlay after key combination is pressed)

    If you want to call out your window through a shortcut key in the game/application, how about using hook to monitor the keyboard messages.

    Best Regards,

    Suarez Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, December 13, 2019 7:50 AM

All replies

  • Hello,

    Thank you for posting here.

    >>My account isn't verified yet, can't post links or images. 

    Please check this link to verify your account:https://social.technet.microsoft.com/Forums/en-US/dc4002e4-e3de-4b1e-9a97-3702387886cc/verify-account-42?forum=reportabug

    The following content is based on Win32.

    >>invisible/transparent windows or drawing to the screen

    use this function:SetLayeredWindowAttributes function to set the opacity and transparency color key of a layered window.

    >>capability to display visuals like images, videos, gifs, etc in those windows

    How about using GDI+ to display images and gifs, and use DirectShow to display videos.

    >>capability to read mouse movement without making full-screen applications/games lose focus

    >>maybe even reserve mouse input only for the overlay to not send bad inputs to the application/game

    Get the handle of the game/application, intercept the mouse message in your program, and send other required messages to the game/application through the handle.

    >>read keyboard input (to show overlay after key combination is pressed)

    If you want to call out your window through a shortcut key in the game/application, how about using hook to monitor the keyboard messages.

    Best Regards,

    Suarez Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, December 13, 2019 7:50 AM
  • What's the point of this?  Are you thinking of this as a little launcher, almost like your own version of the Windows "start button," but implemented with greater coolness and transparent windows?  Such a project is fraught with design problems.  If you have a transparent window sitting topmost, mouse clicks in the transparent region are still sent to your window, and not the window that's showing through.  That's an unexpected user experience.  You can certainly use hooks to grab keystrokes and mouse motion globally, although those actions do tend to be big performance hits.

    There are open source packages that do overlay displays for things like current system load and processor temperature.  Have you looked at any of those?


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Friday, December 13, 2019 11:19 PM
  • Hey, 

    Thank you very much for your reply. 

    I have heard about GDI+ but was very skeptical as it didn't support videos, thinking there might be an all-in-one solution. If GDI+ together with DirectShow works well, this would be the solution to my biggest problems so far, even if it means wandering into external library territory for me.

    For the interception; I am not very informed about anti-cheat systems, but wouldn't "altering" the mouse movement input the game/application receives trigger said anti-cheat systems? I have not thought about this before and am a little worried now - what is safe territory, and what isn't?

    Still, your answer has helped me continue my project and even keep my earlier progress, as it is still based on the Win32api, so thank you very much for helping.

    Saturday, December 14, 2019 4:01 AM