Results 1 to 3 of 3

Thread: Really easy question?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    55

    Red face

    I know this is the easiest question but i can't remember how to do it. How do i send Alt+F4 to an active program using Sendkeys and if there is a better way you have to give, give it.
    Everyone is a begginer at some time, but we all get our fame.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    To close a window you should use:
    Code:
    'declare the function first
    Destroy Window(HWND)
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Member WEiRd0's Avatar
    Join Date
    Dec 2000
    Posts
    49
    try this

    Code:
    Dim ReturnValue As Long
    
    Private Sub Command1_Click()
    AppActivate ReturnValue     ' Activate the Calculator.
    SendKeys "%{F4}", True  ' Send ALT+F4 to close Calculator.
    End Sub
    
    Private Sub Form_Load()
    ReturnValue = Shell("CALC.EXE", 1)  ' Run Calculator.
    End Sub
    just got it from the vb help file

    cya
    TIMMY

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