|
62
|
Programación / Programación Visual Basic / Re: [Ayuda] Form
|
en: 26 Septiembre 2010, 16:24 pm
|
Ahí va con constantes, Psyke. 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 Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000 Private Const WS_SIZEBOX = &H40000
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOZORDER = &H4 Private Const SWP_NOSIZE = &H1
Private Const SWP_REFRESH = SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_FRAMECHANGED
Private Sub Form_Load() Command1.Caption = "FIXED" Command2.Caption = "SIZEABLE" End Sub
Private Sub Command1_Click() Dim lngstylo As Long lngstylo = GetWindowLong(Me.hwnd, GWL_STYLE) And Not WS_SIZEBOX Call SetWindowLong(Me.hwnd, GWL_STYLE, lngstylo) Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, SWP_REFRESH) End Sub
Private Sub Command2_Click() Dim lngstylo As Long lngstylo = GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SIZEBOX Call SetWindowLong(Me.hwnd, GWL_STYLE, lngstylo) Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, SWP_REFRESH) End Sub
|
|
|
63
|
Programación / Programación Visual Basic / Re: [Ayuda] Form
|
en: 26 Septiembre 2010, 13:38 pm
|
En Diseño es como te dice raul y si necesitas cambiar en ejecución se puede usar SetWindowLong (sirve tambien para formularios sin borde) 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 SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load() Command1.Caption = "FIXED" Command2.Caption = "SIZEABLE" End Sub
Private Sub Command1_Click() Call SetWindowLong(Me.hwnd, &HFFF0, GetWindowLong(Me.hwnd, &HFFF0) And Not &H40000) Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, &H20 Or &H2 Or &H4 Or &H1) End Sub
Private Sub Command2_Click() Call SetWindowLong(Me.hwnd, &HFFF0, GetWindowLong(Me.hwnd, &HFFF0) Or &H40000) Call SetWindowPos(Me.hwnd, &H0, &H0, &H0, &H0, &H0, &H20 Or &H2 Or &H4 Or &H1) End Sub
|
|
|
65
|
Programación / Programación Visual Basic / Re: Ayuda Hook y ApiHooking
|
en: 19 Septiembre 2010, 05:55 am
|
yo lo que necesito es hecer un hook a una aplicacion (saber cuando se ejecuta, que parametros le pasan, etc).
para saber si una aplicacion externa está corriendo o no lo podes saber por intermedio del Hwnd de la su ventana o enumerando los procesos (EnumProcesses) , fijate en este link se habla de eso. http://www.vbforums.com/showthread.php?p=3231419 yo lo que necesito es hecer un hook a una aplicacion (saber cuando se ejecuta, que parametros le pasan, etc).
No sé si te puedo ayudar en el tema de saber que parametros se le pasan, a que parametros te referis exactamente ?
|
|
|
67
|
Programación / Programación Visual Basic / Re: [Aporte] EnvironEx
|
en: 19 Septiembre 2010, 04:17 am
|
Option Explicit Private Declare Function SHGetFolderPath Lib "shfolder" Alias "SHGetFolderPathA" (ByVal hwndOwner As Long, ByVal nFolder As Long, ByVal hToken As Long, ByVal dwFlags As Long, ByVal pszPath As String) As Long Private Const MAX_PATH = 260
Private Sub Form_Load() Dim sRet As String * MAX_PATH Call SHGetFolderPath(0, &H25, 0, 0, sRet) MsgBox Split(sRet, Chr$(0))(0)
End Sub
|
|
|
69
|
Programación / Programación Visual Basic / Re: [Aporte] EnvironEx
|
en: 18 Septiembre 2010, 23:33 pm
|
Yo la tenía parecida (siempre me olvido de los &H0 en lugar del 0, luego los cambio) Una duda desde siempre, estária bien sRet o igual debe usarse MAX_PATH ? Public Function ShEnviron(nCode As CSIDL) As String Dim sRet As String * 260 Call SHGetFolderPath(0, nCode, 0, 0, sRet) ShEnviron = Split(sRet, Chr$(0))(0) End Function
|
|
|
|
|
|
|