| |
|
|
| Control Static mouse move Andreas Miethe (01.05.2011)
Statics must whom right Style having, so tappt im dunkeln informations transmit. CompileMarkSeparation $H windows.ph
$H messages.ph
Declare appexit%
WindowStyle $003F
WindowTitle "anklicken und verschieben "
Window 207,114 - 771,611
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
Var Text& = Create("Text",%hwnd,"veschieb mich",10,10,100,24)
'#################################
'STATIC MUSS ~SS_NOTIFY STIL HABEN
'#################################
SetStyle Text&,GetStyle(Text&) | ~SS_NOTIFY
'#################################
WhileNot appexit%
WaitInput
If %key = 2
'Dispose hdr#
appexit%=1
Endif
If (%message = ~WM_COMMAND) AND (&lParam = Text&)
UseCursor 5
~ReleaseCapture()
SendMessage(&lParam,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
EndIf
EndWhile
And so goes it with each Control in the Window, alike which Style staid is. CompileMarkSeparation $H windows.ph
$H messages.ph
STRUCT RECT = Left&,Righ&,Top&,Bottom&
Declare appexit%
Window Style $003F
Window Title "anklicken and move "
Window 207,114 - 771,611
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
Var Text& = Create("Text",%hwnd,"veschieb mich",10,10,100,24)
Var Group& = Create("Group box",%hwnd,"veschieb mich",10,40,300,300)
Var Button& = Create("Button",%hwnd,"veschieb mich",140,10,100,24)
Var R# = New(RECT)
WhileNot appexit%
WaitInput
~EnumChildWindows(%hwnd,ProcAddr("MoveIt",2),MakeLong(%mousex,%mousey))
If %key = 2
Dispose hdr#
Dispose R#
appexit%=1
Endif
EndWhile
Proc MoveIt
Parameters wnd&,lParam&
~GetClientRect(wnd&,R#)
~MapWindowPoints(wnd&,%hwnd,R#,2)
If ~PtInRect(R#,LoWord(lParam&),HiWord(lParam&))
~Capture Release()
UseCursor 5
SendMessage(wnd&,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
Return 0
endif
Return 1
ENDPROC
|
|
|
| |
|
|