English
Source / code snippets

Echtzeit Resize Steuerelementen

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Resize of Steuerelementen in Echtzeit
in the subesquent example becomes The Resize one Steuerelementes,
in this drop one Button, in Echtzeit demonstrating. with Veränderung the Size the Fensters
changed itself too The Size the Buttons.
-Begin-----------------------------------------------------------------
-HeaderFiles---------------------------------------------------------
 $H windows.ph
 $H Messages.ph
-Variables Declaration-----------------------------------------------
Declare end%, OldWndProc&, hButton%
-CallBack routine----------------------------------------------------

Proc ChangeControl

    Parameters hWnd&, Message&, wParam&, lParam&
    Declare btnHeight&

    If Message& = ~WM_SIZE

        -request, so Button not small 16 Pixel Hoehe------------

        If @Height(%hWnd) / 5 < 16

            btnHeight& = 16

        Else

            btnHeight& = @Height(%hWnd) / 5

        EndIf

        -Groesse the Buttons Change-----------------------------------
        SetWindowPos hButton%, 10, 34 - @Width(%hWnd) - 20, btnHeight&

    EndIf

    Return ~CallWindowProc(OldWndProc&, hWnd&, Message&,
    wParam&, lParam&)

ENDPROC

-Main----------------------------------------------------------------
-Erweitertes MessageHandling turn off----------------------------
Set(FastMode, 1)
-Window oeffnen and GUI set up----------------------------------
Window 0, 0 - 640, 480
Window Title Resize of Steuerelementen in Echtzeit
-Backgroundcolor the Fensters set---------------------------
Declare Color&, Red%, Green%, Blue%
Color& = ~GetSysColor(~COLOR_3DFACE)
Red% = @GetRValue(Color&)
Green% = @GetGValue(Color&)
Blue% = @GetBValue(Color&)
Cls @RGB(Red%, Green%, Blue%)
-----------------------------------------------------------------
@Create(Text, %hWnd, Ändere The Size this Fensters, 10,
10, 250, 20)
hButton% = @Create(Button, %hWnd, end, 10, 34,
@Width(%hWnd) - 20, @Height(%hWnd) / 5)
-ProgramMainRoutine with CallBack redirecting on Own---------------
OldWndProc& = ~GetWindowLong(%hWnd, ~GWL_WNDPROC)
~SetWindowLong(%hWnd, ~GWL_WNDPROC, @ProcAddr(ChangeControl, 4))
-dialog-Loop---------------------------------------------------
Clear end%

WhileNot end%

    WaitInput

    If %Key = 2

        end% = 1

    ElseIf @Clicked(hButton%)

        end% = 1

    EndIf

EndWhile

-Urspruengliche ProgramMainRoutine again produce---------------
~SetWindowLong(%hWnd, ~GWL_WNDPROC, OldWndProc&)
-End-------------------------------------------------------------------
End
 
07/15/07  
 



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

1.460 Views

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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