Aug 21, 2010 05:34 AM
(This post was last modified: Aug 21, 2010 05:40 AM by The-One.)
This is what we are going to do:
[img]http://i286.photobucket.com/albums/ll109/w00tare/Tut_Mutex.gif?t=1282394211[/img]
It uses a error to decide if its running or not, since we use '0' as rights for the mutex, it will give a error when we try to handle it since we don't have the rights. The error will contain 'denied', thats were we are going to search for, you can also use GET_LAST_ERROR, but if you want to do that you need to make another mutex code.
The code:
[img]http://i38.[censored].com/97l1kh.png[/img]
Im not sure i quite understand, what can this be used for exactly?
(Aug 21, 2010 05:56 AM)xBroak Wrote: Im not sure i quite understand, what can this be used for exactly?
To see if a program/process is running.
I have already posted this not the exactly the same just a few lines different.
https://hackforums.net/showthread.php?tid=584046
(Aug 21, 2010 05:57 AM)The-One Wrote: To see if a program/process is running.
More specifically to prevent multiple launches of your program.
+1 for making them type out the code themselves and seemingly understanding what your doing.
(Aug 21, 2010 06:07 AM)Neroxan Wrote: +1 for making them type out the code themselves and seemingly understanding what your doing.
+2 For me, because I am going to write a quick image reader =]
Aug 21, 2010 06:11 AM
(This post was last modified: Aug 21, 2010 06:15 AM by The-One.)
0.o :P Well, I can only give you +1 :(
(Aug 21, 2010 06:05 AM)Vorfin Wrote: More specifically to prevent multiple launches of your program.
That can also be done like this:
Code If Ubound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
MessageBox.Show("Program is already running!")
End
End If
(Aug 21, 2010 06:11 AM)The-One Wrote: 0.o :P Well, I can only give you +1 :(
purchase uber to be able to +3 or give negative rep. Its how omni cons you into giving him another $15 :P But if you meant you can only +1 in return, ppl shouldent give rep expecting to get it back....
Rep is usually given for help in this section, if ppl know you arent a total skid, or if your a total skid and happen to leach something onto the forum that some other skid can use. Unfortunately, the last option seems to be the most common occurrence :/
also can be done something like
Code If previous.instance(program name) = true then
end
end if
^^thats prolly not exact, im not a vb.net coder I just remember it off the top of my head.
(Aug 21, 2010 06:25 AM)Neroxan Wrote: purchase uber to be able to +3 or give negative rep. Its how omni cons you into giving him another $15 :P But if you meant you can only +1 in return, ppl shouldent give rep expecting to get it back....
Rep is usually given for help in this section, if ppl know you arent a total skid, or if your a total skid and happen to leach something onto the forum that some other skid can use. Unfortunately, the last option seems to be the most common occurrence :/
also can be done something like
Code If previous.instance(program name) = true then
end
end if
^^thats prolly not exact, im not a vb.net coder I just remember it off the top of my head.
I don't need rep back from him, I just like to see how he 'asks' for rep :P
(Aug 21, 2010 06:29 AM)The-One Wrote: I don't need rep back from him, I just like to see how he 'asks' for rep :P
Vorfin, ask for rep? I lol'ed. Seriously.... See that staff tag up under his name bro? He wouldent make it that far if he "asks" or implies that he wanted rep...
Vorfin has more ppl hanging on his nuts than Britney Spears influences lil girls to be whores.
(Aug 21, 2010 06:32 AM)Neroxan Wrote: Vorfin, ask for rep? I lol'ed. Seriously.... See that staff tag up under his name bro? He wouldent make it that far if he "asks" or implies that he wanted rep...
Vorfin has more ppl hanging on his nuts than Britney Spears influences lil girls to be whores.
Yes but I didn't gave him rep to get +5 back from him.
I gave him rep because he wanted +2, So I gave him +1 >.<
|