|
Syberaptor,
The "Special Buttons" on your laptop are controlled by a proprietary filter drivers, they have nothing to do with the keyboard.
On an HP Laptop for instance, one of the more common driver names they use is "eawdmfd.sys", but this is by no means standard, compaq (now merged with HP) uses one called "eaps2kbd.sys". Some of them have more than just the driver they also have dependancies to dynamic link libraries like "fltrcoi.dll" for instance.
I haven't seen any "Generic" code for working with these drivers recently, but I can tell you, that it will be quite an adventure for you if you decide to dive into filter drivers and the windows ddk.
If your really interested, the first thing you should probably do is download the windows ddk,and take a look, It is part of the Kernel-Mode Driver framework found here:
http://www.microsoft.com/whdc/driver/WDF/KMDF_pkgdwn.mspx?
It has some interesting sample codes on filter drivers.
Be prepared to start programming in more than one language, and learn all you can about p/invoke in the framework if you decide to interface your work in the .net framework, and have the desire to do this type of work.
That should get you started....
Hope it helps...
progload
|
|
|
|
|
Thanks for the help.
Drivers are a little beyond me, I think. Though I may see if I can figure anything out.
Thanks again.
|
|
|
|
|
I have built the following code in my global.asax code
My question is how and when does the Sub application_start know when to start?
What must I do to trigger it to start and send an email?
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
myConnection.Open()
'2. Create the command object, for the query
Const strSQL As String = "Select LastUpdated, ProductId from products "
Dim objCmd As New SqlCommand(strSQL, myConnection)
Dim objDR As SqlDataReader
objDR = objCmd.ExecuteReader()
While (objDR.Read)
'look the code is looking for DATETIME .. but it found NULL values
'need this code to keep from getting errors if a null is found
'we need to put some check for nulls
If (Not (objDR("LastUpdated") Is DBNull.Value)) Then
If (Date.Compare(objDR("LastUpdated"), Today.Date) = 0) Then
Dim newMail As New MailMessage
newMail.From = "from@from.com" '' this is the From Address
newMail.To = "kenn_rosie@msn.com" '' this is TO Address
newMail.Subject = "Change in Product Rate"
newMail.Body = " Dear Ken, " & _
"Please review attached email for product ID: " & objDR("ProductID") & _
"Thank you," & _
"Kenn()"
End If
End If
End While
myConnection.Close() 'Close the connection
End Sub
|
|
|
|
|
It runs when your ASP.NET app spins up for the first time.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Not quite sure what that means.... example, in my code I updated a db field that was placed in a word document, then I have the sub application_start send it email.
I did that earlier today but have not received the email back yet, so I was wondering if I have to write code that causes the sub application_start to start?
|
|
|
|
|
kenn_rosie wrote: so I was wondering if I have to write code that causes the sub application_start to start?
No, but unless you restart IIS, this code won't run. It gets run when IIS starts.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hmm, so How do I get it to work to send out email without restarting IIS, That seems strange? If I want the email to go out daily, do I need to have a trigger or something to restart IIS all the time?
|
|
|
|
|
No need to restart IIS daily for purpose of sending mail .Restarting IIS means restarting application .
If you want to automatically send email daily , then create a small exe In which can be scheduled to run once in a day .This exe can be created in vb / vb.net .
Divya Rathi
|
|
|
|
|
My application is going to move some files when a button is clicked.
If the file is opened by other application,
my system.io.file.move(file) will have exception,
How can I detect the file is opened by other application before the move action?
Thanks.
|
|
|
|
|
Catch the exception.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I know this method, but any other way?
|
|
|
|
|
No.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Catching the Exception is the only way to get feedback that a file is open and can not be moved...
What you need to do is loop throuhg the files you are moving and when it hits a locked file it keeps trying till it can.
<br />
Dim bIOEx As Boolean = True<br />
Try<br />
If blnMove = True Then<br />
Do<br />
Try<br />
System.IO.File.Move(strOriginalFile, strDestinationFile)<br />
bIOEx = False<br />
<br />
Catch ex As IOException<br />
bIOEx = True<br />
End Try<br />
Loop Until bIOEx = False<br />
End If<br />
Catch ex As Exception<br />
MessageBox.Show("The File Redirection Failed" & vbCrLf & ex.Message, "Move Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)<br />
Finally<br />
blnMove = False<br />
End Try<br />
You may want to do a loop count that times out after 3 tries 10 seconds apart.
Hope this helps...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I am new at vb.net and would like to know
What object is streamwriter located under?
Is it a function or sub routine?
VS 2003:
I have a project with the folowing in code behind:
Dim sw As StreamWriter
I thought maybe I could drill down in the objects and find it.
I assume that is under System.IO?
I did an Ctrl ALT J in visual studio to look at the classes
and I cannot drill down to streamWriter?
Where can I find where streamwriter is located?
|
|
|
|
|
|
I was trying to drill down to it in visual studio but It does not drill down very far in system.io for visual studio.
Unless I am doing something wrong?
|
|
|
|
|
kenn_rosie
Do you have "system" referenced in the solution explorer?
progload
|
|
|
|
|
Thanks, I found it, I expanded mscorlib and there it was
|
|
|
|
|
Hi, I am programming a tcp messanger with ips. this is my coding for the server!
THE PROBLEM IS THAT WHEN I MAKE PORT 5000 OR ANY OTHER NUMBER IT CRASHES AND TELLS ME THAT IT MUST BE PERFORMED BY 1 TIME ONLY! SOCKETERROR
listener = New TcpListener(5000)
listener.Start()
THIS IS MY WHOLE CODING FOR THE SERVER
Imports System.Threading
Imports System.Net.Sockets
Imports System.IO
Imports System.Windows.Forms
Public Class frmServer
Inherits Form
Private connection As Socket
Private readThread As Thread
Private socketStream As NetworkStream
Private writer As BinaryWriter
Private reader As BinaryReader
Private Sub frmServer_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
System.Environment.Exit(System.Environment.ExitCode)
End Sub
Private Sub txtOut_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtOut.KeyDown
Try
If (e.KeyCode = Keys.Enter AndAlso Not connection Is Nothing) Then
writer.Write("Server>>> " & txtIn.Text)
txtOut.Text &= vbCrLf & "Server>>> " & txtIn.Text
If txtIn.Text = "Terminate" Then
connection.Close()
End If
txtIn.Clear()
End If
Catch ex As SocketException
txtOut.Text &= vbCrLf & "Error writing object"
End Try
End Sub
Public Sub RunServer()
Dim listener As TcpListener
Dim counter As Integer = 1
Try
listener = New TcpListener(5000)
listener.Start()
While True
txtOut.Text = "Waiting for connection" & vbCrLf
connection = listener.AcceptSocket()
socketStream = New NetworkStream(connection)
writer = New BinaryWriter(socketStream)
reader = New BinaryReader(socketStream)
txtOut.Text &= "Connection " & counter & " recieved." & vbCrLf
writer.Write("Server>>> Connection Successful")
txtIn.ReadOnly = False
Dim theReply As String = ""
Try
Do
theReply = reader.ReadString()
txtOut.Text &= vbCrLf & theReply
Loop While (theReply <> "Client>>> Terminate" AndAlso connection.Connected)
Catch ex As IOException
MessageBox.Show("Client application closing")
Finally
txtOut.Text &= vbCrLf & "User terminated connection"
txtIn.ReadOnly = True
writer.Close()
reader.Close()
socketStream.Close()
connection.Close()
counter += 1
End Try
End While
Catch ex As IOException
MessageBox.Show("Server application closing")
End Try
End Sub
Adrian De Battista
-- modified at 18:26 Tuesday 21st February, 2006
|
|
|
|
|
I have written a very simple vb.net app to look at some properties in an msi file. Whenever I execute the msiInstall = CreateObject("WindowsInstaller.Installer") statement I get the error: Cannot create ActiveX component. I have added a reference to the Microsoft Windows Installer module and msi.dll is definately registered on my system. I have declared the msi object using Dim msiInstall As WindowsInstaller.Installer.
When I run the same bit of code in VBScript I do not get this error so it must be something in my VS 2003 configuration.
This is the complete error with details when I compile and run the exe:
************** Exception Text **************
System.Exception: Cannot create ActiveX component.
at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
at UpdateVers.Form1.btnUpdateMin_Click(Object sender, EventArgs e) in C:\VB\UpdateVers\UpdateVers\UpdateVers\Form1.vb:line 95
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
UpdateVers
Assembly Version: 1.0.2243.29760
Win32 Version: 1.0.2243.29760
CodeBase: file:///C:/VB/UpdateVers/UpdateVers/UpdateVers/obj/Debug/UpdateVers.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Interop.WindowsInstaller
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/VB/UpdateVers/UpdateVers/UpdateVers/obj/Debug/Interop.WindowsInstaller.DLL
|
|
|
|
|
Hi,
i want to create a multiple datasets and bind it seperately. the query will look like
select * from table where id=ID
now,
if id = 1,
i want to generate dataset1 just for records with id=1 and
if id = 2,
i want to generate dataset2 just for records with id=2 and so forth
so that i can bind those datasets to different web control say for webchart component or a datagrid.
hope my question makes sense.
please help!!!
Robin
|
|
|
|
|
no problem dude.
just create 2 query n store them in 2 seperate variable.
say
Dim q1 As String="SELECT * from table WHERE id=2"
Dim q2 As String="SELECT * from table WHERE id=2"
Dim cmd1 As New SQLCommand(q1,conn) 'conn is ur connection
Dim cmd2 As New SQLCommand(q2,conn)
Dim da1 as New SQLDataAdapter
Dim da2 as New SQLDataAdapter
da1.selectCommand=cmd1
da2.selectCommand=cmd2
Dim ds1 As New DataSet
Dim ds2 As New DataSet
da1.Fill(ds1)
da2.Fill(ds2)
' ur dataset populated
' show them
DataGrid1.DataSource=ds1
DataGrid2.DataSource=ds2
Hope that helps.
this is not the end, this is how its goin to begin !
|
|
|
|
|
Does anybody know if there is a function
like the one in excel for vlookup.
;);P
|
|
|
|
|
Dim lookupTable As New HashTable
lookupTable.Add("KeyName", "Value")
lookupTable.Add("KeyName1", "Value1")
lookupTable.Add("KeyName2", "Value2")
lookupTable.Add("KeyName3", "Value3")
Dim value = lookupTable.Item("KeyName")
My Blog[^] FFRF[^]
|
|
|
|
|
I am creating a simple form that requires additional information before being displayed.
What I want to do:
Override ShowDialog(owner) with ShowDialog(owner, string0, string1) As DialogResult
That part is easy.
What I want to do is prevent the use of ShowDialog() and ShowDialog(owner).
Naturally, there are many ways to accomplish what I am trying to do, but I really want to know If I can do this. Is there a way to override these methods (or some other way) so that thay may not be called on my custom dialog?
Thanks
-mE
|
|
|
|