How to block the computer during a save??
Hi everyone!
How can i make the computer to block while the user is doing a save to the application i'm building?
I mean the user cant do anything else in the computer while the my application is making save, the applicattion cant loose the focus.
Thanks.
Re: How to block the computer during a save??
try this:
vb Code:
Public Class Form1
Declare Function apiBlockInput Lib "user32" Alias "BlockInput" (ByVal fBlock As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
apiBlockInput(1) 'block input
'do your save
apiBlockInput(0) 'unblock input
End Sub
End Class
Re: How to block the computer during a save??
Please explain why your application cannot lose focus while saving? This is a little unusual.
Re: How to block the computer during a save??
Quote:
Originally Posted by
em07189
Hi everyone!
How can i make the computer to block while the user is doing a save to the application i'm building?
I mean the user cant do anything else in the computer while the my application is making save, the applicattion cant loose the focus.
Thanks.
That sounds like a really poorly designed save routine. If there's a lot of processing that cant be optimized better, you could at least do it in a background thread.
Re: How to block the computer during a save??
If you do block the computer during save, then you had better not allow that save to fail poorly.
Re: How to block the computer during a save??