Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) 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, 09:22 PM
Knows the basics
 
Join Date: May 2007
Location: Czech Republic
Posts: 72
Awards Showcase
Beta Tester 
Total Awards: 1
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, 02:45 AM
Senior Member
 
Join Date: May 2007
Posts: 174
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

DEVICE: Motorola ATRIX (Dual Core) Android 2.2.1
DESKTOP: Intel Pentium Dual-core E5200; Microsoft® Windows® Vista Home (Basic); Hard Disk:320GB; Memory:4096MB
Reply With Quote
  #3 (permalink)  
Old 10-16-2007, 09:30 AM
Knows the basics
 
Join Date: May 2007
Location: Czech Republic
Posts: 72
Awards Showcase
Beta Tester 
Total Awards: 1
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, 10:23 AM
Senior Member
 
Join Date: May 2007
Posts: 174
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

DEVICE: Motorola ATRIX (Dual Core) Android 2.2.1
DESKTOP: Intel Pentium Dual-core E5200; Microsoft® Windows® Vista Home (Basic); Hard Disk:320GB; Memory:4096MB

Last edited by Rioven : 10-16-2007 at 11:27 AM. Reason: text added
Reply With Quote
  #5 (permalink)  
Old 10-16-2007, 12:00 PM
Knows the basics
 
Join Date: May 2007
Location: Czech Republic
Posts: 72
Awards Showcase
Beta Tester 
Total Awards: 1
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, 04:38 PM
Senior Member
 
Join Date: May 2007
Posts: 174
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi petrbury,


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

http://www.basic4ppc.com/forum/questions-windows-mobile/855-getting-value-other-other-application-runtime.html

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

DEVICE: Motorola ATRIX (Dual Core) Android 2.2.1
DESKTOP: Intel Pentium Dual-core E5200; Microsoft® Windows® Vista Home (Basic); Hard Disk:320GB; Memory:4096MB

Last edited by Rioven : 10-16-2007 at 04:58 PM.
Reply With Quote
  #7 (permalink)  
Old 10-16-2007, 07:20 PM
Knows the basics
 
Join Date: May 2007
Location: Czech Republic
Posts: 72
Awards Showcase
Beta Tester 
Total Awards: 1
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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 05:31 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0