Click here to Skip to main content
15,890,336 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to use printer to print a data grid Pin
Mekong River23-May-06 15:07
Mekong River23-May-06 15:07 
AnswerRe: how to use printer to print a data grid Pin
Duncan Edwards Jones24-May-06 2:19
professionalDuncan Edwards Jones24-May-06 2:19 
QuestionRotate display 90 degrees with vb.net Pin
crash89323-May-06 13:18
crash89323-May-06 13:18 
AnswerRe: Rotate display 90 degrees with vb.net Pin
Mekong River23-May-06 15:09
Mekong River23-May-06 15:09 
Questionhow to deploy my windows application ?? Pin
Mohammed Amine23-May-06 13:05
Mohammed Amine23-May-06 13:05 
AnswerRe: how to deploy my windows application ?? Pin
Mekong River23-May-06 15:15
Mekong River23-May-06 15:15 
QuestionScan For New Hardware Pin
XFalloutX23-May-06 12:41
XFalloutX23-May-06 12:41 
AnswerRe: Scan For New Hardware [modified] Pin
progload23-May-06 17:53
progload23-May-06 17:53 
Pat,

Somthing like this: (In VB.Net.)

(Imports System.Runtime.InteropServices)

Public Const CM_LOCATE_DEVNODE_NORMAL = &H0

Public Const CR_SUCCESS = &H0
Public Const CR_OUT_OF_MEMORY = &H2
Public Const CR_INVALID_DATA = &H1F
Public Const CR_INVALID_MACHINENAME = &H2F
Public Const CR_ACCESS_DENIED = &H33


<DllImport("cfgmgr32.dll", SetLastError:=True)> _
Public Shared Function CM_Locate_DevNode( _
ByRef pdnDevInst As IntPtr, _
ByVal pDeviceID As String, _
ByVal ulFlags As Integer) _
As Integer
End Function

<DllImport("cfgmgr32.dll", SetLastError:=True)> _
Public Shared Function CM_Reenumerate_DevNode( _
ByVal dnDevInst As IntPtr, _
ByVal ulFlags As Integer) _
As Integer
End Function

Private Function ScanForHardwareChanges() As Boolean

Dim status As Integer
Dim hDevInst As IntPtr

status = CM_Locate_DevNode(hDevInst, vbNullString, CM_LOCATE_DEVNODE_NORMAL)
'Debug.WriteLine("CM_Locate Status: " & status)
If status <> CR_SUCCESS Then
Return False
End If
status = CM_Reenumerate_DevNode(hDevInst, 0)
'Debug.WriteLine("CM_Reenumerate Status: " & status)
If status <> CR_SUCCESS Then
Return False
End If

Return True

End Function


Progload


GeneralRe: Scan For New Hardware [modified] Pin
XFalloutX24-May-06 3:16
XFalloutX24-May-06 3:16 
QuestionBindingSource.AddNew() causes System.NotSupportedException Pin
authentictech23-May-06 12:02
authentictech23-May-06 12:02 
AnswerRe: BindingSource.AddNew() causes System.NotSupportedException Pin
authentictech24-May-06 8:11
authentictech24-May-06 8:11 
QuestionInstall Program Pin
New_Coder23-May-06 11:50
New_Coder23-May-06 11:50 
AnswerRe: Install Program Pin
MohammadAmiry23-May-06 12:31
MohammadAmiry23-May-06 12:31 
AnswerRe: Install Program Pin
Mekong River23-May-06 15:19
Mekong River23-May-06 15:19 
QuestionCalendar VB.net Pin
MohamadJaber23-May-06 10:31
MohamadJaber23-May-06 10:31 
Questionvb.net projects Pin
lucky123456023-May-06 9:29
lucky123456023-May-06 9:29 
AnswerRe: vb.net projects Pin
DougW4823-May-06 9:49
DougW4823-May-06 9:49 
AnswerRe: vb.net projects Pin
Mekong River23-May-06 15:27
Mekong River23-May-06 15:27 
Questionhow i can gives the resume suport in my downloader in VB.NET Pin
goharnazir23-May-06 9:25
goharnazir23-May-06 9:25 
QuestionEmbed an Application in VB.NET Web form [modified] Pin
kgoodlad23-May-06 9:00
kgoodlad23-May-06 9:00 
QuestionHow create a DBF db and set size of a field in VB6 [modified] Pin
Dormarth23-May-06 8:27
Dormarth23-May-06 8:27 
QuestionTo update and add data in the dataset from the datagrid Pin
SwatiPathania23-May-06 8:11
SwatiPathania23-May-06 8:11 
AnswerRe: To update and add data in the dataset from the datagrid Pin
MohammadAmiry23-May-06 12:34
MohammadAmiry23-May-06 12:34 
AnswerRe: To update and add data in the dataset from the datagrid Pin
Vaja Dinesh V.23-May-06 20:45
Vaja Dinesh V.23-May-06 20:45 
QuestionProblem lining up data to columns Pin
Quecumber25623-May-06 8:00
Quecumber25623-May-06 8:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.