Loading ...
Sorry, an error occurred while loading the content.

29992Re: What a to-do!

Expand Messages
  • Walter Briscoe
    Oct 7, 2002
    • 0 Attachment
      In article <200210031806.g93I6qu02401@...> of Thu, 3 Oct 2002
      20:06:52 in , Bram Moolenaar <Bram@...> writes
      >
      >Walter Briscoe wrote:
      >
      [snip]
      >> > 8 ":winpos" doesn't work. Patch from Vipin Aravind.
      >> It works for me in gvim. It does not work in vim. Why should it do so?
      >> It is documented as:
      >> > :winp[os]
      >> > Display current position of the top left corner of
      >> >the GUI vim
      >> > window in pixels. Does not work in all versions.
      >
      >It also works for an xterm. If there is a way to make it work in a
      >console window, why not do it?

      I set up a test program. It produces the same results as Spy++ on W2K.
      It produces plausible results in W95. When it runs in full screen mode,
      it produces implausible results. (-32000, -32000) in W2K, (3000, 3000)
      in W95. Is this behaviour adequate?

      #pragma warning(disable: 4100 4115 4201 4214 4514)
      #include <windows.h>
      #pragma warning(default: 4100 4115 4201 4214)
      #include <stdio.h>

      HWND s_hwnd = NULL;
      int
      gui_mch_get_winpos(int *x, int *y)
      {
      RECT rect;

      GetWindowRect(s_hwnd, &rect);
      *x = rect.left;
      *y = rect.top;
      return 0;
      }

      int main(void) {
      int x, y;

      s_hwnd = GetForegroundWindow();
      (void)gui_mch_get_winpos(&x, &y);

      printf("x = %d, y = %d\n", x, y);
      return 0;
      }


      --
      Walter Briscoe
    • Show all 15 messages in this topic