An emacs function that works on Windows..

Linux or any other Unix has spoiled its user with too many desktop environments and window managers. So maximising the Emacs frame through an Emacs command is not done for those systems.

But since Windows is not so, w32-send-sys-command seems to do the ‘maximise’ window of the Emacs frame properly.

I don’t use Windows at all, leave alone Emacs on it. But who knows? I keep this tip for the future 😉

Advertisements

One response to “An emacs function that works on Windows..

  1. you things like that :

    (global-set-key [f11] ‘maximize-or-restore)
    (defvar maximize-or-restore-maximized ‘nil
    “Current maximization state of the frame”)
    (defun maximize-or-restore ()
    “Maximize to full screen or restore to normal state”
    (interactive)
    (if maximize-or-restore-maximized
    (w32-send-sys-command ?\x0F120)
    (w32-send-sys-command ?\x0F030))
    (setq maximize-or-restore-maximized (not maximize-or-restore-maximized)))

    (global-set-key “\C-cm” ‘move-frame)
    (defun move-frame ()
    “Move frame window”
    (interactive)
    (w32-send-sys-command ?\x0F010))

    (global-set-key “\C-cr” ‘resize-frame)
    (defun resize-frame ()
    “Move frame window”
    (interactive)
    (w32-send-sys-command ?\x0F000))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s