elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Temas
Páginas: [1]
1  Programación / .NET (C#, VB.NET, ASP) / Como pasar eventos en: 22 Agosto 2013, 19:14 pm
Buen dia a todos, tengo una gran duda y me gustaria que me agudara.

Tengo un Tree y un Grid en un solo formulario (Trabajo: C# + Silverlight + DevExpress) y los datos del tree son los mismos que el grid, es decir cuando doy dobleclick a un  nodo del tree y si hay hijos, pues el tree se expando y los hijos tambien aparacen en el grid, ahora mi problema es que me gustaria darle dobleclick al grid y si hay hijos pues que reacargue el grid y lo que deseo es que tambien se expanda en el tree...

Les agradeceria mucho si ayuda.

Saludos!
2  Comunicaciones / Dispositivos Móviles (PDA's, Smartphones, Tablets) / Posicion de Celular en: 21 Febrero 2012, 00:03 am
Buen dia a todos, estoy comenzado a recibir llamadas amenazadoras, ya hasta he recibido 2 balas amenazandome para darles dinero.
Hay una forma de poder saber la ubicación del tio cuando esta llamando?

Gracias, me es urgente, mi familia esta muy nerviosa....
3  Programación / Programación Visual Basic / Email en: 6 Febrero 2006, 21:19 pm
Una pregunta.... Alguien sabe enviar e-mail a hotmail pero sin usar el winsork...

Gracias
4  Programación / Programación Visual Basic / Una ayuda con frm + apis en: 24 Enero 2006, 16:21 pm
Bueno yo no se mucho de vb, y se me ocurrio una idea pues por q no hacer ventamas pero como yo las diseñle en c es decir con puras apis, sin utilizar ningun frm de vb...

Les agradecieria mucho su ayuda
5  Programación / Programación Visual Basic / Pequeña clase de API's en VB en: 12 Julio 2005, 17:21 pm
INTRODUCCION A LAS API´s DE WINDOWs.

Primero que todo, API quiere decir Aplication Program Interface, o lo que es lo mismo Interfase para la programación de Aplicaciones. Las api son funciones ajenas a VB, por lo que tiene que buscar afuera (Windows) en dlls´s o en archivos .exe que trae Windows.

Como dijimos antes el mismo Windows nos deja acceder a las api, que usa para hacer distintas tareas como por ejemplo dejar una ventana Always on top,  reiniciar el sistema, Acceder al registro y modificarlo, abrir la lectora de cd...etc (y si... como estas pensando se usan para hacer bromas también xD o daño en algunos casos). En sintesis hacer exactamente todo o casi todo lo que hace windows hacia el usuario.


El armado para llamar alguna función API consta de:


[PRIVATE] + 'DECLARE FUNCTION' + <NOMBREDELAFUNCION> + 'LIB'  + <"LIBRERIA"> + 'ALIAS' +  (Parametros)

Si la funcion necesita el uso de CONSTANTES es necesario declararlas antes.

Por ejemplo para  obtener el nombre de la PC escribiríamos lo siguiente en un módulo para poder distinguir bien el codigo.....o escribirlo en el mismo Form (General) <Poco Recomendado>.-

Código:
Private Declare Function NombrePC Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
    Dim Cadena As String
    Cadena = String(255, Chr$(0))
   NombrePC Cadena, 255
   Cadena = Left$(Cadena, InStr(1, Cadena, Chr$(0)))
  MsgBox Cadena
End Sub

Como se puede observar se uso la librería "Kernel32" (Es el núcleo del S.O), pero hay otras mas usadas como:

GDI32 > Funciones para manejar la parte gráfica y de pantalla
USER32 > Funciones de uso en general
ADVAPI32 > Funciones de nivel avanzado
WINMM > La parte sonido y multimedia

 Shell32, nos sirve para ejecutar algo, por ejemplo abrir el Outlook Express para que alguien nos envie un mail, o abrir el explorador para que entre a un sitio determinado
otras: Comdlg32, winspool.drv, lz32, Ole32 etc.

Donde esta el Api Viewer?
Menu Inicio/Programas/Microsoft Visual Studio 6.0/Herramientas de Microsoft Visual Studio 6.0/(He aqui) Visor de Texto API >O su direccion equivalente en Inglés.

Como usar el api Viewer?
Una vez abierto el API Viewer, tenemos que cargar los datos (Archivos .txt) que trae, ponemos cargar archivo de texto, dependiendo de la pc va tener una pequeña tardanza por lo cual va a preguntar si queremos convertir a una BD para tener acceso mas rápido. Le ponemos si, y usamos, buscando en la parte superior de búsqueda.

Algunos Ejemplos Útiles


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Abrir Outlook para que nos envíen un mail

---------------
SHELL32
  (Copialo tal cual y pegalo)
---------------

Código:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
    ShellExecute Me.hwnd, vbNullString, "mailto:shadow_enn_357 @ Hotmail.com", vbNullString, "C:\", SW_SHOWNORMAL
End Sub

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Para Obtener la Version de Windows

---------------
KERNEL32
  (Copialo tal cual y pegalo)
---------------

Código:
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long

Private Type OSVERSIONINFO
    dwOSVersionInfoSize As Long
    dwMajorVersion As Long
    dwMinorVersion As Long
    dwBuildNumber As Long
    dwPlatformId As Long
    szCSDVersion As String * 128
End Type

Private Sub Form_Load()
    Dim OSInfo As OSVERSIONINFO, PId As String
     Me.AutoRedraw = True
    'Set the structure size
    OSInfo.dwOSVersionInfoSize = Len(OSInfo)
    'Get the Windows version
    Ret& = GetVersionEx(OSInfo)
    'Chack for errors
    If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub

    'Print the information to the form
    Select Case OSInfo.dwPlatformId
        Case 0
            PId = "Windows 32s "
        Case 1
            PId = "Windows 95/98"
        Case 2
            PId = "Windows NT "
    End Select

    Print "OS: " + PId
    Print "Win version:" + Str$(OSInfo.dwMajorVersion) + "." + LTrim(Str(OSInfo.dwMinorVersion))
    Print "Build: " + Str(OSInfo.dwBuildNumber)
End Sub

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Dibujo y Formas
 >Necesita *Dos Timer con Intervalo =100 un *Command Button
---------------
GDI32
  (Copialo tal cual y pegalo)
---------------
Código:
Private Type POINTAPI
    x As Long
    y As Long
End Type

Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Sub Form_Load()
    Timer1.Interval = 100
    Timer1.Enabled = True
    Timer2.Interval = 100
    Timer2.Enabled = True
    Command1.Caption = "Draw Text"
End Sub

'This will draw an Ellipse on the active window
Sub Timer1_Timer()
    Dim Position As POINTAPI
    'Get the cursor position
    GetCursorPos Position
    'Draw the Ellipse on the Screen's DC
    Ellipse GetWindowDC(0), Position.x - 5, Position.y - 5, Position.x + 5, Position.y + 5
End Sub

Sub Command1_Click()
    Dim intCount As Integer, strString As String
    strString = "Cool, text on screen !"
    For intCount = 0 To 30
        'Draw the text on the screen
        TextOut GetWindowDC(0), intCount * 20, intCount * 20, strString, Len(strString)
    Next intCount
End Sub

Private Sub Timer2_Timer()
    'Draw the text to the active window
    TextOut GetWindowDC(GetActiveWindow), 50, 50, "This is a form", 14
End Sub
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Obtiene Nombre de Usuario 
 >Necesita un control Timer
---------------
ADVAPI32
  (Copialo tal cual y pegalo)
---------------
Código:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Form_Load()
    Timer1.Interval = 100
    Timer1.Enabled = True
    Dim strTemp As String, strUserName As String
    'Create a buffer
    strTemp = String(100, Chr$(0))
    'Get the temporary path
    GetTempPath 100, strTemp
    'strip the rest of the buffer
    strTemp = Left$(strTemp, InStr(strTemp, Chr$(0)) - 1)

    'Create a buffer
    strUserName = String(100, Chr$(0))
    'Get the username
    GetUserName strUserName, 100
    'strip the rest of the buffer
    strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)

    'Show the temppath and the username
    MsgBox "Hello " + strUserName + Chr$(13) + "The temp. path is " + strTemp
End Sub

Private Sub Timer1_Timer()
    Dim Boo As Boolean
    'Check if this form is minimized
    Boo = IsIconic(Me.hwnd)
    'Update the form's caption
    Me.Caption = "Form minimized: " + Str$(Boo)
End Sub
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Reiniciar PC

-----------
USER32
 (Copialo tal cual y pegalo)   
----------

Código:
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

Private Sub Form_Load()
    msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)
    If msg = vbCancel Then End
    'reboot the computer
    ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
End Sub
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
By
Shadow
 2003

Nota1:
 Algunos ejemplos Fueron sacados del API guide.
Nota2:
 Me puedo haber equivocado en algo...o en todo, se aceptan sugerencias.


Función Api que permite abrir y cerrar el lector de CD.

Código:
'Api para incluir en un modulo
Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long

'crear dos botones en un formulario
Private Sub Command1_Click()
'Se abrirá el CD
retvalue = mciSendString("set Cdaudio door open", returnstring, 127, 0)
End Sub

Private Sub Command2_Click()
'Se cerrará el CD
retvalue = mciSendString("set Cdaudio door closed", returnstring, 127, 0)
End Sub
6  Programación / Programación Visual Basic / Mandar email por vb en: 18 Mayo 2005, 04:41 am
Hola gente me gutaria q me podrian ayudar a diselñar un programita en vb q se puede mandar email a hotmail...

Gracias
7  Programación / Programación General / Que es union REGS r;?? en: 11 Mayo 2005, 05:13 am
Hola, me gustaria sabes q funcion cumple esta funcion y para q sirve gracias : union REGS r;
8  Programación / Programación C/C++ / menus en turbo c++ en: 30 Abril 2005, 04:58 am
Hola me gustaria saber como se pude crear menus en modo texto, asi como la misma interface q el turbo c++...

Gracias
9  Programación / Programación General / Alguien sabe como puedo resaltal en rich text box??? VB en: 28 Abril 2005, 03:35 am
Hola gente quisiera saber como puedo resaltar una palabra en un rich text box, les cuento q he diceñado un buscar y quisiera q la palabra buscada salga resaltado, hasta ahora solo puedo cambiarle de color pero eso no es suficiente, necesito resaltar...
Les agradeceria mucho a los q me ayudaran
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines