473,669 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Application.Run () without a form

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
4 5491
"mike2036" <mi******@discu ssions.microsof t.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.Ad dMessageFilter' 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
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******@discu ssions.microsof t.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.Ad dMessageFilter' 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
"mike2036" <mi******@discu ssions.microsof t.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
Addendum:

Background information:

<URL:http://msdn.microsoft. com/library/en-us/winui/winui/windowsuserinte rface/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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2199
by: joseph | last post by:
Hi, I would like to run a windows application without the user interface. Console application is not a choice because it does not allow to use ADO controls. When I start the Windows Application I do not want to see the Form and click some buttons to start a program. The program should start executing the main program immediately. Thank you very much for help.
1
2278
by: Erik Jensen | last post by:
I am interested in calling Application.Run() without passing a first form as the argument to the Run method. Reason being is that i would like to instantiate some helper or foundation classes before showing any vestiges of a form on the screen. This is how i am trying: Form1 frm = new Form1(); //form one is empty with a textbox for fun in it frm.Visible = false;
13
6079
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which during production. Usually, this only wraps code used to control quitting the whole app versus just shutting a form, but it can also control many other things. However, as part of the build before delivering an update, I have to remember to...
11
6587
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
7
3883
by: Zeke | last post by:
I'm using the following code to create word document but the problem is if you go to task manager you'll see a WINWORD.EXE process is running but not the application, here is the code: Word.Document aDoc= WordApp.Documents.Add(ref fileName, ref newTemplate, ref docType, ref isVisible); WordApp.Visible = true; aDoc.Activate(); WordApp.Selection.TypeText("Hello");
2
2877
by: Phuff | last post by:
I have an application that should run in the system tray while open. It is supposed to be open at all times and I need it to dissapear when the "X" button is pushed on the form...but without closing the app. I've tried overriding the closing event > Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As > System.ComponentModel.CancelEventArgs) Handles MyBase.Closing > 'Don't close this form > e.Cancel = True
8
6036
by: mike2036 | last post by:
I have an application (that has unmanaged code) and when I launch it without 'FullTrust' permissions (LocalIntranet_Zone), it crashes. When I set 'FullTrust' permissions, it launches fine. Is there a way I can compile the application such that it won't even attempt to launch without correct permissions instead of just crashing? Thanks for any help. -Mike
0
1850
by: jan.loucka | last post by:
We're running Windows Forms application written in .NET 2.0 (c#). The application is single threaded app - it starts without any form (Application.run()). After that we start another application (MapInfo professional) from our app using interop services and do some reparenting etc to make it look like our app. We also register our own application as a COM server and let MapInfo professional register a callback so MapInfo can communicate...
0
2071
Plater
by: Plater | last post by:
I have been trying to access a messageloop without opening a form. That is, I want to be able to receive messages from other applications through the message loop without having a form. I've read that you can use Application.Run() without an argument to create a loop without a form, but I have no way of sending messages to that loop (that i have figured out) I've tried using: Application.AddMessageFilter(ft);...
0
8382
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.