English
Source / code snippets

Control mouse Static move

 
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


 
05/01/11  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.163 Views

Untitledvor 0 min.
Member 862464105/13/24
Sven Bader07/03/23
RudiB.04/05/20
Rainer Hoefs05/10/19
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie