vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Schützen Sie Ihre Software vor Software-Piraterie - mit sevLock 1.0 DLL!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

ActiveX-Programmierung
Re: Reaktion in der IDE a´la TabStrip 
Autor: E7
Datum: 29.10.03 19:27

Dim hwnd2 As Long, hwnd3 As Long, old_proc As Long, new_proc As Long
Public Sub Main()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim lngTemp As Long
    ' Register class
    If MyRegisterClass Then
        ' Window created?
        If MyCreateWindow Then
        ' Change the button's procedures
        ' Point to new address
            new_proc = GetMyWndProc(AddressOf ButtonProc)
            old_proc = SetWindowLong(hwnd2, GWL_WNDPROC, new_proc)
            ' Message loop
            MyMessageLoop
        End If
        ' Unregister Class
        MyUnregisterClass
    End If
End Sub
Private Function MyRegisterClass() As Boolean
    ' WNDCLASS-structure
    Dim wndcls As WNDCLASS
    wndcls.style = CS_HREDRAW + CS_VREDRAW
    wndcls.lpfnwndproc = GetMyWndProc(AddressOf MyWndProc)
    wndcls.cbClsextra = 0
    wndcls.cbWndExtra2 = 0
    wndcls.hInstance = App.hInstance
    wndcls.hIcon = 0
    wndcls.hCursor = LoadCursor(0, IDC_ARROW)
    wndcls.hbrBackground = COLOR_WINDOW
    wndcls.lpszMenuName = 0
    wndcls.lpszClassName = "myWindowClass"
    ' Register class
    MyRegisterClass = (RegisterClass(wndcls) <> 0)
End Function
Private Sub MyUnregisterClass()
    UnregisterClass "myWindowClass", App.hInstance
End Sub
Private Function MyCreateWindow() As Boolean
    Dim hWnd As Long
    ' Create the window
    hWnd = CreateWindowEx(0, "myWindowClass", "My Window", WS_OVERLAPPEDWINDOW, _
      0, 0, 400, 300, 0, 0, App.hInstance, ByVal 0&)
    ' The Button and Textbox are child windows
    hwnd2 = CreateWindowEx(0, "Button", "My button", WS_CHILD, 50, 55, 100, 25, _
      hWnd, 0, App.hInstance, ByVal 0&)
    hwnd3 = CreateWindowEx(0, "edit", "My textbox", WS_CHILD, 50, 25, 100, 25, _
    hWnd, 0, App.hInstance, ByVal 0&)
    If hWnd <> 0 Then ShowWindow hWnd, SW_SHOWNORMAL
    ' Show them
    ShowWindow hwnd2, SW_SHOWNORMAL
    ShowWindow hwnd3, SW_SHOWNORMAL
    ' Go back
    MyCreateWindow = (hWnd <> 0)
End Function
Private Function MyWndProc(ByVal hWnd As Long, ByVal message As Long, ByVal _
  wParam As Long, ByVal lParam As Long) As Long
    Select Case message
        Case WM_DESTROY
            ' Destroy window
            PostQuitMessage (0)
    End Select
    ' calls the default window procedure
    MyWndProc = DefWindowProc(hWnd, message, wParam, lParam)
End Function
Function GetMyWndProc(ByVal lWndProc As Long) As Long
    GetMyWndProc = lWndProc
End Function
Private Sub MyMessageLoop()
    Dim aMsg As Msg
    Do While GetMessage(aMsg, 0, 0, 0)
        DispatchMessage aMsg
    Loop
End Sub
Private Function ButtonProc(ByVal hWnd As Long, ByVal message As Long, ByVal _
  wParam As Long, ByVal lParam As Long) As Long
    Dim x As Integer
    If (message = 533) Then
        x = MsgBox("You clicked on the button", vbOKOnly)
    End If
    ' calls the window procedure
    ButtonProc = CallWindowProc(old_proc, hWnd, message, wParam, lParam)
End Function
PS: Ist alles ein Code - nur gibt's hier im Forum eine Längenbegrenzung

E7

???????????????????????????????????????????????????????????
e7o.de | jetzt (wirklich) neu!

alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Reaktion in der IDE a´la TabStrip1.267Cyberbob28.10.03 11:47
Re: Reaktion in der IDE a´la TabStrip980E729.10.03 19:13
Re: Reaktion in der IDE a´la TabStrip913Cyberbob29.10.03 19:18
Re: Reaktion in der IDE a´la TabStrip1.031E729.10.03 19:26
Re: Reaktion in der IDE a´la TabStrip1.050E729.10.03 19:27
Re: Reaktion in der IDE a´la TabStrip1.116E729.10.03 19:27
Re: Reaktion in der IDE a´la TabStrip957Cyberbob29.10.03 19:36
Re: Reaktion in der IDE a´la TabStrip902E729.10.03 20:43
Re: Reaktion in der IDE a´la TabStrip910E729.10.03 20:45
Re: Reaktion in der IDE a´la TabStrip877Cyberbob29.10.03 20:53
Re: Reaktion in der IDE a´la TabStrip982E729.10.03 21:06
Re: Reaktion in der IDE a´la TabStrip1.020Cyberbob29.10.03 21:11

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel