Results 1 to 13 of 13

Thread: start program automatically after login??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    start program automatically after login??

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 ?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    yes the monitors width ( reselution ), how can i get it?

    and how can i add the program the registery during installation?!
    Last edited by persianboy; Sep 27th, 2003 at 02:32 PM.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What happened to the posts , did you change questions order !!

    The monitor ? huh , I don't know then , just do a search

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    the screen width is what i need! i've started searching, i thought its going to be just a line of code

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    thanks dude, i'll take a look at it as soon as i get home

  9. #9
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    For the screen width try this

    VB Code:
    1. Dim y As String = System.Windows.Forms.SystemInformation.WorkingArea.Height
    2. Dim x As String = System.Windows.Forms.SystemInformation.WorkingArea.Width

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    System.Windows.Forms.SystemInformation was a wonderful class, lot of system info can be used, no api need

  11. #11
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    VB Code:
    1. Debug.Writeline(Screen.PrimaryScreen.Bounds.ToString)

    or

    VB Code:
    1. 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:
    1. Dim Index As Integer
    2.         Dim UpperBound As Integer
    3.  
    4.         ' Gets an array of all the screens connected to the system.
    5.  
    6.         Dim Screens() As System.Windows.Forms.Screen = _
    7.             System.Windows.Forms.Screen.AllScreens
    8.         UpperBound = Screens.GetUpperBound(0)
    9.  
    10.         For Index = 0 To UpperBound
    11.  
    12.             ' For each screen, add the screen properties to a list box.
    13.  
    14.             Debug.WriteLine("Device Name: " + Screens(Index).DeviceName)
    15.             Debug.WriteLine("Bounds: " + Screens(Index).Bounds.ToString())
    16.             Debug.WriteLine("Type: " + Screens(Index).GetType().ToString())
    17.             Debug.WriteLine("Working Area: " + Screens(Index).WorkingArea.ToString())
    18.             Debug.WriteLine("Primary Screen: " + Screens(Index).Primary.ToString())
    19.  
    20.         Next
    Last edited by nemaroller; Sep 28th, 2003 at 09:22 AM.

  12. #12
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    That's cool . I don't know where are these classes hidden when I look for them ......... Did you check if they give same values ! I always trust APIs .

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    < < < 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width