|
451
|
Programación / Programación Visual Basic / Re: Problema cSubclassToolBar cargar imagen.
|
en: 4 Octubre 2008, 19:20 pm
|
hola si es cieto en alguas PC funciona con la versión 6 y en otras no. porque? no tengo ni la mas remota idea. hice un par de pruebas sensillas en esas pc que no funciona y no pude dar en la tecla. asi que bueno si la vas a usar te recomiendo la versión 5. Eso que vos decis que se ven pesimas es porque seguramete utilizas iconos y la v5 desde el ide las arruina. para solucionar eso carga los iconos en un .RES y cargalos al imagelist en tiempo de ejecucion.(cualquier cosa fijate en el ejemplo del "Mail html"
Otra solucion es utilizar BMP con mascaras, pero yo opto por la primera.
Saludos
|
|
|
452
|
Programación / Programación Visual Basic / Re: ProgresBar indefinido (source)
|
en: 30 Septiembre 2008, 20:51 pm
|
Aca le implente esta funcion a la clase de Cobein para crear el progresbar con las apis. '--------------------------------------------------------------------------------------- ' Module : cProgBar ' DateTime : 28/07/2008 09:23 ' Author : Cobein ' Mail : cobein27@hotmail.com ' WebPage : http://cobein27.googlepages.com/vb6 ' Purpose : Mini ProgressBar class ' Usage : At your own risk ' Requirements: None ' Distribution: You can freely use this code in your own ' applications, but you may not reproduce ' or publish this code on any web site, ' online service, or distribute as source ' on any media without express permission. ' ' History : 28/07/2008 First Cut.................................................... '--------------------------------------------------------------------------------------- Option Explicit Private Const PROGRESS_CLASSA As String = "msctls_progress32" Private Const WS_VISIBLE As Long = &H10000000 Private Const WS_CHILD As Long = &H40000000 Private Const WM_USER As Long = &H400 Private Const PBM_SETPOS As Long = (WM_USER + 2) Private Const PBS_SMOOTH As Long = &H1 Private Const PBS_VERTICAL As Long = &H4 Private Const PBS_MARQUEE As Long = 8
Private Const PBM_SETMARQUEE = (WM_USER + 10) Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private c_lhWnd As Long Private c_lVal As Long Public Function CreateProgBar( _ ByVal lhWndOwner As Long, _ ByVal Left As Long, _ ByVal Top As Long, _ ByVal Width As Long, _ ByVal Heght As Long, _ Optional ByVal bHorizontal As Boolean = True, _ Optional ByVal bSmooth As Boolean = False, _ Optional ByVal bMarquee As Boolean = False, _ Optional ByVal Velocity As Integer = 0) As Boolean Dim lFlag As Long lFlag = WS_CHILD Or WS_VISIBLE If Not bHorizontal Then lFlag = lFlag Or PBS_VERTICAL If bSmooth Then lFlag = lFlag Or PBS_SMOOTH If bMarquee Then lFlag = lFlag Or PBS_MARQUEE If Not c_lhWnd = 0 Then Class_Terminate c_lhWnd = CreateWindowEx(0, PROGRESS_CLASSA, vbNullString, _ lFlag, Left, Top, Width, Heght, _ lhWndOwner, vbNull, App.hInstance, ByVal 0&) If bMarquee Then If c_lhWnd Then CreateProgBar = SendMessageLong(c_lhWnd, PBM_SETMARQUEE, 1, Velocity) End If Else CreateProgBar = c_lhWnd End If
End Function Public Property Let Value(ByVal lVal As Long) If Not c_lhWnd = 0 Then c_lVal = lVal Call SendMessage(c_lhWnd, PBM_SETPOS, ByVal lVal, ByVal 0&) End If End Property Public Property Get Value() As Long Value = c_lVal End Property Private Sub Class_Initialize() ' End Sub Private Sub Class_Terminate() If Not c_lhWnd = 0 Then Call DestroyWindow(c_lhWnd) c_lhWnd = 0 End If End Sub
y lo llamamos asi Option Explicit Dim Progress As New cProgBar
Private Sub Form_Load() Progress.CreateProgBar Me.hwnd, 10, 10, 200, 30, True, True, True, 0 End Sub
y lo mismo hay que compliarlo y agregar el archivo Proyecto1.exe.manifest Saludos
|
|
|
453
|
Programación / Programación Visual Basic / ProgresBar indefinido (source)
|
en: 30 Septiembre 2008, 20:45 pm
|
Buenas esta es una simple funcion para agregar un progreso indefinido a las barra de progreso tal como lo hacen muchos programas o cuando se ejecuta una busqueda en el disco una imagen de ejemplo agregar un progressbar1 (de la version Common Controls 5) 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 SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Const GWL_STYLE = (-16) Private Const WM_USER As Long = &H400 Private Const PBS_MARQUEE As Long = 8 Private Const PBM_SETMARQUEE = (WM_USER + 10)
Private Sub Form_Load() Dim Ret As Long Ret = SetStyleMarquee(ProgressBar1.hwnd, 50) If Ret = False Then MsgBox "No se pudo aplicar el estilo" End If End Sub
Public Function SetStyleMarquee(hwnd As Long, Velocity As Long) As Boolean SetWindowLong hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Or PBS_MARQUEE SetStyleMarquee = SendMessageLong(hwnd, PBM_SETMARQUEE, 1, Velocity) End Function
Lo compilan y agregan un archivo Proyecto1.exe.manifest junto al ejecutable, sino no funciona. Me han dicho que con algunos themes de windows no funciona. aver que les pasa a ustedes.
|
|
|
455
|
Programación / Programación Visual Basic / Re: Mandar click
|
en: 20 Septiembre 2008, 09:21 am
|
Hola yo te diria que no renigues al pedo, lo que queres hacer si es que ablamos de un webbrowser lo podes hacer mediante la parte javascript del documento del webbrowser. pero para que no sigas renegando, si el form esta invisible el webbrowser no navega.
Saludos.
|
|
|
456
|
Programación / Programación Visual Basic / Re: TheBug [SRC]
|
en: 17 Septiembre 2008, 13:48 pm
|
Che esta muy util, lo puse al palo el timer del test con un contador y recive todos los eventos perfectos , incluso con mas de una instancia tirando palo y palo, digo esta muy util ya que cuando compilamos despues se hace muy dificil llevar un chequeo una cosita que vi que creo que podes hacer para reducir un vastante el uso de la memoria es ingresar un key del pid al imagelist para no ingresar permanentemente el mismo icono. Private Sub f_cDebug_DebugString(ByVal lPID As Long, ByVal sPrint As String) With grdReport .AddRow .CellDetails .Rows, 1, .Rows, ALIGNMENT .CellDetails .Rows, 2, Time, ALIGNMENT .CellDetails .Rows, 3, lPID, ALIGNMENT .CellDetails .Rows, 4, ProcessPathByPID(lPID, True), ALIGNMENT .CellDetails .Rows, 5, sPrint, ALIGNMENT .CellDetails .Rows, 6, ProcessPathByPID(lPID, False), ALIGNMENT
Dim lIndex As Long Dim lIcon As Long If Not f_cImgLst.KeyExists("k" & lPID) Then If ExtractIconEx(.CellText(.Rows, 6), _ 0, 0, lIcon, 1) Then Call f_cImgLst.AddFromHandle(lIcon, IMAGE_ICON, "k" & lPID) Call DestroyIcon(lIcon) lIndex = f_cImgLst.ImageCount - 1 .CellIcon(.Rows, 4) = lIndex End If Else .CellIcon(.Rows, 4) = f_cImgLst.ItemIndex("k" & lPID) End If If f_bLock Then .SelectedRow = .Rows End If End With End Sub
lo que si hay una (o varias) funciones mal en la clase cVBALImageList en el checkeo de las key Public Property Get ItemIndex(ByVal vKey As Variant) As Long Dim lR As Long Dim i As Long ' Returns the 0 based Index for the selected ' Image list item: If (IsNumeric(vKey)) Then lR = vKey If (lR > 0) And (lR <= ImageCount) Then ItemIndex = lR - 1 Else ' error Err.Raise 9, App.EXEName & ".vbalImageList" ItemIndex = -1 End If Else lR = -1 For i = 0 To ImageCount - 1 If (m_sKey(i) = vKey) Then lR = i Exit For End If Next i If (lR > -1) And (lR <= ImageCount) Then ItemIndex = lR Else Err.Raise 9, App.EXEName & ".vbalImageList" ItemIndex = -1 End If End If End Property
aca en esta funcion se comieron (lR > 0) donde deberia ser (lR > -1) y bueno corrigiendo eso se puede adaptar lo primero. y esta muy linda la interfaz. Saludos
|
|
|
458
|
Programación / Programación Visual Basic / Re: El Random no es tan Random.
|
en: 13 Septiembre 2008, 19:13 pm
|
hola prova asi Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Randomize Timer For i = 0 To 1000 Picture1.PSet (Random(5000), Random(3000)) Picture1.ForeColor = RGB(Random(255), Random(255), Random(255)) Picture1.DrawWidth = Random(10) Next i End Sub Function Random(Max As Long) As Integer Random = Int((Max - 1 + 1) * Rnd) + 1 End Function
osea llamar Randomize Timer de entrada
|
|
|
459
|
Programación / Programación Visual Basic / Mail con formato HTML (Source)
|
en: 4 Septiembre 2008, 08:01 am
|
Buenas otro producto del aburrimiento, se trata de un proyecto para enviar mails con formato Html, y adjuntos , utiliza " CDO" así que si bien esto funciona desde windows 2000 y posteriores. Para poder enviar los mails nesesita configurarlo. por lo que deben tener una cuenta de mail con SMTP (Gmail, Yahoo etc.) "Hotmail NO" a hotmail solo se pueden enviar los mails, bien el mas practico es gmail ya que no nesesita configurarlo. encambio con yahoo ya deberán configurarlo desde la pagina de yahoo (cosa que no voy a explicar). Cuenta con dos Skin y tiene las opciones Basicas de un editor, se podria aver echo si tantas boludeces pero bueno tenia ganas de usar lo que habia echo. Supongo que si tiene IE7 no lo podrán ejecutar desde el IDE de visual. pero si el ejecutable. o bien si saben como se soluciona ese problema con el Webbrowser y el IE7. Bueno la idea es que si encuentran errores los reporten aca. Gracias Descargar
|
|
|
|
|
|
|