The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > StreetDeck > DigitalMods (Scripts / API)

Reply
 
LinkBack Thread Tools Display Modes
Old 10-04-2007, 05:02 PM   #1
Newbie
 
Join Date: May 2007
Posts: 12
C to vb.net conversion of "Integrate a windows application into a DigitalMod "

In case anyone wanted it, I converted the example to vb.net. Here it is:

declare these items

'windows API declarations for the external application
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
Public Declare Function EnableWindow Lib "user32" (ByVal hWnd As Integer, ByVal bEnable As Boolean) As Boolean

'varible to store a pointer to your main class from your external form
Public m_Parent As Class1

' module used for External application
Public modEX As StreetDeck.ScriptModule

'Create our embedded form and embed it inside of our host window
Public embeddedForm As EmbeddedForm = New EmbeddedForm
Public hWndHost As Integer


in the OnConnection

modEX = app.CreateModule("External Prog")

'Create a host window to put in general windows inside the program
hWndHost = CType(modEX.CreateHostWindow, Integer)

'To enable gestures, we have to disable the host window
'once you do this, you should recieve mouse events
'through the module.OnMouse... functions, but mouse events
'will no longer be processed in your form.
'If set to true then mouse events will occur in form
EnableWindow(hWndHost, True)


embeddedForm.TopLevel = False

'set the pointer back to main class from your form
embeddedForm.m_Parent = Me
embeddedForm.Show()
SetParent(CType(embeddedForm.Handle, Integer), hWndHost)

'//Register to recieve some events from the objects
AddHandler modEX.OnEnter, AddressOf modEX_OnEnter
AddHandler modEX.OnRender, AddressOf modEX_OnRender

'in the OnDisconnect
RemoveHandler modEX.OnEnter, AddressOf modEX_OnEnter
RemoveHandler modEX.OnRender, AddressOf modEX_OnRender

'update any items in the OnRender for the module you created i.e. modEX

on the form declare
Public m_Parent As StreetDeckVBAddin.Class1

then
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'tell StreetDeck to go back to the previous module when it is clicked
m_Parent.modEX.GoBack()

End Sub

hopefully this will help someone out.
Hockeynut is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Change windows shell IntellaWorks WinNT Based 38 08-09-2008 02:01 AM
New Frontend for Windows and Linux gbr Other Cool Front Ends 66 10-26-2006 05:08 PM
Windows Vista thanatos106 Software & Software Development 123 06-28-2006 10:56 AM
Run WinCE & XP together ShawJohn Software & Software Development 12 11-07-2005 05:09 PM
Booting another application as windows shell psyclobe Software & Software Development 13 02-10-2004 10:27 PM


All times are GMT -5. The time now is 02:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics