473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how could i not loose focus from my current active form in vb2005

hello sir,
i am into a project were i don't want my client to access the system until he types the user name and password correctly.........for this i need to stop him to access other application even windows explorer... i have tried few things ....but they dint worked...>>secnd option i tried to kill the explorer process itself but im not getting that also....please help...my code

Expand|Select|Wrap|Line Numbers
  1. Imports proc = System.Diagnostics
  2. Public Class Form1
  3.     Dim i As Integer
  4.  
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.  
  7. 'option 2 this is nt working for closing explorer.exe  
  8.        Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
  9.         For Each proc As System.Diagnostics.Process In pList
  10.             ' MsgBox(proc.ProcessName)
  11.             process.Items.Add(proc.ProcessName)
  12.             If (proc.ProcessName = "explorer") Then
  13.                 proc.Kill()
  14.                 proc.Close()
  15.  
  16.                 MsgBox("killed")
  17.  
  18.             End If
  19.         Next
  20. 'option 1 this is nt working for not accessing other application  
  21.  
  22.         proc.Process.GetProcessesByName()
  23.         If (My.Computer.Keyboard.AltKeyDown) Then
  24.         Me.Refresh()
  25.  
  26.  
  27.     End Sub
  28.  
  29.  
  30. 'this is fr logging in
  31.     Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
  32.         If i >= 3 Then
  33.             'shutdown system
  34.             MsgBox("System Shutting Down")
  35.             'and remove ur login from table
  36.         End If
  37.         If (Uname.Text = "" And Pass.Text = "") Then
  38.             Conf.Visible = True
  39.             Login.Enabled = False
  40.             Login.SendToBack()
  41.  
  42.         Else
  43.             i = i + 1
  44.  
  45.         End If
  46.     End Sub
  47. End Class
  48.  
  49.  
  50.  
//this is the code i tried but both options are nt working s please help......thanking you
Sep 25 '08 #1
3 1183
Curtis Rutland
3,256 Expert 2GB
Well, you could make your app full screen and TopMost, but that won't stop your user from bringing up a task manager.
Sep 25 '08 #2
Frinavale
9,735 Expert Mod 8TB
Well, you could make your app full screen and TopMost, but that won't stop your user from bringing up a task manager.
I think the user can still press ctrl+alt+delete and bring up task manager that way?


hello sir,
i am into a project were i don't want my client to access the system until he types the user name and password correctly.........for this i need to stop him to access other application even windows explorer... i have tried few things ....but they dint worked...>>secnd option i tried to kill the explorer process itself but im not getting that also....please help...my code
I have no idea why your application needs to kill explorer.
Why do you want the user from accessing other applications?
I would be really unhappy if I were a first time user with no username/password and I couldn't get out of your application..

If the user has to log in to use your application then you need to specify a flow to your application: first they log in, then the main app loads.

One approach to doing this is to add a module to your application and create a method that will implement the flow that you require: display a log in dialog and if it is successful display the main form of the application...otherwise exit. This method will be the application entry point. You will have to uncheck the "Enable application framework" in order to use your module and set your method to the entry point of your application (right click on your application in the solution explorer and select "properties").

-Frinny
Sep 25 '08 #3
hi........
thanx for ur replies but im into a project of cyber cafe were my client shuld not acess other applications untill he enters right user name and password which i verify from server database...
if he is allowed then he could easily go to the browser.which i dont want. if u have got any ideas, please help..
thanking you
Sep 26 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Stephen Poley | last post by:
The issue of the focus pseudo-class came up a few weeks ago, and I finally got around to trying it out (better late than never ...) The recommended order given for the pseudo-classes is link,...
7
by: Gerry Abbott | last post by:
Hi all, Ive got a form with several controls which contain date fields. I'm usng the activex calender control as a separate floating form, I would like to be able to click onto any of the date...
0
by: Vinod. | last post by:
Hi all, I have added browser control to a windows form. I am loading pages having multiple frames. I have noticed that the focus in a text is not maintained when the application is deactivated....
3
by: Brian Henry | last post by:
Hi, I have a bunch of forms in a DLL that I call from my main application. The one form is a login form, and I have the tab order set in the order I want it (password box first, then ok button...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers for...
3
by: c_shah | last post by:
VB 2005 and windows form application I am having difficulty putting my question into words but.. Is there a way to determine whether my win form application has focus or it is active or being...
1
by: danyeungw | last post by:
I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have...
5
by: flashsilverlight | last post by:
i have a c# application in which it has several forms. how do i make it so that a certain form would not lose focus while it is active? i mean, the only possible way to get to another form is by...
4
by: =?ISO-8859-15?Q?Albe_V=B0?= | last post by:
In my Application, I need to make a certain graphical refresh, interrogating SqlServer, only if Application has focus (i.e. the title bar is blue). Interrogating .Focused property of various...
10
by: Gary | last post by:
I'm trying to find a way to determin which window Within-Another-Program currently has the focus. THE SITUATION: (Skip down to "My Question" if you don't want the background...) * This is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.