Feeling

    三人行,必有我师焉

   ::  :: 新随笔 :: 联系 ::  :: 管理 ::
  185 随笔 :: 0 文章 :: 392 评论 :: 0 Trackbacks

扩展SWT功能,实现了Windows下注册表,磁盘,CPU,内存,目录访问,网络,关机,系统特性等常用API功能。现在可以通过CVS进行访问该项目,直接下载:http://www.blogjava.net/Files/cnfree/swt-extension.zip

SWT Extension under Windows OS can be checked out through CVS now! 

User can access it from:
 
cvs -z3 -d:pserver anonymous@feeling.cvs.sourceforge.net:/cvsroot/feeling co -P org.eclipse.swt.extension  
 
Add native method: 

public   static   final   native   boolean  ShowCursor( boolean  bShow);
public   static   final   native   void
 GetDiskFreeSpace(String drive, DISKFREESPACE diskFreeSpace);
public   static   final   native   void
 GetSystemInfo(SYSTEM_INFO systemInfo);
public   static   final   native   void
 GlobalMemoryStatus(MEMORYSTATUS memoryStatus);
public   static   final   native   int
 GetDriveType(String drive);
public   static   final   native
 String[] GetLogicalDrives();
public   static   final   native
 String GetVolumeLabel(String drive);
public   static   final   native   boolean
 SetVolumeLabel(String drive, String label);
public   static   final   native
 String GetCurrentDirectory();
public   static   final   native   boolean
 SetCurrentDirectory(String directory);
public   static   final   native   boolean
 RegistryKeyIteratorHasNext(KeyIterator iterator);
public   static   final   native   void
 DeleteRegistryKey(RegistryKey key);
public   static   final   native   boolean
 RegistryKeyHasSubKeys(RegistryKey key);
public   static   final   native   boolean
 RegistryKeyHasValue(RegistryKey key, String name);
public   static   final   native
 String RegistryKeyValueIteratorGetNext(ValueIterator iterator);
public   static   final   native   boolean
 RegistryKeyHasValues(RegistryKey key);
public   static   final   native
 RegistryValue RegistryKeyGetValue(RegistryKey key, String name);
public   static   final   native   void
 RegistryKeySetValue(RegistryKey key, RegistryValue value);
public   static   final   native   void
 RegistryKeyDeleteValue(RegistryKey key, String name);
public   static   final   native
 String RegistryKeyIteratorGetNext(KeyIterator iterator);
public   static   final   native   boolean
 ExistsRegistryKey(RegistryKey key);
public   static   final   native   void
 CreateRegistryKey(RegistryKey key);
public   static   final   native   boolean
 RegistryKeyValueIteratorHasNext(ValueIterator iterator);
public   static   final   native   int
 CreateShortCut(String sourceFile, String linkFile,String linkDescriptor);
public   static   final   native   int
 SHFileOperationA(SHFILEOPSTRUCT shFileOpStruct);
public   static   final   native   int
 SHFileOperationW(SHFILEOPSTRUCT shFileOpStruct);
public   static   final   native   boolean  FlashWindow( int  hwnd,  boolean
 bInvert);
public   static   final   native   boolean  SetLayeredWindowAttributes( int  hwnd,  int  color,  byte  alpha,  int
 type);
public   static   final   native
 String GetSystemDirectory();
public   static   final   native
 String GetWindowsDirectory();
public   static   final   native
 String GetTempPath();
public   static   final   native
 String GetLongPathName(String shortPathName);
public   static   final   native   boolean  SetWallPaper( char [] picturePath, int
 style);
public   static   final   native   int  Ping( String host ,  int
 dateSize );
public   static   final   native   int
[] GetMACID( );
public   static   final   native   int [] GetMACAddress(  int
 MACID);
public   static   final   native   boolean  Reboot( boolean
 force);
public   static   final   native   boolean  Shutdown( boolean
 force);
public   static   final   native   boolean  Logoff( boolean
 force);
public   static   final   native   boolean
 LockWorkStation();
public   static   final   native   boolean  SuspendWorkstation( boolean  suspend, boolean
 force);
public   static   final   native   boolean  InitiateShutdownA( byte [] info, int  time,  boolean  force , boolean
 reboot);
public   static   final   native   boolean  InitiateShutdownW( char [] info, int  time,  boolean  force , boolean
 reboot);

snapshot:
swt-extension.jpg
posted on 2007-01-03 18:32 三人行,必有我师焉 阅读(1219) 评论(3)  编辑  收藏

评论

# re: SWT Extension under Windows OS 项目可以通过CVS访问了! 2007-01-29 11:17 alon xiong
你好,我用了你的Extension.FlashWindow函数,在你的Example例子里面调用成功, 当最小化时任务栏会闪烁:
shell.addShellListener(new ShellAdapter() {
public void shellDeactivated(ShellEvent e){
Extension.FlashWindow(shell.handle, true);
}
});

然后我将你的class打包成jar,将lib里面的两个dll放到jar的根目录下,然后在我的RCP程序中这样调用:
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
Extension.FlashWindow(shell.handle, true);

任务栏不会闪烁,但是我用以下语句取代Extension.FlashWindow(shell.handle, true);这句时,
shell.open();
shell.setMinimized(false);
shell.forceActive();
shell.forceFocus();
可以打开窗口,证明shell是正确的
请问这是为什么?是不是我那里设置不对,谢谢!
  回复  更多评论
  

# re: SWT Extension under Windows OS 项目可以通过CVS访问了! 2007-04-06 04:18 催月泪
SWT Extension 这个项目是不是已经停止开发,我在sourceforge没有找到,但找到了一个eclipse ui extension  回复  更多评论
  

# re: SWT Extension under Windows OS 项目可以通过CVS访问了! 2007-04-06 10:57 三人行,必有我师焉
SWT Extension 是 eclipse ui extension 的子项目。不过由于工作的原因,最近确实没有时间开发了。  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航:
 
GitHub |  开源中国社区 |  maven仓库 |  文件格式转换