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 check if Form is active

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-05-2008, 08:59 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default How to check if Form is active

I hope someone can help me,
Is there a way to have the program check if it is on the foreground?

I want to make a program which will open a 2nd program, once that 2nd program is finished/closed the focus should go back to my app and it needs to do something else.

I have tried with Form1.Focus (= true) and Control("Form1").Focus = true
But I cannot seem to get it working.
I also thought i might be able to use a Textbox for the focusing part but that
also didn't do anything.

The workaround would be to have a MsgBox popup which the user needs to click..
but that would only be a last resort ...

I could use some
Thanks
Reply With Quote
  #2 (permalink)  
Old 05-05-2008, 10:17 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

See the ShellAndWait example: http://www.basic4ppc.com/forum/code-samples-tips/2040-shell-wait.html
It will make your application wait for the second application to end.
If I remember correctly your application will be brought to the foreground.
There are other solutions available, so please reply if it didn't help.
Reply With Quote
  #3 (permalink)  
Old 05-05-2008, 10:48 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

it works like a charm, thanks for your help Erel
Reply With Quote
  #4 (permalink)  
Old 05-07-2008, 01:44 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Wait for a sound command stop

Hello,
Is it also possible to wait for the end of a B4PPC command like sound?
I would like to wait for the end of the ".wav" file before doing something else.

Thank you.
Reply With Quote
  #5 (permalink)  
Old 05-07-2008, 02:18 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

If you know the length of the wave file you can add Sleep(...) after playing the sound.
If I remember correctly the Hekkus sound library allows you to wait for the sound to end.
Reply With Quote
  #6 (permalink)  
Old 05-07-2008, 03:00 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Wait for a sound command stop

I don't know the length of the wave file,
so I'm gonna try the Hekkus lib
Thank you Erel.
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
Check for duplicates moster67 Questions (Windows Mobile) 2 09-07-2008 06:58 AM
automatically send a csv file via active-sync sunnyboyj Questions (Windows Mobile) 3 12-22-2007 01:35 PM
Another newbie question: How to refere to the active form? yildi Questions (Windows Mobile) 2 11-17-2007 07:55 PM
Check for Sub existance Scubaticus Questions (Windows Mobile) 4 11-04-2007 09:54 PM
How to detect whether SIP is active / not? belotrei Questions (Windows Mobile) 5 06-01-2007 04:22 PM


All times are GMT. The time now is 09:23 AM.


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