|
-
Jun 16th, 2000, 06:59 PM
#1
Thread Starter
Addicted Member
Hello!
Does anyone know how can I make my program (form) system modal, so noone could use windows until I enter pass and unload program?
Regards
Zvonko
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Jul 13th, 2000, 11:37 AM
#2
New Member
System Modal Window
Hi!
This might work, but I'm not sure. I got it out of an old VB-Knowledge base help file:
[Declarations:]
Private Declare Function SetSysModalWindow Lib "User32" (ByVal hWnd) as Integer
[Code:]
Return=SetSysModalWindow(hWnd)
Give it a go and see if it works!
Here is my suggestion. If you don't like it, bite me.
-
Jul 13th, 2000, 11:55 AM
#3
This is the way to show it using General VB Code. This will disable every form only allowing that form to be accessed. But since this in in Api, I guess you wanted the API way.
-
Jul 13th, 2000, 12:46 PM
#4
Thread Starter
Addicted Member
And how can I "UnSet" it?
It would be funny if I set it and if then I have to restart windows because I would be unable to "UnSet" it...
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Jul 13th, 2000, 01:11 PM
#5
-
Jul 13th, 2000, 02:42 PM
#6
Hyperactive Member
modal
Using the Me.Show vbModal method will put your form on top until it's cleared but it won't stop the user from bring other applications forward. I think you're after locking down windows until your form is cleared ? Sorry to say, that function SetSysModalWindow only works under 16-bit windows. According to Technet it can't be done with 32 bit Windows.
However, you could put a timer on a form and everytime it goes off - say every second execute
Me.SetFocus
this would keep bringing your form ( and app. ) to the front. However, this also stops users from typing text into the form because the focus is taken away from the controls on the form to the form itself.
Hope this helps.
That's Mr Mullet to you, you mulletless wonder.
-
Jul 19th, 2000, 10:44 PM
#7
New Member
SetSysModelWindow
True, this API will only work in 16-bit windows, or if you write a 16-bit program and run THAT in 32-bit windows. I.e. use SetSysModelWindow in Visual Basic 3 or 4 16-bit and the program will work in 32-bit windows. A bit impractical, though...
Here is my suggestion. If you don't like it, bite me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|