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.

Background Task

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2008, 12:45 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default Background Task

I've searched the Forum but not found anything relating to running programs in the background on the desktop.
I'm writing a backup utility (primarily for a friend) using the ROBOCOPY function and what I would like to do is, after a preset time backup to a USB drive when it connects to the PC.
Agraham has assisted with the http://www.basic4ppc.com/forum/quest...detection.html , but this is no good unless I can actualy force the App to run in the background.
At best I would have to use SHELL to issue an AT command to schedule ROBOCOPY to run, but then I remove the possibility of detecting the drive presence first.
I don't think that running with the form minimised is really a solution as it would be displayed on the task bar all the time.

Got any ideas?

@Erel, any plans to make B4PPC stay active even if no FORM is displayed, maybe as an option within the tools menu?

Thanks,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 06-27-2008, 01:27 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Ioannina, Greece
Posts: 356
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hello RandomCoder,

Look at NotifyIcon library samples here http://www.basic4ppc.com/forum/addit...on-libary.html
Don't forget to replaces the DLLs with these from post #15 here http://www.basic4ppc.com/forum/addit....html#post7964
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #3 (permalink)  
Old 06-27-2008, 01:41 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks DZT but thats not quite what I was after, but it's going to come in handy.

I'd like to have my app running completely in the background. The taskbar icon is good as it will allow the user to select options such as to close the App. But the problem is that the form is still minimized on the taskbar when run on the desktop.

I suppose what I'm after is to close the Form but keep the code running. Does that make sense? Think of it as a service in XP.

Regards,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 06-27-2008, 01:51 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

On the device you can set the form's title to "" (empty string), and use Hardware.ShowTodayScreen.
Reply With Quote
  #5 (permalink)  
Old 06-27-2008, 03:34 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I realise that is possible on the device but my question is only related to the desktop.
Am I just trying to use B4PPC for something it was never intended?
Any work around would be greatly appreciated.

Thanks,
RandomCoder.
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #6 (permalink)  
Old 06-27-2008, 04:10 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by RandomCoder View Post
But the problem is that the form is still minimized on the taskbar when run on the desktop.
Check out this utility http://www.basic4ppc.com/forum/code-...r-utility.html It does what you want by using a FormEx from my FormExDesktop library, which has a Hide method that removes it from the taskbar, and a NotifyIcon from my ControlsExDesktop library.

dzts' library might work as well but I haven't tried that as I've got my own

EDIT :- I've just tried this. You could also use the Door library on a normal Form and hide that using its' visible property, unhiding it from the NotifyIcon Click event.
Code:
' o is a Door library object
o.new1(false)
o.FromControl(
"Form1")
o.SetProperty(
"Visible"false)

Last edited by agraham : 06-27-2008 at 04:28 PM.
Reply With Quote
  #7 (permalink)  
Old 06-27-2008, 05:06 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Agraham to my rescue again

I had a feeling that the door library would be suggested but didn't know what properties were possible. Where do you find this information? MSDN is immense and often what I want to find is scattered across the site (but saying that, I managed to find the Windows message for DeviceAdded to see where you got those values
from).

Thanks for the help once again, this is exactly what I'm after.

Regards,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #8 (permalink)  
Old 06-27-2008, 05:14 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by RandomCoder View Post
Where do you find this information? MSDN is immense
See this post http://www.basic4ppc.com/forum/11133-post16.html Most of what is useful for controls in B4ppc is in Systems.Windows.Forms. Arcane stuff, especially if it is not .NET like DeviceAdded, you either have to already know or Google for.
Reply With Quote
  #9 (permalink)  
Old 06-27-2008, 06:47 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks for the heads up, already added to my bookmarks, with a little searching I was able to find this Form Properties (System.Windows.Forms) listing all the properties for a Form.
MSDN is not the easiest of sites to navigate especially if your not entirely sure of the exact terminology to use.

Cheers,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #10 (permalink)  
Old 06-27-2008, 09:58 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

To make research a little bit easier, you can use the ControlInfo application from agrahem extended by alfcen and myself at:
http://www.basic4ppc.com/forum/code-...-controls.html
post 19.
In this application you have direct links to the MSDN site.

Best regards.
__________________
Klaus
Switzerland
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
dzSpy - Spy and Task Manager App - Open Source dzt Share Your Creations 13 09-07-2009 02:41 PM
Task Switcher for WM5/6 agraham Questions (Windows Mobile) 10 01-15-2009 03:11 PM
Task.DueDate cannot be set correctly specci48 Bug Reports 4 09-14-2008 09:52 AM
the background and sprite GallyHC Questions (Windows Mobile) 4 06-01-2008 03:21 PM
Outlook task reminder time Rioven Questions (Windows Mobile) 3 09-30-2007 06:38 PM


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


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