⇤ ← Revision 1 as of 2004-12-22 10:39:08
Size: 1217
Comment:
|
← Revision 2 as of 2009-12-25 07:09:08 ⇥
Size: 1217
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
-- ZoomQuiet [[[DateTime(2004-12-22T10:39:08Z)]]] [[TableOfContents]] |
-- ZoomQuiet [<<DateTime(2004-12-22T10:39:08Z)>>] <<TableOfContents>> |
WinAPI 123
-- ZoomQuiet [2004-12-22 10:39:08]
Contents
使用 WinAPI 的例子
>>> import hidewin >>> hidewin.hide(1) # 隐藏 状态条 0 >>> hidewin.hide(0) # 显示状态条 0 >>>
C 语言源程序
: hidewin.c
#include <windows.h> int hide(int flag) { HWND hShellTray = FindWindow("Shell_TrayWnd",NULL); if(flag == 1) { ShowWindow(hShellTray,SW_HIDE); } else { ShowWindow(hShellTray,SW_SHOW); } return 0; }
swig 配置文件
- hidewin.i
%module hidewin %{ %} extern int hide(int flag);
编译与安装步骤
- 安装 swig (请看其他文档)
- swig.exe -python hidewin.i
- (生成 hidewin_wrap.c hidewin.py 两个文件)
- 在 VC 中建立 Win32 DLL 工程,把 hidewin_wrap.c 以及 hidewin.c 加入工程, 设置 Python 头文件,及库文件目录
- 编译 生成 _hidewin.dll
- ok, 在这个目录中可以执行 python解释器 使用了,使用见上面的例子
- 或者把 hidewin.py _hidewin.dll 两个文件放到Python安装目录的lib目录下,就可以了。