Like winzip

Like winzip

Postby MarcoBoschi » Thu Dec 13, 2007 8:39 am

Hi everybody,
from explorer a can select multiple files.
When I click right mouse button from one of these selected files a context menu appears. For instance I find "Winzip" item with its own menu.
If I select the voice "Add to myfolder.zip" then winzip start and compress all selected files.
The question is:
In a Fivewin/xHarbour program how can I obtain an array containing these selected files? (simply to display them...)

#include "fivewin.ch"

FUNCTION MAIN( aSelectedFiles )
LOCAL i
FOR i := 1 TO LEN(aSelectedFiles)
MsgInfo[aSelectedFiles[i]
// other complicated processing......

NEXT i


RETURN NIL

Thanks in advance
Marco Boschi
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Thu Dec 13, 2007 11:10 am

Marco,
Code: Select all  Expand view  RUN
function Main()

   local n

   for n = 1 to HB_ArgC()
      MsgInfo( HB_ArgV( n ) )
   next

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Thu Dec 13, 2007 11:18 am

Antonio,
I've tested.
I see only the firts selected file
Thanks
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Thu Dec 13, 2007 11:23 am

Marco,

Please run your EXE this way:

test.exe one two three
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Thu Dec 13, 2007 1:35 pm

ine two three if I run from
c:\fwh\samples\test01.exe one two three
but my scenario is different
from explorer - seleccted files right click mouse Open with....selecct program
c:\fwh\samples\test01.exe
I see only "one"

Best regards
Marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby nageswaragunupudi » Thu Dec 13, 2007 1:55 pm

Yes. If we drag and drop a bunch of files, we get all of them. But if we use "Openwith" we see only one file.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Antonio Linares » Thu Dec 13, 2007 1:57 pm

Nageswararao,

> But if we use "Openwith" we see only one file.

Please check HB_ArgC() value in that case
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Thu Dec 13, 2007 1:59 pm

hb_argc() is ! ( one )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby MarcoBoschi » Thu Dec 13, 2007 2:34 pm

With regedit I add this

HKEY_CLASSES_ROOT\*\shell\Cataloga\command

"c:\foto\test01.exe" "%L"

If I select one file test01.exe run once
If I select two files test01.exe run twice
and so on...
I want to run once for one or for one thousand files.
Thanks
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Thu Dec 13, 2007 3:48 pm

Marco,

It seems as Windows runs the EXE for each supplied file, again and again.

Anyhow it seems as we could code a workaround for this. We need to do some tests
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Thu Dec 13, 2007 4:04 pm

I found this:
http://www.eggheadcafe.com/forumarchive ... 949448.asp

is the same problem!

I think a little program writte in C ( smaller ) that write in append mode in a temporary file.
Now the problem is
"At the and of this files collection in one single file, how can I run my application?"

dilemma of 5 p.m.
Bye Bye :?: :?:
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Thu Dec 13, 2007 4:15 pm

Marco,

The plan is:

1. The EXE gets called and ONE parameter is supplied from Windows
2. The EXE checks if another instance of the EXE is already running
3. If yes, then the parameter is supplied to the first EXE through an exported function ("entry point")
4. The again invoked EXE quits
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Dec 14, 2007 9:22 am

Marco,

We have tried it as we commented it but it does not work properly.

I guess the solution is to use a timer and IsExeRunning() to quit the application if it is already running previously, but before copy in a text file the name of the new file to open. And the timer from the first EXE will open it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Fri Dec 14, 2007 10:47 am

I found that the easier solution is using the "sendto" directory. Any program link placed inside that directory will receive all the selected file names as parameters.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby nageswaragunupudi » Fri Dec 14, 2007 11:02 am

Mr Enrico

Great. This works.

Now if we are able to add our program name to the RightClick Menu that gives it the final professional look.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wilsongamboa and 41 guests