Source / code snippets | | | | - Page 1 - |
| Pedro Santos | Hello Roland
becomes it in XProfan10 with Loadfile the bmps Preview thereby his?
greeting
Pedro |
| | | | |
| | « this Posting watts as Solution marked. » | | Jörg Sellmeyer | Repariert...
window 10,10-700,500
$H Messages.ph
$H windows.ph
proc OpenFileHook'-------------------------------OpenFileHook----------------------------
parameters dlg&,msg&,wparam&,lparam&
case status%:return 1'-----view must only once adjusted go
casenot msg&=~WM_NOTIFY:return 1
if long(lparam&,8)=-603'---with Init existieren DefView and LV not yet!
status%=1
DefView&=~FindWindowEx(~GetParent(dlg&),0,"SHELLDLL_DefView","")
sendmessage(DefView&,~WM_COMMAND,$702D,0)'--Undokumentierte Message
endif
return 1
endproc---------------------------------------------------------------------------------
proc LoadPicDialog'------------------------------LoadPicDialog---------------------------
parameters way$,cover$,name$
declare ofn#,Result$,Result&
declare DefView&,status%'------variables for Hook
name$=name$+"\z*.bmp;*.jpe;*.jpeg;*.jpg;*.gifzz"'--filter (with want adjust)
dim ofn#,88+256'---------------structure (Win2000/NT/XP) + Puffer
clear ofn#
long ofn#,0=88'----------------Size structure for GetOpenFileName (76 for Win9x)
long ofn#,4=%hwnd'-------------übergeordnetes Window
long ofn#,12=addr(name$)'------filter/type
long ofn#,28=ofn#+88'----------Beginn Puffer
long ofn#,32=255'--------------Puffergrösse
long ofn#,44=addr(way$)'------Anfangspfad
long ofn#,48=addr(cover$)'-----cover
long ofn#,52=$880024'----------? Happen?
long ofn#,68=procaddr(OpenFileHook,4)
Result&=external("COMDLG32","GetOpenFileNameA",ofn#)
Result$=string $(ofn#,88)
casenot Result&:Result$=\
procaddr("OpenFileHook",-4)
dispose ofn#
return Result$
endproc'---------------------------------------------------------------------------------
print LoadPicDialog("","Bitte Image wählen","Bild")
waitkey
|
| | | | | |
| | Pedro Santos | Hello
I question simply again.????
thanks
greeting
Pedro |
| | | | |
| | | Hm What is herewith? [...] |
| | | | |
| | | for the Schönmachen are but You zuständig.
here I habs time zusammengeballert there ichs too interestingly found: CompileMarkSeparation {$cleq}
seterrorlevel -1
set(Fastmode,1)
Def GetOpenFileName(1) ! COMDLG32, GetOpenFileNameA
Def CommDlgExtendedError(0) ! COMDLG32, CommDlgExtendedError
Def Mm(3) !KERNEL32, RtlMoveMemory
declare h&,dc&,xx&,yy&,bwidth&,__mem#,preview.lastImg$
dim __mem#,12//(long)hwnd, id, code
clear __mem#
bwidth&=external(USER32,GetSystemMetrics,7)// borderwidth
print Multiloadfile()
dispose __mem#
waitkey
end
proc hook
parameters _hWnd&,_Msg&,_wparam&,_lparam&
if _msg&==272//init
h&=external(USER32,GetParent,_hWnd&)
dc&=external(USER32,GetDC,h&)
xx&=width(h&)
yy&=height(h&)
external(USER32,SetWindowPos,h&,0,0,0,xx&+bwidth&+220,yy&+bwidth&,20)
_wparam&=createblackframe(h&,,xx&+10,0,1,yy&)
elseif _msg&==2//kill
elseif _msg&==78//notify -602
declare l&
l&=addr(__mem#)
mm(l&,_lparam&,12)
if long(__mem#,8)==-602
preview getfname(1125,h&)
endif
endif
return _msg&
endproc
proc preview
parameters fle$
case instr(*,fle$) : return
if fileexists(fle$)
fle$=lower$(fle$)
if right$(fle$,4)==.bmp
if (preview.lastImg$<>fle$)
preview.lastImg$=fle$
startpaint h&
loadsizedbmp fle$,xx&+20,5 - 190,(yy&-15-%cycaption);0
endpaint
endif
endif
settext h&,Öffnen von q+fle$+q
elseif direxists(fle$)
settext h&,Öffnen von q+fle$+q
endif
endproc
proc getfname
parameters msg&,h&
declare s$
s$=space$(260)
sendmessage(h&,msg&,260,addr(s$))
return trim$(s$)
endproc
Proc Multiloadfile
Parameters title$,fmask$,drive$
Declare mem#,fle$
Dim mem#,8100
fmask$=Bitmap-Dateien (*.bmp)z*.bmpzz
Clear mem#
Long mem#,0=76
Long mem#,4=Getactivewindow()
Long mem#,8=%Hinstance
Long mem#,12=Addr(fmask$)
Long mem#,28=mem#+100
Long mem#,32=8000
Long mem#,44=Addr(drive$)
Long mem#,48=Addr(title$)
Long mem#,52=( 4 | 2 | 32 | 524288 )
Long mem#,68=procaddr(hook,4)
Getopenfilename(mem#)
if Commdlgextendederror()
Dispose mem#
return 0
endif
fle$=String$(mem#,100)
Dispose mem#
Return fle$
Endproc
If you BMP then still not reicht then is it simply with the new GDI-Unit others Image formats To support. |
| | | | |
| | | Have whom code strain again vereinfacht... |
| | | | |
| | | here a Variant for any Image formats through GDI-Unit. CompileMarkSeparation {$cleq}
$I gdi.inc
seterrorlevel -1
set(Fastmode,1)
Def GetOpenFileName(1) ! COMDLG32, GetOpenFileNameA
Def CommDlgExtendedError(0) ! COMDLG32, CommDlgExtendedError
Def Mm(3) !KERNEL32, RtlMoveMemory
declare h&,dc&,xx&,yy&,bwidth&,__mem#,preview.lastImg$
declare gdiLoadableExtensions$
gdiLoadableExtensions$:=.bmp.dib.rle.jpg.jpeg.jpe.jfif.exif.gif.png.tiff.tif.wmf.emf.ico.
dim __mem#,12//(long)hwnd, id, code
clear __mem#
cls
bwidth&:=external(USER32,GetSystemMetrics,7)// borderwidth
gdi.init
print Multiloadfile()
gdi.kill
dispose __mem#
waitkey
end
proc hook
parameters _hWnd&,_Msg&,_wparam&,_lparam&
if _msg&==272//init
h&:=external(USER32,GetParent,_hWnd&)
dc&:=external(USER32,GetDC,h&)
xx&:=width(h&)
yy&:=height(h&)
external(USER32,SetWindowPos,h&,0,0,0,xx&+bwidth&+220,yy&+bwidth&,20)
_wparam&:=createblackframe(h&,,xx&+10,0,1,yy&)
elseif _msg&==2//kill
elseif _msg&==78//notify -602
declare l&
l&:=addr(__mem#)
mm(l&,_lparam&,12)
if long(__mem#,8)==-602
preview getfname(1125,h&)
endif
endif
return _msg&
endproc
proc preview
parameters fle$
case instr(*,fle$) : return
if fileexists(fle$)
fle$:=lower$(fle$)
if instr(.+right$(fle$,3)+.,gdiLoadableExtensions$)
if (preview.lastImg$<>fle$)
preview.lastImg$:=fle$
declare pic&
pic&:=gdi.loadimage(fle$)
preview.bg
gdi.startpaint dc&
gdi.drawsizedimage pic&,xx&+21,6,188,(yy&-17-%cycaption)
gdi.endpaint
gdi.deleteimage pic&
endif
endif
settext h&,Öffnen von q+fle$+q
elseif direxists(fle$)
settext h&,Öffnen von q+fle$+q
endif
endproc
proc preview.bg
startpaint h&
usepen 0,0,0
usebrush 1,$00FFFFFF
rectangle xx&+20,5 - xx&+210,yy&-10-%cycaption
endpaint
endproc
proc getfname
parameters msg&,h&
declare s$
s$:=space$(260)
sendmessage(h&,msg&,260,addr(s$))
return trim$(s$)
endproc
Proc Multiloadfile
Parameters title$,fmask$,drive$
Declare mem#,fle$
Dim mem#,8100
fmask$=Bild-Dateien (*+translate$(.+trim$(translate$(gdiLoadableExtensions$,., )), ,;*.)+)z*+translate$(.+trim$(translate$(gdiLoadableExtensions$,., )), ,;*.)+zz
Clear mem#
Long mem#,0=76
Long mem#,4=Getactivewindow()
Long mem#,8=%Hinstance
Long mem#,12=Addr(fmask$)
Long mem#,28=mem#+100
Long mem#,32=8000
Long mem#,44=Addr(drive$)
Long mem#,48=Addr(title$)
Long mem#,52=( 4 | 2 | 32 | 524288 )
Long mem#,68=procaddr(hook,4)
Getopenfilename(mem#)
if Commdlgextendederror()
Dispose mem#
return 0
endif
fle$=String$(mem#,100)
Dispose mem#
./../function-references/XProfan/return/'>Return fle$
Endproc
|
| | | | |
| | RGH | ... and who it integrally without program having would like, dial in the integrally normalemn Loadfile$-dialog The Miniaturansicht* and beautiful go any of Create(hPic,...) supported Formate as Vorschaubild displayed. the goes at least under windows 2000 and XP.
* in the dialog supra right the Icon You can and the suitable view select. the functions unfortunately not Win98 or Win95. How it under WinME looks, white I do not, I it never using have.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 04/20/06 ▲ |
| |
| | | Hello Roland >>* in the dialog supra right the Icon You can and the suitable view select. the functions unfortunately not Win98 or Win95. How it under WinME looks, white I do not, I it never using have. <<
can you calm: under ...ME works it too |
| | | | |
| | RGH | Horst horn
can you calm: under ...ME works it too
OK, then was Bill Gates means so kind, the trouble for us To solve what about me must me in this thing not further bemühen.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 04/22/06 ▲ |
| |
| | | Uwe Pascal Niemeier
Hello people! since Win2000 watts The OpenFileName-structure circa 3 optionale Parameter complement (see MSDN). becomes The Size the structure properly extended (The three LongInts end must zero his) ought to it klappen. here a demonstration, circa a dialog by Hook in the Miniatur-view to open (order Image-selection): window 10,10-700,500
$H Messages.ph
$H windows.ph
proc OpenFileHook-------------------------------OpenFileHook----------------------------
parameters dlg&,msg&,wparam&,lparam&
case status%:return 1-----view must only once adjusted go
casenot msg&=~WM_NOTIFY:return 1
if long(lparam&,8)=-603---with Init existieren DefView and LV yet not!
status%=1
DefView&=~FindWindowEx(~GetParent(dlg&),0,SHELLDLL_DefView,)
sendmessage(DefView&,~WM_COMMAND,$702D,0)--Undokumentierte Message
endif
return 1
endproc---------------------------------------------------------------------------------
proc LoadPicDialog------------------------------LoadPicDialog---------------------------
parameters way$,cover$,name$
declare ofn#,Result$,Result&
declare DefView&,status%------variables for Hook
name$=name$+z*.bmp;*.jpe;*.jpeg;*.jpg;*.gifzz--filter (with want adjust)
dim ofn#,88+256---------------structure (Win2000/NT/XP) + Puffer
clear ofn#
long ofn#,0=88----------------Size structure for GetOpenFileName (76 for Win9x)
long ofn#,4=%hwnd-------------übergeordnetes Window
long ofn#,12=addr(name$)------filter/type
long ofn#,28=ofn#+88----------Beginn Puffer
long ofn#,32=255--------------Puffergrösse
long ofn#,44=addr(way$)------Anfangspfad
long ofn#,48=addr(cover$)-----cover
long ofn#,52=$880024----------? Happen?
long ofn#,68=procaddr(OpenFileHook,4)
Result&=external(COMDLG32,GetOpenFileNameA,ofn#)
Result$=string $(ofn#,88)
casenot Result&:Result$=
procaddr(OpenFileHook,-4)
dispose ofn#
return Result$
endproc'---------------------------------------------------------------------------------
print LoadPicDialog(,Please Image dial,Image)
waitkey
HTH Pascal |
| | | | |
| | Jörg Sellmeyer | Repariert...
window 10,10-700,500
$H Messages.ph
$H windows.ph
proc OpenFileHook'-------------------------------OpenFileHook----------------------------
parameters dlg&,msg&,wparam&,lparam&
case status%:return 1'-----view must only once adjusted go
casenot msg&=~WM_NOTIFY:return 1
if long(lparam&,8)=-603'---with Init existieren DefView and LV not yet!
status%=1
DefView&=~FindWindowEx(~GetParent(dlg&),0,"SHELLDLL_DefView","")
sendmessage(DefView&,~WM_COMMAND,$702D,0)'--Undokumentierte Message
endif
return 1
endproc---------------------------------------------------------------------------------
proc LoadPicDialog'------------------------------LoadPicDialog---------------------------
parameters way$,cover$,name$
declare ofn#,Result$,Result&
declare DefView&,status%'------variables for Hook
name$=name$+"\z*.bmp;*.jpe;*.jpeg;*.jpg;*.gifzz"'--filter (with want adjust)
dim ofn#,88+256'---------------structure (Win2000/NT/XP) + Puffer
clear ofn#
long ofn#,0=88'----------------Size structure for GetOpenFileName (76 for Win9x)
long ofn#,4=%hwnd'-------------übergeordnetes Window
long ofn#,12=addr(name$)'------filter/type
long ofn#,28=ofn#+88'----------Beginn Puffer
long ofn#,32=255'--------------Puffergrösse
long ofn#,44=addr(way$)'------Anfangspfad
long ofn#,48=addr(cover$)'-----cover
long ofn#,52=$880024'----------? Happen?
long ofn#,68=procaddr(OpenFileHook,4)
Result&=external("COMDLG32","GetOpenFileNameA",ofn#)
Result$=string $(ofn#,88)
casenot Result&:Result$=\
procaddr("OpenFileHook",-4)
dispose ofn#
return Result$
endproc'---------------------------------------------------------------------------------
print LoadPicDialog("","Bitte Image wählen","Bild")
waitkey
|
| | | | |
|
Zum QuelltextTopic-Options | 14.291 Views |
Themeninformationenthis Topic has 5 subscriber: |