|
Yeah I wasn't very clear, but what I was attempting to do was monitor remotely using a socket to find out if my program was still responding, but I was getting into trouble because the socket listener was running in a seperate thread. So even though the main thread had hung, my background thread was quite happily telling me everything was ok!
This Process.GetProcessByName is exactly what I needed, no need to bother with sockets or threads at all... superb, thanks!
By the way I managed to access the Application.Idle event by adding a reference to System.Windows.Forms in my class library, then I used the following code to check if the calling thread was idle.
AddHandler System.Windows.Forms.Application.Idle, AddressOf Idle_app<br />
<br />
Private Sub Idle_app(ByVal sender As Object, ByVal e As System.EventArgs)<br />
iIdleTime = 0<br />
<br />
End Sub<br />
<br />
|
|
|
|
|
Found one slight problem with the Process.GetProcessByName, running it against a remote machine returns a System.NotSupportedException with the message
Feature is not supported for remote machines.
|
|
|
|
|
execute a file in automathic mode using VB.net?
Now I explain myself better.......
I should make run the file xxx. exe in automatic during the execution of a program.........making this in DOS I would do:
C:\> cd C:\WINNT\ServicePackFiles\i386
C:\WINNT\ServicePackFiles\i386>msinfo32.exe /report FILE_NAME.txt /categories
Can I do this two simple operations whith vb??
Please Answer me ASAP....it's very important....
Thanks All.
Night Soul!!!
|
|
|
|
|
What? Your post doesn't make any sense at all. What do you mean by 'automatic'?
Are you asking how you can launch two applications (.EXE's) if you double-click one of
them? Are you asking how to launch another application from inside your application?
In VB.NET, you'd use the Process and ProcessStartInfo classes to launch an external application.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
first of all thanks for the reply...
maybe I express myself bad.
I want to create a subroutine or a function that when it run make this:
C:\> cd C:\WINNT\ServicePackFiles\i386
C:\WINNT\ServicePackFiles\i386>msinfo32.exe /report FILE_NAME.txt /categories
is it possible?
It hope to be explained myself better this time..
Thanks of the help.
Night Soul!!!
|
|
|
|
|
Make what? Are you talking about running an external application?
Easy enough?
Dim newProcess As New Process
newProcess.Start(C:\WINNT\ServicePackFiles\i386\msinfo32.exe", "/report FILE_NAME.txt /catagories")
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
IT WORK!!!
Thanks a lot.;););)
(and sorry for not perfect my English... )
Night Soul!!!
|
|
|
|
|
Hi all!!!
first of all I want to greet all of you...this is my first thread here!!!
I need your help because i'm tring to do a program that on keypress of a button (in the keyboard) will activate the "mute on"....is it possible?
thanks for your attention....
Night Soul!!!
|
|
|
|
|
This is possible. You'd have to write either a keyboardhook or a message filter that looks for the keypress you want, then you'd call the multimedia functions that will mute the sound. This seeming simple part will be extraordinarily difficult if your not familiar with the Multimedia SDK and P/Invoking API functions.
Multimedia SDK Docs[^]
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i know how to develop single user(desktop) database application using ado.How i can make it multi user(more than one computer) in visual basic 6.0 and access/oracle as backend.
|
|
|
|
|
It's not much different than a single user app. The database backend should handle the bulk of the concurrency and your user side shouldn't know (or care) about any other instance running on another machine.
What do you mean by "Access/Oracle" backend? Are you using and Access database and an intermediary to an Oracle database? Why the Access part?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am making a blowfish cryptography program in vb .NET and i have run into a point where i have to convert for unicode. I tried using the StrConv() function but it no long support vbFromUnicode enum. I can convert to unicode but i just need to convert back in .Net. The code that i am using in 6.0 is
Key() = StrConv(New_Value, vbFromUnicode)
Any help with this would be great.
|
|
|
|
|
You might want to replace 'vbFromUnicode' with 'VbStrConv.Wide' in the VB.NET code.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi guys!!!
Im new to VB.NET, and im having some difficulty writing a code that displays all the hardware setting and specifications, presumably currently installed into a computer....What should I do?? =(
Your help will greatly be appreciated!!!
Thanks,
jules
|
|
|
|
|
majulose wrote:
What should I do??
You never mentioned what you problem was. Try posting an actual question...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there,
i'm having big trouble in reading a binary file that has some values in little-endian encoding and some other in big-endian encoding in the header.
can someone explain how to read the header retreaving those values?
thanks in advance.
fuel2run
|
|
|
|
|
fuel2run wrote:
a binary file that has some values in little-endian encoding and some other in big-endian encoding
WHAT?? Very strange...
But the fields that are encoded backwards would have to be read into a byte array and you'll have to write the code to reverse the byte order and then do some simple math to get the value back out.
byte0 | byte1 | byte2 | byte3
Gets reversed to:
byte3 | byte2 | byte1 | byte0
Do the math:
Value = (Byte3 << 24) + (Byte2 << 16) + (Byte1 << 8) + Byte0
Of course, this is subject to exactly how the bytes are really stores and what the value is supposed to be. You COULD have something like this if the values were stored WORD reversed instead of BYTE:
byte0 | byte1 | byte2 | byte3
Should be:
byte2 | byte3 | byte 0 | byte 1
It all depends on the system that wrote the file...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks Dave,
i have to read some "int32" (in vb.net) and i know "where they are" , could you explain the simple math you wrote? i'm not familiar with that sintax (Byte3 << 24 ?)
a win system wrote the file,it is an esri shape file.
thank you
fuel2run
|
|
|
|
|
The << and >> operators are bit shift operators available in VB.NET 2003. They don't exist in 2002. All they do is shift a value a specificed number of bits in that direction. So if you, int a UInt32 had the value &HFF (decimal 255), it would look like this:
00000000|00000000|00000000|11111111
Shifting the value 24 bits to the left, it would now look like this:
11111111|00000000|00000000|00000000
And it's value would then be &HFF000000 (decimal 4,278,190,080).
You could accomplish the same shift by multiplying the value by 2^24.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i'll try as soon as possible, you've been crystal clear
thank you!
fuel2run
|
|
|
|
|
it works fine Dave!
it's the very first time i read binary data.
many thanks!
fuel2run
|
|
|
|
|
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using:
Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
In a VB.Net project (virtual desktops) to (try) and hide running programs (windows not created by my application). I have allready found the hWnd for the window I want to hide (invisable and not in task bar).
I can use the API above to hide the windows no problem (hWnd, SW_HIDE) but getting them back is... not working. I have tried to restore the window (same hWnd) on the next line of code, with SW_SHOW, SW_SHOWNORMAL, SW_RESTORE, SW_MAXIMIZE, SW_MAX (which I took straight form the VB6 API Text Viewer), all with no sucess. The process is still running (in TaskManager) so I doubt that the window was destroyed.
I tested the program on 2 PCs with different OSs (XP Pro and Longhorn 4074 - i know, i know: unstable alpha. But it should work on the XP system), so I think it is my fault.
If any one knows whats wrong, or has another way to hide and restore windows, I'd appriciate it.
Colonel Sanders
|
|
|
|
|
Could someone please explain the difference between scalewidth, scaleheight, scaleX, scaleY, etc. I am really confused. I am trying to set my controls and pictureboxes to automatically resize with the form, but I am having a lot of trouble. I would really like to see an explanation mathematically so that I understand it better. I see a lot of code that uses these with the screen.TwipsPerPixelX, screen.TwipsPerPixelY, but don't quite understand.
|
|
|
|
|
ScaleX and ScaleY convert the values from one unit of measure (twips, pixels, whatever's....) to another.
ScaleWidth and ScaleHeight get/set the values that represent the width and height of the control/form in the units set by the ScaleMode property. Usually, you leave ScaleMode set to vbTwips.
You can use the TwipsPerPixelX and TwipsPerPixelY to determine what the increment should be for ScaleWidth and ScaleY. Say you want to increase the width of a button control by 2 pixels. You would get the TwipsPerPixelX value and multiply that by 2, then add that value to the value in Button1.ScaleWidth.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|