Deutsch
Forum

Skalierbares-Fenster erstellen, ohne Dicken Rahmen

 
- Seite 1 -



Julian
Schmidt
Hallo,
ich würde gerne aus optischen Gründen ein Fenster erstellen das weiterhin skalierbar ist, allerdings keinen Dicken Rahmen besitzt. Ist so etwas möglich?

LG

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

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
20.09.2011  
 



 
- Seite 2 -


« Dieser Beitrag wurde als Lösung gekennzeichnet. »

- Seite 2 -



Andreas
Miethe


iF (21.09.11)
Du hast ja schon einen fetten Block: case (%mouseXheight(%hWnd)-10) : hwnd.scaleByMouse()


iF (21.09.11)
da kannst Du doch der hWnd.scaleByMouse-Proc als Parameter übergeben welche Ecke/ Kante gemeint war um zu Ersparen das Du das in der Proc erst wieder ermitteln musst.


Das geht mir irgendwie gegen den Strich

Das wird normalerweise über die Message WM_NCHITTEST geregelt.

Hier mal ein kleines Beispiel für einen skalier / verschiebbaren Button. Sollte sich wohl für ein Fenster anpassen lassen.
 $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 :  [...] 
21.09.2011  
 



Ich weiß nicht ob es sinnvoller ist z.B. bei jeder Mausbewegung statt nur einmalig nach Klick zu prüfen in welchen Bereich geklickt wurde. oO
 
21.09.2011  
 




Andreas
Miethe


Naja, zumindest wird bei Mausbewegung gleich der richtige Cursor angezeigt und nicht erst nach ''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 :  [...] 
21.09.2011  
 



Hm, wirds doch beim 1. Beispiel dazu auch:
'URL: https://xprofan.com/intl/de/forum/skalierbares-fenster-erstellen-ohne-dicken-rahmen/
/*
{$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

-

ist halt wm_mouseMove statt wm_ncHitTest.

Nachtrag: Ah, jetzt sehe ich den Unterschied und Vorteil!
 
21.09.2011  
 




Julian
Schmidt
Der Quelltext mit wm_ncHitTest funktioniert wirklich super! Danke 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 [...] 
22.09.2011  
 




Jörg
Sellmeyer
Na - wenn das nicht Rolf für seinen ROC gebrauchen kann, weiß ich's auch nicht. Irgendwer woltte doch auch mal Edits skalieren. Man hier zwar nicht reinschreiben aber für einen Entwurfsmodus ist das doch großartig!!
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
23.09.2011  
 



Vlt. noch nen Verschieben mit einbauen.
 
23.09.2011  
 




Jörg
Sellmeyer
Geht so schon!
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
23.09.2011  
 



Ah, bestimmt wegen else HTCAPTION.
 
23.09.2011  
 




Jörg
Sellmeyer
Kann man das so einrichten, daß es mit Statics ebenfalls funktioniert?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11.11.2011  
 



Von Andreas seiner Variante per wm_ncHitTest weiß ich es nicht aber mit "meiner" analogeren Variante ginge es auch mit unsichtbaren Controls:  [...] 
 
11.11.2011  
 




Jörg
Sellmeyer
Was meinst Du mit unsichtbaren Controls?
Irgendwie mag ich die Variante von Andreas mehr, obwohl Deine auch interessant ist.
Die von Andreas scheint mir systemnäher.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11.11.2011  
 




Antworten


Thementitel, max. 100 Zeichen.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Beitrag  Schrift  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Themenoptionen

27.796 Betrachtungen

Unbenanntvor 0 min.
H.Brill16.09.2023
R.Schneider04.04.2022
Peter Max Müller01.11.2017
Jörg Sellmeyer04.02.2016
Mehr...

Themeninformationen



Admins  |  AGB  |  Anwendungen  |  Autoren  |  Chat  |  Datenschutz  |  Download  |  Eingangshalle  |  Hilfe  |  Händlerportal  |  Impressum  |  Mart  |  Schnittstellen  |  SDK  |  Services  |  Spiele  |  Suche  |  Support

Ein Projekt aller XProfaner, die es gibt!


Mein XProfan
Private Nachrichten
Eigenes Ablageforum
Themen-Merkliste
Eigene Beiträge
Eigene Themen
Zwischenablage
Abmelden
 Deutsch English Français Español Italia
Übersetzungen

Datenschutz


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie