SKControl.DLL | | | | Manfred Barei | Hello Sebastian,
have You times for this commands one kurzes example, come lest kanz glar. SKCtrl_CreateHvrImageButtonEx(hwnd, img, s, ico, hndl, offx, offy, w, h, x, y, sx, sy, hInst)
Grus |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 11/11/07 ▲ |
| |
| | Sebastian König | Hello Manfred,
The function can You moreover using, circa only a designed part of/ one Bitmap (position offx,offy, Size w * h) as graphic To using. to that example uses CompileMarkSeparationSKCtrl_CreateHvrImageButtonEx(%hwnd,multi.bmp,Test,0,0,32,0,32,32,200,510,150,50,%hInstance) > the area number 2 from the File in the attachment.
HTH
Sebastian |
| | | Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 11/12/07 ▲ |
| |
| | Manfred Barei | Hello Sebastian,
mmmm, this is Behavior when custom. How can I with diser function a Button with of/ one BMP a DLL occupy.
string string#,0=SKHVRIMAGEBUTTON string skimage#,0 =EROGRAMMEXPROFAN10LIBSKBILD2.BMP SKHVRIMAGEBUTTON1&=SKCTRL_CREATEHVRIMAGEBUTTON(%HWND,skimage#,string#,0,0,0172,0246,0150,0030,%hInstance)
Grus Manfred |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 11/18/07 ▲ |
| |
| | Sebastian König | Hello Manfred,
for a Image of/ one DLL To using, must You you first of all a handle hereon procure. ex XProfan 9 (or 10, be me straight not sure) does it simply with Create(hPic,...) - with older versions must You The API LoadImage() using (for there sure here in the Community some Examples).
the lever becomes then simply on place the Dateinamens (in Your example skimage#) transfer. Also must the fifth Parameter of SKCtrl_CreateHvrImageButton() on 1 staid to be view, that it itself with the graphic for a lever deals.
MfG
Sebastian |
| | | Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 11/19/07 ▲ |
| |
| | Manfred Barei | Hello Sebastian,
get it simply not there What do I do wrong? here one kurzes example How I it make wished, CompileMarkSeparation $P+
SET(ERRORLEVEL,0)
DEF GETSYSCOLOR(1) !USER32,GetSysColor
DEF GETWINDOW(2) !USER32,GetWindow
DECLARE SKCONTROL&,STRING#,SKIMAGE#,SKIMAGE2#,SKIMAGE3#,FONT&
DECLARE GW_CHILD&
Declare DemoDll&,DLLPic&
GW_CHILD& = 5
$I E:PROGRAMMEXPROFAN10LIBSKCONTROL.INC (Für SKCONTROL.DLL)
DemoDll&=@USEDLL(DEMO.DLL)
SKCONTROL&=USEDLL(E:PROGRAMMEXPROFAN10LIBSKCONTROL.DLL)
SKCTRL_INITDLL()
DIM STRING#,500
DIM SKIMAGE#,500
DIM SKIMAGE2#,500
DIM SKIMAGE3#,500
FONT&=CREATE(FONT,MS SANS SERIF,13,0,0,0,0)
DECLARE SKCLRHVRIMAGEBUTTON1&
DECLARE BUTTON1&
WINDOWSTYLE 63
WINDOWTITLE BMP aus DLL
WINDOW 604,302-279,189
SET(TRUECOLOR,1)
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT MS Sans Serif,13,0,0,0,0
SETDIALOGFONT 1
Hier kann ggf. Ihr Menü hin
DLLPic&=@Create(hPic,DemoDll&,UNFALL1)
string string#,0=
string skimage#,0 =DLLPic&
SKCLRHVRIMAGEBUTTON1&=SKCTRL_CREATECLRHVRIMAGEBUTTON(%HWND,skimage#,string#,0,1,RGB(0,255,255),RGB(0,64,128),0052,0045,0033,0033,%hInstance)
SETFONT SKCLRHVRIMAGEBUTTON1&,FONT&
SKCTRL_SETCOLOR(SKCLRHVRIMAGEBUTTON1&,1,RGB(0,0,160))
SKCTRL_SETCOLOR(SKCLRHVRIMAGEBUTTON1&,2,GETSYSCOLOR(15))
BUTTON1& = CREATE(BUTTON,%HWND,Ende,0095,0110,0070,0030)
SETFOCUS(%HWND)
REPAINT
WHILENOT ENDE%
WAITINPUT
If %KEY=2
ENDE%= 1
ELSEIF %KEY=4
ELSEIF GETFOCUS(SKCLRHVRIMAGEBUTTON1&) SKCLRHVRIMAGEBUTTON
ELSEIF GETFOCUS(BUTTON1&) BUTTON
ENDE%= 1
ENDIF
ENDWHILE
DISPOSE STRING#
DISPOSE SKIMAGE#
DISPOSE SKIMAGE2#
DISPOSE SKIMAGE3#
SKCTRL_DEINITDLL()
FREEDLL SKCONTROL&
FREEDLL DemoDll&
DELETEOBJECT DLLPic&
DELETEOBJECT FONT&
The DLL slopes I the Posting on.
grus Manfred |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 12/01/07 ▲ |
| |
| | | @Manfred I make it always of these code CompileMarkSeparationDEF LoadImage(6) ! USER32,LoadImageA
DECLARE eigen_dll&
eigen_dll&=UseDLL(shell32.dll) Kann jede DLL benutzt werden
------------------------------------------------------------------------
proc showbutton damit das Icon auch immer wieder angezeigt wird, ohne diese Proc wird es in der Exe nicht mehr angezeigt
parameters hdl& handle des Static controls
showwindow(hdl&,0)
showwindow(hdl&,1)
endproc
Parameter: Fenster, oder Dialoghandle, Buttontext, handle der iconresource, Iconname, x%,y%,w%,h%, ButtonID, Text Links, rechts oder Zentiert
subproc Create.ITextbutton
Parameters hwnd&,text$,source&,image$,x%,y%,w%,h%,id&,dct$
declare button&,st&,Imh&,hpos&,hwid&
Imh& = LoadImage(source&,addr(Image$),$1,20,20,$0) Icongröße = 20 x 20
if dct$ = upper$(R)
button& = Control(BUTTON,text$,$54010200,x%,y%,w%,h%,hwnd&,id&,eigen_dll&,$0100)
elseif dct$ = upper$(L)
button& = Control(BUTTON,text$,$54010100,x%,y%,w%,h%,hwnd&,id&,eigen_dll&,$0100)
elseif dct$ = upper$(C)
button& = Control(BUTTON,text$,$54010000,x%,y%,w%,h%,hwnd&,id&,eigen_dll&,$0100)
endif
hpos& = height(button&) - 20
hpos& = int(hpos&/2)
hwid& = width(button&) -23 3 pixel vom Rand weg + Icongröße
if (dct$ = upper$(R)) or (dct$ = upper$(C))
st& = control(Static,,$50000003,3,hpos&,20,20,button&,0,%Hinstance)
else
st& = control(Static,,$50000003,hwid&,hpos&,20,20,button&,0,%Hinstance)
endif
Sendmessage(st&,$170,Imh&,0)
showbutton(st&)
return str$(button&) + | + str$(st&)
endproc
############################################################
DECLARE hlp$,hlp%,tip%,font0%
Jeder Button braucht zwei Variablen - eine String- und eine Integer-Variable
DECLARE win1&,but1$,but1%
font0%=CREATE(FONT,ARIAL,16,6,0,0,0)
CLS
--------------------------------------------------------------------
hlp$ = create(ITextbutton,%hwnd,F1 Hilfe ,eigen_dll&,#24, 5,3,80,25,10,R)
Vorletzter Parameter ID-Nr(für jeden Button ändern) - Letzter Parameter R=rechts, L=links,C=mittig
hlp% = val(substr$(hlp$,1,|))
SetFont hlp%,font0%
tip%=CREATE(TOOLTIP,%HWnd,hlp%, Den Hilfetext anzeigen...)
---------------------------------------------------------------------
win1&=CREATE(DIALOG,%HWnd,Dialog,50,150,200,200) das geht auch auf Dialog-Fenstern
but1$ = create(ITextbutton,win1&,&Laden ,eigen_dll&,#5, 5,3,80,25,20,R) ID-Nr ändern
but1% = val(substr$(but1$,1,|))
SetFont but1%,font0%
tip%=CREATE(TOOLTIP,%HWnd,but1%, Datei laden...)
---------------------------------------------------------------------
WAITIN >
END
plenty success ! |
| | | | |
| | Sebastian König | Manfred Barei
get it simply not there What do I do wrong? here one kurzes example How I it make wished, (...)
The Error lying into subesquent Lines: CompileMarkSeparationstring skimage#,0 =DLLPic&
SKCLRHVRIMAGEBUTTON1&=SKCTRL_CREATECLRHVRIMAGEBUTTON(%HWND,skimage#,string#,0,1,RGB(0,255,255),RGB(0,64,128),0052,0045,0033,0033,%hInstance)e> If instead of one Dateinamens a handle using go should, so is this not The Memory-Variable To write, separate directly To transfer. correctly. would therefore this appeal: CompileMarkSeparationSKCLRHVRIMAGEBUTTON1&=SKCTRL_CREATECLRHVRIMAGEBUTTON(%HWND,DLLPic&,string#,0,1,RGB(0,255,255),RGB(0,64,128),0052,0045,0033,0033,%hInstance) > HTH
Sebastian |
| | | Windows XP, XProfan/Profan² 4.5 bis 11 Profan2Cpp-Homepage: [...] Alte Profan²-Seite: [...] | 12/02/07 ▲ |
| |
| | Manfred Barei | Hi,
what Have I do not already everything probiert, but that not.
thanks, now working it.
Grus |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 12/05/07 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |