|
Cute. You're going to have to investigate that yourself. The problem you have is that not every Windows installation is the same. Certain installation options will vary your list depending on whats installed.
Frankly, I think this is a waste of time as suspending process, even non-system ones, can cause problems. There's just no way you're going to be able to tell which process can and cannot be suspended.
|
|
|
|
|
(1.) Would you suggest just disconnecting the internet using the shell command:
Shell ("ipconfig /release", vbHide)
(2.) or disabling all network and I.p. devices.
(3.) Check the process really deep to make sure it's not connected to anything important, then if it's not do whatever I please to it. But if it is, freeze the non-important parts of the program.
Then re-enable anything that has been mess with (see above).
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
1 and 2 do nothing but stop all TCP/IP traffic on the network interfaces. They have nothing to do with stopping process or OK'ing a process to launch.
Brandon T. H. wrote: (3.) Check the process really deep to make sure it's not connected to anything
important
First, how do you define "anything important"?? Then, how do you think you're going to implement this "check"??
Brandon T. H. wrote: freeze the non-important parts of the program.
You've already been told: You're not going to "freeze" anything. Attempting to do so can have unforseen consequences in the system.
Windows already implements the goal of your application in Group Policy.
|
|
|
|
|
That is not practical, the list of typical processes is a moving target. It differs from one Windows version to the next, from one PC to the next, and from one moment to the next, as Windows, your AntiVirus SW, and a lot of applications get updated any way their vendor sees fit. Forget it.
What you might do is run Windows in kiosk mode (Google!), and write one app that offers the user exactly those operations you want available, no more, no less; it would launch allowed processes, the user would never launch anything through Windows, only through your one app (which may or may not require a lot of Windows Explorer functionality). No guarantees, as I've never done that (kiosk mode, that is).
|
|
|
|
|
The best advice is "do not do this". Unless you have a very clear understanding of the Windows operating system internals this will cause you nothing but pain; followed by a lot of anger from your customers.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
You should never suspend a process you don't know its purpose. By the way, if you suspend a process that own a resource, then other process won't have access to it so you can create deadlock particularly if you try to suspend a lot of processes and some process will have problems like timeout.
It is impossible to know what process are critical as it vary in time. Say you are printing, then if you suspend related process chances are that you will scrap the output. And it might get worst if a program is saving data to a file.
Philippe Mori
|
|
|
|
|
I am working on an MVC3 web application using VB, and need to have a countdown that updates itself on the page.
would highly appreciate any assistance for this.
|
|
|
|
|
Assistance with "what" exactly? Creating a countdown or displaying it? What have you tried?
I'd imagine that a simple JavaScript might do the trick. Does it need to do anything else when done with counting?
Bastard Programmer from Hell
|
|
|
|
|
I tried using javascript countdown but it does not work in my environment
yes it needs to inform the page when the countdown is over.
this is part of a timed quiz I am working on, and when the time is finished, it should provide feedback to the server part so that editing is stopped.
|
|
|
|
|
Member 8442750 wrote: I tried using javascript countdown but it does not work in my environment
That's where these things are usually done. What's wrong with the environment?
Does it allow VBScript? Seems that you'd want to do the counting on the client
Bastard Programmer from Hell
|
|
|
|
|
my environment is MVC RAZOR, and javascript compatibility is quite limited.
|
|
|
|
|
What does "quite limited" mean? Can or can't you execute JavaScript on the browser?
Bastard Programmer from Hell
|
|
|
|
|
it depends on the libraries used: some are compliant and some are not, thus finding one that works is close to impossible.
|
|
|
|
|
Hello,
I want to make an application which writes and reads the records from a binary file and to search the records according to various parameter of each record from the file efficiently. How could I do this job using VB 2010?
|
|
|
|
|
Binary files to store and retrieve data consistently and efficiently are called "databases". What you are suggesting is writing your own database, which is a cool excercise. If you don't have the time to learn how a database works internally, then you'd best use an existing database-application. Sqlite and SqlCE would use local (binary) files that you can query easily.
Bastard Programmer from Hell
|
|
|
|
|
Hello all,
Whenever I run my program, it gives the error "32-bit processes cannot access the modules of 64-bit processes," since my program is 32-bit and that it reads (basically) every 64-bit processes start-up path, and terminates it or keeps it alive to make sure it's the real program. So how can I build my program in 64-bit.
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
modified 3-May-12 8:57am.
|
|
|
|
|
|
lol, ok
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Thanks bro it helped
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
It's good to combine a joke with being useful! Don't get the chance too often.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thanks for the advice
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Imports System.Runtime.InteropServices
Public Class Form1
Public Const MAXPNAMELEN = 32 ' max product name length (including NULL)
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Structure MIDIINCAPS 'Structure def copied from win32api.txt
Dim wMid As Int16
Dim wPid As Int16
Dim vVersion As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAXPNAMELEN)> _
Dim szPname As String 'win32api.txt def is String*MAXPNAMELEN
End Structure
Declare Function midiInGetNumDevs Lib "winmm.dll" () As Long
Declare Function midiInGetDevCaps Lib "winmm.dll" Alias "midiInGetDevCapsA" _
(ByVal uDeviceID As Int32, ByVal lpCaps As MIDIINCAPS, ByVal uSize As Int32) As Int32
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim retval As Int32
Dim NumMidiInDevices As Int32
Dim DevCounter As Int32
Dim devicecaps As New MIDIINCAPS
NumMidiInDevices = midiInGetNumDevs()
For DevCounter = 0 To NumMidiInDevices - 1
retval = midiInGetDevCaps(DevCounter, devicecaps, Len(devicecaps)) ' Runtime error msg here
'=======================================================================
'A call to PInvoke function 'MidiInCapTest!MidiInCapTest.Form1::midiInGetDevCaps' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
'========================================================================
Next DevCounter
End Sub
'============================================================================
'I have tried <VBFixedString(MAXPNAMELEN)> instead of Marshall as, in the sructure plus countless tries at int16, int32 etc for the other parameters in the API call,in a fruitless attempt to outwit the known inconsistencies between winapi32.txt data types & .NET but to no avail.
'Can anyone help
End Class
|
|
|
|
|
The main thing is that the 2nd parameter should be 'ByRef':
Declare Function midiInGetDevCaps Lib "winmm.dll" Alias "midiInGetDevCapsA" (ByVal uDeviceID As Integer, ByRef lpCaps As MIDIINCAPS, ByVal uSize As Integer) As Integer
Public Structure MIDIINCAPS
Dim ManufacturerID As Short
Dim ProductID As Short
Dim DriverVersion As Integer
Dim Label As String
Dim Support As Integer
End Structure
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
You are right, the main thing was to use byref on the 2nd param. I usually copy Api calls directly from win32api.txt but in this case copied it from someone elses downloaded code
Thanks for the assist
Midigeek
|
|
|
|
|
Hi,
This article[^] of mine should help you out for most issues.
Yes it may take some experimenting; however for optimum progress, you should fix issues in this order:
1. The stack problem should be solved through the CallingConvention attribute.
2. The numeric parameters or fields should pose no problem, just make sure you use the managed/unmanaged types with matching sizes.
3. The fixed-length string field takes a MarshalAs with SizeConst (not sure a symbolic constant is acceptable); I expect ByValTStr is right, the doc says:
Used for in-line, fixed-length character arrays that appear within a structure. The character type used with ByValTStr is determined by the System.Runtime.InteropServices.CharSet argument of the System.Runtime.InteropServices.StructLayoutAttribute applied to the containing structure.
Good luck
|
|
|
|