rnd-20090623-1-src
[rocksndiamonds.git] / src / game_sp / TopMost.c
1 // ----------------------------------------------------------------------------
2 // TopMost.c
3 // ----------------------------------------------------------------------------
4
5 #include "TopMost.h"
6
7 // static char *VB_Name = "TopMost_Module";
8 // --- Option Explicit
9 // --- const int SWP_FRAMECHANGED = 0x20;
10 // --- const int SWP_HIDEWINDOW = 0x80;
11 // --- const int SWP_NOACTIVATE = 0x10;
12 // --- const int SWP_NOCOPYBITS = 0x100;
13 // --- const int SWP_NOMOVE = 0x2;
14 // --- const int SWP_NOOWNERZORDER = 0x200;
15 // --- const int SWP_NOREDRAW = 0x8;
16 // --- const int SWP_NOSIZE = 0x1;
17 // --- const int SWP_NOZORDER = 0x4;
18 // --- const int SWP_SHOWWINDOW = 0x40;
19 // --- const int SWP_DRAWFRAME = SWP_FRAMECHANGED;
20 // --- const int SWP_NOREPOSITION = SWP_NOOWNERZORDER;
21
22 // --- const int HWND_BOTTOM = 1;
23 // --- const int HWND_BROADCAST = 0xFFFF;
24 // --- const int HWND_DESKTOP = 0;
25 // --- const int HWND_NOTOPMOST = - 2;
26 // --- const int HWND_TOP = 0;
27 // --- const int HWND_TOPMOST = - 1;
28
29 int SetWindowPos(long h, long hb, int X, int Y, int cx, int cy, int f);
30
31 void TopMost(Object obj)
32 {
33   int i;
34
35   i = SetWindowPos(obj.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE);
36 }
37
38 void UnTopMost(Object obj)
39 {
40   int i;
41
42   i = SetWindowPos(obj.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE);
43 }
44
45 void HideWindow(long hWnd)
46 {
47   int i;
48
49   i = SetWindowPos(hWnd, HWND_BOTTOM, 100, 100, 200, 200, SWP_HIDEWINDOW);
50 }
51