Results 1 to 10 of 10

Thread: [RESOLVED] Run a program in a program...

  1. #1

    Thread Starter
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    [RESOLVED] Run a program in a program...

    Alright, i have a very very simple TFTP server program that i was going to try and recreate, but i was wondering...is there some way i could imbed or like run inside my program so the end user will not see it? Or some way i could run the program and hide it until the transfer completes then close it?


    Any help, or suggestions are appreciated!!

    Thanks!
    Last edited by ixtrip; Feb 14th, 2008 at 11:20 AM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Run a program in a program...

    You can use SetParent api - there are many samples posted on the forum.
    The following two functions (at least) you will more likely need:
    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
    
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

  3. #3

    Thread Starter
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    Re: Run a program in a program...

    Ok thanks set parent worked, but how would i go about hiding it so it's not visible at all? And can i just kill that process and then it will end the program running in my program?

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Run a program in a program...

    You will need another 2 APIs if you want to hide and/or destroy it:
    Code:
    Private Const SW_HIDE = 0
    
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    
    Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long

  5. #5

    Thread Starter
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    Re: Run a program in a program...

    Awesome, thanks for the help!

  6. #6

  7. #7

    Thread Starter
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    Re: [RESOLVED] Run a program in a program...

    Another quick question, not really important but is there some way to like tie the other .exe file to the one i will create, so there will be only 1 file not two? I could always just zip the files together, just curious if it's possible

  8. #8

  9. #9
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: [RESOLVED] Run a program in a program...

    You can "bind" or "join" 2 EXE files into 1 so they execute at the same time. I'm not sure if the mods want this discussed here though since a lot of people use it to bind a virus/trojan to a legit program.

  10. #10

    Thread Starter
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    Re: [RESOLVED] Run a program in a program...

    Could you PM me some information on that? I want to try and do it with a tftp server program i have...

    thanks`

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