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

How to realize hiding my app while sharing screen

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 682 Views
  • 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.
  • W Offline
    W Offline
    Wenchi
    wrote on 5 Jul 2022, 09:49 last edited by Wenchi 7 May 2022, 09:50
    #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

    J 1 Reply Last reply 5 Jul 2022, 11:03
    0
    • W Offline
      W Offline
      Wenchi
      wrote on 17 Oct 2022, 07:41 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
      • W Wenchi
        5 Jul 2022, 09:49

        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

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 5 Jul 2022, 11:03 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
        • K Offline
          K Offline
          Kent-Dorfman
          wrote on 6 Jul 2022, 03:36 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.

          1 Reply Last reply
          1
          • W Offline
            W Offline
            Wenchi
            wrote on 17 Oct 2022, 07:41 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