5楼的意思很接近,“内容”在列的中间显示,编译完锁定不能拖动,不知道如何实现请高手指点
cy3379 发表于 2011-6-1 09:29
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
Global $hListView, $OCall, $Call, $Handle
GUICreate("Column居中显示+宽度锁定", 400, 300)
$hListView = GUICtrlCreateListView("", 0, 2, 400, 268)
_GUICtrlListView_AddColumn($hListView, "内容", 394, 2)
$Handle = GUICtrlGetHandle(-1)
$Call = DllCallbackGetPtr(DllCallbackRegister('_test', 'int', 'hWnd;uint;wparam;lparam'))
$OCall = _WinAPI_SetWindowLong($Handle, -4, $Call)
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func _test($hWnd, $iMsg, $wparam, $lparam)
If $iMsg = 0x004E Then Return 1
Return _WinAPI_CallWindowProc($OCall, $hWnd, $iMsg, $wparam, $lparam)
EndFunc ;==>_test
|