| |
|
|
| Julian57 (07.08.11)
... style de fenêtre 64+16+1024
window 0,0-0,0
SetWindowPos %hwnd=%MaxX-380,(%MaxY-80) - 120,35;-1
Utilisateur Messages 513
cls RGB(255,0,0)
tandis que 1
waitinput
cas iskey(27) : end
cas %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)
tandis que iskey(1)
external("user32","GetCursorPos",mpos#)
x1&=(long(mpos#,0)+wix&)
cas x1&<workarea("Links") : x1&=workarea("Links")
cas x1&>workarea("Rechts")-(%winRight-%winLeft) : x1&=workarea("Rechts")-(%winRight-%winLeft)
y1&=(long(mpos#,4)+wiy&)
cas y1&<workarea("Oben") : y1&=workarea("Oben")
cas 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"
Paramètres position$
Déclarer Rect#,x%
Faible Rect#,16
SysParameterInfo(48,0,Rect#,0)
cas position$="Links" : x%=Long(Rect#,0)
cas position$="Oben" : x%=Long(Rect#,4)
cas position$="Rechts" : x%=Long(Rect#,8)
cas position$="Unten" : x%=Long(Rect#,12)
Dispose Rect#
Retour x%
endproc
|
|
|
| |
|
|