Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why it have to use more time to m.Write?
#1
int htv=id(101 win("123" "Afx:400000:*" "" 0x800));out htv
int i=SendMessage(htv TVM_GETNEXTITEM TVGN_ROOT 0);out "hItem=%i" i

__ProcessMemory m; int pid
TVITEMEX tt
m.Alloc(htv 1000)
GetWindowThreadProcessId(htv &_i);pid=_i ;out _i

int a=m.address; out "a=%i" a
tt.pszText=+(a+200)
tt.cchTextMax=260
tt.hItem=i
tt.mask=TVIF_TEXT
out "time=%i" GetTickCount
m.Write(&tt sizeof(tt))
out "time=%i" GetTickCount
_i=SendMessage(htv TVM_GETITEMW 0 a);out _i
if(_i) m.ReadStr(_s 20 200 1);out "%s %i" _s _s.len
m.Free

TimeInterval =50-150ms,only in m.Write,why......? :?:
#2
Don't know, when I test with Winamp and other windows, time interval is 0 (16 mcs).

GetTickCount is not precise. Instead use perf or timeGetTime.

Write() jut calls WriteProcessMemory().
Google for WriteProcessMemory related problems.
#3
yes,if change to int htv=id(100 win("My Computer" "CabinetWClass"))

will be 0 delay,I have to try more programs and compare the time interval...
#4
I found small applications look like well,some "big" app will have problem(big memory), firefox's bookmarks(left side) could reproduce it,is there any diffrence between small or big memory when we Alloc+Write it? :?:

int htv=child("" "MozillaWindowClass" win("" "MozillaUIWindowClass") 0x1 0 0 3)
#5
Should not be difference.
#6
finally I found the cause:firewall setting,faint...

shutdown the firewall,everything is ok. :wink:
#7
Yes, antivirus and some other programs may protect itself and maybe other programs from such dangerous API that often are used by viruses etc. They hook these API, and it slows down calling them.


Forum Jump:


Users browsing this thread: 1 Guest(s)