emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add function to make frame topmost?


From: Lennart Borgman
Subject: Add function to make frame topmost?
Date: Fri, 30 Apr 2010 03:48:05 +0200

Could something like this please be added to w32fns.c?

DEFUN ("x-set-frame-topmost", Fx_set_frame_topmost,
Sx_set_frame_topmost, 1, 3, 0,
       doc: /* Make frame FRAME topmost if TOP, otherwise not topmost.
When ACTIVATE try to activate freme. */)
     (frame, top, activate)
     Lisp_Object frame, top, activate;
{
  FRAME_PTR f = check_x_frame (frame);
  HWND hwndInsertAfter = NILP (top) ? HWND_NOTOPMOST : HWND_TOPMOST;
  UINT swp_flags = SWP_NOMOVE | SWP_NOSIZE;
  if (NILP (activate)) swp_flags = swp_flags | SWP_NOACTIVATE;
  BLOCK_INPUT;
  /* non-zero success, 0 fail + use GetLastError. */
  SetWindowPos (FRAME_W32_WINDOW (f), hwndInsertAfter,
                0, 0, 0, 0,
                swp_flags);
  UNBLOCK_INPUT;
  return Qnil;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]