Source / code snippets | | | | | ControlsMap Controls Desktop Window lists
Created one hPic as well as 6 lists a Momentaufnahme all visible Window
as well as all on the visible Windows encompassed Controls velvet Coordinates
and Ausmaße repräsentieren.
the hPic is useful so one simply by getPixel The lists-Eintragsnummer
one Controls at a designed Bildschirmposition zurückerhält under Beachtung
the Z-axis.
Download
power from:
this:
CompileMarkSeparation {$cleq}
windowstyle 80
window maxx,maxy
long hPicControlsMap=create("hNewPic",maxx,maxy,$FFFFFF)
long ControlsMapLists=paintControlsMap(hPicControlsMap)//gibt einen speicher mit 6 listenhandles zurück.
drawpic hPicControlsMap,,0;0
print getcount(long(ControlsMapLists,)),"Elemente gefunden."
destroyWindow(long(ControlsMapLists,))//enthält die handles
destroyWindow(long(ControlsMapLists,4))//die x position
destroyWindow(long(ControlsMapLists,8))//die y position
destroyWindow(long(ControlsMapLists,12))//die xx position
destroyWindow(long(ControlsMapLists,16))//die yy position
destroyWindow(long(ControlsMapLists,20))//den typ, 1=fenster 2=control
waitinput
end
nProc paintControlsMap(long hPic){
long \
lst=createLongsList(),lst2=createLongsList(),\
hsh=createLongsList(),hsx=createLongsList(),hsy=createLongsList(),hsxx=createLongsList(),hsyy=createLongsList(),hstyp=createLongsList(),\
rc=globalAlloc(gPTR,16),rc2=globalAlloc(gPTR,16),\
x,y,xx,yy,cnt,wnd,cnt2
enumWindows(procAddr(paintControlsMap.enumProc),lst)
cnt=getcount(lst)
whileloop cnt-1,,-1 {
wnd=SendMessage(lst,lb_getitemdata,loop,)
getWindowRect(wnd,rc)
sendMessage(hstyp,lb_addstring,,1)
sendMessage(hsh,lb_addstring,,wnd)
sendMessage(hsx,lb_addstring,,long(rc,))
sendMessage(hsy,lb_addstring,,long(rc,4))
sendMessage(hsxx,lb_addstring,,long(rc,8))
sendMessage(hsyy,lb_addstring,,long(rc,12))
sendmessage(lst2,lb_resetContent,,)
enumChildWindows(wnd,procAddr(paintControlsMap.enumProc),lst2)
cnt2=getcount(lst2)
if cnt2 {
whileloop 0,cnt2-1 {
wnd=SendMessage(lst2,lb_getitemdata,loop,)
getWindowRect(wnd,rc2)
case long(rc2,)<long(rc,) : long rc2&,0=long(rc,)
case long(rc2,4)<long(rc,4) : long rc2&,4=long(rc,4)
case long(rc2,8)>long(rc,8) : long rc2&,8=long(rc,8)
case long(rc2,12)>long(rc,12) : long rc2&,12=long(rc,12)
case long(rc2,)>long(rc,8) : long rc2&,0=long(rc,8)
case long(rc2,4)>long(rc,12) : long rc2&,4=long(rc,12)
case long(rc2,8)<long(rc,) : long rc2&,8=long(rc,)
case long(rc2,12)<long(rc,4) : long rc2&,12=long(rc,4)
sendMessage(hstyp,lb_addstring,,2)
sendMessage(hsh,lb_addstring,,wnd)
sendMessage(hsx,lb_addstring,,long(rc2,))
sendMessage(hsy,lb_addstring,,long(rc2,4))
sendMessage(hsxx,lb_addstring,,long(rc2,8))
sendMessage(hsyy,lb_addstring,,long(rc2,12))
}
}
}
globalFree(rc)
globalFree(rc2)
destroyWindow(lst2)
destroyWindow(lst)
cnt=getcount(hsh)
if cnt {
long dc=createCompatibleDC(hDC)
selectObject(dc, hPic)
selectobject(dc,getStockObject(NULL_PEN))
selectobject(dc,getStockObject(DC_BRUSH))
whileloop 0,cnt-1 {
SetDCBrushColor(dc,loop)
rectangle(dc,SendMessage(hsx,lb_getitemdata,loop,),SendMessage(hsy,lb_getitemdata,loop,),SendMessage(hsxx,lb_getitemdata,loop,)+1,SendMessage(hsyy,lb_getitemdata,loop,)+1)
}
deleteDC(dc)
}
long rt=dim(24)
long rt&,0=hsh,hsx,hsy,hsxx,hsyy,hstyp
return rt
}
nProc paintControlsMap.enumProc(long wnd,lst){
PushAll
case IsWindowVisible(wnd) and (wnd<>hwnd) : sendMessage(lst,lb_addstring,,wnd)
PopAll
return true
}
nproc createLongsList(){
return Control("LISTBOX","",WS_CHILD | LBS_OWNERDRAWFIXED,,,,,hWnd,999,hInstance,)
}
|
| | | | |
| | | Nachtrag: View source again fix adjusted -
small BugFixes. |
| | | | |
| | Julian Schmidt | shining, super To functions. now must You it only yet fix in your ruler-Tool reinhauen. |
| | | | |
| | | jaja! |
| | | | |
| | Julian Schmidt | might one fix NEN ego-Shooter draus write, because one Controls killen must. xD |
| | | | |
| | | either so: [...]
ooooder naturally so: [...]
or so: [...]
thoroughly machbar!
Aaber Perhaps too so: [...] |
| | | | |
| | Julian Schmidt | game-target: who creates it first thing windows crash To let. xD |
| | | | |
|
Zum QuelltextTopic-Options | 10.060 Views |
Themeninformationenthis Topic has 2 subscriber: |
|