Question Integrating LibreOffice Into Form Panel

acozzetta

New member
Joined
Feb 21, 2014
Messages
1
Programming Experience
1-3
Hey guys first off I hope you are all doing awesome! I have a question concerning integrating LibreOffice into a VB Net form panel. I have it working with integrating Notepad and Wordpad, but cannot for the life of me get it to work with LibreOffice Write. I'm also positive that it has something to do with the LibreOffice API that needs to be called or imported upon loading.(Changing the .dll files in the SetParent and SendMessage lines of code) I have read the documentation for the LibreOffice SDK but am having lots of difficulty implementing it. Below is the code that I currently have to open notepad in the panel. I will be attaching a screenshot as well for those who may not understand what I am trying to accomplish. Any help would be greatly appreciated. Btw I am using VS 2012 and am writing using .NET Framework 4.0



Imports System.Runtime.InteropServices

Public Class Form1
Private Const WM_SYSCOMMAND As Integer = 274
Private Const SC_MAXIMIZE As Integer = 61488
Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim proc As Process

proc = Process.Start("notepad")
proc.WaitForInputIdle()
SetParent(proc.MainWindowHandle, Me.Panel1.Handle)
SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End Sub
End Class
 

Attachments

  • Capture.PNG
    Capture.PNG
    23.6 KB · Views: 31
Last edited:
If LibreOffice actually has an SDK then I would imagine that the code you have shown is completely irrelevant. That sort of thing is often used for applications with no API but if LibreOffice has an API then you would use that instead.
 
Back
Top