Click here to Skip to main content
15,923,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionIPs Pin
ADY0071-Dec-05 23:44
ADY0071-Dec-05 23:44 
AnswerRe: IPs Pin
Gideon Engelberth7-Dec-05 6:04
Gideon Engelberth7-Dec-05 6:04 
QuestionMonitor CPU Pin
nitin_ion1-Dec-05 22:25
nitin_ion1-Dec-05 22:25 
AnswerRe: Monitor CPU Pin
[Marc]2-Dec-05 3:51
[Marc]2-Dec-05 3:51 
Questionhow can i receive the ip address from a remote client? Pin
yuvalda11-Dec-05 21:16
yuvalda11-Dec-05 21:16 
QuestionDetermine Printer Port Pin
thebread1-Dec-05 20:34
thebread1-Dec-05 20:34 
AnswerRe: Determine Printer Port Pin
Duncan Edwards Jones1-Dec-05 23:08
professionalDuncan Edwards Jones1-Dec-05 23:08 
GeneralRe: Determine Printer Port Pin
thebread2-Dec-05 2:37
thebread2-Dec-05 2:37 
Thx very much !!

after knowing what i am looking for i found this:


<DllImport("winspool.drv", CharSet:=CharSet.Auto, SetLastError:=True)> _
Private Shared Function OpenPrinter( _
ByVal pPrinterName As String, ByRef hPrinter As IntPtr, _
ByVal pDefault As IntPtr) As Boolean
End Function

<DllImport("winspool.drv", CharSet:=CharSet.Auto, _
SetLastError:=True)> _
Private Shared Function ClosePrinter( _
ByVal hPrinter As IntPtr) As Boolean
End Function

<DllImport("winspool.drv", CharSet:=CharSet.Auto, _
SetLastError:=True)> _
Private Shared Function GetPrinter( _
ByVal hPrinter As IntPtr, ByVal dwLevel As Integer, _
ByVal pPrinter As IntPtr, ByVal cbBuf As Integer, _
ByRef pcbNeeded As Integer) As Boolean
End Function

Private Shared Function GetPrinterInfo(ByVal printerName As String) As PRINTER_INFO_2

Dim hPrinter As IntPtr
If Not OpenPrinter(printerName, hPrinter, IntPtr.Zero) Then
Throw New Win32Exception(Marshal.GetLastWin32Error())
End If

Dim pPrinterInfo As IntPtr = IntPtr.Zero
Try

Dim needed As Integer
GetPrinter(hPrinter, 2, IntPtr.Zero, 0, needed)
If needed <= 0 Then
Throw New Exception("Na Zeavas...")
End If

pPrinterInfo = Marshal.AllocHGlobal(needed)


Dim temp As Integer
If Not GetPrinter(hPrinter, 2, pPrinterInfo, needed, temp) Then
Throw New Win32Exception(Marshal.GetLastWin32Error())
End If


Dim printerInfo As PRINTER_INFO_2 = _
CType(Marshal.PtrToStructure( _
pPrinterInfo, GetType(PRINTER_INFO_2)), PRINTER_INFO_2)


Return printerInfo
Finally

ClosePrinter(hPrinter)
Marshal.FreeHGlobal(pPrinterInfo)
End Try
End Function

&lt;StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)&gt; _
Public Structure PRINTER_INFO_2
Public pServerName As String
Public pPrinterName As String
Public pShareName As String
Public pPortName As String
Public pDriverName As String
Public pComment As String
Public pLocation As String
Public pDevMode As IntPtr
Public pSepFile As String
Public pPrintProcessor As String
Public pDatatype As String
Public pParameters As String
Public pSecurityDescriptor As IntPtr
Public Attributes As System.UInt32
Public Priority As System.UInt32
Public DefaultPriority As System.UInt32
Public StartTime As System.UInt32
Public UntilTime As System.UInt32
Public Status As System.UInt32
Public cJobs As System.UInt32
Public AveragePPM As System.UInt32
End Structure
QuestionBinding Textbox with 2 tables. Pin
Bhavna Varshney1-Dec-05 20:22
Bhavna Varshney1-Dec-05 20:22 
QuestionProblem in Image saving Pin
Anindya Chatterjee1-Dec-05 20:18
Anindya Chatterjee1-Dec-05 20:18 
Questionhow to add a combobox to a datagrid column Pin
jayendra_wani1-Dec-05 18:53
jayendra_wani1-Dec-05 18:53 
AnswerRe: how to add a combobox to a datagrid column Pin
abhinish1-Dec-05 20:39
abhinish1-Dec-05 20:39 
Question[Message Deleted] Pin
Roy_Joseph1-Dec-05 18:26
Roy_Joseph1-Dec-05 18:26 
AnswerRe: ms-sql server database-bkp &amp; restore Using VB6 Pin
abhinish2-Dec-05 19:56
abhinish2-Dec-05 19:56 
GeneralRe: ms-sql server database-bkp &amp;amp; restore Using VB6 Pin
Roy_Joseph5-Dec-05 19:55
Roy_Joseph5-Dec-05 19:55 
QuestionVB.Net Controls: Default-Value of a Property Pin
vocaris1-Dec-05 13:44
vocaris1-Dec-05 13:44 
AnswerRe: VB.Net Controls: Default-Value of a Property Pin
Christian Graus1-Dec-05 14:11
protectorChristian Graus1-Dec-05 14:11 
GeneralRe: VB.Net Controls: Default-Value of a Property Pin
vocaris2-Dec-05 2:23
vocaris2-Dec-05 2:23 
AnswerRe: VB.Net Controls: Default-Value of a Property Pin
[Marc]2-Dec-05 4:01
[Marc]2-Dec-05 4:01 
GeneralRe: VB.Net Controls: Default-Value of a Property Pin
vocaris2-Dec-05 5:02
vocaris2-Dec-05 5:02 
QuestionPublic Integers........ Pin
daviiie1-Dec-05 13:42
daviiie1-Dec-05 13:42 
AnswerRe: Public Integers........ Pin
Christian Graus1-Dec-05 14:13
protectorChristian Graus1-Dec-05 14:13 
AnswerRe: Public Integers........ Pin
tusar1231-Dec-05 18:11
tusar1231-Dec-05 18:11 
Questionserver socket instance blocking Pin
mpage1-Dec-05 12:06
mpage1-Dec-05 12:06 
QuestionGraphics flickering in VB6 Pin
Hoopla!1-Dec-05 11:56
Hoopla!1-Dec-05 11:56 

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.