Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created March 7, 2012 00:20
Show Gist options
  • Save hidsh/1990061 to your computer and use it in GitHub Desktop.
Save hidsh/1990061 to your computer and use it in GitHub Desktop.
xyzzy ウィンドウ最大化、トグル
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; @@@ maximize-xyzzy
;;; http://plaza.umin.ac.jp/~takeshou/xyzzy/setting.html
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require "wip/winapi")
(c:define-dll-entry winapi:BOOL ShowWindow (winapi:HWND c:int) "user32")
;; ウィンドウ最大化
(defun maximize-xyzzy ()
(interactive)
(ShowWindow (get-window-handle) 3))
;; 元のウィンドウサイズに戻す
(defun restore-xyzzy ()
(interactive)
(ShowWindow (get-window-handle) 9))
;; ウィンドウ最大化<ー>元のサイズをトグル
(c:define-dll-entry winapi:BOOL IsZoomed (winapi:HWND) "user32")
(defun toggle-maximize-xyzzy ()
(interactive)
(if (/= 0 (IsZoomed (get-window-handle)))
(restore-xyzzy)
(maximize-xyzzy)))
(global-set-key '(#\C-x #\`) 'toggle-maximize-xyzzy) ; C-x `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment