;------------------------------------------------------------------------------------------- ; Title: Remote LVM_SETITEMSTATE ; Functions for working with remote LVM_SETITEMSTATE controls ;> ; This is set of function to work with LVM_SETITEMSTATE controled by third party process. ; This process requires some data to be injected into remote process address space ; thus this library depends on *Remote Buffer* module. ; ;----------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; Function: Lvm_setItemStateCheck ; setItemStateCheck ; ; Parameters: ; winTitle - name of the window containing list view ; winText - name of the window containing list view ; classNN - the classname and instance number of the control) ; num - entry of the list view ; Returns: ; Handle to the item that display's drive letter ; ; Remarks: ; This is specific to Explorer's TreeView and ther system windows wich ; use the same presentation of file system hierarchy (like Browse For Folders ; standard dialog and similar). ; Lvm_setItemStateCheck(winTitle,classNN,num,winText){ hwEx := WinExist(winTitle) if ( hwEx = 0 ){ MsgBox, hwEx--%hwEx%. return 0 } RemoteBuf_Open(bufID,hwEx, 36) r_stvAdr := RemoteBuf_Get(bufID) LVM_SETITEMSTATE = 4139 LVIF_STATE=0x0008 LVIS_STATEIMAGEMASK=0xF000 LVIF_UNCHECKED=0x1000 LVIF_CHECKED=0x2000 VarSetCapacity(LvitemStruct,36,0) NumPut(LVIF_STATE,LvitemStruct,0) NumPut(LVIF_CHECKED,LvitemStruct,12) NumPut(LVIS_STATEIMAGEMASK, LvitemStruct,16) RemoteBuf_Write( bufID, LvitemStruct,36 ) SendMessage,LVM_SETITEMSTATE,num-1,r_stvAdr,%classNN%,%winTitle%,%winText% ret =%ErrorLevel% RemoteBuf_Close( bufID ) return %ret% } #include %A_ScriptDir%\RemoteBuf.ahk