Jump to content

Recommended Posts

Posted

Example: Something similar to GUICtrlSetStyle to add (or remove) extended style $WS_EX_COMPOSITED to File Explorer's (explorer.exe) treeview (SysTreeView32).

Here is what I have so far:

#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIDlg.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
        Local $aWinList = WinList("This PC - File Explorer")
        ;_ArrayDisplay($aWinList)
        ConsoleWrite($aWinList[1][1] & @CRLF)
        $hWnd = $aWinList[1][1]
        ;GUICtrlSetStyle($hWnd, -1, $WS_EX_COMPOSITED)
        ;MsgBox($MB_SYSTEMMODAL, "ID", "Dialog Control ID: " & _WinAPI_GetDlgCtrlID($hWnd))
        ControlMove($hWnd, "", "[CLASS:SysTreeView32]", 0, 0, 150, 150)
EndFunc   ;==>Example

The only purpose of the ControlMove function is to show me visually that I've got the right handle for explorer.exe and the right class. But that is far as I can get.

Is there any way to set the extended style for the SysTreeView32 control of another process (explorer.exe)?

Thank you for your time.

Posted (edited)
Instance: [CLASS:DirectUIHWND; INSTANCE:2]
Style: WS_CHILD, WS_VISIBLE, WS_CLIPSIBLINGS, WS_CLIPCHILDREN
ExStyle: 0x000000

DirectUIHWND is not SysTreeView32 :(
I don't know if that technic will work on Win11 ( haven't tested either )

Edit: Oops. I meant the ListView side. 🤪

Edited by argumentum
oops

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

Posted
7 minutes ago, argumentum said:

don't know if that technic will work on Win11 ( haven't tested either )

Also I just found this msdn link which stipulates :

The SetWindowLongPtr function fails if the process that owns the window specified by the hWnd parameter is at a higher process privilege in the UIPI hierarchy than the process the calling thread resides in.

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted
9 minutes ago, argumentum said:

DirectUIHWND is not SysTreeView32

..I made a mistake there, pointing that out. That wasn't the OP question  =/

4 minutes ago, pixelsearch said:
... if the process that owns the window specified by the hWnd parameter is at a higher process privilege ...

Yes, that's a given. Unless as admin won't work either ? ( no time to test, playing around with something else )

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

Posted

@WildByDesign   If you're sure that the requested window got the $WS_EX_COMPOSITED extended style set, then you can try this :

Local $hWnd = ...
Local $iExStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)
Local $iExStyleToRemove = $WS_EX_COMPOSITED

If BitAND($iExStyle, $iExStyleToRemove) = $iExStyleToRemove Then
    _WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, BitXOR($iExStyle, $iExStyleToRemove))
Endif

 

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted
5 minutes ago, pixelsearch said:

If you're sure that the requested window got the $WS_EX_COMPOSITED extended style set, then you can try this :

Thanks for the suggestions. It seems like the perfect function for what I'm trying to do. I'm using System Informer (previously Process Hacker) to view all of the details about various windows and controls. After running the initial code snippet that you shared, I could not see any change in the extended styles in System Informer. It could be because File Explorer may have more protections against this sort of thing. I'm not sure yet.

It did get File Explorer firing up the CPU quite a lot, so it definitely did something. I have to spend more time looking into it.

The reason why I am trying this is because some users have suggested that when applying full window Acrylic or Mica, the composited extended style is supposed to make the text in the treeview sharper.

Posted
32 minutes ago, pixelsearch said:

Also I just found this msdn link which stipulates :

This also:

Certain window data is cached, so changes you make using SetWindowLongPtr will not take effect until you call the SetWindowPos function.

I will have to consider this as well and dig into this more later.

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...