Thread View: fj.lang.visualbasic
2 messages
2 total messages
Started by yuuki yamashita
Mon, 20 Oct 1997 00:00
$B%W%j%s%?!<$N>\:Y>pJs$N<hF@(J
Author: yuuki yamashita
Date: Mon, 20 Oct 1997 00:00
Date: Mon, 20 Oct 1997 00:00
18 lines
949 bytes
949 bytes
$B$O$8$a$^$7$F!#(J $B:#(Jvisualbasic$B$G%W%m%0%i%`$rAH$s$G$$$k$N$G$9$,!"(Jvisualbasic5.0$B$+$i%W%j%s%?!<(J $B$N(J $B>\:Y$J>pJs!J%W%j%s%?!<L>!&>uBV!&%]!<%H$J$I!K$r<hF@$9$kJ}K!$r65$($F$$$?$@$-(J $B$?(J $B$$$N$G$9!#(J Win32$B$N(JGetPrinter$B4X?t$G=PMh$k$HJ9$$$?$N$G$9$,!">e<j$/$$$-$^$;$s!#(J $B$I$J$?$+$4B8CN$G$7$?$i65$($F$$$?$@$1$J$$$G$7$g$&$+!#(J /---------------------------------------------------------/ / Name: yuuki yamashita / / mail : yyamas@osk3.3web.ne.jp / /---------------------------------------------------------/
Re: プリンターの詳細情報の取得
Author: Sato Masahiro
Date: Mon, 20 Oct 1997 00:00
Date: Mon, 20 Oct 1997 00:00
72 lines
2556 bytes
2556 bytes
In article <01bcdd0d$d50acf20$29c2ebca@xc13>, yyamas@osk3.3web.ne.jp says...
>Win32$B$N(BGetPrinter$B4X?t$G=PMh$k$HJ9$$$?$N$G$9$,!">e<j$/$$$-$^$;$s!#(B
$B$^$:!"9=B$BN$N(B PRINTER_INFO_2 $B$r!"%a%s%PJQ?t$rA4$F(B Long $B7?$H$7$F(B
$B@k8@$7$^$9!#0J2<$O!"(BGetPrinter $B4X?t$N%5%s%W%k%3!<%I$G$9!#(B
$BNc(B1: $B%W%j%s%?>pJs$N<hF@(B
OpenPrinter "PrinterName", hPrinter, 0
' $BI,MW$J%P%$%H?t$r<hF@(B
ReDim Bytes(0)
GetPrinter hPrinter, 2, Bytes(0), 0, Needed
' $B>pJs$N<hF@(B
ReDim Bytes(Needed - 1)
GetPrinter hPrinter, 2, Bytes(0), Needed, Needed
'$B>pJs$r9=B$BN$K3JG<(B
ReadProcessMemory hProcess, Bytes(0), PrinterInfo2, _
Len(PrinterInfo2), ReadCount
'$B>pJs$NI=<((B
MsgBox "PrinterName: " & GetStrByAddress(PrinterInfo2.pServerName)
MsgBox "Status: " & PrinterInfo2.Status
MsgBox "PortName: " & GetStrByAddress(PrinterInfo2.pPortName)
ClosePrinter hPrinter
$B>e5-%5%s%W%kCf$G!"(BGetStrByAddress $B$H$$$&4X?t$O!"0J2<$N$h$&$K(B
$BDj5A$7$^$9!#(B
$BNc(B2: $B%"%I%l%9CM$+$iJ8;zNsCM$r:n@.(B
Declare Function ReadProcessMemoryByAdr Lib "kernel32" _
Alias "ReadProcessMemory" ( _
ByVal hProcess As Long, _
ByVal lpBaseAddress As Long, _
lpBuffer As Any, _
ByVal nSize As Long, _
lpNumberOfBytesWritten As Long) As Long
Public Function GetStrByAddress(p As Long) As String
Dim S As String
Dim I As Long
Dim ReadCount As Long
Dim ReadByte As Byte
Dim hProcess As Long
hProcess = GetCurrentProcess()
S = ""
I = p
ReadProcessMemoryByAdr hProcess, I, ReadByte, 1, ReadCount
While ReadByte <> 0
S = S + ChrB(ReadByte)
I = I + 1
ReadProcessMemoryByAdr hProcess, I, ReadByte, 1, ReadCount
Wend
S = StrConv(S, vbUnicode)
GetStrByAddress = S
End Function
hProcess $B$NCM$O!"(BGetCurrentProcess $B4X?t$K$h$C$F<hF@$7$^$9!#(B
$B4*0c$$$J$I$"$j$^$7$?$i!"$I$J$?$+$4;XE&$r$*4j$$$$$?$7$^$9!#(B
--
$B:4F#@59((B <masahiro@cij.co.jp>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads