请问如何实现象MSN那种从窗体右下脚弹出小窗体的功能 啊? 谢谢
请问如何实现象MSN那种从窗体右下脚弹出小窗体的功能 啊? 问题点数:20、回复次数:12Top
1 楼batfree(没有计算机的程序员)回复于 2004-12-04 18:34:48 得分 5
关注,我也想知道Top
2 楼Ziox(笑·沧海)回复于 2004-12-04 22:21:48 得分 5
hoho 一个对话框之类的东东 而已 在指定位置显示出来 不就行了
Top
3 楼baisun(蟋蟀.NET)回复于 2004-12-05 00:26:32 得分 5
var oPopup = window.createPopup();
var popTop=50;
popshow();Top
4 楼foreverwufan(凡凡)回复于 2004-12-06 10:31:08 得分 5
-- NotifyIcon.cs
using System;
using System.Runtime.InteropServices;
namespace SlnJLDataSave
{
public class NotifyIcon
{
[StructLayout(LayoutKind.Sequential)]
public struct NotifyIconData
{
public System.UInt32 cbSize; // DWORD
public System.IntPtr hWnd; // HWND
public System.UInt32 uID; // UINT
public NotifyFlags uFlags; // UINT
public System.UInt32 uCallbackMessage; // UINT
public System.IntPtr hIcon; // HICON
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
public System.String szTip; // char[128]
public System.UInt32 dwState; // DWORD
public System.UInt32 dwStateMask; // DWORD
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)]
public System.String szInfo; // char[256]
public System.UInt32 uTimeoutOrVersion; // UINT
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=64)]
public System.String szInfoTitle; // char[64]
public System.UInt32 dwInfoFlags; // DWORD
//GUID guidItem; > IE 6
}
public enum NotifyCommand {Add = 0, Modify = 1, Delete = 2, SetFocus = 3, SetVersion = 4}
public enum NotifyFlags {Message = 1, Icon = 2, Tip = 4, State = 8, Info = 16, Guid = 32}
[DllImport("shell32.Dll")]
public static extern System.Int32 Shell_NotifyIcon(NotifyCommand cmd, ref NotifyIconData data);
[DllImport("Kernel32.Dll")]
public static extern System.UInt32 GetCurrentThreadId();
public delegate System.Int32 EnumThreadWndProc(System.IntPtr hWnd, System.UInt32 lParam);
[DllImport("user32.Dll")]
public static extern System.Int32 EnumThreadWindows(System.UInt32 threadId, EnumThreadWndProc callback, System.UInt32 param);
[DllImport("user32.Dll")]
public static extern System.Int32 GetClassName(System.IntPtr hWnd, System.Text.StringBuilder className, System.Int32 maxCount);
private System.IntPtr m_notifyWindow;
private bool m_foundNotifyWindow;
// Win32 Callback Function
private System.Int32 FindNotifyWindowCallback(System.IntPtr hWnd, System.UInt32 lParam)
{
bool blnDebug = false;
string strBallnoonWinName = "WindowsForms10.Window.0.app3";
System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
try
{
strBallnoonWinName = ((string)(configurationAppSettings.GetValue("balloonWinName", typeof(string))));
}
catch{}
try
{
blnDebug = ((bool)(configurationAppSettings.GetValue("debug", typeof(bool))));
}
catch{}
System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
GetClassName(hWnd, buffer, buffer.Capacity);
if(buffer.ToString() == strBallnoonWinName) // but what if this changes? - anybody got a better idea?
{
m_notifyWindow = hWnd;
m_foundNotifyWindow = true;
return 0; // stop searching
}
else
{
if(blnDebug)
{
clsLog log = new clsLog();
log.OpenLog();
log.Log.Add(buffer.ToString());
log.WriteLog();
}
}
return 1;
}
public void ShowBalloon(uint iconId, string title, string text, uint timeout)
{
try
{
// find notify window
uint threadId = GetCurrentThreadId();
EnumThreadWndProc cb = new EnumThreadWndProc(FindNotifyWindowCallback);
m_foundNotifyWindow = false;
EnumThreadWindows(threadId, cb, 0);
if(m_foundNotifyWindow)
{
// show the balloon
NotifyIconData data = new NotifyIconData();
data.cbSize = (System.UInt32)System.Runtime.InteropServices.Marshal.SizeOf(typeof(NotifyIconData));
data.hWnd = m_notifyWindow;
data.uID = iconId;
data.uFlags = NotifyFlags.Info;
data.uTimeoutOrVersion = 15000;
data.szInfo = text;
data.szInfoTitle = title;
Shell_NotifyIcon(NotifyCommand.Modify, ref data);
}
}
catch{}
}
}
}
Top
5 楼foreverwufan(凡凡)回复于 2004-12-06 10:32:43 得分 0
-- 初始化
this.notifyIcon1.Visible=true;
-- 弹出
NotifyIcon notifyIcon = new NotifyIcon();
notifyIcon.ShowBalloon(1, "test", strBallonMsg, 15000);
Top
6 楼alias88()回复于 2004-12-07 07:04:53 得分 0
去codeproject搜balloonwindowTop
7 楼cxyPioneer(matt)回复于 2004-12-07 08:33:47 得分 0
upTop
8 楼kandyasp(博客收集 http://www.1638988.cn)回复于 2004-12-08 11:44:51 得分 0
我最近在参与的项目中作了这个功能,是web下的。Top
9 楼jonescheng(小块头无大智慧)回复于 2004-12-08 17:31:08 得分 0
http://www.51windows.net/myjs/
里面有。。。Top
10 楼ling_ao(不断地问,不断地学习)回复于 2004-12-09 16:01:27 得分 0
to: foreverwufan(凡凡)
看了你写的东东,还是不大明白Top
11 楼xmr_gxcfe(不疯怎么行)回复于 2004-12-10 01:51:31 得分 0
我也想知道怎么做,可是看不懂楼上的CODETop
12 楼xaodoudou(我不想做潜水员)回复于 2004-12-12 14:20:42 得分 0
上 www.codeproject.com 搜索 popupwin C#代码
很好用 我试过
Top




