Forum | | | |  Rainer Hoefs | Hello together, I need time again Help.
I have one Static prepares, which a vertikalen and horizontalen Scroll bar has. therein should a BMP-graphic viewed go. is these in a or both directions larger, should tappt im dunkeln through the Scroll bar moved go can.
now have I following Problems.
How can I to the loading the Bildes... 1. The required Scroll bar enable or deaktivieren Hor / Ver / Hor+Ver? 2. The Scrollrange take on? 3. whom Slider in the Size take on? 4. the two Scroll bar intercepting circa hereon To react? 5. at all The Handles the three items (Static, hScroll and vScroll) check circa Messages there To Send or tappt im dunkeln abzufangen?
I had already once on anybody Website Messages and Description seen, white but not any more where. and since Meet Search I thereafter erfolglos in the network.
here the Source one Testprogrammes.
for Your Help Schonmal one Thank you in the ahead.
Rainer
' code created with F.Abbing's LemonViD Version 1.0.0.3 on the 11.05.2019 circa 08:35 watch,
' donate-Button, as well as further Freeware-Tools for XProfan on https://frabbing.net
' Technischer Support on ./../../sys/?nohdr=1&u=www.paules-pc-forum.de/forum/XProfan and https://purebasic.fr/German
' --------------------------------------------------------------------------------------------------
Declare nurso%, end%, button2%, StaticFrame&, OriginalBMP$, OriginalBMp&, OriginalBMPWidth%, OriginalBMPHeight%, \
Style%, Message$, mwnd$, wParam$, lParam$
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def SendBMP2Static(2) SendMessage(&(1),$172,0,&(2))
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Set("Truecolor", 1)
Set("Autopaint", 1)
Proc ShowDesign
Parameters Design&, Target&, X%, Y%, fashion%
If Design&
StartPaint Target&
DrawPic Design&, X%, Y%; fashion%
EndPaint
Else
MessageBox("No BMP loaded!", "Error!",64)
EndIf
ENDPROC
Proc LoadDesign
OriginalBMP$ = loadfile$("Bitte Image or HTML-File wählen","c:\css\pictures\*.bmp")
If OriginalBMP$ <> ""
OriginalBMp& = Create("HPIC", -1, OriginalBMP$)
OriginalBMPWidth% = %bmpx
OriginalBMPHeight% = %bmpy
'------------------------------------------------------------------------------------------------------------
' here go The different Styles in static staid, moreover Please simply whom Style% on 1 - 6 settle!
'------------------------------------------------------------------------------------------------------------
Style% = 1
Style% = Input$( "Style select, a number between 1 and 6 eingeben", "Style", Style%)'3* or 6 wären optisch my Favoriten
If (Style% > 0) And (Style% < 7)
DestroyWindow(StaticFrame&)
Select Style%
CaseOf 1
StaticFrame& = Control("Static", "", $5630030f, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $060018)
CaseOf 2
StaticFrame& = Control("Static", "", $56320b0f, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $070018)
CaseOf 3
StaticFrame& = Control("Static", "", $54300107, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $020010)
CaseOf 4
StaticFrame& = Control("Static", "", $56300107, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $018)
CaseOf 5
StaticFrame& = Control("Static", "", $52b01b0e, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $0)
OtherWise
StaticFrame& = Control("Static", "", $54b00107, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $010010)
EndSelect
'SendMessage()
Else
MessageBox("Eine number between 1 and 6 prompt!", "Error!",64)
EndIf
'------------------------------------------------------------------------------------------------------------
Else
MessageBox("Design loading aborted!","Design laden",64)
EndIf
ENDPROC
Proc CreateElements
Window Style 26 | 512 | 2048
Window Title "Arbeitsfenster"
Window 426, 120 - 1009, 782
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
StaticFrame& = Control("Static", "", $5630030f, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $060018)
end% = Create("Button", %hwnd, "Ende", 896, 720, 96, 24)
button2% = Create("Button", %hwnd, "Bild laden", 8, 720, 96, 24)
ENDPROC
Proc MainLoop
User Messages 16
ShowWindow(%hwnd, 1)
While 1
GetMessage
WaitInput
Case %umessage = 16 : BREAK
If Clicked(end%)
End
ElseIf Clicked(button2%)
LoadDesign
Showdesign OriginalBMp&, StaticFrame&, 0, 0, 0
ElseIf Clicked(StaticFrame&)
message$ = Hex$(%message)
mwnd$ = Hex$(%mwnd)
wParam$ = Hex$(&wparam)
lParam$ = Hex$(&lparam)
$D "StaticFrame klicked GetMessage", Message$, mwnd$, wParam$, lParam$
Showdesign OriginalBMp&, StaticFrame&, 0, 0, 0
EndIf
EndWhile
ENDPROC
Proc Main
CreateElements
MainLoop
ENDPROC
Main
|
| | | | |
| |  Matthias Arlt | here should You fündig go: [...] 
Greeting Matthias |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 05/13/19 ▲ |
| |
| |  Rainer Hoefs | Hello Matthias,
thankyou.
the must I first time sacken let.
have now at first speedy Durchlesen not so really what found, I with my trouble assoziieren could.
could You me there yet a further hint give?
Greeting Rainer |
| | | | |
| |  Matthias Arlt | Hello Rainer,
there find You hold The complete API-reference for the ScrollBar-Control. One lever becomes to that inquire and steer the ScrollBar not needed. there The ScrollBar always with a anderem Control or. Window assoziiert is, is which lever in link with the suitable Flag (z.B. SB_HORZ, SB_VERT, SB_BOTH) To use.
On The speedy time another example to that de/enable of/ one ScrollBar:
external("USER32","EnableScrollBar",StaticFrame&,~SB_HORZ,~ESB_DISABLE_BOTH) SB_HORZ = 0 (concerns The horizontale ScrollBar) ESB_DISABLE_BOTH = 3 (deaktiviert both Pfeiltasten) ESB_ENABLE_BOTH = 0 (activate both Pfeiltasten again)
Greeting Matthias |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 05/14/19 ▲ |
| |
| |  Rainer Hoefs | thanks you, then must I there something try. Rainer |
| | | | |
| |  Georg Teles | have time hinbekommen, both beam manually values zuzuweisen ... this is utterly umständlich with GetScrollInfo and SetScrollinfo, but It's all right.
though are my beam ditto deaktiviert, first if I The the Mainwindow building, then are The active. Why the lying, no idea...
one can still with the mitgelieferten VScroll / HScroll works, here have I an example (The Designs have I rausgelöscht, there the image Yes on Static is / for Umrandung must one only the Static-lever adjust)
' code created with F.Abbing's LemonViD Version 1.0.0.3 on the 11.05.2019 circa 08:35 watch,
' donate-Button, as well as further Freeware-Tools for XProfan on https://frabbing.net
' Technischer Support on ./../../sys/?nohdr=1&u=www.paules-pc-forum.de/forum/XProfan and https://purebasic.fr/German
' --------------------------------------------------------------------------------------------------
Declare nurso%, end%, button2%, StaticFrame&, OriginalBMP$, OriginalBMp&, OriginalBMPWidth%, OriginalBMPHeight%, \
Style%, Message$, mwnd$, wParam$, lParam$
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def SendBMP2Static(2) SendMessage(&(1),$172,0,&(2))
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Set("Truecolor", 1)
Set("Autopaint", 1)
' additional VARs -----------#
DECLARE uStatic&, Static&, hsv&, hsh&
' ----------------------------#
Proc ShowDesign
Parameters Design&, Target&, X%, Y%, fashion%
If Design&
'StartPaint Target&
'DrawPic Design&, X%, Y%; fashion%
'EndPaint
' BILD on STATIC Send ------#
SendMessage(target&,$172,0,Design&)
Else
MessageBox("No BMP loaded!", "Error!",64)
EndIf
ENDPROC
Proc LoadDesign
Parameters target&
OriginalBMP$ = loadfile$("Bitte Image or HTML-File wählen","c:\css\pictures\*.bmp")
If OriginalBMP$ <> ""
OriginalBMp& = Create("HPIC", -1, OriginalBMP$)
OriginalBMPWidth% = %bmpx
OriginalBMPHeight% = %bmpy
' BILD on STATIC Send ------#
SendMessage(target&,$172,0,OriginalBMp&)
' SetWindowPos Static& = 0, 0 - OriginalBMPWidth%, OriginalBMPHeight%;0 'not necessary, there vorangehende Message The Static& automatically on The Size anpasst
SetScrollRange hsh&,0,OriginalBMPWidth%-964
SetScrollRange hsv&,0,OriginalBMPHeight%-684
SetScrollPos hsh&,0
SetScrollPos hsv&,0
' ----------------------------#
Else
MessageBox("Design loading aborted!","Design laden",64)
EndIf
ENDPROC
Proc CreateElements
Window Style 26 | 512 | 2048
Window Title "Arbeitsfenster"
Window 426, 120 - 1009, 782
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
' additional FOBKEJTE -------#
hsh& = Create("HScroll",%hwnd,"",8,692,964,20)
hsv& = Create("VScroll",%hwnd,"",972,8,20,684)
uStatic& = Control("Static", "", $54000000, 8, 8, 964, 684, %hwnd, 2000, %hinstance, $0)' UnterSTATIC
Static& = Control("Static", "", $5400010E, 0, 0, 0, 0, uStatic&, 2000, %hinstance, $0)' eigentliche Static with images
' ----------------------------#
'StaticFrame& = Control("Static", "", $5630030f, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $060018)
end% = Create("Button", %hwnd, "Ende", 896, 720, 96, 24)
button2% = Create("Button", %hwnd, "Bild laden", 8, 720, 96, 24)
ENDPROC
Proc MainLoop
User Messages 16
ShowWindow(%hwnd, 1)
While 1
GetMessage
WaitInput
Case %umessage = 16 : BREAK
If Clicked(end%)
End
ElseIf Clicked(button2%)
LoadDesign(Static&)
ElseIf Clicked(StaticFrame&)
' message$ = Hex$(%message)
' mwnd$ = Hex$(%mwnd)
' wParam$ = Hex$(&wparam)
' lParam$ = Hex$(&lparam)
' $D "StaticFrame klicked GetMessage", Message$, mwnd$, wParam$, lParam$
' Showdesign OriginalBMp&, StaticFrame&, 0, 0, 0
EndIf
' SCROLL reaktionen / Image scroll
If GetFocus(hsh&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
If GetFocus(hsv&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
EndWhile
ENDPROC
Proc Main
CreateElements
MainLoop
ENDPROC
Main
Regards |
| | | | |
| |  Rainer Hoefs | Hello and a large THANK YOU!
this is the I wished.
Rainer |
| | | | |
| |  Georg Teles | so it something liquid runs, here the example with of/ one CallBack function
$H windows.ph
$H Messages.ph
' code created with F.Abbing's LemonViD Version 1.0.0.3 on the 11.05.2019 circa 08:35 watch,
' donate-Button, as well as further Freeware-Tools for XProfan on https://frabbing.net
' Technischer Support on ./../../sys/?nohdr=1&u=www.paules-pc-forum.de/forum/XProfan and https://purebasic.fr/German
' --------------------------------------------------------------------------------------------------
Declare nurso%, end%, button2%, StaticFrame&, OriginalBMP$, OriginalBMp&, OriginalBMPWidth%, OriginalBMPHeight%, \
Style%, Message$, mwnd$, wParam$, lParam$
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def SendBMP2Static(2) SendMessage(&(1),$172,0,&(2))
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Set("Truecolor", 1)
Set("Autopaint", 1)
' additional DEFs ---------- #
Def CommDlgExtendedError(0)!"ComDlg32.Dll","CommDlgExtendedError"
Def GetOpenFileName(1)!"ComDlg32.Dll","GetOpenFileNameA"
' advanced Handling deakt. #
Set("FastMode", 1)
' additional VARs -----------#
DECLARE uStatic&, Static&, hsv&, hsh&, OldWndProc&, Api#
' ----------------------------#
Proc ShowDesign
Parameters Design&, Target&, X%, Y%, fashion%
If Design&
'StartPaint Target&
'DrawPic Design&, X%, Y%; fashion%
'EndPaint
' BILD on STATIC Send ------#
SendMessage(target&,$172,0,Design&)
Else
MessageBox("No BMP loaded!", "Error!",64)
EndIf
ENDPROC
Proc LoadDesign
Parameters target&
OriginalBMP$ = loadfile_api("Bitte Image or HTML-File wählen","Alle Files (*.*)|*.*","c:\css\pictures\*.bmp")'loadfile$("Bitte Image or HTML-File wählen","c:\css\pictures\*.bmp")
If OriginalBMP$ <> ""
OriginalBMp& = Create("HPIC", -1, OriginalBMP$)
OriginalBMPWidth% = %bmpx
OriginalBMPHeight% = %bmpy
' BILD on STATIC Send ------#
SendMessage(target&,$172,0,OriginalBMp&)
' SetWindowPos Static& = 0, 0 - OriginalBMPWidth%, OriginalBMPHeight%;0 'not necessary, there vorangehende Message The Static& automatically on The Size anpasst
SetScrollRange hsh&,0,OriginalBMPWidth%-964
SetScrollRange hsv&,0,OriginalBMPHeight%-684
SetScrollPos hsh&,0
SetScrollPos hsv&,0
' ----------------------------#
Else
MessageBox("Design loading aborted!","Design laden",64)
EndIf
ENDPROC
Proc loadfile_api
Parameters tit$,mas$,LW$
Declare i%, Path$, File$
Dim Api#,8100
mas$ = Translate$(mas$,"|","\z")+"\z\z"
Clear Api#,Path$
Long Api#,0 = 76
Long Api#,4 = %HWnd
Long Api#,8 = %hInstance
Long Api#,12 = Addr(mas$)
Long Api#,16 = 0
Long Api#,20 = 0
Long Api#,24 = 0
long Api#,28 = Api#+100
long Api#,32 = 8000
long Api#,36 = 0
long Api#,40 = 0
long Api#,44 = Addr(LW$)
long Api#,48 = Addr(tit$)
long Api#,52 = $00081006
Word Api#,56 = 0
Word Api#,58 = 0
Long Api#,60 = 0
GetOpenFileName(Api#)
If CommDlgExtendedError()
Err$ = If(CommDlgExtendedError() = $3003,"Sie having To many Entries select !",stature$("'Fehlernummer : '###",CommDlgExtendedError()))
Messagebox(Err$,"Hinweis",48)
Else
i% = Long(Api#,56)-1
File$ = String $(Api#,100)
return File$
EndIf
DisPose Api#
ENDPROC
Proc CreateElements
Window Style 26 | 512 | 2048
Window Title "Arbeitsfenster"
Window 426, 120 - 1009, 782
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
' additional FOBKEJTE -------#
hsh& = Create("HScroll",%hwnd,"",8,692,964,20)
hsv& = Create("VScroll",%hwnd,"",972,8,20,684)
uStatic& = Control("Static", "", $54000000, 8, 8, 964, 684, %hwnd, 2000, %hinstance, $0)' UnterSTATIC
Static& = Control("Static", "", $5400010E, 0, 0, 0, 0, uStatic&, 2000, %hinstance, $0)' eigentliche Static with images
' ----------------------------#
'StaticFrame& = Control("Static", "", $5630030f, 8, 8, 984, 704, %hwnd, 2000, %hinstance, $060018)
end% = Create("Button", %hwnd, "Ende", 896, 720, 96, 24)
button2% = Create("Button", %hwnd, "Bild laden", 8, 720, 96, 24)
ENDPROC
Proc MainLoop
User Messages 16
ShowWindow(%hwnd, 1)
OldWndProc& = ~GetWindowLong(%hWnd, ~GWL_WNDPROC)
~SetWindowLong(%hWnd, ~GWL_WNDPROC, @ProcAddr("ChangeControl", 4))
While 1
WaitInput
Case %umessage = 16 : BREAK
If Clicked(end%)
End
ElseIf Clicked(button2%)
LoadDesign(Static&)
ElseIf Clicked(StaticFrame&)
' message$ = Hex$(%message)
' mwnd$ = Hex$(%mwnd)
' wParam$ = Hex$(&wparam)
' lParam$ = Hex$(&lparam)
' $D "StaticFrame klicked GetMessage", Message$, mwnd$, wParam$, lParam$
' Showdesign OriginalBMp&, StaticFrame&, 0, 0, 0
EndIf
EndWhile
~SetWindowLong(%hWnd, ~GWL_WNDPROC, OldWndProc&)
ENDPROC
Proc ChangeControl
Parameters hWnd&, Message&, wParam&, lParam&
' SCROLL reaktionen / Image scroll
If GetFocus(hsh&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
If GetFocus(hsv&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
Return ~CallWindowProc(OldWndProc&, hWnd&, Message&, wParam&, lParam&)
ENDPROC
Proc Main
CreateElements
MainLoop
ENDPROC
Main
Regards Georg |
| | | | |
| |  p.specht
 | Profan 11.2a free: Graues Image, no Buttons. selected Info, what there To Change is ... greeting |
| | | XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/20/19 ▲ |
| |
| |  Georg Teles | I have XProfan 11 Free probiert, by me functions it - the 2. code naturally not, there in 11 free The function ProcAddr not gives.

try time these Line in the procedure LoadDesign To enable, possible can it help
' SetWindowPos Static& = 0, 0 - OriginalBMPWidth%, OriginalBMPHeight%;0 'not necessary, there vorangehende Message The Static& automatically on The Size anpasst
Regards |
| | | | |
| |  p.specht
 | the alone is not. must well whom code first time accurate study... |
| | | XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/20/19 ▲ |
| |
| |  Georg Teles | there would another alternative, Franks Area [...] 
If one new Image loaded becomes, becomes the box through DestroyWindow removes, circa tappt im dunkeln with the new wide / Höhe To produce - one should The Size too so Change can, Have straight only no Time
' code created with F.Abbing's LemonViD Version 1.0.0.3 on the 11.05.2019 circa 08:35 watch,
' donate-Button, as well as further Freeware-Tools for XProfan on https://frabbing.net
' Technischer Support on ./../../sys/?nohdr=1&u=www.paules-pc-forum.de/forum/XProfan and https://purebasic.fr/German
' --------------------------------------------------------------------------------------------------
Declare nurso%, end%, button2%, StaticFrame&, OriginalBMP$, OriginalBMp&, OriginalBMPWidth%, OriginalBMPHeight%, \
Style%, Message$, mwnd$, wParam$, lParam$
Def GetStockObject(1) !"GDI32","GetStockObject"
Def GetSysColor(1) !"USER32","GetSysColor"
Def GetParent(1) !"USER32","GetParent"
Def SendBMP2Static(2) SendMessage(&(1),$172,0,&(2))
Def &COLOR_BTNFACE $F
Def &DEFAULT_GUI_FONT $11
Set("Truecolor", 1)
Set("Autopaint", 1)
$I an_area.inc = FA_
SubClassProc
FA_SubclassArea
ENDPROC
' additional VARs -----------#
DECLARE uStatic&, Static&, hsv&, hsh&
' ----------------------------#
Proc LoadDesign
Parameters target&
OriginalBMP$ = loadfile$("Bitte Image or HTML-File wählen","c:\css\pictures\*.bmp")
If OriginalBMP$ <> ""
OriginalBMp& = Create("HPIC", -1, OriginalBMP$)
OriginalBMPWidth% = %bmpx
OriginalBMPHeight% = %bmpy
' BILD on STATIC Send ------#
SubClass uStatic&, 0
DestroyWindow(uStatic&)
uStatic& = FA_CreateArea(OriginalBMPWidth%+17,OriginalBMPHeight%+17,$0,$50300000,8,8,990,690,%hwnd)
SubClass uStatic&, 1
Static& = Control("Static", "", $5400010E, 0, 0, 0, 0, uStatic&, 2000, %hinstance, $0)' eigentliche Static with images
SendMessage(Static&,$172,0,OriginalBMp&)
' ----------------------------#
Else
MessageBox("Design loading aborted!","Design laden",64)
EndIf
ENDPROC
Proc CreateElements
Window Style 26 | 512 | 2048
'Window Title "Arbeitsfenster"
Window 426, 120 - 1009, 782
Cls GetSysColor(&COLOR_BTNFACE)
SetDialogFont GetStockObject(&DEFAULT_GUI_FONT)
' additional FOBKEJTE -------#
uStatic& = FA_CreateArea(3200,1247,$0,$50300000,8,8,990,690,%hwnd)
SubClass uStatic&, 1
Static& = Control("Static", "", $5400010E, 0, 0, 0, 0, uStatic&, 2000, %hinstance, $0)' eigentliche Static with images
' ----------------------------#
end% = Create("Button", %hwnd, "Ende", 896, 720, 96, 24)
button2% = Create("Button", %hwnd, "Bild laden", 8, 720, 96, 24)
ENDPROC
Proc MainLoop
User Messages 16
ShowWindow(%hwnd, 1)
While 1
GetMessage
WaitInput
Case %umessage = 16 : BREAK
If Clicked(end%)
End
ElseIf Clicked(button2%)
LoadDesign(Static&)
ElseIf Clicked(StaticFrame&)
' message$ = Hex$(%message)
' mwnd$ = Hex$(%mwnd)
' wParam$ = Hex$(&wparam)
' lParam$ = Hex$(&lparam)
' $D "StaticFrame klicked GetMessage", Message$, mwnd$, wParam$, lParam$
' Showdesign OriginalBMp&, StaticFrame&, 0, 0, 0
EndIf
' SCROLL reaktionen / Image scroll
If GetFocus(hsh&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
If GetFocus(hsv&)
SetWindowPos Static& = (-GetScrollPos(hsh&)), (-GetScrollPos(hsv&))
EndIf
EndWhile
SubClass uStatic&, 0
ENDPROC
Proc Main
CreateElements
MainLoop
ENDPROC
Main
The Inc have I time settled
Regards Georg |
 | | | | |
|
AnswerThemeninformationenthis Topic has 4 subscriber: |