|
1231
|
Programación / Programación Visual Basic / Re: mi bixo parte 2 vb6
|
en: 25 Febrero 2010, 15:00 pm
|
yo sigo hacienolo por la forma facil, mira: puse en el sever: *drivelistbox *dirlistbox *flielistbox y en el client: *combobox *treeview *listbox bien, gracias a este code he conseguido q me envie el contenido del drivelistbox del server al combobox del client: SERVER Private Sub pausa()
Dim comenzar Dim controlar
comenzar = Timer
Do Until controlar >= comenzar + 0.01 controlar = Timer DoEvents Loop
End Sub
Private Sub WS_DataArrival(ByVal bytesTotal As Long) Dim datos As String WS.GetData datos Select Case datos Case "getdrives" Dim x As Integer For x = 0 To Drive1.ListCount WS.SendData Drive1.List(x) pausa Next
End Select
Bien, ahora mi duda esta en como mando el contenido del dirlistbox del server al treeview del client, se que he de hacer algo por el estilo: CLIENT: Private Sub Combo1_Change()
WS.SendData Combo1.Text End Sub
SERVER: Private Sub WS_DataArrival(ByVal bytesTotal As Long) Dim datos As String WS.GetData datos Select Case datos Case "changedrive" Drive1.Path = datos
Dim i As Integer For i = 0 To Dir1.ListCount WS.SendData Dir1.List(i) pausa Next
End Select
todo ello teniendo en cuenta que antes puse: SERVER:
Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub
Private Sub Drive1_Change() On Error Resume Next Directorios.Path = Drive1.Drive End Sub
agradezco la ayuda!!!!!!!
|
|
|
1236
|
Programación / Programación Visual Basic / Re: mi bixo parte 1 vb6
|
en: 14 Febrero 2010, 21:47 pm
|
me podrian desgranar este code?? Private Type PALETTEENTRY peRed As Byte peGreen As Byte peBlue As Byte peFlags As Byte End Type Private Type LOGPALETTE palVersion As Integer palNumEntries As Integer palPalEntry(255) As PALETTEENTRY ' Enough for 256 colors. End Type Private Type GUID Data1 As Long Data2 As Integer Data3 As Integer Data4(7) As Byte End Type Private Type PicBmp Size As Long Type As Long hBmp As Long hPal As Long Reserved As Long End Type Private Declare Function GetDC Lib "user32" _ (ByVal hwnd As Long) As Long Private Declare Function DeleteDC Lib "GDI32" _ (ByVal hDC As Long) As Long Private Declare Function ReleaseDC Lib "user32" _ (ByVal hwnd As Long, ByVal hDC As Long) As Long Private Declare Function CreateCompatibleDC Lib "GDI32" _ (ByVal hDC As Long) As Long Private Declare Function CreateCompatibleBitmap Lib "GDI32" _ (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long Private Declare Function SelectObject Lib "GDI32" _ (ByVal hDC As Long, ByVal hObject As Long) As Long Private Declare Function GetDeviceCaps Lib "GDI32" _ (ByVal hDC As Long, ByVal iCapabilitiy As Long) As Long Private Declare Function GetSystemPaletteEntries Lib "GDI32" _ (ByVal hDC As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long Private Declare Function CreatePalette Lib "GDI32" _ (lpLogPalette As LOGPALETTE) As Long Private Declare Function SelectPalette Lib "GDI32" _ (ByVal hDC As Long, ByVal hPalette As Long, ByVal bForceBackground As Long) As Long Private Declare Function RealizePalette Lib "GDI32" _ (ByVal hDC As Long) As Long Private Declare Function BitBlt Lib "GDI32" _ (ByVal hDCDest As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal nWidth As Long, _ ByVal nHeight As Long, ByVal hDCSrc As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" _ (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
Function CaptureWindow(ByVal hWndSrc As Long, _ ByVal LeftSrc As Long, ByVal TopSrc As Long, _ ByVal WidthSrc As Long, ByVal HeightSrc As Long) As Picture Dim hDCMemory As Long Dim hBmp As Long Dim hBmpPrev As Long Dim r As Long Dim hDCSrc As Long Dim hPal As Long Dim hPalPrev As Long Dim RasterCapsScrn As Long Dim HasPaletteScrn As Long Dim PaletteSizeScrn As Long Dim LogPal As LOGPALETTE Const RASTERCAPS As Long = 38 Const RC_PALETTE As Long = &H100 Const SIZEPALETTE As Long = 104 ' Get device context for client area. hDCSrc = GetDC(hWndSrc) ' Create a memory device context for the copy process. hDCMemory = CreateCompatibleDC(hDCSrc) ' Create a bitmap and place it in the memory DC. hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc) hBmpPrev = SelectObject(hDCMemory, hBmp) ' Get screen properties. RasterCapsScrn = GetDeviceCaps(hDCSrc, RASTERCAPS) ' Raster capabilities. HasPaletteScrn = RasterCapsScrn And RC_PALETTE ' Palette support. PaletteSizeScrn = GetDeviceCaps(hDCSrc, SIZEPALETTE) ' Size of palette. ' If the screen has a palette make a copy and realize it. If HasPaletteScrn And (PaletteSizeScrn = 256) Then ' Create a copy of the system palette. LogPal.palVersion = &H300 LogPal.palNumEntries = 256 r = GetSystemPaletteEntries(hDCSrc, 0, 256, _ LogPal.palPalEntry(0)) hPal = Create
es algo similar, no? gracias
|
|
|
1237
|
Programación / Programación Visual Basic / Re: mi bicho sigue dando guerra
|
en: 14 Febrero 2010, 21:28 pm
|
bufff, aer si me explico: dado el problema q tenia(el de poner los servers q se intentaban conectar a mi client en un listbox, seleccionar uno y aceptar su conexion), lo resolvi de la siguiente manera: código: private sub_escuchar() ws.remoteport = 6239 ws.closesck ws.listen end sub
private sub_conectar() if serverlist.text = "" then msgbox "selecciona un server de la lista", vbcritical else ws.remoteport = 6239 ws.closesck ws.listen label3.caption= label3.caption + 1 end if end sub
private sub_ws_connetionrequest(byval requestid as long) if label3.caption = 1 then if serverlist.text = ws.remotehostip then ws.closesck ws.accept requestid label1.caption = conectando timer1.enabled = true label3.caption = "0" end if else If not List1.List(x) = ws.remotehostip Then serverlist.additem ws.remotehostip End If end if
end sub de este modo la funcion connetcionrequest de mi ws, actua de manera diferente al apretar el boton escuchar o el boton connectar. es posible que tenga algun fallo porque lo he hecho todo de memoria, mañana lo corrigo... si tienen dudas pregunten
|
|
|
|
|
|
|