Running process inside a panel in VB.NET -
is there way run jar (or other process) file inside panel in vb.net?
i trying this:
imports system.diagnostics imports system.runtime.interopservices imports system.threading public class fgrupos <dllimport("user32.dll")> shared function setparent(byval hwndchild intptr, byval hwndnewparent intptr) intptr end function private sub fgrupos_load(sender system.object, e system.eventargs) handles mybase.load dim p process p = process.start("java.exe", "-jar processo.jar") threading.thread.sleep(500) setparent(p.mainwindowhandle, panel1.handle) end sub end class
but not working.
the code bellow (from vb.net launch application inside form) trick:
public class fgrupos declare auto function setparent lib "user32.dll" (byval hwndchild intptr, byval hwndnewparent intptr) integer declare auto function sendmessage lib "user32.dll" (byval hwnd intptr, byval msg integer, byval wparam integer, byval lparam integer) integer private const wm_syscommand integer = 274 private const sc_maximize integer = 61488 friend sub rodar_processo() dim p system.diagnostics.process p = process.start("notepad.exe") p.waitforinputidle() setparent(p.mainwindowhandle, pngrupo.handle) sendmessage(p.mainwindowhandle, wm_syscommand, sc_maximize, 0) me.bringtofront() end sub end class
Comments
Post a Comment