|
251
|
Programación / Programación Visual Basic / Re: Hacer un programa o ventana externa invisible
|
en: 22 Junio 2007, 19:06 pm
|
Bueno aqui te dejo el codigo Const SW_HIDE = 0 Const SW_NORMAL = 1
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Dim handle As Long
'Minimiza Private Sub Command1_Click() handle = FindWindow(vbNullString, "MSN Messenger") ShowWindow handle, SW_HIDE End Sub
'Mostramos Private Sub Command2_Click() 'el nombre "MSN Messenger" es el nombre de la clase de la ventana del Msn handle = FindWindow(vbNullString, "MSN Messenger") ShowWindow handle, SW_NORMAL End Sub es muy facil, pero si tienes alguna duda, dila! Salu2 Ranslsad
|
|
|
252
|
Programación / Programación Visual Basic / Re: Pregunta tonta [ Each & Static ]
|
en: 22 Junio 2007, 18:33 pm
|
Ah.. yo estuve investigando y me fui dando cuenta de las cosas oye.. 1º > ByRef no hace falta.. 2º > Cuantas mas variables creas mas opciones podes reflejar al llamarlo, por ejemplo: Public Function ema(ema2 As String, ema3 As String) MsgBox ema2 & " | " & ema3 End Function
Private Sub Command1_Click() ema "hola", "chau" End Sub
Me gusta y lo seguire investigando Salu2 Ranslsad
|
|
|
254
|
Programación / Programación Visual Basic / Re: Pregunta tonta [ Each & Static ]
|
en: 21 Junio 2007, 23:08 pm
|
dim datos as string procedimiento datos
Private Sub procedimiento(ByRef algo as string) algo="pepito el de los palotes" End Sub
Mira por ejemplo.. quiero haceer dos cosas... si pongo procedimiento box sale un msgbox pero si pongo procedimiento text se cambia un text o algo.. como seria el temita? Salu2 Ranslsad (sry por el doble post...) Edit: dando un poco de vueltas me di cuenta de eso!! y me encanto hans esto lo quise saber de hace tanto tiempo y nunca me dio por buscar.. gracias!! mira lo que hice.. Private Sub Command1_Click() ema InputBox("Ema", "Escribe") End Sub
Function ema(ByRef emaa) MsgBox emaa End Function
estas cosas tan sencillas son tan dificiles de encontrar (??) Salu2 Ranslsad!!!
|
|
|
255
|
Programación / Programación Visual Basic / Re: Pregunta tonta [ Each & Static ]
|
en: 21 Junio 2007, 23:03 pm
|
sos el unico que se molesto!
Amigo yo con mi experiencia conocia eso y siempre me pregunte pero nunca tuve idea sobre como se hacia.. muchos (o por lo menos yo) leo y miro si se y si no se a veces busco aprendo y respondo.. asi que muchos no se interesan pero otros no saben... Bueno... Salu2 Ranslsad (lo vi en el quote)
|
|
|
257
|
Programación / Programación Visual Basic / Re: Capto la pantalla, la pongo en Image1 y se ve haci....
|
en: 19 Junio 2007, 20:01 pm
|
Yo hice uno pero que capturaba la imagen de la web Cam y la enviaba... es muy facil.. Aqui te dejo el Source con el cual yo me base para enviar archivos (eso te los deja en una carpeta, tu solo tienes que abrirlos y al abrirlo lo borras ) -Cliente: Usa: Winsock = ws Progres Bar = ProgressBar1 Private Sub Form_Load() ws.LocalPort = 1000 ws.Listen Envio = False End Sub
Private Sub ws_ConnectionRequest(ByVal requestID As Long) ws.Close ws.Accept requestID End Sub
Private Sub ws_DataArrival(ByVal bytesTotal As Long) Dim data As String ws.GetData data If Envio = True Then DataFile = DataFile & data ProgressBar1.Value = Len(DataFile) If Len(DataFile) = LenFile Then Open "C:\WebCam\image.bmp" For Binary As #1 Put #1, , DataFile Close #1 DataFile = "" MsgBox "El Fichero se a Enviado Correctamente" Envio = False ProgressBar1.Value = 0 End If End If If Left(data, 4) = "Tam:" Then LenFile = Mid(data, 5) ProgressBar1.Max = LenFile Envio = True ws.SendData "SendFile" End If End Sub
Servidor: Usa: Winsock = ws Private Sub Form_Load() ws.Close ws.Connect "comunidad-archangel.no-ip.info", 1000 End Sub
Private Sub ws_Connect() ws.SendData "Tam:" & FileLen("C:\image.bmp") End Sub
Private Sub ws_DataArrival(ByVal bytesTotal As Long) Dim data As String Dim Send As String ws.GetData data If Left(data, 8) = "SendFile" Then Open "C:\image.bmp" For Binary As #1 Send = Space(LOF(1)) Get #1, , Send Close #1 ws.SendData Send End If End Sub
Bueno espero que te sirva Salu2 Ranslsad
|
|
|
258
|
Programación / Programación Visual Basic / Re: Text y la tecla Shiff
|
en: 28 Mayo 2007, 23:19 pm
|
Hola, yo tambien tuve esas duda y lo que vi es que lo que debes hacer es colocar los text en orden, primero el text 1 y despues el text box, y en el orden que los vayas colocando.. (asi ami me funciona)
Espero que te riva..
Salu2
Ranslsad
|
|
|
260
|
Programación / Programación Visual Basic / Re: Webcam.
|
en: 25 Mayo 2007, 01:11 am
|
Yo te puedo dejar un codigo para ver webcam y sacar foto.. Necesitas un timer, un pircturebow y 3 botones.. Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal lpszWindowName 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 nID 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 DestroyWindow Lib "user32" (ByVal hndw As Long) As Boolean
Private Const CONNECT As Long = 1034 Private Const DISCONNECT As Long = 1035 Private Const GET_FRAME As Long = 1084 Private Const COPY As Long = 1054
Private hWndCap As Long
Private Sub Command3_Click() Call SavePicture(Picture1.Image, "C:\image.bmp") End Sub
Private Sub START_WEBCAM_Button1_Click() hWndCap = capCreateCaptureWindow("WebcamCapture", 0, 0, 0, 160, 120, Me.hwnd, 0) DoEvents SendMessage hWndCap, CONNECT, 0, 0 Timer1.Enabled = True End Sub
Private Sub STOP_WEBCAM_Button2_Click() DoEvents: SendMessage hWndCap, DISCONNECT, 0, 0 Timer1.Enabled = False End Sub
Private Sub Timer1_Timer() 'Obtiene frames para Picture1 SendMessage hWndCap, GET_FRAME, 0, 0 SendMessage hWndCap, COPY, 0, 0 Picture1.Picture = Clipboard.GetData Clipboard.Clear End Sub
Private Sub Form_Load() Timer1.Enabled = False Timer1.Interval = 1 End Sub
Private Sub Form_Unload(Cancel As Integer) DestroyWindow hWndCap End Sub
Espero que estiendas el codigo, es facil!! Salu2 Ranslsad
|
|
|
|
|
|
|