|
You've never heard of Windows Services??? Click on Start/Settings/Control Panel/Administrative Tools/Services??
Like I said, there is no other way...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I prevent opening the cdrom drive or floppy drive.
using vb only
|
|
|
|
|
CD Drives can be locked shut, floppy drives can't.
Check out this[^] example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I know whether cd is in cdrom or not and whether floppy is in floppy drive or not. Please tell me using vbcode
|
|
|
|
|
Just try and get the list of files from the root of the drive. If it fails, then there's nothing in the drive.
There is nothing that will tell you a disk is mounted in the drive without actually trying to access the disk.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I know whether cd is in cdrom or not and whether floppy is in floppy drive or not
|
|
|
|
|
Can any one can tell me how can i know whic O.S. is running. ie,windows xp/2000/95/98/nt in visual basic not in vb.net
|
|
|
|
|
see my reply below. i'm assuming you're the same anonymous person who asked this question earlier. if you would just create an account and login to post your questions you'd get responses when people answer them.
nonetheless, i hope this helps.
[edit]corrected broken link[/edit]
-jim
|
|
|
|
|
I want it in vb6 not through .net platform
|
|
|
|
|
|
Vb.net 2003
DataGrid
Enter is not working
in datagrid.I press Enter
key in datagrid nothing
to happen. How use AddHandler
in datagrid
I neednot processcmdkey
that make more problem
that call keyup function automatic
help me
|
|
|
|
|
Have a datagrid with the following values
1,Smith
2,Brown
3,Green
When I select the grid row say >>>> 2, Brown
What is the datagrid event that will allow me to display the row selected
|
|
|
|
|
When a row or a cell is selected. The default event of datagrid is raised.
FIRE
|
|
|
|
|
Hi every body.
I want to make report generator something like Crystal Report that uesr can make report at runtime.
Do something like resize,drag and drap,drawing lines...
If any one have an idea please lead me or if you have code about it please send it to me.(VB,C#,C++)
Thanks
Akbar
|
|
|
|
|
debugged this and in immediate window when intArr is -1 the loop wont break not sure why forgive me new to this language
Do
intArr(i) = strName.IndexOf("%", y)
y = intArr(i) + 1
i = i + 1
Loop While (intArr(i) <> -1)
|
|
|
|
|
What are you trying to do with this code?
It doesn't break because your Loop While (intArr(i)<> - 1) will already return 0. You incremented the index variable i immediately before the loop while code, pointing your expression at an (apparently) empty position in your intArr() array.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I've been trying for days to write a piece of VB.NET code that will read from winamp's memory space the paths of the files from the current winamp playlist.
The GETPLAYLISTFILE command of the winamp API will only return a pointer to the position of the asked path. An article available on http://msmvps.com/ch21st/archive/2004/02/26.aspx provides a VB6 implementation of this, using the ReadProcessMemory Windows API command, but something goes wrong when I transcribe the code to VB.NET!
In the attached code below that contains all you need to recreate my problem, when the program reaches the "ReadProcessMemory(lpWinamp, lp, Buffer(0), 260, dwRead)" line it will just exit!!! Can anybody help? I am annoyed because I know that it will just be due to some stupid declaration blunder
----------------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' We request the path of the first name in the list
MsgBox(Me.GetPlaylistFile(0))
End Sub
'API commands, constants etc.
Dim WinampWindow As Integer
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Private Const PROCESS_VM_READ As Long = &H10
Public Const IPC_GETPLAYLISTFILE = 211
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Object, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Function FindWinamp() As Boolean
'Returns winamp's hwnd
WinampWindow = FindWindow("Winamp v1.x", vbNullString)
If WinampWindow <> 0 Then
Return True
End If
Return False
End Function
Public Function GetPlaylistFile(ByVal TrackNo As Integer) As String
Dim strFileName As String
Dim lp As Integer
Dim lpWinamp As Integer
Dim PID As Integer
Dim Buffer(260) As Object
Dim Temp As String
Dim dwRead As Long
FindWinamp()
lp = SendMessage(WinampWindow, &H400, TrackNo, IPC_GETPLAYLISTFILE)
If lp = 0 Then
Return ""
Exit Function
End If
GetWindowThreadProcessId(WinampWindow, PID)
lpWinamp = OpenProcess(PROCESS_VM_READ, 0, PID)
If lpWinamp = 0 Then
Return ""
Exit Function
End If
Dim tmpString As String
ReadProcessMemory(lpWinamp, lp, Buffer(0), 260, dwRead)
Call CloseHandle(lpWinamp)
'don't yet have a clue how to convert the data to text form, never reached
'this point on execution
'Temp = StrConv(Buffer, vbUnicode)
'strFileName = Left$(Temp, InStr(Temp, Chr$(0)) - 1)
Return strFileName
End Function
|
|
|
|
|
pangel83 wrote:
Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Object, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Well, the first thing that sticks out is you're using the wrong type for the buffer. It should be:
Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" ( _
ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, _
ByRef lpBuffer As Byte(), ByVal nSize As Integer, _
ByRef lpNumberOfBytesWritten As Integer _
) As Integer
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Nope, wasn't that. I re-attach the code, in a more legible form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
MsgBox(Me.GetPlaylistFile(0))<br />
End Sub<br />
<br />
Dim WinampWindow As Integer<br />
Private Const PROCESS_VM_READ As Long = &H10<br />
Public Const IPC_GETPLAYLISTFILE = 211<br />
<br />
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer<br />
<br />
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer<br />
<br />
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer<br />
<br />
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer<br />
<br />
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long<br />
<br />
Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Byte(), ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer<br />
<br />
Public Function FindWinamp() As Boolean<br />
WinampWindow = FindWindow("Winamp v1.x", vbNullString)<br />
If WinampWindow <> 0 Then<br />
Return True<br />
End If<br />
Return False<br />
End Function<br />
<br />
<br />
Public Function GetPlaylistFile(ByVal TrackNo As Integer) As String<br />
Dim strFileName As String<br />
Dim lp As Integer<br />
Dim lpWinamp As Integer<br />
Dim PID As Integer<br />
Dim Buffer(260) As Object<br />
Dim Temp As String<br />
Dim dwRead As Long<br />
<br />
FindWinamp()<br />
<br />
lp = SendMessage(WinampWindow, &H400, TrackNo, IPC_GETPLAYLISTFILE)<br />
If lp = 0 Then<br />
Return ""<br />
Exit Function<br />
End If<br />
GetWindowThreadProcessId(WinampWindow, PID)<br />
lpWinamp = OpenProcess(PROCESS_VM_READ, 0, PID)<br />
If lpWinamp = 0 Then<br />
Return ""<br />
Exit Function<br />
End If<br />
<br />
Dim tmpString As String<br />
ReadProcessMemory(lpWinamp, lp, Buffer(0), 260, dwRead)<br />
<br />
Call CloseHandle(lpWinamp)<br />
<br />
'don't yet have a clue what to do from here!<br />
'Temp = StrConv(Buffer, vbUnicode)<br />
'strFileName = Left$(Temp, InStr(Temp, Chr$(0)) - 1)<br />
<br />
Return strFileName<br />
End Function
|
|
|
|
|
I should have been a little more clear. When you declare the array of bytes going to the fuction, you have to call it with an array of bytes too:
Public Function GetPlaylistFile(ByVal TrackNo As Integer) As String
Dim strFileName As String
Dim lp As Integer
Dim lpWinamp As Integer
Dim PID As Integer
Dim Buffer(260) As Byte
Dim Temp As String
Dim dwRead As Long
I can't test the code because I don't use WinAmp...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Still does not work.... I am annoyed because it doesn't even return an exception!
|
|
|
|
|
'don't yet have a clue how to convert the data to text form, never reached
'this point on execution
'Temp = StrConv(Buffer, vbUnicode)
'strFileName = Left$(Temp, InStr(Temp, Chr$(0)) - 1)
Would be somthing like:
Temp = ConvertToStringFromBytes(Buffer)
strFileName = Left(Temp, InStr(Temp, Chr(0)) - 1)
Return strFileName
here's the function :
Public Function ConvertToStringFromBytes(ByRef abData() As Byte) As String
Return System.Text.Encoding.Default.GetString(abData)
End Function
Hope that helps
|
|
|
|
|
Hey, guys I know how to diable taskmanager in windows xp/2000 but I didn't know how to trap alt+f4 in windows xp/2000 ,can i have to program low level keyboard hooking
|
|
|
|
|
See this[^] article by George Mamaladze. It's in C#, but is covertable to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hey dave can the code is in vb available and it should work in windows xp/2000/nt
|
|
|
|
|