| 70 | |
| 71 | |
| 72 | bool Create(char *Name, int x, int y, int width, int height, HWND Parent) |
| 73 | { |
| 74 | if (Parent) { |
| 75 | hWnd = CreateWindow(CHILD, Name, WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, |
| 76 | x, y, width, height, Parent, NULL, hInstance, NULL); |
| 77 | } |
| 78 | else { |
| 79 | hWnd = CreateWindow(TITLE, Name, WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN, |
| 80 | x, y, width, height, Parent, NULL, hInstance, NULL); |
| 81 | } |
| 82 | |
| 83 | if (Parent == NULL) |
| 84 | MainHWnd = hWnd; |
| 85 | if (hWnd == NULL) |
| 86 | return false; |
| 87 | |
| 88 | WinWidth = Width; |
| 89 | WinHeight = Height; |
| 90 | XPos = x; |
| 91 | YPos = y; |
| 92 | |
| 93 | ShowWindow(hWnd, CmdShow); |
| 94 | UpdateWindow(hWnd); |
| 95 | InvalidateRect(hWnd, NULL, false); |
| 96 | |
| 97 | SetForegroundWindow(hWnd); |
| 98 | SetFocus(hWnd); |
| 99 | BringWindowToTop(hWnd); |
| 100 | ShowWindow(hWnd, SW_SHOWNORMAL); |
| 101 | |
| 102 | CurChildWnd = hWnd; |
| 103 | |
| 104 | hDC = GetDC(hWnd); |
| 105 | hMemDC = CreateCompatibleDC(hDC); |
| 106 | |
| 107 | return true; |
| 108 | } |
| 109 | |
| 110 | void Destroy(void) |
| 111 | { |