
这是个封装好的类,非常好用,不懂怎么使用可以百度给我发消息
using System;
using SystemRuntimeInteropServices;
namespace SystemHotKey
{
public delegate void HotkeyEventHandler(int HotKeyID);
public class Hotkey : SystemWindowsFormsIMessageFilter
{
SystemCollectionsHashtable keyIDs = new SystemCollectionsHashtable();
IntPtr hWnd;
public event HotkeyEventHandler OnHotkey;
public enum KeyFlags
{
MOD_ALT = 0x1,
MOD_CONTROL = 0x2,
MOD_SHIFT = 0x4,
MOD_WIN = 0x8
}
[DllImport("user32dll")]
public static extern UInt32 RegisterHotKey(IntPtr hWnd, UInt32 id, UInt32 fsModifiers, UInt32 vk);
[DllImport("user32dll")]
public static extern UInt32 UnregisterHotKey(IntPtr hWnd, UInt32 id);
[DllImport("kernel32dll")]
public static extern UInt32 GlobalAddAtom(String lpString);
[DllImport("kernel32dll")]
public static extern UInt32 GlobalDeleteAtom(UInt32 nAtom);
public Hotkey(IntPtr hWnd)
{
thishWnd = hWnd;
SystemWindowsFormsApplicationAddMessageFilter(this);
}
public int RegisterHotkey(SystemWindowsFormsKeys Key, KeyFlags keyflags)
{
UInt32 hotkeyid = GlobalAddAtom(SystemGuidNewGuid()ToString());
RegisterHotKey((IntPtr)hWnd, hotkeyid, (UInt32)keyflags, (UInt32)Key);
keyIDsAdd(hotkeyid, hotkeyid);
return (int)hotkeyid;
}
public void UnregisterHotkeys()
{
SystemWindowsFormsApplicationRemoveMessageFilter(this);
foreach (UInt32 key in keyIDsValues)
{
UnregisterHotKey(hWnd, key);
GlobalDeleteAtom(key);
}
}
public bool PreFilterMessage(ref SystemWindowsFormsMessage m)
{
if (mMsg == 0x312)
{
if (OnHotkey != null)
{
foreach (UInt32 key in keyIDsValues)
{
if ((UInt32)mWParam == key)
{
OnHotkey((int)mWParam);
return true;
}
}
}
}
return false;
}
}
}
实现:
1 在plsqldev 中编译java代码 调用接口(具体的语法百度即可) 访问地址是:1921681257:8088/Jfinaltest/show
[sql] view plain copy
create or replace and compile java source named jxdClient as
import javanet;
public class Demo {
public static void main(String[] args) {
try {
URL url = new URL(">
以上就是关于(winform)如何监控程序运行时处理的数据全部的内容,包括:(winform)如何监控程序运行时处理的数据、oracle 怎么 监控数据变化、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)