 |
|
 |
A little suggestion:
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("user32.dll")]
static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public UInt32 left;
public UInt32 top;
public UInt32 right;
public UInt32 bottom;
}
private int GetTaskBarHeight()
{
IntPtr hWnd = FindWindow("Shell_TrayWnd", null);
RECT rect;
GetClientRect(hWnd, out rect);
int retVal = (int)rect.top - (int)rect.bottom;
if (retVal > 0)
return retVal;
else
return -retVal; // in fact it should show the notify window from top of the screen. i.e. taskbar is aligned at the top. but it is enough for our case.
}
And change that 30 with GetTaskBarHeight()
|
|
|
|
 |
|
 |
Interop...
That old cool stuff is just amazing me every time I get to use it
I must say that at the time I did the GmailNotifierControl I didn't know the interop website reference pinvoke[^] which helped me sooo much in my later .csproj
:: YOU make history ::
|
|
|
|
 |
|
 |
your .csproj of GmailNotifier? if so will you share it?
|
|
|
|
 |
|
|
 |
|
 |
Firstly, thanks for the code - works a charm!
I made a small addition, I noticed the gmail version has fade-in/fade-out when it scrolls up. I added the following two lines to get this behaviour
private void tmrMove_Tick(object sender, System.EventArgs e)
{
int nTaskBarHeight = Screen.PrimaryScreen.Bounds.Bottom - Screen.PrimaryScreen.WorkingArea.Bottom;
double currPercentFull = (double)(Screen.PrimaryScreen.WorkingArea.Bottom - this.Top) / this.Height;
this.Opacity = currPercentFull;
if(!bHide) // Show the Info Box
...
This just scales the opacity depending on where the movement is up to.
Cheers.
|
|
|
|
 |
|
|
 |
|
 |
Good work.
There is a slight difference with the google Notifier, and i am wondering if your control can do this as well.
When clicking "Tell me again..." in gNotifier, it shows all the unread messages one by one. Basically, texts in the notifier window change, can your control do this?
BTW, would it be nice to make the "lblInfo" as an instance of "LinkLabel"?
Regards,
Mike
|
|
|
|
 |
|
|
 |
|
 |
I was just looking for a control like this for my project. Great
Its very useful.
|
|
|
|
 |
|
 |
Hi,
Feel free to use it as commercial/noncommercial aim
doesn't it feel great 2 b helpfull?
:: YOU make history ::
^_^
|
|
|
|
 |
|
 |
Hi,
Thanks for your great example. May I know I can use and modify it to use at commercial product?
Thanks again.
|
|
|
|
 |
|
 |
hi,
Sorry I was a bit OOO these two weeks.
Of course u can!!!
All I ask is a notification, i mean once your product is done, just a screen capture of the GmailNotifierControl @ work
good luck
:: YOU make history ::
^_^
|
|
|
|
 |
|
 |
I would also like your permission to use your code in this way. I assume from your response above that it is granted but figured it would be nice to ask anyways.
Thanks in advance.
|
|
|
|
 |
|
|
 |
|
 |
How do I change the opacity and movement speed?
I changed the values in the control but that doesn't seem to matter...?
|
|
|
|
 |
|
 |
The opacity is not directly accessible, use the max opacity property instead; the movement speed can be exposed as a public accessor in the gmailNotifier code itself.
good luck
:: YOU make history ::
^_^
|
|
|
|
 |
|
 |
I have a menu bar which is of double height. The pop-up appear right above a single height menu bar. I would think that Screen.PrimaryScreen.WorkingArea.Bottom would refer to the actual working area but I guess not. I do know it is possible since I have OWA uses a similar pop-up and it does take into account the actual height of the menu bar. Does anybody have any insights on this?
Phebous...
|
|
|
|
 |
|
 |
Hi, the value Screen.PrimaryScreen.WorkingArea changes every app launch,
Try for example, launching the app with the explorer bar size bigger, it would give you the right value.
try MessageBoxing Screen.PrimaryScreen.WorkingArea.Size.ToString()!
:: YOU make history ::
^_^
|
|
|
|
 |
|
 |
I m looking forward to know if the article does miss something, any comment is wellcome!!!
:: YOU make history ::
^_^
|
|
|
|
 |
|
 |
Hey,
if you change
( this.Top > Screen.PrimaryScreen.Bounds.Bottom - (this.Height + 30))
into this
if ( this.Top > Screen.PrimaryScreen.WorkingArea.Bottom - (this.Height)
then you dont have to advise the height of the taskbar.
But the i have still one problem,
-> the Window is above the taskbar.
regards
|
|
|
|
 |
|
 |
Thanks,
I made some changes, the 30 is now replaced by
int nTaskBarHeight = Screen.PrimaryScreen.Bounds.Bottom - Screen.PrimaryScreen.WorkingArea.Bottom;
and the GmailNotifierControl appears now behind the TaskBar and TopMost .
:: YOU make history ::
^_^
|
|
|
|
 |