elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Mensajes
Páginas: 1 ... 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 [54] 55 56 57 58 59 60 61 62 63
531  Programación / Programación Visual Basic / Re: Saber cuantas impresoras hay instaladas en el pc en: 15 Octubre 2005, 14:55 pm
este es un codigo de ejemplo que te dice las impresoras que ay instaladas:

Código:
' to be used in place of strings:
Private Declare Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Private Declare Function lstrlen Lib "kernel32.dll" Alias "lstrlenA" (ByVal lpString As Long) As Long
Private Declare Function EnumPrinters Lib "winspool.drv" Alias "EnumPrintersA" (ByVal flags As Long, ByVal name As String, ByVal Level As Long, pPrinterEnum As Long, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Const PRINTER_ENUM_LOCAL = &H2
Private Type PRINTER_INFO_1
        flags As Long
        pDescription As String
        pName As String
        pComment As String
End Type
Private Sub Form_Load()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim longbuffer() As Long  ' resizable array receives information from the function
    Dim printinfo() As PRINTER_INFO_1  ' values inside longbuffer() will be put into here
    Dim numbytes As Long  ' size in bytes of longbuffer()
    Dim numneeded As Long  ' receives number of bytes necessary if longbuffer() is too small
    Dim numprinters As Long  ' receives number of printers found
    Dim c As Integer, retval As Long  ' counter variable & return value
    Me.AutoRedraw = True 'Set current graphic mode to persistent
    ' Get information about the local printers
    numbytes = 3076  ' should be sufficiently big, but it may not be
    ReDim longbuffer(0 To numbytes / 4) As Long  ' resize array -- note how 1 Long = 4 bytes
    retval = EnumPrinters(PRINTER_ENUM_LOCAL, "", 1, longbuffer(0), numbytes, numneeded, numprinters)
    If retval = 0 Then  ' try enlarging longbuffer() to receive all necessary information
        numbytes = numneeded
        ReDim longbuffer(0 To numbytes / 4) As Long  ' make it large enough
        retval = EnumPrinters(PRINTER_ENUM_LOCAL, "", 1, longbuffer(0), numbytes, numneeded, numprinters)
        If retval = 0 Then ' failed again!
            Debug.Print "Could not successfully enumerate the printes."
        End  ' abort program
    End If
    End If
    ' Convert longbuffer() data into printinfo()
    If numprinters <> 0 Then ReDim printinfo(0 To numprinters - 1) As PRINTER_INFO_1 ' room for each printer
    For c = 0 To numprinters - 1  ' loop, putting each set of information into each element
        ' longbuffer(4 * c) = .flags, longbuffer(4 * c + 1) = .pDescription, etc.
        ' For each string, the string is first buffered to provide enough room, and then the string is copied.
        printinfo(c).flags = longbuffer(4 * c)
        printinfo(c).pDescription = Space(lstrlen(longbuffer(4 * c + 1)))
        retval = lstrcpy(printinfo(c).pDescription, longbuffer(4 * c + 1))
        printinfo(c).pName = Space(lstrlen(longbuffer(4 * c + 2)))
        retval = lstrcpy(printinfo(c).pName, longbuffer(4 * c + 2))
        printinfo(c).pComment = Space(lstrlen(longbuffer(4 * c + 3)))
        retval = lstrcpy(printinfo(c).pComment, longbuffer(4 * c + 3))
    Next c
    ' Display name of each printer
    For c = 0 To numprinters - 1
        Me.Print "Name of printer"; c + 1; " is: "; printinfo(c).pName
    Next c
End Sub


Salu2
532  Programación / Programación Visual Basic / Re: msn messenger en: 15 Octubre 2005, 14:53 pm
Si te refieres a acer un programa que te permita chatear con los contactos del msn ay un codigo fuente en la web de uno del foro que no me acuerdo como se llama
533  Programación / Programación Visual Basic / Re: "" INSERTAR UN EJECUTABLE DENTRO DE OTRO "" en: 15 Octubre 2005, 00:18 am
pero eso de byte a byte es por que al mandarlo por internet, si mandas paketes muy grandes no llegan y ocuan much0 ancho de banda, pero para trabajar en el ekipo usa lo k te e dixo, el maximo, se hacen menos divisiones y es mucho mas rapido

Salu2
534  Programación / Programación Visual Basic / Re: Reducir imágen en: 15 Octubre 2005, 00:08 am
Código:
Picture_pantalla.PaintPicture LoadPicture("lalala.jpg"), 0, 0, Picture_pantalla.ScaleWidth, Picture_pantalla.ScaleHeight

Salu2

PD: cuando mueves el form o pones otro encima la imagen desaparece, como se hace para k siempre este?
535  Programación / Programación Visual Basic / Re: problem al descifrar un texto y mas en: 15 Octubre 2005, 00:02 am
No se mu bien, pero te puedo decir que cuanco cargas un texto a una string, los saltos de linea los representa con un cuadradito []

Salu2
536  Programación / Programación Visual Basic / Re: Errores al crear Instalador (mkdir y filecopy) en: 14 Octubre 2005, 15:50 pm
Código:
Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long

otra manera  ;)

Salu2
537  Programación / Programación Visual Basic / Problema con Listview en: 14 Octubre 2005, 15:30 pm
Hola
tengo un prblema con un listview, en el metodo report para que me muestre subitems, cuando inserto los datos se ven correctamente(los items y los subitems), pero cuando limpio la tabla y les inserto de nuevo solo me inserta los items y los subitems se quedan en blanco...

¿alguien sabe lo k pasa?

Salu2
538  Programación / Programación Visual Basic / Re: "" INSERTAR UN EJECUTABLE DENTRO DE OTRO "" en: 14 Octubre 2005, 15:25 pm
pues puedes dividir el archivo en las partes k necesites.

Código:
dim Trozos as integer
dim i as integer
dim datos as string * 65000

Trozos = FileLen("lala") / 65000
open "lala" for binary as #1
for i = 1 to trozos
get #1,, datos
'aces lo k keras con ellos
next
close #1

Salu2, no tengo el vb aki, corregid errores
539  Programación / Programación Visual Basic / Re: Una opinion... en: 12 Octubre 2005, 01:12 am
a mi no me ace falta
solo con ese archivo ya va
lo k si k tenes k acer si ves k el form se ve mal, pon un picture box en el fondo del form

Salu2
540  Programación / Programación Visual Basic / Re: Una opinion... en: 12 Octubre 2005, 00:50 am
http://dex.webcindario.com/Estilo Xp.zip

este es un programa k ice ace muucho, muucho tempo, pa ti, freeware..., lo unico k ce es crear un manifest en asm en la carpeta del programa para cambiar el estilo al de xp

Salu2
Páginas: 1 ... 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 [54] 55 56 57 58 59 60 61 62 63
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines