Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add RemoveDesktop, CreateDesktop, IsAppIdPinned,PinAppID,UnpinAppID method use demo #6

Closed
huo-feng-ding opened this issue Oct 26, 2021 · 7 comments

Comments

@huo-feng-ding
Copy link

i want to use RemoveDesktop, CreateDesktop method to contrl remove or create desktop . Can you add these methods.
and IsAppIdPinned,PinAppID,UnpinAppID these methods add demo to use

@FuPeiJiang
Copy link
Owner

can you try to do it yourself with https://github.com/MScholtes/VirtualDesktop/blob/812c321e286b82a10f8050755c94d21c4b69812f/VirtualDesktop1803.cs#L378 ?
and pull request ?

you'll probably have to wait a few days, I'm working on ahk_parser.js
adding it doesn't take long, I'm just don't want to lose my concentration

@huo-feng-ding
Copy link
Author

I try to do it , but not success 😣

@FuPeiJiang
Copy link
Owner

I try to do it , but not success 😣

true, it was hard to do VD_IsAppPinned(wintitle)


I discovered 2 things:

; revelation, view IS the object, I was looking everywhere for CLSID of IApplicationView
    ; Ptr* passes the address to Receive the string
    ; &RECT passes the address to, well input the RECT, not for output
    ; VarSetCapacity(Rect, 16)  ; A RECT is a struct consisting of four 32-bit integers (i.e. 4*4=16).
    ; DllCall("GetWindowRect", "Ptr", WinExist(), "Ptr", &Rect)  ; WinExist() returns an HWND.
    ; MsgBox % "Left " . NumGet(Rect, 0, "Int") . " Top " . NumGet(Rect, 4, "Int")
    ; . " Right " . NumGet(Rect, 8, "Int") . " Bottom " . NumGet(Rect, 12, "Int")
    ; wait what?, now I'm confused
    ; it is because the function says [out]. not in. [in] write to YOUR struct
    ; , [out] CREATES the struct and returns the pointer to you

Pin App was done at this commit:
7540f8f

; "Show windows from this app on all desktops"
; VD_IsAppPinned(wintitle)
; VD_TogglePinApp(wintitle)
; VD_PinApp(wintitle)
; VD_UnPinApp(wintitle)

@FuPeiJiang
Copy link
Owner

now you regret asking for IsAppIdPinned
because RemoveDesktop, CreateDesktop is what's actually useful, and IsAppIdPinned is useless
but VD_IsAppPinned is similar to VD_IsWindowPinned so I wanted to do that first.

@huo-feng-ding
Copy link
Author

image

FuPeiJiang added a commit that referenced this issue Nov 2, 2021
; VD_createDesktop(goThere:=true) ; VD_createUntil(howMany, goThere:=true)
; VD_removeDesktop(whichDesktop, fallback_which:=false)

with demo

#6
@FuPeiJiang
Copy link
Owner

@MaxSherry

@huo-feng-ding
Copy link
Author

❤️ u are kindhearted person, I love you, thank u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants