Here is a quick addition of the ListView with LVS_EX_DOUBLEBUFFER.
By the way, @pixelsearch, I see that you just edited your example. My ListView addition is based on your example that was originally posted. I still have to check your updated example.
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
; DPI
DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext" , "HWND", "DPI_AWARENESS_CONTEXT" -2)
Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declaration
Global $g_hGUI, $g_hChild, $g_hChildMDI, $g_aPosChild, $g_iDeltaX, $g_iDeltaY
Example()
Func Example()
$g_hGUI = GUICreate("Example", 400, 400, -1, -1, $WS_OVERLAPPEDWINDOW, $WS_EX_COMPOSITED)
GUISetBkColor(0x202020)
GUISetState(@SW_SHOW, $g_hGUI)
$g_hChild = GUICreate("ChildWindow", 320, 320, 40, 40, 0x40000000, -1, $g_hGUI)
GUISetBkColor(0x606060)
GUISetState(@SW_SHOW, $g_hChild)
$g_hChildMDI = GUICreate("", 280, 280, 20, 20, $WS_POPUP, BitOr($WS_EX_MDICHILD, $WS_EX_CONTROLPARENT), $g_hChild)
GUISetBkColor(0xff00ff)
; add listview
Local $idListview = GUICtrlCreateListView("Column1|Column2", 20, 20, 240, 240, -1, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE, $LVS_EX_DOUBLEBUFFER, $LVS_EX_CHECKBOXES))
Local $idLVi_Item1 = GUICtrlCreateListViewItem("1|1", $idListview)
Local $idLVi_Item2 = GUICtrlCreateListViewItem("2|2", $idListview)
Local $idLVi_Item3 = GUICtrlCreateListViewItem("3|3", $idListview)
; get rid of selection rectangle on listview
GUICtrlSendMsg($idListview, $WM_CHANGEUISTATE, 65537, 0)
GUISetState(@SW_SHOW, $g_hChildMDI)
_CalcPosAndDelta()
GUIRegisterMsg($WM_ENTERSIZEMOVE, "WM_ENTERSIZEMOVE")
GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_ENTERSIZEMOVE")
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_MOVE, "WM_SIZE")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
GUIDelete($g_hChildMDI)
GUIDelete($g_hChild)
GUIDelete($g_hGUI)
EndFunc ;==>Example
Func _CalcPosAndDelta()
Local $aPosChildMDI = WinGetPos($g_hChildMDI)
$g_aPosChild = WinGetPos($g_hChild)
$g_iDeltaX = $g_aPosChild[0] - $aPosChildMDI[0]
$g_iDeltaY = $g_aPosChild[1] - $aPosChildMDI[1]
EndFunc ;==>_CalcPosAndDelta
Func WM_ENTERSIZEMOVE($hWnd, $iMsg, $wParam, $lParam)
_CalcPosAndDelta()
EndFunc ;==>WM_ENTERSIZEMOVE
Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
If $hWnd = $g_hGUI Then
$g_aPosChild = WinGetPos($g_hChild)
WinMove($g_hChildMDI, "", $g_aPosChild[0] - $g_iDeltaX, $g_aPosChild[1] - $g_iDeltaY)
EndIf
EndFunc ;==>WM_SIZE