English
Forum

LoadFile in wproc case

 
not-XPSE:
DECLARE __cf1&,__cf2&
Def __cf1(2) !KERNEL32,GetProcAddress
Def __cf2(1) !KERNEL32,GetModuleHandleA
__cf1&=__cf1(__cf2(user32.dll),SetWindowLongA)
__cf2&=__cf1(__cf2(user32.dll),CallWindowProcA)
 $DEFINE XPSE
CLS
VAR _OWP&=call(__cf1&,%HWND,-4,PROCADDR(WPROC,4))
PRINT LOADFILE$(,)
WAITINPUT
END

proc WPROC

    PARAMETERS WND&, MSG&, WPARAM&, LPARAM&
    call(__cf2&,_OWP&,WND&, MSG&, WPARAM&, LPARAM&)

endproc


cls
var _owp&:=setwindowlong(hwnd,gwl_wndproc,procaddr(wproc,4))
print loadfile$(,)
waitinput
end

proc wproc(Wnd&, Msg&, Wparam&, Lparam&)

    callwindowproc(_owp&,Wnd&, Msg&, Wparam&, Lparam&)

endproc


The Source shows (faith is one altes trouble!) the LoadFile$ not whom desired worth zurückgibt.

i will not on the trouble rumhacken but it simply over again address. i think with ChooseDir behave it itself similar.
 
10/23/06  
 




RGH
If one in that Profan-interne Messagehandlich eingreift, about by the Fastmode or through one Umbiegens the windows-Procedures, must one not wonder, if The vordefinierten dialogs not any more How desired functions, there tappt im dunkeln the Profan-interne Messagehandling dependent are.

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
10/23/06  
 




RGH
If one itself but tzrotzdem the write eigener dialogs save wants, can Yes to the appeal of LoadFile$ The ursprüngliche windows-procedure (finds itself exakt To this object in &WinProc) bring into action and directly thereafter again on The Own switch, about so:
DECLARE __cf1&, __cf2&, MyWProc&
Def __cf1(2) !KERNEL32,GetProcAddress
Def __cf2(1) !KERNEL32,GetModuleHandleA
__cf1&=__cf1(__cf2(user32.dll),SetWindowLongA)
__cf2&=__cf1(__cf2(user32.dll),CallWindowProcA)

proc WPROC

    Parameters WND&, MSG&, WPARAM&, LPARAM&
    call(__cf2&,_OWP&,WND&, MSG&, WPARAM&, LPARAM&)

endproc

Proc WLoadFile

    Parameters cover$, filter$
    call(__cf1&,%HWND,-4,&winproc)
    var erg$ = LoadFile $(cover$, filter$)
    call(__cf1&,%HWND,-4,MyWProc&)
    return erg$

ENDPROC

Hauptprogramm
-------------
CLS
MyWProc& = PROCADDR(WPROC,4)
VAR _OWP&=call(__cf1&, %HWND, -4,MyWProc&)
PRINT WLoadFile(,)
WAITINPUT
call(__cf1&,%HWND,-4,&winproc)
END

alas Yes: to the End must The Original-procedure too yet eingewsetzt go, there it otherwise at End of program to that crash come can.

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
10/23/06  
 



OK - light one. one must means for each Control which one SubClasst to the Calling the vordefinierten dialogs The originalWinProzedur restore - the deckt itself too with my Experience.

I find one Info in the Helpfile with whom Vordefinierten Dialogen and with ProcAddr is appropriate and can many Verzweiflungen in the Vorraus prevent.
 
10/23/06  
 




RGH
Yes, I ought to it in the Help on passender place allude.
The geschickteste Possibility would sure, no vordefinierten dialogs in such Programs To use. who The Windowsprozedur self writes, creates it sure too, The dialogs self To write. ;)

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
10/23/06  
 



RGH
Yes, I ought to it in the Help on passender place allude.
The geschickteste Possibility would sure, no vordefinierten dialogs in such Programs To use. who The Windowsprozedur self writes, creates it sure too, The dialogs self To write. ;)

Greeting
Roland


Well It's all right objectively still something eleganter - particularly if one so rotten is How I it be!

circa it short To illustrate - I engage simply The same Exe with new Process for nötige task...
//only to explanation!
include usermessages.pcu = circa.
include pipe.pcu = pipe.
include scrollarea.inc

if %parcount

    select par$(1)

        caseof loadfile

        app.loadfile

        caseof browsefolder

        app.browseForFolder
        otherwise
        end

    endselect

endif

var hwnd:=new(ScrollArea,0,(%maxx/2-305),(%maxy/2-300),610,430,610-18,600,sa_complete | SA_DESKTOPISDIALOG - SA_MINIMIZEBOX,apptitle)
var _owp&:=setwindowlong(hwnd,gwl_wndproc,procaddr(wproc,4))
print hwnd.loadfile$(,)
waitinput
end

proc wproc(Wnd&, Msg&, Wparam&, Lparam&)

    callwindowproc(_owp&,Wnd&, Msg&, Wparam&, Lparam&)

endproc

proc hwnd.loadfile(desc$,mask$)

    enablewindow hwnd::window&,0
    var sid$:=st$(gettickcount)
    var pipe&:=pipe.create(sid$)
    pipe.push pipe&,desc$
    pipe.push pipe&,mask$
    pipe.push pipe&,st$(%hwnd)
    shell par$(0)+ loadfile +sid$
    circa.add 7788

    while pipe.get(pipe&)<>done

        waitinput

    wend

    circa.sub 7788
    sleep 100
    pipe.pop pipe&
    var result$:=pipe.pop(pipe&)
    pipe.close pipe&
    enablewindow hwnd::window&,1
    setactivewindow(hwnd::window&)
    return result$

endproc

proc app.loadfile

    var sid$:=par$(2)
    var pipe&:=pipe.create(sid$)
    var desc$:=pipe.pop(pipe&)
    var mask$:=pipe.pop(pipe&)
    var hwnd&:=val(pipe.pop(pipe&))
    var result$:=loadfile$(desc$,mask$)
    pipe.push pipe&,done
    pipe.push pipe&,result$
    pipe.close pipe&
    sendmessage(hwnd&,7788,0,0)
    end

endproc

 
10/23/06  
 




Frank
Abbing

one must means for each Control which one SubClasst to the Calling the vordefinierten dialogs The originalWinProzedur restore - the deckt itself too with my Experience.


but not my. there there were only with the Mainwindow ex and on Problems, never but with others Controls. what indeed logical is, there itself the the Fastmode only on %hwnd relating.
 
10/23/06  
 




RGH
we've here two Tatbestände exist, The directly in XProfan interfere: The Fastmode and the Umdefinierung the Windowsprozeduren.

very taken relating itself the Fastmode only the XProfan-interne Messagehandling, that through this largely shorted becomes. the can (must but not each drop) Auswirkungen on The vordefinierten dialogs having.

the second are The Windowsroutinen. of it has XProfan 4 Strück: Mainwindow (&WinProc), Mainwindow in the Dialogstil (&WinDProc), Dialog-Window with @Create(dialog (&DlgProc) and Window with @Create(Window (&DlgWProc). The vordefinierten dialogs than Elternfenster always the Mainwindow, if it because existing, or simply 0.

however: who on the apertured hearts of XProfan operates, must so calculate, whom a or others Bypass lay To must. ;)
 
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
10/23/06  
 



Frank Abbing
Frank Abbing
one must means for each Control which one SubClasst to the Calling the vordefinierten dialogs The originalWinProzedur restore - the deckt itself too with my Experience.


but not my. there there were only with the Mainwindow ex and on Problems, never but with others Controls. what indeed logical is, there itself the the Fastmode only on %hwnd relating.


Well then look you time that here Screen memory, i think the can your opinion Change:
 {$cleq}
cls
var listbox&:=createlistbox(hwnd,,10,10,100,100)
var _owp&:=setwindowlong(listbox&,gwl_wndproc,procaddr(wproc,4))
print loadfile$(,)
waitinput
end

proc wproc(Wnd&, Msg&, Wparam&, Lparam&)

    callwindowproc(_owp&,Wnd&, Msg&, Wparam&, Lparam&)

endproc

here becomes The listbox& gesubclasst - and Loadfile behave itself dämlich How expects...
 
10/23/06  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

883 Views

Untitledvor 0 min.
E.T.01/08/12

Themeninformationen

this Topic has 3 subscriber:

iF (4x)
RGH (4x)
Frank Abbing (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