Prikazi cijelu temu 09.12.2010 20:04
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: Poruka o završetku printanja, dali može?
Evo ti kod za printer. Odnosno za citanje instalisanih printera.
Sada moras reci kako ces dalje.
Dali da odredis jedan printer ili default printer koji ces provjeravati.
Ovo ide na vrh modula.
PreuzmiIzvorni kôd (Visual Basic):
  1. Declare Function aht_apiGetProfileSection Lib "kernel32" Alias "GetProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
  2. Declare Function aht_apiWriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal strAppName As String, ByVal strKeyName As String, ByVal strValue As String) As Integer
  3. Const MAX_VEL = 255
  4. Const MAX_SEK = 2048


PreuzmiIzvorni kôd (Visual Basic):
  1. Function UpisST()
  2. Dim Db As Database
  3. Dim SQL As String
  4. Dim ST As Integer, a As Integer, B As Integer
  5. Dim STP As String, Diostr1 As String, Diostr2 As String
  6. Dim Rs As Recordset
  7. Dim NazivS As String, DrN As String, NPort As String
  8.  
  9. Set Db = CurrentDb()
  10.  
  11. SQL = "DELETE * FROM Stampaci;"
  12. DoCmd.RunSQL (SQL)
  13. a = 1
  14. SQL = "SELECT * FROM Stampaci;"
  15. Set Rs = Db.OpenRecordset(SQL)
  16.    STP = Space(MAX_VEL)
  17.    ST = aht_apiGetProfileSection("DEVICES", STP, MAX_SEK)
  18. START:
  19.  
  20.  Diostr1 = DioStr(a, STP, Chr(0), 0)
  21.  Diostr1 = DioP(Diostr1)
  22.  If Diostr1 = "" Then
  23.   GoTo Kraj
  24.  End If
  25.  Rs.AddNew
  26.  For B = 1 To 3
  27.  Diostr2 = DioStr(B, Diostr1, ",", 1)
  28.      Select Case B
  29.         Case 1
  30.         NazivS = Trim(Diostr2)
  31.         Case 2
  32.         DrN = Trim(Diostr2)
  33.         Case 3
  34.         NPort = Trim(Diostr2)
  35.      End Select
  36.  Next B
  37.  Rs.Fields(0) = a
  38.  Rs.Fields(1) = Trim(NazivS)
  39.  Rs.Fields(2) = DrN
  40.  Rs.Fields(3) = NPort
  41.  Rs.Update
  42.  'Forms![F]![T] = NazivS
  43. B = 1
  44.  a = a + 1
  45. GoTo START
  46. Kraj:
  47. Rs.Close
  48. Set Db = Nothing
  49. End Function

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.
Ovaj post je ureden 1 puta. Posljednja izmjena 09.12.2010 20:06 od strane zxz.