Giter Club home page Giter Club logo

Comments (16)

Twometer avatar Twometer commented on July 21, 2024 1

I am trying to get a fix to work, but as for now you have to bring up any app after clicking show desktop. After that, all fences will reappear.

from nofences.

GordnCZ avatar GordnCZ commented on July 21, 2024 1

@Twometer I currently don't have time. But I'll try to look at it on the weekend.

from nofences.

Twometer avatar Twometer commented on July 21, 2024

I don't think it is possible with WinForms to prevent Show Desktop from hiding the fences, as it does not minimize the window but bring the desktop to foreground.
However, once you reopen any window, they should reappear.

from nofences.

rockmanvnx6 avatar rockmanvnx6 commented on July 21, 2024

Understandable. Would you recommend any workaround?

from nofences.

Lucarnosky avatar Lucarnosky commented on July 21, 2024

I think this should Help: https://stackoverflow.com/questions/938924/get-the-minimize-box-click-of-a-wpf-window/938956#938956

from nofences.

Twometer avatar Twometer commented on July 21, 2024

@Lucarnosky Thanks for the suggestion but unfortunately, that doesn't work. The app uses WinForms, but I think there is also a way to get the Minimize Box Event.
The main problem is that a (winforms?) app does not get any event for when the show desktop button is clicked, as it does not minimize the windows...

from nofences.

leonelsr avatar leonelsr commented on July 21, 2024

Hello! I've just found and started using NoFences, and it's just great!

I do think this issue is solved by now, isn't it?

Well, if it isn't, I've had the "Win+D minimization issue" before on personal use projects, and the snippet found on this Stack Overflow question did the trick: https://stackoverflow.com/questions/35045060/how-to-keep-window-visible-at-all-times-but-not-force-it-to-be-on-top

I hope it helps, please take a look!

Thanks!
(I might clone NoFences and try to make it un-minimizable myself, later today or this week... I'll turn anything I do with it into one or more PRs)

from nofences.

Twometer avatar Twometer commented on July 21, 2024

Hi! Thank you for the suggestion.

Unfortunately, the issue still isn't fixed, as I haven't found a way to prevent the show desktop buttons from Windows

I have actually tried implementing a similar solution in Win32/DesktopUtil.cs which however did not prevent Win+D. I've just tried the code from StackOverflow as well, but for me it still disappears when pressing Windows+D
If you get it to work, I would greatly appreciate the PR 😄

from nofences.

leonelsr avatar leonelsr commented on July 21, 2024

I'm on lunch time, but I've already found the solution I've used on my repositories (though I have no time right now to try it on NoFences).

This is the piece of code that did the trick:

        private const Int32 GWL_STYLE = -16;
        private const Int32 WS_MAXIMIZEBOX = 0x00010000;
        private const Int32 WS_MINIMIZEBOX = 0x00020000;

        [DllImport("User32.dll", EntryPoint = "GetWindowLong")]
        private extern static Int32 GetWindowLongPtr(IntPtr hWnd, Int32 nIndex);

        [DllImport("User32.dll", EntryPoint = "SetWindowLong")]
        private extern static Int32 SetWindowLongPtr(IntPtr hWnd, Int32 nIndex, Int32 dwNewLong);

        // ...

            m_hwnd = new WindowInteropHelper(this).Handle;

            Int32 windowStyle = GetWindowLongPtr(m_hwnd, GWL_STYLE);
            SetWindowLongPtr(m_hwnd, GWL_STYLE, windowStyle & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX);

You may try it right away if you have time before I do! 😅

I'm looking forward to contribute on this project, thinking of a lot of features... That's why I checked the "Issues" tab lol. It can turn out great if I manage to spend some weekend time on it :)

from nofences.

Twometer avatar Twometer commented on July 21, 2024

Even with this code in place, for me it still disappears with Win+D... Maybe you have more luck than I do :-)
Looking forward to your contributions, sounds great!

from nofences.

MahmoudKhaiti avatar MahmoudKhaiti commented on July 21, 2024

woah... woah... woah

how to I enable it even? I'm new to Github

from nofences.

Twometer avatar Twometer commented on July 21, 2024

@MahmoudKhaiti what do you mean by enabling it?

from nofences.

GordnCZ avatar GordnCZ commented on July 21, 2024

Hi. Just noticed this repo while finding free alternative.
I've been already experimenting with this kind of issues.
I already have some code ready for this so I might contribute by fixing this stuff.
But it's really dirty solution.

You can simply set the window to normalized and even set position of the window to the most bottom (relative to other windows) every time application gets message (event) from windows.
But you need to import C libs tho.

I didn't check it, but code from Leonelsr might be way to go.

BTW: I just made my account. I previously deleted my GH account when I moved all my stuff to NAS...

from nofences.

Twometer avatar Twometer commented on July 21, 2024

@GordnCZ Sounds nice, I'd be glad if you find a way to fix it. I tried leonelsr's code already when he posted it, but for me it did not work.

from nofences.

GordnCZ avatar GordnCZ commented on July 21, 2024

@Twometer Hi. Sorry for taking so long. Didn't have time at all.
Anyway I found a solution.

It's pretty easy. All you need to do is to replace line 46 in DesktopUtil.cs with this:
SetWindowLongPtr(handle, GWL_HWNDPARENT, nWinHandle.ToInt32());

And uncomment line 60 in FencesWindow.cs.
Even background blur works 😉

from nofences.

Twometer avatar Twometer commented on July 21, 2024

Thanks everyone for the suggestions! Fixed in #14

from nofences.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.