Ya que nadie me tiro una ayudita, pues aca esta mi esfuerzo, pero tiene un pequeño error y la verdad q no lo encuentro, me gustaria q en esto me ayudaramn.... Gracias
'*********************************************
' Creador de from
' sowher / GEDZAC - Group / 2006
'*********************************************
Public Const WS_OVERLAPPED = &H0&
Public Const WS_VISIBLE = &H10000000
Public Const WS_MAXIMIZE = &H1000000
Public Const CS_DBLCLKS = &H8
Public Type WNDCLASSEX
cbSize As Long
style As Long
lpfnwndproc As Long
cbClsextra As Long
cbWndExtra As Long
hInstance As Long
hIcon As Long
hCursor As Long
hbrBackground As Long
lpszMenuName As String
lpszClassName As String
hIconSm As Long
End Type
Declare Function RegisterClassEx Lib "user32" Alias "RegisterClassExA" (pcWndClassEx As WNDCLASSEX) As Integer
Declare Function UnregisterClass Lib "user32" Alias "UnregisterClassA" (ByVal lpClassName As String, ByVal hInstance As Long) As Long
Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName 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 hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Sub main()
RegistrarClase (WindowProcedure)
If Not CrearAplicacion Then
MsgBox "Falla en la creacion de la aplicacion"
UnregisterClass "mipropiaclase", App.hInstance
Exit Sub
End If
End Sub
Private Function RegistrarClase(FuncionMensajes As Long) As Boolean
Dim clase As WNDCLASSEX
clase.cbSize = 0
clase.style = CS_DBLCLKS
clase.lpfnwndproc = FuncionMensajes
clase.cbClsextra = 0
clase.cbWndExtra = 0
clase.hInstance = App.hInstance
clase.hIcon = 0
clase.hCursor = 0
clase.hbrBackground = COLOR_WINDOW + 1
clase.lpszMenuName = 0
clase.lpszClassName = "clase"
clase.hIconSm = 0
RegistrarClase = (RegisterClassEx(clase) <> 0)
End Function
Private Function CrearAplicacion() As Boolean
'Tipos de Ventanas Principales
hWnd = CreateWindowEx(0, "clase", "Ventana Principal", WS_OVERLAPPED Or WS_VISIBLE Or WS_MAXIMIZE, 0, 0, 500, 400, HWND_DESKTOP, 0, App.hInstance, ByVal 0&)
If hWnd = 0 Then
CrearAplicacion = False
Exit Function
End If
ShowWindow hWnd, SW_SHOWDEFAULT
CrearAplicacion = True
End Function