There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
antivirus audio avg avg 8 backup bios boot browser bsod computer cpu crash css desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt install internet internet explorer itunes javascript keyboard lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem router screen seo slow sound sp3 spyware trojan usb video virus vista vundo windows windows vista windows xp wireless word
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Verify the number of open Windows


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
kenbla's Avatar
Junior Member with 2 posts.
 
Join Date: May 2008
15-May-2008, 09:05 AM #1
Verify the number of open Windows
Hello,
I would like to limit the number of times a user can open a particular window/form from my application! Are there any Windows API calls that I can issue to find out this?
Regards,
kenbla
Chicon's Avatar
Computer Specs
Distinguished Member with 6,321 posts.
 
Join Date: Jul 2004
Location: 50° 34' 07.13" N - 04° 10' 23.
Experience: Second socks retriever
15-May-2008, 09:30 AM #2
Hi kenbla,

Welcome to TSG !

You've just to set a counter in a file. You increment the counter each time the user starts your application and when the limitation is reached, you force the application to exit.
Also, if you mean to limit the usage restriction for a defined period, then use the timestamp utilities on the file in order to reset the counter.
__________________
for ( ; ; ) ;

Examinations time is coming, take a Java beta exam and get a belt !
kenbla's Avatar
Junior Member with 2 posts.
 
Join Date: May 2008
16-May-2008, 02:16 AM #3
Thanks Chicon.
I already have the counter but what's the Windows command to retrieve the number of forms already started by a user?
In my application the user can start a number of non-modal forms and I want to limit the number of started forms by each user to 2 or 3.
The started forms must be non-modal for different reasons!
Chicon's Avatar
Computer Specs
Distinguished Member with 6,321 posts.
 
Join Date: Jul 2004
Location: 50° 34' 07.13" N - 04° 10' 23.
Experience: Second socks retriever
16-May-2008, 07:45 AM #4
If VB is your programming language, you can use the Count method of the Forms collection object.
Indeed, Forms.Count will give the value of the opened forms. Forms is managed by VB and provides informations about loaded forms in the application.
Reply


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

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

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

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:50 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.