Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to realize hiding my app while sharing screen
Forum Updated to NodeBB v4.3 + New Features

How to realize hiding my app while sharing screen

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 956 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • WenchiW Offline
    WenchiW Offline
    Wenchi
    wrote on last edited by Wenchi
    #1

    Hello everyone!

    Is there any way to hide my app windows while shareing screen?
    eg:
    view of who is sharing screen:
    企业微信截图_16570091027294.png

    view of who is watching:
    49e3105c-675c-44f7-9f17-5913329aa149.jpg

    jsulmJ 1 Reply Last reply
    0
    • WenchiW Offline
      WenchiW Offline
      Wenchi
      wrote on last edited by
      #4

      Finally I find a way to do that in Windows.

      #pragma once
      
      #include <windows.h>
      
      #include "frameless_dialog.h"
      
      /**
       * @brief 防止被截图的无边框对话框
       *        setResizeable(true)启用手动调整大小,setContentRemovable(true)启用内容区域可拖动
       */
      class FramelessQDialogAntiCapture : public FramelessQDialog {
       public:
        FramelessQDialogAntiCapture(QWidget* parent = nullptr)
            : FramelessQDialog(parent) {
            SetWindowDisplayAffinity((HWND)(this->winId()), WDA_EXCLUDEFROMCAPTURE);
        }
      
       protected:
        virtual void showEvent(QShowEvent *e) override{
            SetWindowDisplayAffinity((HWND)(this->winId()), WDA_EXCLUDEFROMCAPTURE);
            FramelessQDialog::showEvent(e);
        }
      
        virtual void hideEvent(QHideEvent *e) override{
            SetWindowDisplayAffinity((HWND)(this->winId()), WDA_NONE);
            FramelessQDialog::hideEvent(e);
        }
      };
      
      1 Reply Last reply
      0
      • WenchiW Wenchi

        Hello everyone!

        Is there any way to hide my app windows while shareing screen?
        eg:
        view of who is sharing screen:
        企业微信截图_16570091027294.png

        view of who is watching:
        49e3105c-675c-44f7-9f17-5913329aa149.jpg

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @Wenchi https://doc.qt.io/qt-6/qwidget.html#hide

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #3

          no. RFB protocol simply copies the screen image memory to the other end as-is. RDP may have some facility to restrict what gets copied but that is well beyond the scope of this forum to discuss.

          If you meet the AI on the road, kill it.

          1 Reply Last reply
          1
          • WenchiW Offline
            WenchiW Offline
            Wenchi
            wrote on last edited by
            #4

            Finally I find a way to do that in Windows.

            #pragma once
            
            #include <windows.h>
            
            #include "frameless_dialog.h"
            
            /**
             * @brief 防止被截图的无边框对话框
             *        setResizeable(true)启用手动调整大小,setContentRemovable(true)启用内容区域可拖动
             */
            class FramelessQDialogAntiCapture : public FramelessQDialog {
             public:
              FramelessQDialogAntiCapture(QWidget* parent = nullptr)
                  : FramelessQDialog(parent) {
                  SetWindowDisplayAffinity((HWND)(this->winId()), WDA_EXCLUDEFROMCAPTURE);
              }
            
             protected:
              virtual void showEvent(QShowEvent *e) override{
                  SetWindowDisplayAffinity((HWND)(this->winId()), WDA_EXCLUDEFROMCAPTURE);
                  FramelessQDialog::showEvent(e);
              }
            
              virtual void hideEvent(QHideEvent *e) override{
                  SetWindowDisplayAffinity((HWND)(this->winId()), WDA_NONE);
                  FramelessQDialog::hideEvent(e);
              }
            };
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved