Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


How to find out that Shell command has finished


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-15-2007, 10:22 PM
Junior Member
 
Join Date: May 2007
Posts: 46
Default How to find out that Shell command has finished

Hi,
I'm using Shell command to start conversion of pictures using IrfanView :

tmp = selectedfolder & "*.jpg /resize(800,600) /aspectratio /convert=*.jpg"
Shell("i_view32.exe",tmp)

It should resize all pictures in selected folder to 800x600 pixels and it works.
The problem is, that I need to know when the resizing of all pictures is finished, so I could continue
working with resized pictures.
Can anybody advise me how to find out it?
Thanks in advance
Petr
Reply With Quote
  #2 (permalink)  
Old 10-16-2007, 03:45 AM
Senior Member
 
Join Date: May 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi petrbury,

Have you already tried 'fileExist', 'fileSearch', 'FileName', etc. on runtime to verify files created?

Regards,
__________________
Rioven

Sony Ericsson XPERIA X1i WM6.1
480x800 Display Resolution
with QWERTY keyboard
Reply With Quote
  #3 (permalink)  
Old 10-16-2007, 10:30 AM
Junior Member
 
Join Date: May 2007
Posts: 46
Default

Thank you Rioven,
it could be the way, but it seems a bit complicate for me. Because my code is resizing and overwriting every file, I should have tested if size of every file has changed. Or I could resize files and move them to another folder and then test them ... (Btw. I don't know if it is possible conflict when i_view is resizing some file and I'm trying to test it with FileExist or FileSize at the same moment).
So I wonder if there is some possibility how to find out the end of that (some returned parameter or so). I don't know much about it, so I'm asking here.
If somebody tells me that it is not possible, OK - I'll try another way.
Thanks
Petr
Reply With Quote
  #4 (permalink)  
Old 10-16-2007, 11:23 AM
Senior Member
 
Join Date: May 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi petrbury,


Is it possibble to do this so that files will not overwritten?

tmp = selectedfolder & "*.jpg /resize(800,600) /aspectratio /convert=*"&"-resized"&".jpg"
Shell("i_view32.exe",tmp)

or

tmp = selectedfolder & "*.jpg /resize(800,600) /aspectratio /convert=*.png"
Shell("i_view32.exe",tmp)

then use...

FileSearch (Arraylistjpg,selectedfolder & "*"&"-resized"&".jpg") 'to gather all jpg on the folder and assigned value to array list 'arraylistjpg'
Obviously you have already return file names and count.


Maybe try 'filesearch' to gather all files and assign to arraylist.
and use arraylist to resize your pictures one by one.

FileSearch (Arraylistjpg,selectedfolder & "*.jpg")

for i=0 to arraylistjpg.count-1
tmp = selectedfolder & arraylistjpg.item(i)&".jpg /resize(800,600) /aspectratio /convert=& arraylistjpg.item(i)
Shell("i_view32.exe",tmp)
next i

but shell could be exhausted..


Regards,
__________________
Rioven

Sony Ericsson XPERIA X1i WM6.1
480x800 Display Resolution
with QWERTY keyboard

Last edited by Rioven : 10-16-2007 at 12:27 PM. Reason: text added
Reply With Quote
  #5 (permalink)  
Old 10-16-2007, 01:00 PM
Junior Member
 
Join Date: May 2007
Posts: 46
Default

OK,
I'll try it this way. I think it should works.
Thank you very much Rioven.
Petr
Reply With Quote
  #6 (permalink)  
Old 10-16-2007, 05:38 PM
Senior Member
 
Join Date: May 2007
Posts: 130
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi petrbury,


I have similar problem before and I've applied the kind of solution...

Getting value from other other application in runtime

Once you manage resizing and renaming files then gather files for process. Inorder to wait the application to finish and no overlaps, you might apply the solution of the control focus. you could try it...

goodluck!
__________________
Rioven

Sony Ericsson XPERIA X1i WM6.1
480x800 Display Resolution
with QWERTY keyboard

Last edited by Rioven : 10-16-2007 at 05:58 PM.
Reply With Quote
  #7 (permalink)  
Old 10-16-2007, 08:20 PM
Junior Member
 
Join Date: May 2007
Posts: 46
Default

I'm still finding out that a lot of informations is already on the forum, but unfortunately I'm really not able to watch it all as good as I'd like. You know it - free time is never enough.
Thank you once more Rioven, your solution seems to be fine, I'll try it.
Petr
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
return codes of a shell command pmu5757 Questions & Help Needed 18 06-15-2008 08:33 PM
Shell command J12345T Questions & Help Needed 2 06-08-2008 10:49 AM
Questions on shell command, and user event, and the 6.30 dan kabestan Questions & Help Needed 2 05-15-2008 07:45 PM
Bad screen refresh with sound command pmu5757 Questions & Help Needed 6 05-09-2008 09:53 PM
Help on Sqlite Update Command jeterry Questions & Help Needed 13 03-31-2008 09:45 AM


All times are GMT. The time now is 06:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0