Jump to content

Syla

Active Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by Syla

  1. 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 !
  2. 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
  3. Ok Guys, I found something who can give me what i want: WinGetTitle("[active]") it gives me the title of the task view and i can test it to know when it's closed. Thanks for you help
  4. I'm trying to get when Task View is activated and more important, when i leave it.
  5. i'm sorry but even after read it, i don't really understand how i could use UIAutomation to handle a window... could you help me a little more please ? πŸ™ƒ
  6. console write is doing strange things actually in my side but if i print an array of classes + msgboxes of getting classes list of them, here is what i get: 2 msgbox were empty (no class list i guess) i've tried to look at the handle i've got from The Window info from Autoit ( launched in the same time ), even in the all winlist results, ( not visible ). No way, i cannot find it.
  7. Task View is launched by windows in full screen, i could get the handle but no way to use it without quit and relaunch again ( and then loose the handle ) ! WinList does not show it !!!
  8. ;=================================================================== ; Callback function ;=================================================================== Func _KeyboardHook($nCode, $wParam, $lParam) Local $tKHS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) Local $vkCode If $nCode > -1 Then $vkCode = DllStructGetData($tKHS, 'vkCode') Switch $vkCode Case 9 $bVKTab = True Case 13 _OnTaskViewExit() Case 27 _OnTaskViewExit() Case 37 $bVKLeftArrow = True Case 39 $bVKRightArrow = True Case 91 To 92 $bVKWin = True Case 162 To 163 $bVKCtrl = True EndSwitch If $bVKWin Then $bVKWin = False If $bVKCtrl Then $bVKCtrl = False If $bVKLeftArrow Then ;Left switch $bVKLeftArrow = False ElseIf $bVKRightArrow Then ;Right switch $bVKRightArrow = False EndIf ElseIf $bVKTab Then ;Task view $bVKTab = False If Not $bTaskView Then $bTaskView = True WinWait("[CLASS:XamlExplorerHostIslandWindow]") $hWnd = WinGetHandle("[CLASS:XamlExplorerHostIslandWindow]") Else $bTaskView = False ;_TestIfDesktopsChanged() EndIf EndIf EndIf EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc
  9. if i use windows title it's the same problem ! i've tried to copy the handle given by the autoit app, but the handle number is changing at every new launch of it.
  10. Hi, i'm trying to get the handle of this class but without success. All others WinGetHandle are working in my code, not this one. the WinWait before WinGetHandle launched when the window is activ does not see it and wait until i close it ! The Window info from Autoit is able to see and get every information, any idea would be really appreciate.
  11. #include <WinAPI.au3> #include <WindowsConstants.au3> HotKeySet('{F3}', '_EXIT') Dim $hHook, $hFunc, $pFunc $hFunc = DllCallbackRegister('_KeyboardHook', 'long', 'int;wparam;lparam') $pFunc = DllCallbackGetPtr($hFunc) $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, $pFunc, _WinAPI_GetModuleHandle(0)) While 1 Sleep(15) WEnd Func _EXIT() Exit EndFunc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hFunc) EndFunc Func _KeyboardHook($iCode, $iwParam, $ilParam) Local $tKHS = DllStructCreate($tagKBDLLHOOKSTRUCT, $ilParam) Local $vkCode, $iScanCode If $iCode > -1 Then $vkCode = DllStructGetData($tKHS, 'vkCode') Switch $vkCode blah blah blah EndSwitch EndIf Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc Func _keybd_event($bvkCode, $Flag) DllCall('user32.dll', 'int', 'keybd_event', 'byte', $bvkCode, 'byte', 0, 'uint', $Flag, 'ptr', 0) EndFunc; Thanks To you both ! It works like a charm πŸ™‚
  12. Thanks junkew and Nine, i will try all your solutions today and tell you back here.
  13. Thanks junkew but in my case, there is nothing to do with a gui… am i wrong ?
  14. Opt("MustDeclareVars", True) If @OSVersion <> "WIN_11" Then Exit MsgBox($MB_SYSTEMMODAL, "", "This script only runs on Win 11") #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_HiDpi=Y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If Not (@Compiled ) Then DllCall("User32.dll","bool","SetProcessDPIAware") Local $Dll = DllOpen("user32.dll") While 1 Sleep ( 50 ) If _IsPressed("11", $Dll) Then If _IsPressed("25", $Dll) Then ExitLoop EndIf EndIf WEnd DllClose($Dll)
  15. The code is working when i do the combination on my keyboard, but not by sending it from the driver of my touchpad. So, i don't think so the problem is from my code.
  16. Hi everybody, is there a way to listen from this kind of events ? i already tried with _IsPressed but it does not work at all.
Γ—
Γ—
  • Create New...