呵呵,之前偶为了作一个透明窗体,专门查windows的API,呵呵,不过OS把调用API封装的很方便 :)
// 透明窗体
OS.SetWindowLong(this.handle, OS.GWL_EXSTYLE, OS.GetWindowLong(
this.handle, OS.GWL_EXSTYLE) ^ 0x80000);
TCHAR lpLibFileName = new TCHAR(0, "User32.dll", true);
int hInst = OS.LoadLibrary(lpLibFileName);
if (hInst != 0) {
String name = "SetLayeredWindowAttributes\0";
byte[] lpProcName = new byte[name.length()];
for (int i = 0; i < lpProcName.length; i++) {
lpProcName
= (byte) name.charAt(i);
}
int fun = OS.GetProcAddress(hInst, lpProcName);
if (fun != 0) {
OS.CallWindowProc(fun, this.handle, 0, 100, 2);
}
OS.FreeLibrary(hInst);
}[ 此贴被river.he在2005年12月14日 14:48重新编辑 ]