Jump to content

How to build a GUI that can be paint (from screen capture), hiden (no icon) on the Taskbar, and not repeated on all Desktops.


Recommended Posts

Posted

Good morning everyone. I'm working on a project who will display pictures with _GDIPlus_GraphicsDrawImage on Windows Virtual Desktops. I'm blocked in the step where i create a GUI for every virtual desktop on Windows 11. I've found some solutions on different topics. 

The first is to hide the icon in the Taskbar. For this i use $WS_EX_TOOLWINDOW when i create the GUI. The problem is that it will be displayed on all Virtual Desktops. No way to have different Pictures on every desktop when i switch between them. 

The second is to use parent and child GUI. But it does not work as expected in my side. I cannot paint it, or it's really slow, and it continues to show a icon on the Taskbar.

I'm trying to find some help, if someone has experience with it, it will be really nice to share your knowledge 🙂

Func _GetMyDockFinderPic($iDesk)

    _GDIPlus_Startup()
    $aVDesk[$iDesk][1] = _ScreenCapture_CaptureWnd("", $hFinder)
    $aVDesk[$iDesk][2] = _ScreenCapture_CaptureWnd("", $hDock)
    _GDIPlus_Shutdown()

EndFunc

Func _FillDockAndFinderGUI($iDesk)

    Local $hBitmap, $hGraphic, $aDockFinder

    _GDIPlus_Startup()
    For $i = 1 To 2
        If $i = 1 Then
            $aDockFinder = $aFinder
        Else
            $aDockFinder = $aDock
        EndIf
        $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($aVDesk[$iDesk][$i])
        $hGraphic = _GDIPlus_GraphicsCreateFromHWND($aVDesk[$iDesk][3])
        _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $aDockFinder[0], $aDockFinder[1])
        _GDIPlus_GraphicsDispose($hGraphic)
        _GDIPlus_ImageDispose($hBitmap)
        _WinAPI_DeleteObject($aVDesk[$iDesk][$i])
    Next
    _GDIPlus_Shutdown()

EndFunc

Func _CreateDockAndFinderGUI($iDesk)

    $aVDesk[$iDesk][3] = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUISetBkColor(0xabcdef)
    _WinAPI_SetLayeredWindowAttributes($aVDesk[$iDesk][3], 0xabcdef)
    GUISetState(@SW_HIDE, $aVDesk[$iDesk][3])

EndFunc

 

Posted

Hi, I have no experinece with virtaul desktops but it is advisable to post runnable code. That way somenone trying to help you has to do a lot less work.

Posted (edited)

My understanding is that you cannot have a tool window displayed only on one virtual desktop, unless someone shows me otherwise...

As for your other question, like @ahmet said, post some runnable code that shows the problem.

Edited by Nine
Posted

He could check which desktop is active in a tight loop (or is there a notification mechanism for changes)? And then, depending on the desktop IDed, show or hide the window or change the style.

Posted

Yes I read the registry to get the active desktop ! The window I use is showing itself during the switch animation between 2 desktops, the active one and the next one to display. After the animation I close the window and desktop appears as usual. 

the problem is when I open and close this window, the taskbar is flashing because of the icon that appears. It’s why I try to create a window without it !

Posted
6 hours ago, Syla said:

...the problem is when I open and close this window, the taskbar is flashing because...

..just loaded Task View to get a clue of what you mean. But the code you posted don't run on my PC. So I don't know what you mean.
But if you posted running code I could help you ?, maybe ?

Spoiler

image.png

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...