|
You'll need the ToolHelp32 or PSAPI files depending on which OS you want to support. There are a variety of functions in those that allow you to list processes, terminate processes, etc.
|
|
|
|
|
|
You'll have to download PSAPI:
http://www.microsoft.com/downloads/details.aspx?FamilyID=3d1fbaed-d122-45cf-9d46-1cae384097ac&DisplayLang=en
There is function in there which lists processes. If I remember correctly, I think it uses a callback, but that may only be for 16-bit processes. There is also a function that will allow you to terminate a process. You'll have to put the dll on your target machine and declare the functions in your vb code.
|
|
|
|
|
Yopu might try posting a wm_close message to it's main window first - this will allow it to do any proper cleanup like closing files etc. Ideally you should only terminate a process using Terminateprocess if it has hung...IMHO.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Does anyone know of a way to set the PC's system time in VB?
Thanks
NR
------------------------------------------
I beat the internet - the end guy is hard.
|
|
|
|
|
use SetLocalTime API function to set date and time.
|
|
|
|
|
Yes I found it thanks - I was having trouble using the API but I finally figured out that the SystemDate Structure items had to be Short not Integer ! Thanks
------------------------------------------
I beat the internet - the end guy is hard.
|
|
|
|
|
Calling the TimeOfDay and setting it does the samething.
|
|
|
|
|
Setting the TimeOfDay Property in Visual Basic
does the samething.
|
|
|
|
|
Doh!
Thanks
------------------------------------------
I beat the internet - the end guy is hard.
|
|
|
|
|
dear all,
how can i detect a system restart using WM_QUERRYSESSION.
i'm able to differentiate between a Logoff and shutdown using the message, but no clue whatsoever of differentiating between a system shutdown and system restart.
plz. respond
regards
|
|
|
|
|
Is there a way to either set a Windows Service (I'm not talking Web Services here) dependencies through code or through the installui utility?
Once my VB.NET service is setup using the command line utility installui.exe, since I have the "Installer" class included in my project with all the options like Type (Automatic, Manual, Disabled), everything behaves like I want... except I see no easy way to set Service dependencies. The "hacked" way of doing it appears to be going to:
HKLM\System\CurrentControlSet\Services\YourServiceName\ and adding a key called DependOnService of type REG_MULTI_SZ and then include the service name(s) you are dependent on. This does appear to work well... except there's got to be a better way than having to manually enter this stuff into the registry.
Anyone?
|
|
|
|
|
You need a service installer in your project. Go to the Design view of your service and right-click in the designer and select 'add installer'. This will add a file called ProjectInstaller.vb which has a ServiceProcessInstaller and ServiceInstaller class. The property window of the ServiceInstaller class will let you add other service dependencies. Search the MSDN for an article entitled:
Walkthrough: Creating a Windows Service Application in the Component Designer
It gives all of the details.
|
|
|
|
|
Thanks for your reply... been meaning to say that. I had the installer and just missed it somehow. DUH Anyway, your reply made me look again and there it is. Thanks alot.
|
|
|
|
|
I have a problem with a datagrid.
The user can edit and add new rows in a bound datagrid. I update the dataset binding to the datagrid when the current cell of the datagrid change.
The problem is if the user change a value in a row without after move to an another rows of the datagrid, the dataset don't detect a change (and the update doesn't work).
The dataset don't detect the changed on a row if we don't navigate on another row of the datagrid !!
Have you the same problem ????? and a solution ?
I hope you understand my bad english.
Thank you
|
|
|
|
|
Deal ALl,
I'm goint to customize Windows Media Player 6.4 using VB 6.
THe basic requirements for this task are:
1) the media player only play at full-screen mode. This is quite easy and I can set the properties related.
2) the media player is exclusively run, which means when there is a playback, there would be no other player running simutaneously.
I dont know how to do this by customizing media player. However, I set the program checking at starting point if there is a previous instance of this program. If yes, then abort the new started player program.
However, if the file name of this media player changed, two media player programs with different names will be running simultaneously, which is a situation i did not expect to see.
3) The full screen mode seems not so stable. For example, if I try to start, at the same time, the same player program more than once, only one will run but NOT in full screen mode.
I appreciate your help!
JW
DJ
|
|
|
|
|
I have an application in ACCESS that requires selecting file names from arbitrary directories to be stored in a field in an ACCESS database. I would like to use the standard windows open file dialog. As a newbie to this level of programming I am not sure where to find a complete control that can be called from a event handler in the VB code for the on_Click method for a button that I labeled 'BROWSE'. It seems a waste to have to reinvent that entire standard interface. Can someone point me in the direction of a implemented control.
Thanks for your help.
Jim Durbin
durbin@northcoast.com
|
|
|
|
|
Hi
in vb you can use (microsoft common dialog control) (comdlg32.ocx)
|
|
|
|
|
Thanks for the information. When attempting to install this control, I get a message saying that I need a design time license. Am I doing something wrong, do I really need a license from MS for this control, or is there a work-around?
|
|
|
|
|
Hi,,
this is strange
I just install Visual studio 6 and use the control and nothing more!!
|
|
|
|
|
This is in VB.Net
I want to make a string object refer to another string object so that whatever changes in the object will show in both variable:
Dim a, b as string
a = b.Clone()
b = "123"
I've tried the above method but the value of a is still "" instead of "123". Any thoughts or idea??
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Notorious SMC wrote:
Dim a, b as string
a = b.Clone()
b = "123"
are you sure this is the code ?
or this :
Dim a, b as string<br />
b = "123"<br />
a = b.Clone()
|
|
|
|
|
Try creating a class with a string property.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
I know what your thinking with Clone on a string. Your getting a pointer that another string variable can be set with so two variables can point to the same memory location. You right, that's how it works! BUT! What you don't know is that in the .NET framework, STRINGS ARE IMMUTABLE. That means that once a string is created, you CANNOT modify it at all!
How is this possible? You can do Search and Replace and change the value of, in your example, 'b'! Your right, you can! What you don't see is that when you change the value of 'b', your actually creating another string in memory and changing the 'b' pointer to look at the new string. 'a' is still looking at the old one and will NOT follow 'b' around. The same is true for replacing a character in the string. You are actually creating a new string (note that 'String <string>.Replace(char,char)' actually returns a String!) and dumping the old one!
The code you wrote is correct, the functionality you want is impossible in .NET, unless you want to go thru the hassle of writing your own String Class.
|
|
|
|
|
Yep, that's exactly what I wanted to do, though i figured out the string immutability thing after countless reference books later. But thanks for the reply.
This limitation of .net makes me long for those good old C++ days
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|