1. How Do I RUN or OPEN found file .. Win32Lib programme ..

Hello,

The programme from Win32Lib is openfile.exw.

It finds whatever .. But

will not "run" or "open" it.

So, what is the command to have it

Run or Open. ??

I do not know where to look !!!!

Is it ... on_click "run" .. ???

This is from Win32Lib...........

include win32lib.ew
object x
x = create(Window, "Test", 0,0,0,0,0,0)
x = getOpenFileName(x, "", "")  

Put in "c:\\"  .. goes there .. great.

But will not do the "click" thing !!

Help...point me somewhere please .. but not out the back door ??

sincerely,

les.r.

new topic     » topic index » view message » categorize

2. Re: How Do I RUN or OPEN found file .. Win32Lib programme ..

Les Rogers wrote:

a whole lot of stuff that doesn't quite make sense. I'm not trying to offend but
is English your first language? Have you ever done any programming courses or are
you trying to teach yourself?

> 
> The programme from Win32Lib is openfile.exw.

Are you saying, "There is a program I found in the Win32lib Demo folder called
'openfile.exw' and there are some things about it that I don't quite get"?


Well, I don't know how this program ever got into the demo folder because it is
very wrong. I'll knock up a proper demo program for using the openFile dialog and
post it to the EUForum list.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: How Do I RUN or OPEN found file .. Win32Lib programme ..

Les Rogers wrote:
> 
> 
> Hello,
> 
> The programme from Win32Lib is openfile.exw.
> 
> It finds whatever .. But
> 
> will not "run" or "open" it.
> 
> So, what is the command to have it
> 
> Run or Open. ??
> 
> I do not know where to look !!!!
> 
> Is it ... on_click "run" .. ???
> 
> This is from Win32Lib...........
> 
> include win32lib.ew
> object x
> x = create(Window, "Test", 0,0,0,0,0,0)
> x = getOpenFileName(x, "", "")  
> 
> Put in "c:\\"  .. goes there .. great.
> 
> But will not do the "click" thing !!
> 
> Help...point me somewhere please .. but not out the back door ??
> 
> sincerely,
> 
> les.r.

les,

Looks like, as Derek suggested, that is some kind of "stub" or experimental
program, ie, the *beginning* of a demo that wasn't finished perhaps, and
wasn't meant to be an actual part of the demos.

What you could do is look at "generic.exw" to see how a program opens
a file.

First *run* the demo, to see how it works, so you can see what you should
be able to expect from your efforts.

Then search the program for "open", until you find "MenuOpen", which is the
menu handle (I think that's what it might be called?), for the menu choice
to invoke the windows dialog to give the user an opportunity to open a file.

Then search for "MenuOpen", and you will find the routine that responds
to the clicking of that menu choice.  Read & think about that routine,
and then when/if you have more questions, ask us.

(the reason I suggested you search in the above fashion is because you can
*see* those words IN the program right away, which is a good way to have
some idea what to look *for* in the program.  ie, look for things that seem
like they would relate to what you're wondering about.)

Dan Moyer

new topic     » goto parent     » topic index » view message » categorize

4. Re: How Do I RUN or OPEN found file .. Win32Lib programme ..

Les Rogers wrote:
> 
> 
> Hello,
> 
> The programme from Win32Lib is openfile.exw.
> 
> It finds whatever .. But
> 
> will not "run" or "open" it.
> 
> So, what is the command to have it
> 
> Run or Open. ??
> 
> I do not know where to look !!!!
> 
> Is it ... on_click "run" .. ???
> 
> This is from Win32Lib...........
> 
> include win32lib.ew
> object x
> x = create(Window, "Test", 0,0,0,0,0,0)
> x = getOpenFileName(x, "", "")  
> 
> Put in "c:\\"  .. goes there .. great.
> 
> But will not do the "click" thing !!
> 
> Help...point me somewhere please .. but not out the back door ??
> 
> sincerely,
> 
> les.r.

les,

Now that I actually *run* it, that demo *does* work, though it doesn't
give any info as to how to *use* it.

So, besides Generic.exe, you might also look at:

selectFolder.exw
GetMfiles.exw
getfile.exw

Dan Moyer

new topic     » goto parent     » topic index » view message » categorize

5. Re: How Do I RUN or OPEN found file .. Win32Lib programme ..

Les Rogers wrote:
> 
> 
> Hello,
> 
> The programme from Win32Lib is openfile.exw.
> 
> It finds whatever .. But
> 
> will not "run" or "open" it.
> 
> So, what is the command to have it
> 

Hello les,

1.) first you would find the file you are interested in with

fileName=getOpenFileName()--in the docs

2,) second you could read it.--or 

3.) Third you could run it.

If you need help with any of the these three let us know.



> Run or Open. ??
> 
> I do not know where to look !!!!
> 
> Is it ... on_click "run" .. ???
> 
> This is from Win32Lib...........
> 
> include win32lib.ew
> object x
> x = create(Window, "Test", 0,0,0,0,0,0)
> x = getOpenFileName(x, "", "")  
> 
> Put in "c:\\"  .. goes there .. great.
> 
> But will not do the "click" thing !!
> 
> Help...point me somewhere please .. but not out the back door ??
> 
> sincerely,
> 
> les.r.


Don Cole

new topic     » goto parent     » topic index » view message » categorize

6. Re: How Do I RUN or OPEN found file .. Win32Lib programme ..

Dan Moyer wrote:
> 
> Les Rogers wrote:
> > 
> > 
> > Hello,
> > 
> > The programme from Win32Lib is openfile.exw.

> Now that I actually *run* it, that demo *does* work, though it doesn't
> give any info as to how to *use* it.

Yes it runs, but it is still a horrible 'example' program. Here is a somewhat
better example ...

include win32lib.ew
integer theWindow
integer btnGetFile
integer txtFile

procedure click_GetFile(integer self, integer event, sequence parms)
    sequence lFileName
    integer lTxtWidth
    integer lTxtHeight
    sequence lRect

    -- Open the dialog and get the user's response.
    lFileName = getOpenFileName(theWindow, "", {"All Files", "*.*"})
    if length(lFileName) = 0 then
        return  -- User cancelled the dialog.
    end if

    -- Adjust the area on screen to show the selected filename.
    lTxtHeight = getTextHeight(txtFile, lFileName) + 2
    lTxtWidth = getTextWidth(txtFile, lFileName) + 2
    lRect = getClientRect(txtFile)
    setClientRect(txtFile, lTxtWidth, lTxtHeight)

    -- Now make sure that the window can show the whole text area.
    lRect = getClientRect(theWindow)
    if lRect[3] < lTxtWidth + 10  then
        setClientRect(theWindow, lTxtWidth + 10, lRect[4])
    end if

    -- Show the selected file name
    setText( txtFile, lFileName)
    setVisible(txtFile, 1)

end procedure

procedure main(sequence Args)


    theWindow = create(Window, "User Selected File", 0, 0, 0, 
                                    400, 100,0)
    btnGetFile = create(Button, "Get a File Name", theWindow, 5, 5, 
                                    300, 40, 0)
    txtFile   = create(Label, "", theWindow, 5, 55, 300, 13, WS_BORDER)
    setVisible(txtFile, 0)  -- Initially hide the showing area.

    setHandler(btnGetFile, w32HClick, routine_id("click_GetFile"))

    WinMain( theWindow, Normal)
end procedure

main( command_line() )


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu