English
Forum

Skalierbares-Window create, without fat welt

 
- Page 1 -



Julian
Schmidt
Hi,
i'd gladly from optischen Found one Window create the furthermore skalierbar is, though none fat welt own. is such a thing possible?

LG

Julian57
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/20/11  
 



« this Posting watts as Solution marked. »

- Page 2 -



Andreas
Miethe


iF (21.09.11)
you have already a fat block: case (%mouseXheight(%hWnd)-10) : hwnd.scaleByMouse()


iF (21.09.11)
there can You still the hWnd.scaleByMouse-Proc as Parameter transfer which corner/ edge meant was in order to Ersparen the You, the in Proc first again detect must.


the goes me somehow against whom Strich

This will usually over The Message WM_NCHITTEST geregelt.

here time one small example for a skalier / verschiebbaren Button. ought to itself well for a Window adjust let.
 $H windows.ph
 $H Messages.ph
 $H Structs.ph
STRUCT TRect         = ~Rect
STRUCT TPoint        = ~Point

Proc HitTest

    Parameters hCtl&,lParam&
    Declare Point#
    Declare Rect#
    Dim Point#,TPoint
    Dim Rect#,TRect
    Point#.x& = LoWord(lParam&)
    Point#.y& = HiWord(lParam&)
    ~ScreenToClient(hCtl&,Point#)
    ~GetWindowRect(hCtl&,Rect#)
    ~MapWindowPoints(~GetDesktopWindow(),%Hwnd,Rect#,2)

    If (Point#.y& < 4) AND (Point#.x& < 4)

        Dispose Point#,Rect#
        Return  ~HTTOPLEFT

    ElseIf (Point#.y& < 4) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTTOPRIGHT

    ElseIf (Point#.y& >= (Rect#.bottom& - Rect#.top&-4)) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMRIGHT

    ElseIf (Point#.x& < 4) AND (Point#.y& >= (Rect#.bottom& - Rect#.top& - 4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMLEFT

    ElseIf Point#.y& < 4

        Dispose Point#,Rect#
        Return  ~HTTOP

    ElseIf Point#.x& < 4

        Dispose Point#,Rect#
        Return ~HTLEFT

    ElseIf Point#.x& >= (Rect#.right& - Rect#.left& - 4)

        Dispose Point#,Rect#
        Return ~HTRIGHT

    ElseIf Point#.y& >= (Rect#.bottom& - Rect#.top& - 4)

        Dispose Point#,Rect#
        Return ~HTBOTTOM

    Else

        Dispose Point#,Rect#
        Return ~HTCAPTION

    EndIf

ENDPROC

SubClassProc

    If SubClassMessage(&sWnd,~WM_NCHITTEST)

        Set("WinProc", 0)
        Return HitTest(&swnd,&slParam)

    Endif

ENDPROC

cls
Var Ende& = 0
Var Button& = Create("Button",%hwnd,"OK",10,10,120,30)
SubClass Button&,1

whilenot ende&

    waitinput

endwhile

 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
09/21/11  
 



 
- Page 2 -


i don't know whether it sinnvoller is z.B. with eachone Mausbewegung instead of only einmalig to Click To Verify in whom area clicked watts. oO
 
09/21/11  
 




Andreas
Miethe


Well, at least becomes with Mausbewegung same the right Cursor displayed and not first to ''KLICK''
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
09/21/11  
 



Hm, Better get going still at 1. example moreover too:
'URL: https://XProfan.com/intl/de/forum/skalierbares-window-create-without-fat-welt/
/*
{$cleq}
{$compiler c:\XProfan11\}
{$runtime c:\XProfan11\}
*/
windowstyle 1 | 2 | 8 | 16 | 512
window 640,480
userMessages 16,513,20//wm_close,wm_lButtonDown,wm_eraseBkGnd
subClass %hWnd,1

while 1

    waitInput

    select %uMessage

        caseof 16 : break

        caseof 513

        case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hWnd.scaleByMouse()

    endSelect

wend

end

subClassProc

    case subClassMessage(%hWnd, 512):useCursor (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10)*7//wm_mouseMove

endProc

proc hWnd.scaleByMouse

    declare m#
    dim m#,8
    external("user32","GetCursorPos",m#)
    var omx%=long(m#,0)
    var omy%=long(m#,4)
    var wi&=%winRight-%winLeft
    var he&=%winBottom-%winTop

    while isKey(1)

        waitInput 10
        external("user32","GetCursorPos",m#)
        setWindowPos %hWnd=%winLeft,%winTop - wi&-omx%+long(m#,0),he&-omy%+long(m#,4)

    wend

    dispose m#

endProc

-

is hold wm_mouseMove instead of wm_ncHitTest.

Nachtrag: Ah, now see I the Difference and benefit!
 
09/21/11  
 




Julian
Schmidt
The View source with wm_ncHitTest functions really super! thanks Andreas
 $H windows.ph
 $H Messages.ph
 $H Structs.ph
STRUCT TRect = ~Rect
STRUCT TPoint = ~Point

Proc HitTest

    Parameters hCtl&,lParam&
    Declare Point#
    Declare Rect#
    Dim Point#,TPoint
    Dim Rect#,TRect
    Point#.x& = LoWord(lParam&)
    Point#.y& = HiWord(lParam&)
    ~ScreenToClient(hCtl&,Point#)
    ~GetWindowRect(hCtl&,Rect#)
    ~MapWindowPoints(~GetDesktopWindow(),%Hwnd,Rect#,2)

    If (Point#.y& < 4) AND (Point#.x& < 4)

        Dispose Point#,Rect#
        Return  ~HTTOPLEFT

    ElseIf (Point#.y& < 4) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTTOPRIGHT

    ElseIf (Point#.y& >= (Rect#.bottom& - Rect#.top&-4)) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMRIGHT

    ElseIf (Point#.x& < 4) AND (Point#.y& >= (Rect#.bottom& - Rect#.top& - 4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMLEFT

    ElseIf Point#.y& < 4

        Dispose Point#,Rect#
        Return  ~HTTOP

    ElseIf Point#.x& < 4

        Dispose Point#,Rect#
        Return ~HTLEFT

    ElseIf Point#.x& >= (Rect#.right& - Rect#.left& - 4)

        Dispose Point#,Rect#
        Return ~HTRIGHT

    ElseIf Point#.y& >= (Rect#.bottom& - Rect#.top& - 4)

        Dispose Point#,Rect#
        Return ~HTBOTTOM

    Else

        Dispose Point#,Rect#
        Return ~HTCAPTION

    EndIf

ENDPROC

SubClassProc

    If SubClassMessage(&sWnd,~WM_NCHITTEST)

        Set("WinProc", 0)
        Return HitTest(&swnd,&slParam)

    Endif

ENDPROC

windowstyle 2+16+64
window 600,400
cls 255
var dg&=Create("Window",%hwnd,"",10,10,200,100)
StartPaint dg&
cls 255
EndPaint
SubClass dg&,1
SubClass %hwnd,1

while 1

    waitinput 30
    case iskey(27) : end

endwhile

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/22/11  
 




Jörg
Sellmeyer
well - if not Rolf for its ROC use can, white ich's neither. Irgendwer woltte still too time Edits skalieren. one here of course not reinschreiben but for a Entwurfsmodus is the still splendid!!
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/23/11  
 



Perhaps. yet NEN move with install.
 
09/23/11  
 




Jörg
Sellmeyer
goes so already!
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/23/11  
 



Ah, certainly because of else HTCAPTION.
 
09/23/11  
 




Jörg
Sellmeyer
Can the so arrange, that it with Statics ditto functions?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/11/11  
 



From Andreas its Variante by wm_ncHitTest white I not but with "meiner" analogeren Variante went it too with unsichtbaren Controls:  [...] 
 
11/11/11  
 



 
- Page 3 -



Jörg
Sellmeyer
what mean You with unsichtbaren Controls?
somehow likes I The Variante of Andreas More, though your too interestingly is.
The of Andreas shining me systemnäher.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/11/11  
 



Andreas its is as it of system virtual is and "meine" Variant sooner a Analog Selbermachvariante.

both mutants having your to- and detriments. with "meiner" Variante has one More Eingriffsmöglichkeiten and can also Verschiebungen make possible The of system even not "gedacht" are. who means Controls How of system virtual move would like takes wm_ncHitTest and Spezialitäten hold The analogere Variante.
 
11/11/11  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

27.485 Views

Themeninformationen



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