PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Silent Register ocx and dll... without displaying successful registration message-VBForums
Results 1 to 6 of 6

Thread: Silent Register ocx and dll... without displaying successful registration message

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2003
    Posts
    599

    Silent Register ocx and dll... without displaying successful registration message

    Guys,

    i want to invincibly register 3 ocx without the window popping up the successful message....how can i go about it?
    Thank You

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,697
    You mean like when you run a setup package? If so, you could
    create a small package of just the three files to install and
    register. If not, look into the Self-Register entry in the install log
    from a p&d install.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,697
    I knew there was another way.
    VB Code:
    1. ' Add 2 Commandbuttons and a textbox to the form, and paste this code into the form
    2. Option Explicit
    3.  
    4. Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
    5. Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
    6. Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
    7. Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long
    8. Private Const ERROR_SUCCESS = &H0
    9.  
    10. Private Sub Form_Load()
    11.     Text1.Text = "C:\WINDOWS\SYSTEM\COMCTL32.OCX"
    12.     Command1.Caption = "Register server"
    13.     Command2.Caption = "Unregister server"
    14. End Sub
    15.  
    16. Private Sub Command1_Click()
    17.     Call RegisterServer(Me.hWnd, Text1.Text, True)
    18. End Sub
    19.  
    20. Private Sub Command2_Click()
    21.     Call RegisterServer(Me.hWnd, Text1.Text, False)
    22. End Sub
    23.  
    24. Public Function RegisterServer(hWnd As Long, DllServerPath As String, bRegister As Boolean)
    25.     On Error Resume Next
    26.  
    27.     'KPD-Team 2000
    28.     'URL: [url]http://www.allapi.net/[/url]
    29.     'E-Mail: [email]KPDTeam@Allapi.net[/email]
    30.     'We're going to call an API-function, without declaring it!
    31.  
    32.     ' Modified by G. Kleijer
    33.     ' [email]gkleijer@casema.net[/email]
    34.     ' going to call the DllRegisterServer/DllUnRegisterServer API of the specified library.
    35.     ' there's no need to use the Regsvr32.exe anymore.
    36.  
    37.     ' Make sure the path is correct and that the file exists, otherwise VB will crash.
    38.  
    39.     Dim lb As Long, pa As Long
    40.     lb = LoadLibrary(DllServerPath)
    41.  
    42.     If bRegister Then
    43.         pa = GetProcAddress(lb, "DllRegisterServer")
    44.     Else
    45.         pa = GetProcAddress(lb, "DllUnregisterServer")
    46.     End If
    47.  
    48.     If CallWindowProc(pa, hWnd, ByVal 0&, ByVal 0&, ByVal 0&) = ERROR_SUCCESS Then
    49.         MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Successful"
    50.    Else
    51.         MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Unsuccessful"
    52.     End If
    53.     'unmap the library's address
    54.     FreeLibrary lb
    55. End Function
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,337
    if u want to run shell execute u can register em silently with :

    regsvr32 dllname.dll /s

  5. #5
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,697
    How about that. Simple. Guess we both need to check out the
    commandline switches for regsvr32.exe!


    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    shell "regsvr32 /s mydl.dll"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width