Create pop up 'toaster' effect message - vb.net

I'm trying to replicate the Gmail Notifier popup.
It both fades in (Opacity) and raises from the start bar.
I've managed to do the fade in\out using a timer and opacity but how do I:
A) make the form appear to 'pop up'? (I think its height grows via a timer from 0 to it's max?
B) Locate it's start point exactly above the task bar as pictured on all screen resolutions\Windows flavours?

I ended up doing this:
Create "Toast" Popup Notification Windows
http://www.vbforums.com/showthread.php?t=351757
Works great, includes VB and C# versions too.

Related

QTP script works in big screen but not in small screen

I am using QTP 11.0 and a java button in my application is highlighted in big monitor screen(19 or 20 inch) but not in Laptop screen(14 or 15 inch).
I have to click the button and a pop up will be seen,this works fine in big screen but in laptop screen the pop up does not appear.Is there any workaround?
In small screen the scroll bar appears and the java button is below the screen, but in big screen its appeared without scrolling so its working fine with the big screen.
Also i have tried if scroll down is possible through scripting in small screen ,but scroll down does not work NOR does pgDown pgUP works in the application.
Addins selected are ActiveX,Java,Web
Advanced thanks...
As per the given information I assume that the problem is with the object properties of the java button. Could you try adding only htmlid/name property & try highlighting the object in both the screens? Please disable object identification, location & indexing if applicable. If possible share the properties of the object for further analysis.
Does QTP fail to recognise the button during play back? QTP may not highlight the button because it is not visible; but in most cases it will be able to perform actions (such as click event) on the button. Make the button visible in web page / application and try clicking on Highlight button in QTP.

Graphics.CopyFromScreen just my app window

I am using copyfromscreen to show a modal please wait message.
It works great but i find it failing when I'm doing alt tab to the app or I'm looking to another app and come back to my application.
Original post I got the idea from:
Javascript Like Modal Window for WinForms
I was curious if there is a function that would let me get screen capture of my app only even when its hidden in the background.
Control.DrawToBitmap Cody Gray suggestion actually works. Just grab the forms bitmap instead of doing full screen grab.

NSPanel in "Non-Activating"-Mode does not always show correct cursors

I've created a simple Cocoa-Application in XCode 4.6 with an NSPanel instead of the default NSWindow. When I enable the Non-Activating
option and start the application everything works fine:
The panel is displayed in front of everything else and when
the mouse cursor hovers over the panel's edges it changes from a normal
arrow-cursor to the appropriate resize-cursor, so the user knows that he can resize
the panel.
This works fine as longs as I don't click on any other application
as for example Safari or Finder.
From the moment I once give focus to another application,
I can click on and hover over my panel as much as I want, the
cursor style will not change anymore - it always stays an arrow and it's not possible to return to the normal behavior.
The panel stays selectable and in the front, you still can move and resize it,
but the mouse cursor stays an arrow all the time. You then cannot even change it
manually using something like: [[NSCursor crosshairCursor] set].
So I need to find a way to create a NSPanel that keeps the normal
automatic-change-cursorstyle-when-hovering-over-panel-edges-behaviour
even when you give focus to another application.
I have already tried to use an customized NSPanel-class,
where I have overwritten the canBecomeKeyWindow and
canBecomeMainWindow methods, so that they return YES
but even when I make my Panel KeyWindow and MainWindow...
[myPanel makeKeyAndOrderFront:self];
[myPanel makeMainWindow];
...it doesn't solve the cursor issue.
Would be great if someone could help me here :)
PS.: the Base SDK and the Deployment Target are set to 10.8 in my project
So I found out that the described issue has nothing to to with the panel's window-state. It really doesn't matter if it is set to key or to main, instead the cursor-problem (stays arrow all the time)is related to the application's activation state.
Everything works fine as long as the application that owns the panel is active but if you click on another application my application is deactivated and does not get activated again - even if you click on the panel - because the "non-activating"-option is enabled.
The problem is that i need the "non activating"-option because I am creating a status-bar-screen-capturing app that should be displayed and operate in front of everything else but without deactivating any running application. I could solve the cursor problem by
[NSApp activateIgnoringOtherApps];
but then taking a screenshot of a fullscreen video running in Safari would deactivate Safari and minimize the video, which I don't want.
I don’t think it’s possible through normal APIs to change the cursor when your app isn’t active. I’m pretty sure the window system doesn’t allow it: it’d be a violation of the boundaries between apps—if you try to set a cursor from the background, and the foreground app also tries to set a cursor, who would win?
Of course the system can do it (like when you take a screenshot with ⌘⇧4), because that’s in the window system itself.

Using Popup control in Window 8

Is there any property of pop up , wherein we can dim the window app.
As in metro app there is no Child Window control available , so using
popup in place of it but the problem in popup is when it is open the
user can still interact with other control on window app.
So is there an workaround to make the window app dim when pop is open.
I'm not sure to understand what your trying to do. You can put a Border as first child of the popup which exposes the Background property. So if you specify a not null Background (Transparent for instance) the popup will catch every interactions.
It sounds like you want the MessageDialog class. The popup is meant to be non-modal, letting the user close it by just clicking away from it. The MessageDialog is a regular modal popup that does not let the user interact with the rest of the app when it is displayed.
If you really insist on using the popup control, here is a simple workaround:
Make the popup use all the screen (using a grid or border), then set that background to Black with opacity 0.1 (or any other color you see fit, this is to give a "dim" effect), then inside this popup, place another container with the size and margins that you want to act as your "real" popup.
Because the popup takes the whole screen it will prevent the user from clicking anywhere in the screen.

Observe global mouse location on screen in Cocoa?

I'd like to be notified when the mouse moves and get the location on the screen. I tried this:
[NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask handler:^(NSEvent *event) {
CGPoint location = [NSEvent mouseLocation];
NSLog(#"Position: %#", NSStringFromPoint(location));
}];
However this seems to only work as long as the mouse is in my app's window. As soon as leave it I'm not notified. Until I enter the window again. Shouldn't this event be global?
UPDATE:
I extracted the code in question and made a separate sample project (Dropbox-Link). Just to be sure, there is nothing else interfering with it. It's a clean project with just the code above in applicationDidFinishLaunching:. I get the same results and it's really strange. I uploaded a video to youtube: http://www.youtube.com/watch?v=I3AKgmURaMk.
These are my observations:
Immediately after launching the app, no events at all are delivered, no matter where I move the mouse.
Clicking the app's window will somehow activate event delivery. Now I receive NSMouseMovedMask events, no matter where I move the mouse (this is what I want to achieve).
Clicking back to Xcode doesn't change anything. I keep getting the events.
However, moving the focus back to my app results in a strange behavior. When I move my mouse over Xcode I only get events over some parts of the window, while some parts seem to absorb the event. More specifically I don't receive events over the editor or the log view. I only receive them while moving the mouse over the gray split view separator area (with the tab bars embedded in them).
It should work, I've seen weird behavior when the window is up but not in the foreground. I've noticed that if the application is in the background but not in the dock you will only get events when the mouse transitions between windows in the foreground. Minimizing the application seems to fix this problem.. I'm very new at cocoa dev/ObjC.. I might be wrong, but I've noticed when I minimize my app, I get all events.