| |
|
|
| Julian57 (07.08.11)
... windowstyle 64+16+1024
window 0,0-0,0
SetWindowPos %hwnd=%MaxX-380,(%MaxY-80) - 120,35;-1
UserMessages 513
cls RGB(255,0,0)
while 1
waitinput
case iskey(27) : end
case %uMessage=513 : hWnd.moveByMouse
Endwhile
proc hWnd.moveByMouse
declare mpos#,x1&,y1&, x2&,y2&
dim mpos#,8
external("user32","GetCursorPos",mpos#)
var wix&=%winLeft-long(mpos#,0)
var wiy&=%winTop-long(mpos#,4)
while iskey(1)
external("user32","GetCursorPos",mpos#)
x1&=(long(mpos#,0)+wix&)
case x1&<workarea("Links") : x1&=workarea("Links")
case x1&>workarea("Rechts")-(%winRight-%winLeft) : x1&=workarea("Rechts")-(%winRight-%winLeft)
y1&=(long(mpos#,4)+wiy&)
case y1&<workarea("Oben") : y1&=workarea("Oben")
case y1&>workarea("Unten")-(%winBottom-%winTop) : y1&=workarea("Unten")-(%winBottom-%winTop)
setWindowPos %hWnd=x1&,y1& - (%winRight-%winLeft),(%winBottom-%winTop);0
Endwhile
dispose mpos#
endProc
Proc workarea
DEF SysParameterInfo(4) ! "user32","SystemParametersInfoA"
Parameters position$
Declare Rect#,x%
Dim Rect#,16
SysParameterInfo(48,0,Rect#,0)
case position$="Links" : x%=Long(Rect#,0)
case position$="Oben" : x%=Long(Rect#,4)
case position$="Rechts" : x%=Long(Rect#,8)
case position$="Unten" : x%=Long(Rect#,12)
Dispose Rect#
Return x%
endproc
|
|
|
| |
|
|