2 Questions >>
1.how can we start a program exactly after user login ( putit in the start up or something ) ???
2. get screens width?!
thnkx
Printable View
2 Questions >>
1.how can we start a program exactly after user login ( putit in the start up or something ) ???
2. get screens width?!
thnkx
A1 : Put your app in this key :HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (that's on XP, I believe it's the same on W2K too)
Q2 : Do you mean moniter width ?
yes the monitors width ( reselution ), how can i get it?
and how can i add the program the registery during installation?!
1-I've not done that but I assume it's in the registry section of the deployment proj . I think in the fullpath of the new key reg , you have to add the above path . not sure though .
2-Try this :http://www.pscode.com/vb/scripts/Sho...txtCodeId=1346
What happened to the posts , did you change questions order !!:confused:
The monitor ? huh , I don't know then , just do a search
the screen width is what i need! i've started searching, i thought its going to be just a line of code
No , Since you are getting info off the hardware and it's not that easy . API of course will do it hopefully with no problems .It's in the above link ;)
thanks dude, i'll take a look at it as soon as i get home
For the screen width try this
VB Code:
Dim y As String = System.Windows.Forms.SystemInformation.WorkingArea.Height Dim x As String = System.Windows.Forms.SystemInformation.WorkingArea.Width
System.Windows.Forms.SystemInformation was a wonderful class, lot of system info can be used, no api need :cool:
VB Code:
Debug.Writeline(Screen.PrimaryScreen.Bounds.ToString)
or
VB Code:
If Screen.PrimaryScreen.Bounds.X > 1024 Then 'do something
Additionally, here's a little snippet straight off MSDN that retrieves a wealth of info.
VB Code:
Dim Index As Integer Dim UpperBound As Integer ' Gets an array of all the screens connected to the system. Dim Screens() As System.Windows.Forms.Screen = _ System.Windows.Forms.Screen.AllScreens UpperBound = Screens.GetUpperBound(0) For Index = 0 To UpperBound ' For each screen, add the screen properties to a list box. Debug.WriteLine("Device Name: " + Screens(Index).DeviceName) Debug.WriteLine("Bounds: " + Screens(Index).Bounds.ToString()) Debug.WriteLine("Type: " + Screens(Index).GetType().ToString()) Debug.WriteLine("Working Area: " + Screens(Index).WorkingArea.ToString()) Debug.WriteLine("Primary Screen: " + Screens(Index).Primary.ToString()) Next
That's cool . I don't know where are these classes hidden when I look for them ........:D. Did you check if they give same values ! I always trust APIs . :)
< < < Tested > > >
MsgBox(System.Windows.Forms.SystemInformation.WorkingArea.Height)
Dim screen() As Screen = System.Windows.Forms.Screen.AllScreens
MsgBox(screen(0).WorkingArea.Height)
both showing the same result