Karcrack, sos un capo !!!
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const GWL_STYLE As Long = (-16)
Private Const WS_CAPTION As Long = &HC00000
Private Const WS_THICKFRAME As Long = &H40000
Private Sub Form_Load()
' Vivan las ranas! :D
SetWindowLong Me.hwnd, _
GWL_STYLE, _
GetWindowLong(Me.hwnd, GWL_STYLE) _
And Not WS_CAPTION And Not WS_THICKFRAME
Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, &H27)
End Sub
Cita de: Cromatico en 7 Diciembre 2010, 04:06 AM
Funciono perfecto me detecta la posicion de donde hago click en la imagen, muchas gracias a los dos!!!
Ahora me surgio otra duda, en que se basan esas posiciones... Es decir, en la esquina superior izquierda por ejemplo me marca (571;244) aproximadamente...
Se puede relacionar con el width y height de la imagen?
Gracias nuevamente!
Cita de: Cromatico en 7 Diciembre 2010, 04:06 AM
Funciono perfecto me detecta la posicion de donde hago click en la imagen, muchas gracias a los dos!!!
Ahora me surgio otra duda, en que se basan esas posiciones... Es decir, en la esquina superior izquierda por ejemplo me marca (571;244) aproximadamente...
Se puede relacionar con el width y height de la imagen?
Gracias nuevamente!
Cita de: Dessa en 7 Diciembre 2010, 05:35 AM
El top y el left cambian al mover el contenedor del control (por ej al mover el formulario que lo contiene) porque repito que se basa en la posicion dentro de la pantalla, pero el HEIGHT y el WIDTHson constanteso mejor dicho no cambian por mover el Formulario o contenedor del control
Cita de: BlackZeroX▓▓▒▒░░ en 25 Noviembre 2010, 19:00 PM
Me gusta mas la forma Binaria xd por que asi puedo controlar a mi gusto el archivo.
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Function ArrStr_vData(StrC_Dir As String) As String
Dim Int_FF%
'Dim ArrByt_vData() As Byte ' // Opcion 1
If Dir(StrC_Dir, vbArchive) <> "" Then ' // Existe el archivo?.
Int_FF% = FreeFile ' // Obtenemos un nuevo registro libre para su lectura.
Open StrC_Dir For Binary As Int_FF% ' // Me gusta mas la forma Binaria xd por que asi puedo controlar a mi gusto el archivo.
If LOF(Int_FF) > 0 Then
'ReDim ArrByt_vData(0 To LOF(Int_FF%) - 1) ' // Opcion 1
ArrStr_vData$ = Space(LOF(Int_FF%)) ' // Opcion 2
'Get Int_FF%, 1, ArrByt_vData ' // Opcion 1
Get Int_FF%, 1, ArrStr_vData$ ' // Opcion 2
End If
Close Int_FF% ' // Cerrar Registro
End If
End Function
Function Input_LOF(StrC_Dir As String) As String
If Dir(StrC_Dir, vbArchive) <> "" Then
Open StrC_Dir For Input As #1
If LOF(1) > 0 Then
Input_LOF = Input(LOF(1), #1)
End If
Close #1
End If
End Function
Function Line_Input(StrC_Dir As String) As String
Dim linea As String
If Dir(StrC_Dir, vbArchive) <> "" Then
Open StrC_Dir For Input As #1
If LOF(1) > 0 Then
While Not EOF(1)
Line Input #1, linea
Line_Input = Line_Input & linea & vbNewLine
Wend
End If
Close #1
End If
End Function
Private Sub Form_Load()
Dim t As Long
Dim x As Long
Open "C:\Archivot.txt" For Output As #1
For x = 1 To 150
Print #1, "LINEA" & vbTab & x
Next
Close #1
'---------------------------------------------------------------
t = GetTickCount
For x = 1 To 10000
Call ArrStr_vData("C:\Archivot.txt")
Next
t = GetTickCount - t
MsgBox ArrStr_vData("C:\Archivot.txt"), , "ArrStr_vData " & t
'---------------------------------------------------------------
t = GetTickCount
For x = 1 To 10000
Call Input_LOF("C:\Archivot.txt")
Next
t = GetTickCount - t
MsgBox Input_LOF("C:\Archivot.txt"), , "Input_LOF " & t
'---------------------------------------------------------------
t = GetTickCount
For x = 1 To 10000
Call Line_Input("C:\Archivot.txt")
Next
t = GetTickCount - t
MsgBox Line_Input("C:\Archivot.txt"), , "Line_Input " & t
'---------------------------------------------------------------
End Sub