English
Source / code snippets

Fenstergröße limit, MINMAXINFO, WM_GETMINMAXINFO

 

Georg
Teles
so can the Fenstergröße to Belieben limit - The Message to that Change the position / Size the Fensters becomes aufgefangen, changed & on the window versendet
'###############################################
'#                                             #
'#  Fenstergröße limit through MINMAXINFO  #
'#                                             #
'#          Georg Teles on the 27.12.2018          #
'#                                             #
'###############################################
 $H structs.ph
 $H windows.ph
 $H messages.ph
Declare OldWndProc&, ico&, e%
'-------------# Definitionen
Def GetWindowLong(2)!"USER32","GetWindowLongA"
Def SetWindowLong(3)!"USER32","SetWindowLongA"
Def CallWindowProc(5)!"USER32","CallWindowProcA"
Def RtlMoveMemory(3)!"KERNEL32","RtlMoveMemory"
'-------------# Structures
'reserved, no usage
Struct ptReserved = ptReservedX&, ptReservedY&
'maximum wide (x) & Höhe (y) at Maximierten Window
Struct ptMaxSize = ptMaxSizeX&, ptMaxSizeY&
'position left (x) & supra (y) at Maximierten Window
Struct ptMaxPosition = ptMaxPositionX&, ptMaxPositionY&
'smallest wide (x) & Höhe (y) at enhance/Verkleindern the Fensters
Struct ptMinTrackSize = ptMinTrackSizeX&, ptMinTrackSizeY&
'most wide (x) & Höhe (y) at enhance/Verkleindern the Fensters
Struct ptMaxTrackSize = ptMaxTrackSizeX&, ptMaxTrackSizeY&
'MINMAXINFO structure
Struct MinMax = ptReserved, ptMaxSize, ptMaxPosition, ptMinTrackSize, ptMaxTrackSize
'Variable for MINMAXINFO
Declare MMI#
Dim MMI#, MinMax
'-------------# CallBack routine

Proc WindowProc

    Parameters hWnd&, Message&, wParam&, lParam&
    ' alternatively in the Loop regulate
    'If Message& = ~WM_KEYFIRST ' TASTEN auswertung
    'Case WParam& = 27:~PostQuitMessage(0) 'zB %Key = 27 for ESC
    'Endif

    If Message& = ~WM_GETMINMAXINFO' Message snatch

        ' Pointer lParam snatch and MMI fill
        RtlMoveMemory(MMI#, lParam&, SizeOf(MMI#))
        ' values to Belieben adjust
        '-------------# alternative 1

        With MMI#

            .ptMinTrackSizeX& = 355
            .ptMinTrackSizeY& = 282
            .ptMaxTrackSizex& = 500
            .ptMaxTrackSizey& = 500

        Endwith

        '-------------# alternative 2
        'MMI#.ptMinTrackSizeX& = 355
        'MMI#.ptMinTrackSizeY& = 282
        'MMI#.ptMaxTrackSizex& = 500
        'MMI#.ptMaxTrackSizey& = 500
        ' MMI the lParam Pointer again allocate
        RtlMoveMemory(lParam&, MMI#, SizeOf(MMI#))

    EndIf

    ' alternatively in the Loop regulate
    'If Message& = ~wm_Destroy
    '  ~PostQuitMessage(0)
    'Endif
    Return CallWindowProc(OldWndProc&, hWnd&, Message&, wParam&, lParam&)

ENDPROC

'-------------# Program
Set("FastMode",1)
Set("TrueColor",1)
Windowtitle "Fenstergröße Begrenzen"
Window 100,100 - 355,282
ico& = Create("hIcon",Par$(0),0)' Icon erwünscht ?
SendMessage(%HWnd,$80,1,ico&)' Icon settle
SetWindowLong(%HWnd,-16,$92CE0000)' suitable Style dial
OldWndProc& = GetWindowLong(%hWnd, -4)' original WndProc Save
SetWindowLong(%hWnd, -4, ProcAddr("WindowProc",4))' WindowProc allocate

WhileNot e%

    Waitinput

    If %Key = 27

        Inc e%

    ElseIf %Key = 2

        Inc e%

    EndIf

EndWhile

SetWindowLong(%hWnd, -4, OldWndProc&)' original WndProc restore
DeleteObject ico&
DisPose MMI#

Regards Georg
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

12/27/18  
 



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.628 Views

Untitledvor 0 min.
Normann Strübli02/03/23
Sven Bader02/24/21
Georg Teles12/30/20
N.Art11/18/20
More...

Themeninformationen

this Topic has 1 subscriber:

Georg Teles (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