Let a Form stay on top even if ToggleDesktop() (shell32.dll) is called - vb.net

is there anyway to capture and cancel or do something like me.activate when the show desktop event is triggered and make my form visible?
note:
The show desktop event is triggered by another app which is installed in some of my users pc. I am not trying to make my form always on top of other open windows.
Thanks in advance.

Alright, you mean to let your form stay on TopMost even if ToggleDesktop() in shell32.dll is executed.
By far I can say: there is none. They tried to experiment at codeguru but it seems there were no successfully results.

Related

How to manage event for made a load bars in Access

I created an application with Access (2013) with VBA. This application crawls a website and inserts some records into database. But it takes too much time.
My solution is to make load bars for waiting. But currently I use the event Form_Current(); and when I set the load bar's value (it's my function) setBarLoadValue (25) Nothing is displayed on the screen. Why ? Because my function run yet.
My question is: How I can manage the event to simulate a load bar in real time ? (Don't want to wait till the end of function to see 100%).
The following link has a beautifully designed Progress status bar. http://www.access-programmers.co.uk/forums/showthread.php?t=265537
The author of the code has provided a Class where you have a Form that acts as a Meter and you basically set the values. It could be real time enough, have a look. I use it in my application and works great.
Finally I found an solution !
Solution
Step1
You must enter this code in your code
DoCmd.SelectObject acForm, Me.Name
Me.Repaint
DoEvents
With this code, you display immediately the form
Step 2
Now, when you want to display something, you must just do that: DoEvents.
When you use DoEvents the form refresh and you can display the new state of the progress bar.
Note: This solution work with Access 2013. Maybe it's not supported with other version.

Allowing two windows from the same APP to move

I'm making a VB.net application. I have a dialog that pops up at some points. It is set as TopMost. The problem is, when it pops up, you can't move the main form. How can I make it so it shows and is usable while allowing the main form to continue to be usable?
It sounds like you're calling ShowDialog(), but the behaviour you describe sounds like you want to call Show() instead (of course, this'll mean that you will not get the DialogResult, nor will the calling code block, but this allows the parent window message loop to handle things like moving the window)

Script in IE to Insert Text at Cursor (in or out of IE)

I need to take text already obtained and stored in a variable and place it in another window: IE or any other windows application.
Context:
An asynchronous application is running in IE, most likely in the background, and when an event fires in the application, certain text needs to be inserted wherever the cursor/carrot is.
I am not restricted to any particular technology so if it even needs to be an ActiveX component I am open to anything.
This is something due for a project by the end of the week so ANY suggestions/ideas are VERY welcome.
Thank you in advance.
You'll need to write an ActiveX control that calls the SendInput function.
However, this sounds like a dumb idea. What are you trying to do?

How can I tell if a Balloon tip in the system tray has closed?

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.
This belongs as a comment to Aarons answer, but I am not allowed to comment yet.
If you handle the BalloonTipClicked and MouseClick events on the NotifyIcon (as well as the BalloonTipClosed) then you can capture all the ways the balloon can close. The only thing you have to be aware of is that several scenerios will trigger multiple events, so be sure to code around that (something like isClosed = true, and then reset that when a new balloon is displayed).
In the event handler for the BalloonTipClicked Event, I would check to see if the right mouse button was clicked, and if it was set the boolean to false.
Here's what I ended up doing, though I don't particularly like this solution. I added a second timer to the form and set it for 10 seconds. When a notification pops up (when I pop one), I start the timer, and then in BalloonTipClosed, I stop it. If the timer ticks (meaning that BalloonTipClosed hasn't run yet), I display the next tip manually.
The result is that if it hasn't fired yet, I take care of it. However, I'm open to better solutions if anybody has one.
I think this post from Raymond Chen about balloon notifications may help you:
http://blogs.msdn.com/oldnewthing/archive/2009/05/04/9585032.aspx

How to capture response from Cancel or Ok Button in two different Applications?

With my Application (vb.net) I am trying to scan Excel files some of which have ActiveX Components.
When running my Application, I am getting a pup-up window in Windows Vista Environment with Office-2007 having button OK and Cancel button to proceed.
But my problem is the scanning is not proceeding even after I keep on pressing the OK button. Now I want to continue with my application while pressing the Cancel button; i.e. just to skip the file. Is it possible to capture the response from the cancel button? (As this is a message box from another application, i.e. either from Vista or Office-2007, I'm not sure).
My main motive is to just ignore the message box to proceed....
Can anyone please help me out there....
Thank you....
The DisplayAlerts property of Microsoft.Interop.Excel.Application may help here.
If set to FALSE then Excel automatically chooses the default option on pop-up boxes.
Whether or not this applies to ActiveX controls I don't know but it may be worth trying.