|
-
Apr 26th, 2006, 02:33 AM
#1
Thread Starter
Fanatic Member
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:
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, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub mExecuteProgram_Click()
If ProgramLst.ListIndex = -1 Then Exit Sub
Const SW_SHOW = 5
hWndLst(ProgramLst.ListIndex) = ShellExecute(Me.hwnd, "open", ProgramLst.Text, vbNullString, vbNullString, SW_SHOW)
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
-
Apr 26th, 2006, 03:13 AM
#2
Thread Starter
Fanatic Member
Re: Execute ANY filetype/program and set start up propeties
Or at least a web page or previous post... I've looked and i can't find...
-
Apr 26th, 2006, 03:15 AM
#3
Re: Execute ANY filetype/program and set start up propeties
You will need a few more APIs.
The FindWindow and SetWindowPos or SetWindowPlacement.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 26th, 2006, 03:20 AM
#4
Thread Starter
Fanatic Member
Re: Execute ANY filetype/program and set start up propeties [Resolved]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|