Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Hybrid View

  1. #1
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky

    [req]how to open a program in C++

    i need help im new to c++


    i mean for example i press a button and firefox opens whats the command to open firefox.exe

    visual basic 2008 is "process.start ("Firefox.exe")"

    btw i have cpp 2008
    Last edited by Stelthkid; 08-21-2009 at 06:59 PM.

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  2. #2
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Be more specific? Like a lot more specific. What exactly do you need help with? What kind of help are you looking for? Rather, what do you mean how to open a program in c++?
    Last edited by zeco; 08-21-2009 at 12:15 PM.

  3. #3
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    Quote Originally Posted by zeco View Post
    Be more specific? Like a lot more specific. What exactly do you need help with? What kind of help are you looking for? Rather, what do you mean how to open a program in c++?
    i edited to be more specific... kk now i need help

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  4. #4
    Micheltjuh's Avatar
    Join Date
    Sep 2008
    Gender
    male
    Location
    Holland
    Posts
    643
    Reputation
    10
    Thanks
    59
    My Mood
    Cynical
    If you mean you want to see the source code of an already compiled application, that's not what C++ compilers are for.

  5. #5
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by Stelthkid View Post
    i need help im new to c++


    i mean for example i press a button and firefox opens whats the command to open firefox.exe

    visual basic 2008 is "process.start ("Firefox.exe")"

    btw i have cpp 2008
    one possible way would be to use

    system ("c:/program files/mozilla/firefox.exe");

    System basically allows you to access command prompt, so with using system you are basically telling c++ to send that command to cmd.

  6. #6
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    tyvm ill try this and ill get bak to u kk

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  7. #7
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    it wont work send me a pic of it



    fkin oops

    its not a cmd its a application with buttons if thats wot your telling me
    Last edited by Stelthkid; 08-21-2009 at 08:07 PM. Reason: double post sorry

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  8. #8
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by Stelthkid View Post
    it wont work send me a pic of it



    fkin oops

    its not a cmd its a application with buttons if thats wot your telling me
    So like windows forms? Even then it should still work, one sec let me try something out.

  9. #9
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    Quote Originally Posted by zeco View Post
    So like windows forms? Even then it should still work, one sec let me try something out.
    ill attach some pics kk
    and can u show me a tut

    bottom left hand corner where your thing is
    Code:
    #pragma once
    
    
    namespace firstattempt {
    
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	/// <summary>
    	/// Summary for Form1
    	///
    	/// WARNING: If you change the name of this class, you will need to change the
    	///          'Resource File Name' property for the managed resource compiler tool
    	///          associated with all .resx files this class depends on.  Otherwise,
    	///          the designers will not be able to interact properly with localized
    	///          resources associated with this form.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO: Add the constructor code here
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Clean up any resources being used.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    	private: System::Windows::Forms::Button^  button1;
    	protected: 
    
    	private:
    		/// <summary>
    		/// Required designer variable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Required method for Designer support - do not modify
    		/// the contents of this method with the code editor.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->button1 = (gcnew System::Windows::Forms::Button());
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(0, 0);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(409, 61);
    			this->button1->TabIndex = 0;
    			this->button1->Text = L"button1";
    			this->button1->UseVisualStyleBackColor = true;
    			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->ClientSize = System::Drawing::Size(408, 191);
    			this->Controls->Add(this->button1);
    			this->Name = L"Form1";
    			this->Text = L"Form1";
    			this->ResumeLayout(false);
    
    		}
    #pragma endregion
    	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {system ("c:/program files/mozilla/firefox.exe");
    			 }
    	};
    }
    thats the whole thing

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  10. #10
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by Stelthkid View Post
    ill attach some pics kk
    and can u show me a tut

    bottom left hand corner where your thing is
    Code:
    #pragma once
    
    
    namespace firstattempt {
    
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	/// <summary>
    	/// Summary for Form1
    	///
    	/// WARNING: If you change the name of this class, you will need to change the
    	///          'Resource File Name' property for the managed resource compiler tool
    	///          associated with all .resx files this class depends on.  Otherwise,
    	///          the designers will not be able to interact properly with localized
    	///          resources associated with this form.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO: Add the constructor code here
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Clean up any resources being used.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    	private: System::Windows::Forms::Button^  button1;
    	protected: 
    
    	private:
    		/// <summary>
    		/// Required designer variable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Required method for Designer support - do not modify
    		/// the contents of this method with the code editor.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->button1 = (gcnew System::Windows::Forms::Button());
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(0, 0);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(409, 61);
    			this->button1->TabIndex = 0;
    			this->button1->Text = L"button1";
    			this->button1->UseVisualStyleBackColor = true;
    			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->ClientSize = System::Drawing::Size(408, 191);
    			this->Controls->Add(this->button1);
    			this->Name = L"Form1";
    			this->Text = L"Form1";
    			this->ResumeLayout(false);
    
    		}
    #pragma endregion
    	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {system ("c:/program files/mozilla/firefox.exe");
    			 }
    	};
    }
    thats the whole thing
    Right, after testing it i see the problem with my first method. I'll work on looking for another way.

  11. #11
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    Quote Originally Posted by zeco View Post
    Right, after testing it i see the problem with my first method. I'll work on looking for another way.
    tyvm im just starting to learn cpp its so hard

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  12. #12
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    well its different for me but do u know yet

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  13. #13
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by Stelthkid View Post
    well its different for me but do u know yet
    Yay!

    [php]
    #pragma endregion
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    WinExec("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", SW_SHOW);
    }
    };
    }


    [/php]

    took me forever to get it to work, then i realised you need double backslash because of the \n e*** type things, and for one backslash you need \\

    Last edited by zeco; 08-21-2009 at 09:02 PM.

  14. #14
    Stelthkid's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    dont know
    Posts
    203
    Reputation
    10
    Thanks
    12
    My Mood
    Sneaky
    ty ill try now ohk


    grr it has build errors ... whats the x86 thing

    Help me raise my Habamon!


    Kills.....43781
    Deaths.....2124
    KDR.....20.61
    Streak.....113
    HS.....18391
    HS%.....40%
    GP.....93284




    Thank Me If I Helped.

  15. #15
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by Stelthkid View Post
    ty ill try now ohk


    grr it has build errors ... whats the x86 thing
    Woops, 2 things. Forgot to tell you to

    [php]
    #include <windows.h>
    [/php]

    at the top....

    and the x86 thing is just my path cause i'm running 64 bit thus i have 2 program files folders, change the path to suit your neeeds

Page 1 of 2 12 LastLast

Similar Threads

  1. .net framework v3.5 how to open hacks if they dotn open?
    By dieterke0147 in forum WarRock - International Hacks
    Replies: 0
    Last Post: 07-28-2008, 03:05 AM
  2. help|How to open 2 accounts in 1 computer?
    By snir3434 in forum WolfTeam General
    Replies: 2
    Last Post: 06-12-2008, 05:01 AM
  3. how to open that rar...cannot open one
    By 1234 in forum WolfTeam General
    Replies: 9
    Last Post: 03-19-2008, 06:59 PM
  4. Pls help! dont check how to open CT an other
    By adg in forum WolfTeam General
    Replies: 4
    Last Post: 02-27-2008, 08:54 AM
  5. [Help] How to close a program with a hotkey (VB6).
    By wr194t in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-22-2007, 06:07 AM

Tags for this Thread