1. New Thread .... Will not work in win32lib BUT does work in its OWN folder .. WHY??,,
- Posted by Selgor Jun 03, 2010
- 1203 views
Hello,
Selgor here.
Derek,
I have "hacked" ... shexec.exw ... from Demo winLIB.
All is now up to speed with winLIB. Working well.
BUT, though I have learned....
sethandler, shellExecute, etc..
Still cannot work out how to get the file executed from "keypress" after typing in file etc.
Type file , location, e.g.
C:\EUPHORIA\DEMO\WIN32\winwire.exw.
and press Return key ..... NIL So my Procedure KeyPress below is POO !..
Do not know what to put into "" in sethandler.
If you can help .. grateful Sorry to be a pain.
Cheers,
Selgor.
include win32lib.ew without warning constant Win = create( Window, " ", 0, 12,120, 1000, 105,{WS_EX_TOOLWINDOW,WS_POPUP,WS_VISIBLE} ) setWindowBackColor(Win,546781) --213543)--123123)--031110)--2332112)--111231207)--2311320)--2002022)-- 81190086) constant b1=create(Button,"E",Win,4,0,20,20,0), b2=create(Button,"D",Win,34,0,20,20,0) constant btn = create(Button, "&Run", Win,425, 30, 50, 25, 0), filel = create(Button, "Klik 4 File:", Win, 360, 30, 60, 25, 0), file = create(EditText, "C:\\", Win, 5, 30, 350, 25, 0)--, procedure get_app(integer self,integer event,sequence parms) if self = b1 then shellExecute ("open","c:\\euphoria",SW_SHOWNORMAL) elsif self = b2 then shellExecute ("open","c:\\euphoria\\win32lib6006\\demo",SW_SHOWNORMAL) elsif self = Win then closeWindow(Win) end if closeWindow(Win) end procedure setHandler({Win,b1,b2},w32HClick,routine_id("get_app")) procedure RUN(integer self, integer event, sequence parms) integer x x = shellExecuteEx("open",--(verb), getText(file), 0, 0,SW_SHOWNORMAL,0) closeWindow(Win) end procedure setHandler(btn, w32HClick, routine_id("RUN")) procedure FindFile(integer self, integer event, sequence parms) sequence theFile theFile = getOpenFileName(Win, getText(file), { "dialog flags", {OFN_EXPLORER, OFN_HIDEREADONLY, OFN_LONGNAMES }, "All Files (*.*)", "*.*"}) setText(file, theFile) end procedure setHandler(filel, w32HClick, routine_id("FindFile")) procedure KeyPress(integer self, integer event, sequence parms) integer result if WM_KEYDOWN then if WM_CHAR = 13 then result = shellExecuteEx("open",getText(file), 0, 0,SW_SHOWNORMAL,0) closeWindow(Win) end if end if end procedure setHandler(file,"", routine_id("KeyPress")) --------- it's not mouse click ...... it's a key press ????? WinMain(Win, Normal)
2. Re: New Thread .... Will not work in win32lib BUT does work in its OWN folder .. WHY??,,
- Posted by DerekParnell (admin) Jun 03, 2010
- 1184 views
Still cannot work out how to get the file executed from "keypress" after typing in file etc.
Try this ...
procedure KeyPress(integer self, integer event, sequence parms) integer result if parms[1] = 13 then result = shellExecuteEx("open",getText(file), 0, 0,SW_SHOWNORMAL,0) closeWindow(Win) end if end procedure setHandler(file,w32HKeyPress, routine_id("KeyPress"))
3. Re: New Thread .... Will not work in win32lib BUT does work in its OWN folder .. WHY??,,
- Posted by Selgor Jun 03, 2010
- 1174 views
Hello,
Selgor here.
Blow me down.
So simple.
I was close though ????
Question....
How would I know w32HKeyPress.... and parms[1} ?? ....
I mean .. Where do I find those ?? ..
Please tell Hope you will tell me ??? ...
Anyway.. ALL works fine.
Thank You so much Derek.
But...
please tell me ?? ...
Cheers,
Selgor.
4. Re: New Thread .... Will not work in win32lib BUT does work in its OWN folder .. WHY??,,
- Posted by DerekParnell (admin) Jun 03, 2010
- 1203 views
How would I know w32HKeyPress.... and parms[1} ?? ....
I mean .. Where do I find those ?? ..
I hid all that information in the documentation that comes with Win32lib.
In the docs folder, open the index.htm file. Browse down the Topics list until you see Events and click on that. You will see all the stuff relevant to event handling, including an entry about w32HKeyPress. Hope this helps.
5. Re: New Thread .... Will not work in win32lib BUT does work in its OWN folder .. WHY??,,
- Posted by Selgor Jun 03, 2010
- 1253 views
Hello,
Well you "hid" it.
So I have to read not only constants but Docs too.
Docs before constants.
Thanks a million Derek.
Really appreciated.
I am sure I will be back with more.
Please stay around. I, no .. We all need you.
Again,
many thanks.
Cheers ,
Selgor.