本帖最后由 yxp 于 2018-6-24 03:05 编辑
LISP+DWX 可调用 Windows API 几乎无所不能,以下代码实现窗口透明。
dwx 插件请搜索本论坛下载。
- ;;DCL 窗口透明化示例
- ;; by. yxp_xa 2018年6月22日
- (defun c:sss( / k)
- (setq dcl_id (load_dialog "sss.dcl"))
- (if (not (new_dialog "sss" dcl_id))(exit))
- (setq k "S01" px (dimx_tile k) py (dimy_tile k))
- (start_image k)
- (fill_image 0 0 px py 181)
- (end_image)
- (action_tile "S02" "(fun_s_02)")
- (setq next (start_dialog))
- (unload_dialog dcl_id)
- (princ)
- )
- ;;透明
- (defun fun_s_02()
- (setq DWX (vlax-create-object "DynamicWrapperX"))
- (vlax-invoke DWX 'Register "user32" "FindWindowExW" "i=hhhw" "r=m")
- (vlax-invoke DWX 'Register "user32" "GetWindowLongW" "i=hl" "r=l")
- (vlax-invoke DWX 'Register "user32" "SetWindowLongW" "i=hll" "r=l")
- (vlax-invoke DWX 'Register "user32" "SetLayeredWindowAttributes" "i=hlbl" "r=b")
- (setq dcl (vlax-invoke DWX 'FindWindowExW 0 0 0 "DCL窗口透明示例"))
- (setq Ele (vlax-invoke DWX 'GetWindowLongW dcl -20))
- (vlax-invoke DWX 'SetWindowLongW dcl -20 (Boole 6 Ele 524288))
- (vlax-invoke DWX 'SetLayeredWindowAttributes dcl 16744351 10 1)
- )
- (princ)
源码下载:
dwx自动注册工具下载: |