|
Mostrar Mensajes
|
Páginas: [1] 2
|
1
|
Programación / Programación Visual Basic / [Ayuda] Control WebBrowser
|
en: 6 Febrero 2008, 00:09 am
|
Hola a todos, Porfavor le pido a aquel que sepa solucionar este problemas, me ayude, aunque se que en esta comunidad son buena onda Lo que quiero es que al usuario no le aparezca ese error que dice si deseo depurarlo... error en la linea xxx acceso denegado... Bueno, ese cuadro de advertencia lo odio, Hate It Graaaaacias amigos de la comunidad Editado--- Ahora le pongo WebBrowser1.Silent = True y no aparece el molesto error eeeeeee pero aparece otra ventana que dice algo de just-in-time debbugger no se q cosa aaaah lloro
|
|
|
2
|
Programación / Programación Visual Basic / Re: ocultar un form vb
|
en: 10 Enero 2008, 05:25 am
|
Ola viejito, Se me imagina que es esto: Private Sub Command1_Click() if txtUser = "blablaAdmin" And txtPass = "blablaPass" then ' Se ingreso bien el usuario y contraseña entonces Form2.Show Me.Hide ' O !creo¡ que funciona con: Unload Me Else ' Si no se cumple entonces msgbox "Usuario o Contraseña Invalidos",,"Error" End Sub
Espero que sea eso Chauuuuz
|
|
|
3
|
Programación / Programación Visual Basic / Re: Pequeña duda!
|
en: 10 Enero 2008, 05:18 am
|
Pero viejito, El form en estilo de borde tiene que estar en "none" esto aparece justo arribita de donde le pones el Caption al form ojala lo veas Para que quede mas claro (y aprovechando el rato de ocio ) Y por si acaso, te posteo altiro la funcion para mover el form Option Explicit ' Libreria mover Formulario 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 ReleaseCapture Lib "User32" () As Long ' Mover el Form Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hWnd, &HA1, 2, 0& End Sub
Saludos, Chauuuz
|
|
|
4
|
Programación / Programación Visual Basic / Leer/Escribir Archivos INI
|
en: 9 Enero 2008, 21:10 pm
|
incrustarlo en el code lo hallo inexistente para darte nuevas ideas, otros caminos, igual de interesante te dejo el codigo de como leer y escribir archivos INI En un Modulo inserta el siguiente codigo: Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long Function ReadINI(strSection As String, strSetting As String, strDefault As String, strRuta As String) Dim lngReturn As Long, strReturn As String, lngSize As Long lngSize = 255 strReturn = String(lngSize, 0) lngReturn = GetPrivateProfileString(strSection, strSetting, strDefault, strReturn, lngSize, strRuta) If strReturn = "" Then ReadINI = strDefault WriteINI strSection, strSetting, strDefault Else ReadINI = LeftOf(strReturn, Chr(0)) End If End Function Function WriteINI(strSection As String, strLValue As String, strRValue As String, strRuta As String) Dim lngReturn As Long lngReturn = WritePrivateProfileString(strSection, strLValue, strRValue, strRuta) End Function Function LeftOf(strData As String, strDelim As String) As String Dim intPos As Integer intPos = InStr(strData, strDelim) If intPos Then LeftOf = Left(strData, intPos - 1) Else LeftOf = strData End If End Function
En el Form: Private Sub Command1_Click() ' Esta es la funcion para guardar el tip en el ini WriteINI "Tips", "ID", Text1, App.Path & "Tips.ini" End Sub Private Sub Command2_Click() ' Y con este boton obtenemos los datos en el Text1 Text1 = ReadINI("Tips", "ID", "1", App.Path & "Tips.ini") End Sub
Ahi para que te entretengas adaptandolo jajajaja duro trabajo xD Suerte, Chauuuuuz
|
|
|
5
|
Programación / Programación Visual Basic / Re: Pequeña duda!
|
en: 9 Enero 2008, 03:45 am
|
Creo que es esto lo que buscas Suerte, Saludos Const LWA_COLORKEY = &H1 Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 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 SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Sub Form_Load() Shape Me, &H0& ' Al cargar el formulario, se quita el color indicado, en este caso el negro End Sub Private Sub Shape(Frm As Form, Color As Long) Frm.BackColor = Color Dim Ret As Long Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE) Ret = Ret Or WS_EX_LAYERED SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret SetLayeredWindowAttributes Me.hWnd, Color, 0, LWA_COLORKEY End Sub
Chauuuuz
|
|
|
6
|
Programación / Programación Visual Basic / Re: [DUDA] Hacer frase aleatoria
|
en: 9 Enero 2008, 03:37 am
|
pues ya habai conseguido hacer estoi pero la verdad, este es mucho mas sencllo que el que yo consegui^^
Pero lo que yo quisiera ahora esque en un texbox se escriba lo que se quiera y luego se añada al code, nuse si s podra hacer :S si no se puede pos weno, no pasa nada
Es que no entendi nunca lo que quieres lei como tres veces la explicacion y no entendi, desde un texbox al code :S Quizas si fueras ma especifico, o quizas con algun ejemplo Suerte Chauuuz
|
|
|
7
|
Programación / Programación Visual Basic / Re: [DUDA] Hacer frase aleatoria
|
en: 8 Enero 2008, 17:37 pm
|
Holanda, Mira por ahi, uno de estos dias postiaron el tema de la funcion Rnd, y lo encontre interesante ... entonces usando Case quedaria mas o menos asi : Dim Tips As Integer 'Si no es entero(integer) no funcionara Private Sub Form_Load() Randomize Tips = Rnd * 5 'Generas un numero aleatorio End Sub Private Sub Form_activate() ' Y aqui, segun el numero aleatorio ' te muestra en una caja de texto ' el tips para cada Case, siiiiiiiii :xD Select Case Tips Case 0 Text1 = "Hoy es el dia para suicidarse" Case 1 Text1 = "Esta de moda martillarse los dedos ;)" Case 2 Text1 = "No tomes viagra" Case 3 Text1 = "Chuchuca!" Case 4 Text1 = "Tu novia no te desea... puaaj" Case 5 Text1 = "Muerdete la lengua... (8)" End Select End Sub
Ahora bien, lo ejecute en mi pc, y la mayoria de las veces salian los mensajes que estan en medio, osea... salian mas veces el Case 2, 3 y 4 que el 1 y el 5 Espero te sirva y sino, que encuentres uno mejor Suerte Chauuuuz
|
|
|
8
|
Programación / Programación Visual Basic / [Codigo] Mata Bichos =P
|
en: 2 Diciembre 2007, 03:55 am
|
Mas mula el programa jajkakajaka pero se hace lo que se puede para el que le sirva parte del codigo, nuevas ideas, etc... haganlo ***** Controles: - 2 cajas de texto (txtRuta y txtBicho) - 3 botones (cmdBuscar, malo y Command2) - 1 CommonDialog (AbrirArchivo) - 1 Listbox (List1) (carga procesos) Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Sub CloseHandle Lib "kernel32" (ByVal hPass As Long) Private Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long th32ModuleID As Long cntThreads As Long th32ParentProcessID As Long pcPriClassBase As Long dwFlags As Long szExeFile As String * 260 End Type Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Const PROCESS_TERMINATE = &H1 Const PROCESS_CREATE_THREAD = &H2 Const PROCESS_VM_OPERATION = &H8 Const PROCESS_VM_READ = &H10 Const PROCESS_VM_WRITE = &H20 Const PROCESS_DUP_HANDLE = &H40 Const PROCESS_CREATE_PROCESS = &H80 Const PROCESS_SET_QUOTA = &H100 Const PROCESS_SET_INFORMATION = &H200 Const PROCESS_QUERY_INFORMATION = &H400 Const STANDARD_RIGHTS_REQUIRED = &HF0000 Const SYNCHRONIZE = &H100000 Const PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &HFFF ////// Pausar Sub Pause(interval) Current = Timer Do While Timer - Current < Val(interval) DoEvents Loop End Sub ///// Rellenar List1 con procesos activos Sub RellenaLista() Dim hSnapShot As Long Dim uProceso As PROCESSENTRY32 Dim res As Long List1.Clear hSnapShot = CreateToolhelpSnapshot(2&, 0&) If hSnapShot <> 0 Then uProceso.dwSize = Len(uProceso) res = ProcessFirst(hSnapShot, uProceso) Do While res List1.AddItem Left$(uProceso.szExeFile, InStr(uProceso.szExeFile, Chr$(0)) - 1) List1.ItemData(List1.NewIndex) = uProceso.th32ProcessID res = ProcessNext(hSnapShot, uProceso) Loop Call CloseHandle(hSnapShot) End If End Sub ////// Buscar el ejecutable en cuestion Private Sub cmdBuscar_Click() With AbrirArchivo .Filter = "Bichos Ejecutables! (*.exe)|*.exe" .DialogTitle = "Buscando Bicho a Exterminar !!" .ShowOpen If .FileTitle = "" Then malo.Visible = False Exit Sub End If End With txtBicho = AbrirArchivo.FileTitle cuadro1.Caption = "Archivo " & "|" & AbrirArchivo.FileTitle & "|" txtRuta = AbrirArchivo.FileName RellenaLista malo.Visible = False End Sub ////// Manda a la cresta el proceso y elimina el archivo Private Sub Command2_Click() malo.Visible = True RellenaLista Dim hProcess As Long, iResult As Long, Resp As Integer List1.Text = txtBicho If List1.Text = txtBicho Then hProcess = OpenProcess(PROCESS_TERMINATE, True, List1.ItemData(List1.ListIndex)) iResult = TerminateProcess(hProcess, 99) CloseHandle hProcess DoEvents Kill txtRuta Pause 2 MsgBox " Matanga dijo la changa !! ", vbInformation, "Bicho Elimindo!" malo.Visible = True Else Resp = MsgBox("No existe proceso activo..." & vbCrLf & "Desea eliminar el archivo?", vbQuestion + vbYesNo, "Eliminar Bicho?") If Resp = 7 Then malo.Visible = False If Resp = 6 Then Kill txtRuta: Pause 2: MsgBox " Matanga dijo la changa !! ", vbInformation, "Bicho Elimindo!": malo.Visible = True Exit Sub End If End Sub ////// Rellena el List1 al cargar el formulario po Private Sub Form_Load() RellenaLista End Sub
jakjkaja y eso era po al que le sirva Chauuuuuz Saludos desde Chile
|
|
|
9
|
Programación / Programación Visual Basic / Re: ¿Como Crear un BOT?
|
en: 2 Diciembre 2007, 03:33 am
|
Quizas esto te ayude viejito este postea en fotolog, donde message es el "name" del campo de mensajes y "gb_form_button" es el boton para postear Controles: - Un boton (Command1) - Una caja de texto (Text1) - Microsoft Internet Control (WebBrowser) Option Explicit Private Sub Command1_Click() WebBrowser.Document.All.Item("message").Value = Text1.Text WebBrowser.Document.All.Item("gb_form_button").Click End Sub
Solo debes trabajartelo y obvio saber lo baaasiico! de html Suerte Saludos desde Chile
|
|
|
10
|
Programación / Programación Visual Basic / Re: Actualizacion: AuToMsn 1.5 by €duhAcK
|
en: 16 Noviembre 2007, 20:21 pm
|
Compa, yo hice un programa identico, por no decir igual... y para evitar que me lanzara error por no tener abierto el messenger, encontre este codigo y lo puse en mi programa... Private Sub Form_Load() Text1 = VerificarExe("msnmsgr.exe") If Text1 = "False" Or Text1 = "Falso" Then msgbox "Messenger Cerrado!" End If End Sub
Funcion verificar: Public Function VerificarExe(ejecutable As String) As Boolean Dim strSQL As String On Error Resume Next strSQL = "Select Name from Win32_Process Where Name = '" & ejecutable & "'" VerificarExe = GetObject("winmgmts:").ExecQuery(strSQL).Count End Function
Como puedes ver, al cargar el formulario (form_load), en un textbox (Text1) se establece si se esta ejecutando el proceso o no... segun el idioma del PC saldra True o False, Verdadero o Falso... Y bueno, ahi a la imaginacion po, puedes editar el codigo para hacerlo mas eficaz, porque igual es harto arcaico :/ Eso po Edu Saludos desde Chile Chauuuz P.D: si te interesa aqui el ejecutable de mi programa.. obviamente libre de todas esas weas malas
|
|
|
|
|
|
|