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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-05-2008, 09:59 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 208
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, 11:17 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

See the ShellAndWait example: Shell and wait
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, 11:48 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 208
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, 02:44 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 53
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, 03:18 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
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, 04:00 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 53
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for duplicates moster67 Questions & Help Needed 2 09-07-2008 07:58 AM
automatically send a csv file via active-sync sunnyboyj Questions & Help Needed 3 12-22-2007 02:35 PM
Another newbie question: How to refere to the active form? yildi Questions & Help Needed 2 11-17-2007 08:55 PM
Check for Sub existance Scubaticus Questions & Help Needed 4 11-04-2007 10:54 PM
How to detect whether SIP is active / not? belotrei Questions & Help Needed 5 06-01-2007 05:22 PM


All times are GMT. The time now is 01:42 AM.


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