|
-
Aug 28th, 2006, 03:04 PM
#1
Thread Starter
Lively Member
[2005] Make a program start up another program and preform action
Well, ok, il try to explain as best as I can.
I have created this tabbed based web browser, and with this i am going to create some plug-ins, like various search plug'ins etc. What i need to know though, is, lets say i have a directory in my web browser install dir called "plugins", and there i have exe's of small plugin programs ive made. Now, how would the command be, on these plugins to make the webbrowser navigate?
Now i only have:
Code:
System.Diagnostics.Process.Start("http://911tabs.com/search.php?search=" + TextBox1.Text + "&type=band")
and this opens up in the default web browser, I want it to show up in my own web browser..
Cheers!
-
Aug 28th, 2006, 03:32 PM
#2
Re: [2005] Make a program start up another program and preform action
VB Code:
Process.Start("YourAppPath", "http://911tabs.com/search.php?search=" + TextBox1.Text + "&type=band")
'in your application put
If Environment.GetCommandLineArgs.Length > 0 Then
WebBrowseObject.navigate(Environment.GetCommandLineArgs(0))
End If
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 03:50 PM
#3
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
Thank you! Another question though, what would be the easiest way to set the application path concidering the plugin is in a subfolder in the application folder.
/folder/application.exe
/folder/plugins/plugin.exe
I would like not to use "c:\program files\folder\application.exe" because it may differ from computer to computer.
Cheers!
-
Aug 28th, 2006, 03:59 PM
#4
Re: [2005] Make a program start up another program and preform action
Store your executable in the registry
VB Code:
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\YourCompany\AppName", True).SetValue("ExePath", Application.ExecutablePath)
And read them anytime you want
VB Code:
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\YourCompany\AppName", False).GetValue("ExePath")
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 04:11 PM
#5
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
Thanks loads. For some reason though, it only results in my webbrowser application being opened, but it doesnt navigate anywhere.. will fiddle around a bit and see if I can fix it! Thanks so much.
EDIT: Just to double check, where in my code should i put
If Environment.GetCommandLineArgs.Length > 0 Then
w.Navigate(Environment.GetCommandLineArgs(0))
End If
Last edited by Untouchab1e; Aug 28th, 2006 at 04:15 PM.
-
Aug 28th, 2006, 04:25 PM
#6
Re: [2005] Make a program start up another program and preform action
in the Load event handler of your main form (the browser)
or in the Sub Main() if you have one
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 04:32 PM
#7
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
Yeh, but thinking this is a webbrowser, the main form is already loaded as the plugin is accessible from the webbrowser itself, so unless the webbrowser application is closed it wont work.. Sorry for being such a newbie.
EDIT: When placed in the Load event, when the form loads normally (Without the plugin command) then the browser navigates to my .exe file and prompts me to download it :P)
Last edited by Untouchab1e; Aug 28th, 2006 at 04:42 PM.
-
Aug 28th, 2006, 04:42 PM
#8
Re: [2005] Make a program start up another program and preform action
it's okay, no problem....
But if the program is already loaded and the plug-in is accessible from the program itself, then make it do the work directly.
you only have to put the plug-in and the app in the same NameSpace.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 04:44 PM
#9
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
hmm, ok, i will try, but i guess i would like it to work the other way, because i may wanna make it easy to make plugins which you can just put in the pluginfolder yourself without actually having to put it in the application, if you see what I mean? And btw, i have no idea how to put the plugin (which is a normal project) into another project (the webbrowser)
Last edited by Untouchab1e; Aug 28th, 2006 at 04:52 PM.
-
Aug 28th, 2006, 04:52 PM
#10
Re: [2005] Make a program start up another program and preform action
 Originally Posted by Untouchab1e
hmm, ok, i will try, but i guess i would like it to work the other way, because i may wanna make it easy to make plugins which you can just put in the pluginfolder yourself without actually having to put it in the application, if you see what I mean? And btw, i have no idea how to put the plugin (which is a normal project) into another project (the webbrowser)
Not in another project, just use the same NameSpace for both projects.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 04:56 PM
#11
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
Hmm, i feel utterly stupid right now, but ive never done anything like this before..
What namespace are you referring to? Could you give me an example? And what do you mean by "Put the program in the app"?
Really appreciate it!
-
Aug 28th, 2006, 05:08 PM
#12
Re: [2005] Make a program start up another program and preform action
 Originally Posted by Untouchab1e
Thank you! Another question though, what would be the easiest way to set the application path concidering the plugin is in a subfolder in the application folder.
/folder/application.exe
/folder/plugins/plugin.exe
I would like not to use "c:\program files\folder\application.exe" because it may differ from computer to computer.
Cheers!
Application.Startuppath will return the path to the exe.
So you can get your plugins folder like so
VB Code:
Dim PluginPath as String = application.Startuppath & "\plugins\"
and it will always be right no matter where the user installed the application.
I would also stay away from the registry and use an XML file that is local the the app. This makes the app very easy to move. You could simply copy the entire folder from one PC to the other and it will work. No need to copy registry entires and such. Also working with the registry opens up a can of permissions worms. Sure it works fine on your machine, but that is because your machine is running the .NET framework at full trust. Another system may only be running at partial trust, and the registry is one of the things limited by that.
-
Aug 28th, 2006, 06:05 PM
#13
Re: [2005] Make a program start up another program and preform action
 Originally Posted by kleinma
I would also stay away from the registry and use an XML file that is local the the app. This makes the app very easy to move. You could simply copy the entire folder from one PC to the other and it will work. No need to copy registry entries and such.
You are right about the permissions thing, but reg values are set at run-time, so you still can copy the folder to another computer nothing will happen
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 28th, 2006, 06:13 PM
#14
Re: [2005] Make a program start up another program and preform action
 Originally Posted by ComputerJy
You are right about the permissions thing, but reg values are set at run-time, so you still can copy the folder to another computer nothing will happen
I was just speaking in general terms. I used to use the registry a lot, because it was pretty easy to use, and seemed to be the "norm" for applications. However using XML files located in the applications directory, or for individual user profile use, the Application Data in documents and settings, is a lot easier to work with.
-
Aug 29th, 2006, 01:44 AM
#15
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
I am still really unsure about how to actually make this plugin\browser thingie work! Can anyone help?
-
Aug 31st, 2006, 12:29 PM
#16
Thread Starter
Lively Member
Re: [2005] Make a program start up another program and preform action
Sorry for the bump, but there must be some sort of solution? Thanks a million!
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
|