I can't find any working code for closing the CD Tray on a computer? I can open it but not close it.Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer..[code]I use "set cd door open" to open it. Why can't i close it? I have tried on 3 different computers!
'This is the event that is fired as the application is closing, whether it 'be from a close button in the application or from the user 'clicking the X in the upper right hand corner
[Code]....
Im trying to make an application that when you press X, the program gets put in system tray. But i have like no idea how i'm suppost to do that, so did a search on google and found this code. Only VB2010 (what i use) doesn't like the fourth line. Can anybody give me a quick tutorial on this, and make this work in VB 2010?
my program has a tray icon and i want it to show up in the system tray. so i went into my windows notification area and set it to show icon for my app. But when my app update to a new version with clickonce, it will think its a new app and i have to set it again. Is there a way that it will treat all new version as the same program and i dont have to keep setting it?
Form1 is a mdi container. It has a bunch of forms that can load inside of it as mdi children. If I close each open form inside the form1, and then click the red X at the top right, application exits fine.If I click the red X without closing the forms inside I get: An unhandled exception of type 'System.CannotUnloadAppDomainException' occurred in mscorlib.dll
Additional information: Error while unloading appdomain. (Exception from HRESULT: 0x80131015) However I can break from it. How do I get the application to not show that error? What must I do to fix those inside forms or close when the red x is clicked?
Dim frm As Form For Each frm In Forms Set frm = Nothing Next frm
The above code is what I used in VB6 to close all forms associated with my programs before my program closed. I have been searching for information on how to make sure all forms are closed when closing a VB2008 program.
I have seen info on using the Project Property Shutdown mode When startup form closes and I currently have this set.
Is this all that is really necessary? Will the garbage disposal close everything else to free up RAM?
Also, if I have several forms open and want to close all from the main form without closing each one individually, what is the best approach? Is there a collection like in VB6, go through the collection, compare it to the name of the main form and close it if it is not the main form?
I have the following code to close a form which is a child. The problem is that when it closes, it closes the MDI parent too.
Private Sub frmTransaction_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing If ListView1.Items.Count >= 1 Then
I im trying to find out if it's possible (using VB.net 08 Xpress) to create an application running solely out of the system tray, no forms - Just the icon and popup notifications.I have been considering building a tray based monitoring system for some time, and while I can get the code to work fine, I still need the thing to start up silently. Using Me.Hide() on Form load doesn't work, and I really don't want to work around using the start-up form as a splash page.I have also looked at making a module, but standard vb.net code just aint doing the job.
I have a problem: I have got an application that is mainly control by a tray icon and I can't show the window unless I click the icon, but the client computer has set the system not to show the icons in the tray area. So can I write a small app to act like a hand-make system tray? That means I have to get all the icons in the tray area and be able to send the mouse events to the icons and let them response to their own program.
[Code] That codes will execute the "xsentinel.bat". But, is there any ways that I can use to made the "xsentinel.bat" will running in background (Sys Tray)?
Im usig VS2008 and I want to make my program to run in in tray (right side of the taskbar) in hide like Antivirus or Tuneup Utility do. Such that it open at start up and goes to that tray and can give message like window security alert.
I've looked all over the internet and did a search on Dreamincode.net but I can't find anything on minimizing to the tray for Vb 2008.What I want to achieve is if the user hits the "X" button at the top, the application should minimize to the tray. When I right-click on the icon, a context menu strip should appear.
I have a multi-threaded tray application. I basically need it to shut down. I do some loops to close down threads, and that does work well. However, if message boxes are open in the UI, this usually prevents shut down. I tried End and Environment.Exit. Thoughts?
I tryed every option in the enumeration and it always pulled from the upper tray. I searched the web and found a number of people said "PaperSource" doesn't work, use "CustomPaperSource" instead. I tried it, but discoved CustomPaperSource doesn't appear to be a method of PrintOptions because the command is not recognized and won't compile. Sample:
For Each printerSource In printerSettings.PaperSources If printerSource.SourceName.ToString = "Tray 1" Then reportPaperSource = printerSource End If Next ReportDocument.PrintOptions.CustomPaperSource = reportPaperSource
I found a Hot fix on the Business Objects site and applied it successfully.
I also fould they recommend Crystal Report Service Pack 3. When I run it, it gives me a message: "Failed to read/update the registry for the Crystal Reports 10.0 Service Pack 3 -199".
I have 2 questions:
A) Is there a way to get my original PaperSource to work? It seems silly to have commands that don't do anything, so there must be a way to get it to do something.
B) Is there a way to get this or some other service pack to load so I can use the new command (CustomPaperSource)?
I'm working on a security type program that has a system tray that starts with windows and a driver to prevent it from being closed. Any ideas where to start?
How do you go about putting your app in the system tray or pinning to the task bar (as in Windows 7)?How do you become part of the right-click menu on the desktop or files - like you see various zip archive tools?
How do you go about putting your app in the system tray or pinning to the task bar (as in Windows 7)?How do you become part of the right-click menu on the desktop or files - like you see various zip archive tools?
I have an application that uses a NotifyIcon in the tray to hide/restore the application, as well as pop up notices to the user of application events. My application has a notification queue, and I use the NotificationIcon.BalloonTipClosed event to determine when to reset the balloon and show the next notification (if there's one in the queue).
This method seems to work great in both usual causes (user lets the balloon close itself when it times out, and user clicks "X" in balloon to force it to close), but there's a third case where BalloonTipClosed doesn't get called:Notification balloon pops up While it's visible, user right-clicks on notification icon to bring up context menu, causing the balloon to disappear
The BalloonTipClosed event doesn't get triggered in this instance - I figure it's a bug in the framework (I'm using 2.0), but does anybody have an idea around this? If I don't get this event, my application always thinks there's a balloon visible (I have a boolean that prevents it from displaying multiple balloons at once), and it will never show another icon again, as long as it's running.
I'm trying to click on an icon that is in the system tray. I'm sure there is API involved,which i'm sure will work. I Was wondering if there's any kind of code already in Visual Basic, that somehow puts them in an array of some sort. Especially with how sometimes windows will only show active icons. Would be a pain to have to click the arrows to show all icons and then find the icon. Which if it's API, would have to be x/y coordinates.Definitely would be different every time.
create a program that enums icons of the tray bar that have been created calling the function ShellNotifyIcon. So my question is how do you do to enum the windows that have called this function and want to appear in the system tray, whit its icons, and display a menu when you click on them. because i want to do the same that explorer.exe does but whit my own program (shell). Is this a secret?
I have looked on the net for demos of how to display a text message in the system tray, but all I can find are examples which say you need to use trayicons. Where you render your string into a bitmap, and then point the trayicon at the bitmap to display it.
Unfortunately this is no good for what I want to do, the trayicon is limited to only 16x16 pixels, and I want to display a longer message, which will just not fit. I can't resize the size of the icon, and if I make the source bitmap larger, it just gets scaled to fit within the 16x16 space (crushing it together into an awful mess)
So I tried using an array of trayicons and split the bitmap between them, but this also fails, because windows inserts about 3-4 pixels of padding between each tray icon.