逃げはしないけどデスクトップが散らかります
等間隔に整列をはずさないとうまくいきません
//ヘッダ↓
#uselib "user32.dll"
#cfunc FindWindow "FindWindowA" sptr,sptr
#cfunc FindWindowEx "FindWindowExA" sptr,sptr,sptr,sptr
#func GetWindowThreadProcessId "GetWindowThreadProcessId" int,int
#func GetCursorPos "GetCursorPos" int
#uselib "kernel32.dll"
#cfunc OpenProcess "OpenProcess" int,int,int
#func CloseHandle "CloseHandle" int
#cfunc VirtualAllocEx "VirtualAllocEx" int,int,int,int,int
#func ReadProcessMemory "ReadProcessMemory" int,int,int,int,int
#func VirtualFreeEx "VirtualFreeEx" int,int,int,int
#const LVM_GETITEMPOSITION 0x1010
#const LVM_GETITEMCOUNT 0x1004
#const LVM_SETITEMPOSITION 0x100f
#const PROCESS_VM_OPERATION 0x0008
#const PROCESS_VM_READ 0x0010
#const PROCESS_VM_WRITE 0x0020
#const MEM_RESERVE 0x2000
#const MEM_COMMIT 0x1000
#const PAGE_READWRITE 0x0004
#const MEM_RELEASE 0x8000
#define ctype MAKELPARAM(%1,%2) (%1 | %2<<16)
#define iIconIndex cnt
//ヘッダ↑
//デスクトップのリストビューのハンドル取得
hList = FindWindow("Progman", "Program Manager")
hList = FindWindowEx(hList, NULL, "SHELLDLL_DefView", NULL)
hList = FindWindowEx(hList, NULL, "SysListView32", NULL)
//アイコンの数取得
sendmsg hList,LVM_GETITEMCOUNT,NULL,NULL
Icnum=stat
//プロセスのハンドル取得
GetWindowThreadProcessId hList,varptr(dwProcessId)
hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE,FALSE,dwProcessId)
repeat icnum
//アイコンの座標取得
dim iconPos,2
ptr=VirtualAllocEx(hProcess,NULL,4096,MEM_RESERVE | MEM_COMMIT,PAGE_READWRITE)
sendmsg hList,LVM_GETITEMPOSITION,iIconIndex,ptr
ReadProcessMemory hProcess,ptr,varptr(iconPos),8,NULL
VirtualFreeEx hProcess,ptr,0,MEM_RELEASE
//アイコン移動処理
//マウスが近づいてきたら座標を足したり引いたり
//iconPos.0+-= //x座標
//iconPos.1+-= //y座標
//
iconPos.0=rnd(ginfo_winx) :iconPos.1=rnd(ginfo_winy)
//
//アイコンの座標設定
sendmsg hList,LVM_SETITEMPOSITION,iIconIndex,MAKELPARAM(iconPos.0,iconPos.1)
loop
CloseHandle hProcess