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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [29] 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ... 65
281  Programación / Programación Visual Basic / Re: Posicion de formulario hijo MDI en: 21 Marzo 2009, 00:40 am
De nada  :xD

Saludos  ;)
282  Programación / Programación Visual Basic / Re: Posicion de formulario hijo MDI en: 20 Marzo 2009, 21:10 pm
Supongo que poniendo esto cuando hagas click en el botón funcionaría:

Código
  1. frmChild.Top = 0
  2. frmChild.Left = 0

Puesto que la ventana hijo solo se puede mover dentro de la ventana padre, por lo que debería ir.
283  Programación / Programación Visual Basic / Re: Cuando ejecuto VB 6.0 me abre el instalador de otra aplicación en: 12 Marzo 2009, 20:39 pm
Eso mismo me pasa a mí a veces, abre un instalador, te pide la ruta de un archivo, y si cancelas continua con VB como si nada.
El acceso directo está bien, porque carga la pantalla de inicio de VB y luego el instalador.

Reinstalando se soluciona  ;)
284  Programación / Programación Visual Basic / Re: ayuda con file manager de EON en: 27 Febrero 2009, 17:27 pm
Cierto, no pensé en eso  :xD
285  Programación / Programación Visual Basic / Re: ayuda con file manager de EON en: 27 Febrero 2009, 16:50 pm
Y no solo eso, sino que también tiene código BBC mezclado:

Citar
Código:
Private Sub Drive1_Change() 'Para camiar las rutas correctamente
On Error Resume Next
Dir1.Path = [color=red]Drive1[/color].Drive
End Sub
286  Programación / Programación Visual Basic / Re: Ayuda con cambio de Icono en Cripter en: 23 Febrero 2009, 21:12 pm
Lo ideal sería:

Código
  1. If chkCambiarIcono.Value = Checked Then
  2.    'Código para cambiar icono.
  3.    'Código para guardar el ejecutable.
  4. Else
  5.    'Código para guardar el ejecutable.
  6. End If

Este es el módulo que utilizo yo, aunque no funciona muy bien:

Código
  1. Option Explicit
  2.  
  3. Public Type ICONDIR
  4.    idReserved As Integer   ' Reserved (must be 0)
  5.    idType As Integer       ' Resource Type (1 for icons)
  6.    idCount As Integer      ' How many images?
  7.    'ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
  8. End Type
  9.  
  10. Public Type ICONDIRENTRY
  11.    bWidth As Byte          ' Width, in pixels, of the image
  12.    bHeight As Byte         ' Height, in pixels, of the image
  13.    bColorCount As Byte     ' Number of colors in image (0 if >=8bpp)
  14.    bReserved As Byte       ' Reserved ( must be 0)
  15.    wPlanes As Integer      ' Color Planes
  16.    wBitCount As Integer    ' Bits per pixel
  17.    dwBytesInRes As Long    ' How many bytes in this resource?
  18.    dwImageOffset As Long   ' Where in the file is this image?
  19. End Type
  20.  
  21.  
  22. Public Type GRPICONDIR
  23.    idReserved As Integer   ' Reserved (must be 0)
  24.    idType As Integer       ' Resource Type (1 for icons)
  25.    idCount As Integer      ' How many images?
  26.    'ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
  27. End Type
  28.  
  29. Public Type GRPICONDIRENTRY
  30.    bWidth As Byte          ' Width, in pixels, of the image
  31.    bHeight As Byte         ' Height, in pixels, of the image
  32.    bColorCount As Byte     ' Number of colors in image (0 if >=8bpp)
  33.    bReserved As Byte       ' Reserved ( must be 0)
  34.    wPlanes As Integer      ' Color Planes
  35.    wBitCount As Integer    ' Bits per pixel
  36.    dwBytesInRes As Long    ' How many bytes in this resource?
  37.    dwIconID As Integer   ' Where in the file is this image?
  38. End Type
  39.  
  40. Public Type Dat
  41.    Data() As Byte
  42. End Type
  43.  
  44. Public Type Ico
  45.    IcoDir As ICONDIR
  46.    Entries() As ICONDIRENTRY
  47.    IcoData() As Dat
  48. End Type
  49.  
  50. Public Type IcoExe
  51.    IcoDir As GRPICONDIR
  52.    Entries() As GRPICONDIRENTRY
  53. End Type
  54.  
  55. Private Declare Function BeginUpdateResource Lib "kernel32.dll" Alias "BeginUpdateResourceA" (ByVal pFileName As String, ByVal bDeleteExistingResources As Long) As Long
  56. Private Declare Function UpdateResource Lib "kernel32.dll" Alias "UpdateResourceA" (ByVal hUpdate As Long, ByVal lpType As Long, ByVal lpName As Long, ByVal wLanguage As Long, lpData As Any, ByVal cbData As Long) As Long
  57. Private Declare Function EndUpdateResource Lib "kernel32.dll" Alias "EndUpdateResourceA" (ByVal hUpdate As Long, ByVal fDiscard As Long) As Long
  58. Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  59.  
  60. Private Const RT_ICON As Long = 3&
  61. Private Const DIFFERENCE As Long = 11
  62. Private Const RT_GROUP_ICON As Long = (RT_ICON + DIFFERENCE)
  63.  
  64. '// ReplaceIcoInExe "C:\EXEtoReplace.exe", OpenIconFile("C:\NewIcon.ico")
  65.  
  66. Public Function OpenIconFile(FileName As String) As Ico
  67. Dim t As Ico 'structure temporaire
  68. Dim X As Long 'compteur
  69.  
  70. 'on ouvre le fichier
  71. Open FileName For Binary As #1
  72.    'on récupère l'entete du fichier
  73.    Get #1, , t.IcoDir
  74.  
  75.    'redimensionne au nombre d'icones
  76.    ReDim t.Entries(0 To t.IcoDir.idCount - 1)
  77.    ReDim t.IcoData(0 To t.IcoDir.idCount - 1)
  78.  
  79.    'pour chaque icones
  80.    For X = 0 To t.IcoDir.idCount - 1
  81.        'récupère l'entete de l'icone
  82.        Get #1, 6 + 16 * X + 1, t.Entries(X)
  83.        'redimensionne à la taille des données
  84.        ReDim t.IcoData(X).Data(t.Entries(X).dwBytesInRes - 1)
  85.        'récupère les données
  86.        Get #1, t.Entries(X).dwImageOffset + 1, t.IcoData(X).Data
  87.    Next
  88. 'ferme le fichier
  89. Close #1
  90. 'renvoie les données
  91. OpenIconFile = t
  92. End Function
  93.  
  94. Private Function MakeIcoExe(IconFile As Ico) As IcoExe
  95. Dim t As IcoExe 'structure temporaire
  96. Dim X As Long 'compteur
  97.  
  98. 'nombre d'icones
  99. t.IcoDir.idCount = IconFile.IcoDir.idCount
  100. 'type : Icone = 1
  101. t.IcoDir.idType = 1
  102. 'chaque entrée
  103. ReDim t.Entries(IconFile.IcoDir.idCount - 1)
  104.  
  105. 'pour chaque entrée
  106. For X = 0 To t.IcoDir.idCount - 1
  107.    'entete d'icones
  108.    t.Entries(X).bColorCount = IconFile.Entries(X).bColorCount
  109.    t.Entries(X).bHeight = IconFile.Entries(X).bHeight
  110.    t.Entries(X).bReserved = IconFile.Entries(X).bReserved
  111.    t.Entries(X).bWidth = IconFile.Entries(X).bWidth
  112.    t.Entries(X).dwBytesInRes = IconFile.Entries(X).dwBytesInRes
  113.    t.Entries(X).dwIconID = X + 1
  114.    t.Entries(X).wBitCount = IconFile.Entries(X).wBitCount
  115.    t.Entries(X).wPlanes = IconFile.Entries(X).wPlanes
  116. Next
  117. 'renvoie la structure
  118. MakeIcoExe = t
  119. End Function
  120.  
  121. Public Function ReplaceIcoInExe(FileName As String, IcoFile As Ico) As Boolean
  122. Dim hWrite As Long 'handle de modification
  123. Dim Exe As IcoExe 'structure de ressource icone
  124. Dim ret As Long 'valeur de retour
  125. Dim X As Long 'compteur
  126. Dim D() As Byte 'buffer
  127.  
  128. 'obtient un handle de modification
  129. hWrite = BeginUpdateResource(FileName, 0)
  130.  
  131. 'si échec, on quitte
  132. If hWrite = 0 Then ReplaceIcoInExe = False: Exit Function
  133.  
  134. 'sinon, on lit l'icone
  135. Exe = MakeIcoExe(IcoFile)
  136.  
  137. 'on redimmensionne le buffer
  138. ReDim D(6 + 14 * Exe.IcoDir.idCount)
  139. 'on copie les données dans le buffer
  140. CopyMemory ByVal VarPtr(D(0)), ByVal VarPtr(Exe.IcoDir), 6
  141.  
  142. 'pour chaque icone
  143. For X = 0 To Exe.IcoDir.idCount - 1
  144.    'on copie les données
  145.    CopyMemory ByVal VarPtr(D(6 + 14 * X)), ByVal VarPtr(Exe.Entries(X).bWidth), 14&
  146. Next
  147.  
  148. 'on met à jour la ressource groupe icone
  149. ret = UpdateResource(hWrite, RT_GROUP_ICON, 1, 0, ByVal VarPtr(D(0)), UBound(D))
  150.  
  151. 'si échec, on quitte
  152. If ret = 0 Then ReplaceIcoInExe = False: EndUpdateResource hWrite, 1: Exit Function
  153.  
  154. 'on met à jour chaque ressource icone
  155. For X = 0 To Exe.IcoDir.idCount - 1
  156.    ret = UpdateResource(hWrite, RT_ICON, Exe.Entries(X).dwIconID, 0, ByVal VarPtr(IcoFile.IcoData(X).Data(0)), Exe.Entries(X).dwBytesInRes)
  157. Next
  158.  
  159. 'on enregsitre dans le fichier executable
  160. ret = EndUpdateResource(hWrite, 0)
  161. 'si échec, on quitte
  162. If ret = 0 Then ReplaceIcoInExe = False: Exit Function
  163.  
  164. 'sinon succès
  165. ReplaceIcoInExe = True
  166. End Function

Uso:

Código
  1. ReplaceIcoInExe "ruta archivo", OpenIconFile("ruta icono")

Saludos  ;)
287  Programación / Programación Visual Basic / Re: Problemas con el IDE de VB en: 18 Febrero 2009, 14:59 pm
Lo siento, no se me ocurrió buscarlo  ;)
288  Programación / Programación Visual Basic / Re: Problemas con el IDE de VB en: 17 Febrero 2009, 15:07 pm
Muchas gracias, ||MadAntrax||. Con ponerlo en "Básico" ya servía, sin necesidad de poner el clásico.  ;)

@cobein: el manifest no me funcionaba, no sé por qué.

Saludos  :D
289  Programación / Programación Visual Basic / Re: Problemas con el IDE de VB en: 16 Febrero 2009, 23:53 pm
No no, me expliqué mal. Lo que pasa es que cuando los voy a colocar, todas las líneas de arrastre van muy lentas, y nunca doy con la posición correcta. También pasa lo mismo cuando los muevo, va muy lento y no puedo colocarlos bien.
290  Programación / Programación Visual Basic / Problemas con el IDE de VB en: 16 Febrero 2009, 23:42 pm
Hola. Estoy trabajando con VB 6 en Vista y resulta que cuando coloco los controles se ve medio ralentizado y con muchos fallos, y no soy capaz de colocar los controles correctamente.

Gracias de antemano.
Páginas: 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [29] 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ... 65
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines