techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old Apr 4, 2010, 07:22 PM   #1
ste2425
2000 Posts
 
ste2425's Avatar
 
Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts

System Specs

c++ code help

is it possible in c++ a function that when called will start any windows programme i choose? like windows media player for example? I want to make some very basic form a voice recognition software i have an idea on how to get the audio bit to recognise what im saying but i have no idea to to make it open the programme i say.
stephen
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols

Where's all the talent gone?
ste2425 is offline  
Reply With Quote
Old Apr 4, 2010, 07:29 PM   #2
erocker
Senior Moderator
 
erocker's Avatar
 
Join Date: Jul 2006
Location: Milwaukee, WI.
Posts: 31,962 (12.77/day)
Thanks: 2,793
Thanked 12,322 Times in 7,833 Posts

System Specs

Sure it's possible, do you have any C++ knowledge? If not, it's probably best to get some first. Lots of links here: http://forums.techpowerup.com/showthread.php?t=31132

C++ tutorials: http://www.cplusplus.com/doc/tutorial/

Perhaps you may find something that works better for you than C++. I'm still skimming though all the links and I'm starting to learn.
erocker is offline  
Reply With Quote
The Following User Says Thank You to erocker For This Useful Post:
Old Apr 4, 2010, 07:31 PM   #3
ste2425
2000 Posts
 
ste2425's Avatar
 
Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts

System Specs

Quote:
Originally Posted by erocker View Post
Sure it's possible, do you have any C++ knowledge? If not, it's probably best to get some first. Lots of links here: http://forums.techpowerup.com/showthread.php?t=31132

Perhaps you may find something that works better for you than C++. I'm still skimming though all the links and I'm starting to learn.
aye i do ive almost finished my first year of programming for audio systems at uni, next year im doing programming for windows and embeded systems,

i think i found out a way to be onest, it was allot easier then i expected.

Quote:
using: system(), CreateProcess() and ShellExecute()
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols

Where's all the talent gone?
ste2425 is offline  
Reply With Quote
Old Apr 4, 2010, 07:31 PM   #4
Kreij
Hardcore Monkey Moderator
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts

System Specs

I'm a little rusty on my C++, but the ShellExecute() function may do what you need.
__________________

Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other.


Get more tech news on a wide variety of topics at NextPowerUp
Kreij is offline  
Reply With Quote
Old Apr 4, 2010, 07:34 PM   #5
erocker
Senior Moderator
 
erocker's Avatar
 
Join Date: Jul 2006
Location: Milwaukee, WI.
Posts: 31,962 (12.77/day)
Thanks: 2,793
Thanked 12,322 Times in 7,833 Posts

System Specs

Quote:
Originally Posted by ste2425 View Post
aye i do ive almost finished my first year of programming for audio systems at uni, next year im doing programming for windows and embeded systems,

i think i found out a way to be onest, it was allot easier then i expected.
Heh, you're way further ahead than me. I just started reading. I haven't "coded" anything since my Commodore 64. I figure I have a couple good application ideas for Droid/iphone and I might as well start doing something about them.
erocker is offline  
Reply With Quote
Old Apr 4, 2010, 08:00 PM   #6
Kreij
Hardcore Monkey Moderator
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts

System Specs

Quote:
Originally Posted by Erocker
I haven't "coded" anything since my Commodore 64
Get with the program you slacker.

I used to do a lot in C/C++, but since I've been doing a lot of Database stuff, C# seems to a good fit. I was dabbling in F#, but can't find a real need for it.
Maybe it's time to dig back in so I can be of more help here. Seems a lot of people, especially in school, need C++ assistance.
__________________

Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other.


Get more tech news on a wide variety of topics at NextPowerUp
Kreij is offline  
Reply With Quote
Old Apr 4, 2010, 10:04 PM   #7
dcf-joe
200 Posts
 
dcf-joe's Avatar
 
Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts

System Specs

Yeah, whenever you code your function and you want to start Windows Media Player, all you have to do it:

void startMediaPlayer() // This function header is completely randomly created, it can say anything
{
system("start wmplayer.exe");
}

Remember, you can start any executable, just go to task manager to find out what the official executable name is so that you can call system("blah.exe")
dcf-joe is offline  
Reply With Quote
The Following User Says Thank You to dcf-joe For This Useful Post:
Old Apr 5, 2010, 09:22 AM   #8
ste2425
2000 Posts
 
ste2425's Avatar
 
Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts

System Specs

Quote:
Originally Posted by dcf-joe View Post
Yeah, whenever you code your function and you want to start Windows Media Player, all you have to do it:

void startMediaPlayer() // This function header is completely randomly created, it can say anything
{
system("start wmplayer.exe");
}

Remember, you can start any executable, just go to task manager to find out what the official executable name is so that you can call system("blah.exe")
so i dont need to give the file path? like c:\ program files etc etc etc? i also heard that using system locks the code there until you close whatever exe you opened? does it?

edit no it doean't lock up just tested cheers that will work perfect for what i need
All i need to do next it work out how to use a mic a record a bit of audio good job im doing that soon at uni
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols

Where's all the talent gone?
ste2425 is offline  
Reply With Quote
Old Apr 5, 2010, 10:19 PM   #9
dcf-joe
200 Posts
 
dcf-joe's Avatar
 
Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts

System Specs

Thank you for the thanks, and you are welcome. I am kind of a beginner myself, but I have had to use that system call before and it works perfectly

No, you do not have to provide system paths, you JUST have to know the executable name, and if you are using a 64-bit operating system, you DO NOT have to provide the *32 flag at the end of the executable name, the operating system already knows
dcf-joe is offline  
Reply With Quote
Old Apr 6, 2010, 04:39 PM   #10
Kreij
Hardcore Monkey Moderator
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts

System Specs

I think to launch an executable without the full path, the directory name has to be in the "Path" enviroment variable.
__________________

Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other.


Get more tech news on a wide variety of topics at NextPowerUp
Kreij is offline  
Reply With Quote
The Following User Says Thank You to Kreij For This Useful Post:
Old Apr 6, 2010, 05:32 PM   #11
ste2425
2000 Posts
 
ste2425's Avatar
 
Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts

System Specs

Quote:
Originally Posted by dcf-joe View Post
Thank you for the thanks, and you are welcome. I am kind of a beginner myself, but I have had to use that system call before and it works perfectly

No, you do not have to provide system paths, you JUST have to know the executable name, and if you are using a 64-bit operating system, you DO NOT have to provide the *32 flag at the end of the executable name, the operating system already knows
what if your running on 32 bit systems though? this just for personall use an my systems 64bit but if it turns out anygood and of any use it might give u guys the code to mess bout with
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols

Where's all the talent gone?
ste2425 is offline  
Reply With Quote
Old Apr 7, 2010, 12:17 AM   #12
dcf-joe
200 Posts
 
dcf-joe's Avatar
 
Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts

System Specs

Does not matter if 32 or 64 bit. The operating system knows what it is when it runs the executable.

I am just saying, if you are running a 64-bit operating system and you are trying to run a 32-bit executable, you do not have to include that flag at the end, because the operating system knows what it is before it runs it.

As for trying to run a 64-bit executable in a 32-bit environment, if I recall correctly, Microsoft released an update a few years back to allow that to work, somehow I am sure it would work the same way though.
dcf-joe is offline  
Reply With Quote
Old Apr 7, 2010, 10:25 AM   #13
ste2425
2000 Posts
 
ste2425's Avatar
 
Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts

System Specs

Quote:
Originally Posted by dcf-joe View Post
Does not matter if 32 or 64 bit. The operating system knows what it is when it runs the executable.

I am just saying, if you are running a 64-bit operating system and you are trying to run a 32-bit executable, you do not have to include that flag at the end, because the operating system knows what it is before it runs it.

As for trying to run a 64-bit executable in a 32-bit environment, if I recall correctly, Microsoft released an update a few years back to allow that to work, somehow I am sure it would work the same way though.
ok thats great cheers
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols

Where's all the talent gone?
ste2425 is offline  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help simplifying code ste2425 Programming & Webmastering 21 Feb 15, 2010 08:52 PM
Ati Code 43 Error Help domy85 General Software 1 Mar 18, 2009 08:58 PM
DFI Code 26.. Need help ShadowFold Motherboards & Memory 12 Jan 2, 2009 08:34 PM
AGESA code WojtasRed Motherboards & Memory 4 Aug 24, 2008 05:07 PM


All times are GMT. The time now is 08:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts