By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,065 Members | 1,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,065 IT Pros & Developers. It's quick & easy.

Using Application.Run() without a form

P: n/a
Is it possible to put a VB.NET application in a message loop without a form?
From what I've read the method Application.Run() (parameterless) allows for
this...but how do you define the message loop handler that's the equivalent
of WndProc for an application that does not have a form? Unfortunately
Application.Run(new form()) makes the form visible so using a dummy form
doesn't work here. Thanks in advance for any help.

-Mike

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"mike2036" <mi******@discussions.microsoft.com> schrieb:
Is it possible to put a VB.NET application in a message loop without a
form?
From what I've read the method Application.Run() (parameterless) allows
for
this...but how do you define the message loop handler that's the
equivalent
of WndProc for an application that does not have a form? Unfortunately
Application.Run(new form()) makes the form visible so using a dummy form
doesn't work here. Thanks in advance for any help.


Check out 'Application.AddMessageFilter' in the documentation.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
Hi Herfried,

Thanks for the reply. Do I still need a hidden form using a message filter,
since I need to pass a handle to external app's to be signaled with messages?
Or can I get the application handle somehow from a formless app?

-Mike

"Herfried K. Wagner [MVP]" wrote:
"mike2036" <mi******@discussions.microsoft.com> schrieb:
Is it possible to put a VB.NET application in a message loop without a
form?
From what I've read the method Application.Run() (parameterless) allows
for
this...but how do you define the message loop handler that's the
equivalent
of WndProc for an application that does not have a form? Unfortunately
Application.Run(new form()) makes the form visible so using a dummy form
doesn't work here. Thanks in advance for any help.


Check out 'Application.AddMessageFilter' in the documentation.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
"mike2036" <mi******@discussions.microsoft.com> schrieb:
Thanks for the reply. Do I still need a hidden form using a message
filter,
since I need to pass a handle to external app's to be signaled with
messages?
Or can I get the application handle somehow from a formless app?


If the other application requires a window handle, you'll have to create a
window.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Addendum:

Background information:

<URL:http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowfeatures.asp?frame=true#message_only>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.