Results 1 to 4 of 4

Thread: Execute ANY filetype/program and set start up propeties [Resolved]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Resolved Execute ANY filetype/program and set start up propeties [Resolved]

    Hey, i want to know how to start a program (or a file) and set the program's windows startup parameters. For example, i want to start a program and set it to a certain place on my screen when it loads, this has to eb any program. I also want to be able to keep it either normal or minimized. I don't want the program to be able to make it self full screen (that's not maximized). Unless i let it while it starts up. What i'm trying to do it prevent a game from going full screen, so that i can do other things while i'm playing it. But i'm making a program that does a wide range of games, not just for this 1 in paticular.

    I have tried to get the window handler by:
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
    2. ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    3.  
    4.  
    5. Private Sub mExecuteProgram_Click()
    6.  
    7. If ProgramLst.ListIndex = -1 Then Exit Sub
    8.  
    9. Const SW_SHOW = 5
    10.  
    11. hWndLst(ProgramLst.ListIndex) = ShellExecute(Me.hwnd, "open", ProgramLst.Text, vbNullString, vbNullString, SW_SHOW)
    12.  
    13.  
    14. End Sub
    ProgramLst is a list box with saved program paths.
    I've read that this is how to get the window handler from a program you'e executed... But it keeps returning 2.

    Also i need to know how to manipulate the window once i get the handler sorted out.

    Thank you.
    Last edited by Hack; Apr 26th, 2006 at 06:58 AM. Reason: Added green "resolved" checkmark

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