Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB6]Question About Using Shell

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 8:07 am    Post subject: [VB6]Question About Using Shell Reply with quote

I was wondering if it were possible to open a program and set a variable in that program from another program, like this:
Code:

Call Shell("c:\Project1.exe Var=111")


Would something like that be possible?


~Elec0

_________________
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 17, 2008 8:21 am    Post subject: Re: [VB6]Question About Using Shell Reply with quote

Elec0 wrote:
I was wondering if it were possible to open a program and set a variable in that program from another program, like this:
Code:

Call Shell("c:\Project1.exe Var=111")


Would something like that be possible?


~Elec0

Sorry. you cant pass variables with shell.

Code:
Shell "C:\temp\blastrox.exe", vbNormalFocus

shell(pathname.exe, [windowstyle as vbappwinstyle=vbnormalfocus]) As Double[/code]

_________________
Intel over amd yes.


Last edited by NINTENDO on Thu Jan 17, 2008 8:24 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 8:23 am    Post subject: Reply with quote

Is there anyway you can?
_________________
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 17, 2008 8:24 am    Post subject: Reply with quote

I dont know if there is
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 8:27 am    Post subject: Reply with quote

Dang, that would be nice. Hmm, I can think of one way, but it's crude and you have to have cooperation from the other program. I think I'll google it.
Thanks though, if you remember anything, please let me know.


~Elec0


Edit: Using
Code:

Call Shell("Blah.exe", vbnormalfocus)


Works just as well instead of using just the Shell "blah.exe", vbnormalfocus

_________________
Back to top
View user's profile Send private message MSN Messenger
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 8:52 am    Post subject: Reply with quote

Use ShellExecute WinAPI it will allow params etc.
Back to top
View user's profile Send private message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 8:55 am    Post subject: Reply with quote

Could you post how to use it please?
_________________
Back to top
View user's profile Send private message MSN Messenger
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 8:58 am    Post subject: Reply with quote

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 somebutton_Click()
   Dim handle As Long
   handle = ShellExecute(0, "Open", "c:\file.exe", "parameter", 0, SW_SHOWNORM)
End Sub
Back to top
View user's profile Send private message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 9:02 am    Post subject: Reply with quote

Cool, thanks.
Am I using it right?
Code:

   Dim handle As Long
   handle = ShellExecute(0, "Open", "c:\Project1.exe", "Var", 111, SW_SHOWNORM)


_________________
Back to top
View user's profile Send private message MSN Messenger
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 9:07 am    Post subject: Reply with quote

No like that it sends "Var" as arg[0] and 111 is set as directory (the start path)...

You could do it like this:

Code:

Dim handle As Long
handle = ShellExecute(0, "Open", "c:\Project1.exe", "Var=111", 0, SW_SHOWNORM)


The "Var=" is not even needed depending how Project1.exe handle it...
Back to top
View user's profile Send private message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 9:11 am    Post subject: Reply with quote

The Var is declared a public variable at the start of the program.
Thanks, I'll try it.

Edit: The label didn't change when I loaded it up. (I have on load it sets a label to what the Var is.)

_________________
Back to top
View user's profile Send private message MSN Messenger
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 9:18 am    Post subject: Reply with quote

Use this:
Code:
Dim handle As Long
handle = ShellExecute(0, "Open", "c:\Project1.exe", "111", 0, SW_SHOWNORM)



Put this in Form_Load() of Project1.exe
Code:
Dim strParam As String
strParam = Command()

Me.Caption = strParam
Back to top
View user's profile Send private message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 9:22 am    Post subject: Reply with quote

Thanks, I'll try once again. Smile


Edit: Yay! It worked! Thanks. +Rep for you.

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites