Mercurial > mplayer.hg
annotate gui/win32/preferences.c @ 34815:049b24e18a65
Do not override mpctx->stream during free_demuxer.
In case of e.g. the chained MPEG-PS in mov demuxer,
that will end up freeing the wrong stream later on.
author | reimar |
---|---|
date | Tue, 15 May 2012 20:56:53 +0000 |
parents | b74a8e55c632 |
children | 7bb176fac55c |
rev | line source |
---|---|
23077 | 1 /* |
23079 | 2 * MPlayer GUI for Win32 |
3 * Copyright (C) 2003 Sascha Sommer <saschasommer@freenet.de> | |
4 * Copyright (C) 2006 Erik Augustson <erik_27can@yahoo.com> | |
5 * Copyright (C) 2006 Gianluigi Tiesi <sherpya@netfarm.it> | |
6 * | |
7 * This file is part of MPlayer. | |
8 * | |
9 * MPlayer is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * MPlayer is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
26457 | 19 * You should have received a copy of the GNU General Public License along |
20 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23079 | 22 */ |
23077 | 23 |
24 #include <windows.h> | |
25 #include <commctrl.h> | |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <string.h> | |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
29 |
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
30 #include "libvo/video_out.h" |
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
31 #include "libao2/audio_out.h" |
32068
ab6ac5b156ca
Replace proc_priority extern declaration by osdep/priority.h #include.
diego
parents:
30558
diff
changeset
|
32 #include "osdep/priority.h" |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
33 #include "mixer.h" |
33761 | 34 #include "gui/util/list.h" |
33557 | 35 #include "gui/ui/gmplayer.h" |
26372
76413880bfad
Update include paths to account for build system changes.
diego
parents:
26193
diff
changeset
|
36 #include "gui/interface.h" |
23077 | 37 #include "gui.h" |
38 #include "mp_msg.h" | |
39 #include "help_mp.h" | |
40 #include "dialogs.h" | |
41 | |
33619
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
42 |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
43 static void set_defaults(void) |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
44 { |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
45 proc_priority = "normal"; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
46 vo_doublebuffering = 1; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
47 vo_directrendering = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
48 frame_dropping = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
49 soft_vol = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
50 gtkAONorm = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
51 gtkAOExtraStereo = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
52 gtkAOExtraStereoMul = 1.0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
53 audio_delay = 0.0; |
34697 | 54 video_window = 1; |
33619
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
55 gtkCacheOn = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
56 gtkCacheSize = 2048; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
57 gtkAutoSyncOn = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
58 gtkAutoSync = 0; |
34087 | 59 player_idle_mode = 1; |
33619
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
60 } |
23077 | 61 |
62 static LRESULT CALLBACK PrefsWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) | |
63 { | |
34390
9082a0976655
Remove options cdrom_device and dvd_device from the Win32 GUI.
ib
parents:
34164
diff
changeset
|
64 HWND btn, label, edit1, edit2, updown1, updown2, track1, track2; |
23077 | 65 static HWND vo_driver, ao_driver, prio; |
66 int i = 0, j = 0; | |
67 char procprio[11]; | |
68 float x = 10.0, y = 100.0, stereopos, delaypos; | |
69 stereopos = gtkAOExtraStereoMul * x; | |
70 delaypos = audio_delay * y; | |
71 | |
72 switch (iMsg) | |
73 { | |
74 case WM_CREATE: | |
75 { | |
76 /* video and audio drivers */ | |
34163 | 77 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Video), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
78 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
79 10, 14, 60, 15, hwnd, |
23077 | 80 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
81 NULL); | |
82 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
83 | |
34163 | 84 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Audio), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
85 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
86 205, 14, 60, 15, hwnd, |
23077 | 87 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
88 NULL); | |
89 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
90 | |
34163 | 91 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Coefficient), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
92 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
93 10, 148, 140, 15, hwnd, |
23077 | 94 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
95 NULL); | |
96 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
97 | |
34163 | 98 label = CreateWindow("static", acp(MSGTR_PREFERENCES_AudioDelay), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
99 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
100 10, 187, 140, 15, hwnd, |
23077 | 101 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
102 NULL); | |
103 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
104 | |
34163 | 105 label = CreateWindow("static", acp(MSGTR_PREFERENCES_FRAME_OSD_Level), |
23077 | 106 WS_CHILD | WS_VISIBLE, |
34087 | 107 10, 286, 115, 15, hwnd, |
23077 | 108 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
109 NULL); | |
110 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
111 | |
34163 | 112 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Priority), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
113 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
114 200, 286, 100, 15, hwnd, |
23077 | 115 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
116 NULL); | |
117 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
118 | |
119 vo_driver = CreateWindow("combobox", NULL, | |
120 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
121 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
122 WS_CHILD | WS_VISIBLE | | |
123 WS_VSCROLL | WS_TABSTOP, | |
124 80, 10, 100, 160, hwnd, | |
125 (HMENU) ID_VO_DRIVER, | |
126 ((LPCREATESTRUCT) lParam) -> hInstance, | |
127 NULL); | |
128 | |
129 ao_driver = CreateWindow("combobox", NULL, | |
130 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
131 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
132 WS_CHILD | WS_VISIBLE | | |
133 WS_VSCROLL | WS_TABSTOP, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
134 275, 10, 100, 160, hwnd, |
23077 | 135 (HMENU) ID_AO_DRIVER, |
136 ((LPCREATESTRUCT) lParam) -> hInstance, | |
137 NULL); | |
138 | |
139 prio = CreateWindow("combobox", NULL, | |
140 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
141 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
142 WS_CHILD | WS_VISIBLE | | |
143 WS_VSCROLL | WS_TABSTOP, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
144 310, 282, 100, 160, hwnd, |
23077 | 145 (HMENU) ID_PRIO, |
146 ((LPCREATESTRUCT) lParam) -> hInstance, | |
147 NULL); | |
148 | |
149 /* checkboxes */ | |
34163 | 150 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DoubleBuffer), |
23077 | 151 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
152 10, 35, 160, 25, |
23077 | 153 hwnd, (HMENU) ID_DOUBLE, |
154 ((LPCREATESTRUCT) lParam) -> hInstance, | |
155 NULL); | |
156 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
157 | |
34163 | 158 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DirectRender), |
23077 | 159 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
160 10, 57, 160, 25, |
23077 | 161 hwnd, (HMENU) ID_DIRECT, |
162 ((LPCREATESTRUCT) lParam) -> hInstance, | |
163 NULL); | |
164 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
165 | |
34163 | 166 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_FrameDrop), |
23077 | 167 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
168 10, 79, 160, 25, |
23077 | 169 hwnd, (HMENU) ID_FRAMEDROP, |
170 ((LPCREATESTRUCT) lParam) -> hInstance, | |
171 NULL); | |
172 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
173 | |
34163 | 174 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NoIdle), |
34087 | 175 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
176 10, 101, 225, 25, |
34087 | 177 hwnd, (HMENU) ID_IDLE, |
178 ((LPCREATESTRUCT) lParam) -> hInstance, | |
179 NULL); | |
180 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
181 | |
34163 | 182 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NormalizeSound), |
23077 | 183 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
184 220, 35, 160, 25, |
23077 | 185 hwnd, (HMENU) ID_NORMALIZE, |
186 ((LPCREATESTRUCT) lParam) -> hInstance, | |
187 NULL); | |
188 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
189 | |
34163 | 190 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_SoftwareMixer), |
23077 | 191 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
192 220, 57, 160, 25, |
23077 | 193 hwnd, (HMENU) ID_SOFTMIX, |
194 ((LPCREATESTRUCT) lParam) -> hInstance, | |
195 NULL); | |
196 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
197 | |
34163 | 198 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_ExtraStereo), |
23077 | 199 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
200 220, 79, 160, 25, |
23077 | 201 hwnd, (HMENU) ID_EXTRASTEREO, |
202 ((LPCREATESTRUCT) lParam) -> hInstance, | |
203 NULL); | |
204 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
205 | |
34163 | 206 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_Cache), |
23077 | 207 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34087 | 208 10, 222, 90, 25, |
23077 | 209 hwnd, (HMENU) ID_CACHE, |
210 ((LPCREATESTRUCT) lParam) -> hInstance, | |
211 NULL); | |
212 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
213 | |
34163 | 214 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_AutoSync), |
23077 | 215 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
216 240, 222, 110, 25, hwnd, |
23077 | 217 (HMENU) ID_AUTOSYNC, |
218 ((LPCREATESTRUCT) lParam) -> hInstance, | |
219 NULL); | |
220 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
221 | |
34697 | 222 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_ShowInVideoWin), |
23077 | 223 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
224 10, 249, 250, 25, |
34697 | 225 hwnd, (HMENU) ID_VIDEOWINDOW, |
23077 | 226 ((LPCREATESTRUCT) lParam) -> hInstance, |
227 NULL); | |
228 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
229 | |
230 /* osd level */ | |
34163 | 231 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL0), |
23077 | 232 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
233 15, 297, 200, 25, hwnd, |
23077 | 234 (HMENU) ID_NONE, |
235 ((LPCREATESTRUCT) lParam) -> hInstance, | |
236 NULL); | |
237 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
238 | |
34163 | 239 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL1), |
23077 | 240 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
241 15, 317, 395, 25, hwnd, |
23077 | 242 (HMENU) ID_OSD1, |
243 ((LPCREATESTRUCT) lParam) -> hInstance, | |
244 NULL); | |
245 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
246 | |
34163 | 247 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL2), |
23077 | 248 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
249 15, 337, 395, 25, hwnd, |
23077 | 250 (HMENU) ID_OSD2, |
251 ((LPCREATESTRUCT) lParam) -> hInstance, | |
252 NULL); | |
253 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
254 | |
34163 | 255 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL3), |
23077 | 256 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
257 15, 357, 395, 25, hwnd, |
23077 | 258 (HMENU) ID_OSD3, |
259 ((LPCREATESTRUCT) lParam) -> hInstance, | |
260 NULL); | |
261 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
262 | |
34163 | 263 btn = CreateWindow("button", acp(MSGTR_Ok), |
23077 | 264 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
265 248, 417, 80, 25, hwnd, |
23077 | 266 (HMENU) ID_APPLY, |
267 ((LPCREATESTRUCT) lParam) -> hInstance, | |
268 NULL); | |
269 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
270 | |
34163 | 271 btn = CreateWindow("button", acp(MSGTR_Cancel), |
23077 | 272 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
273 334, 417, 80, 25, hwnd, |
23077 | 274 (HMENU) ID_CANCEL, |
275 ((LPCREATESTRUCT) lParam) -> hInstance, | |
276 NULL); | |
277 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
278 | |
34163 | 279 btn = CreateWindow("button", acp(MSGTR_Default), |
23077 | 280 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
281 5, 417, 80, 25, hwnd, |
23077 | 282 (HMENU) ID_DEFAULTS, |
283 ((LPCREATESTRUCT) lParam) -> hInstance, | |
284 NULL); | |
285 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
286 | |
287 /* extra stereo coefficient trackbar */ | |
288 track1 = CreateWindow(TRACKBAR_CLASS, "Coefficient", | |
289 WS_CHILD | WS_VISIBLE | WS_TABSTOP | | |
290 WS_DISABLED | TBS_HORZ | | |
291 TBS_BOTTOM | TBS_NOTICKS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
292 165, 142, 245, 35, hwnd, |
23077 | 293 (HMENU) ID_TRACKBAR1, |
294 ((LPCREATESTRUCT) lParam) -> hInstance, | |
295 NULL); | |
296 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETRANGE, 1, MAKELONG(-100, 100)); | |
297 | |
298 /* audio delay */ | |
299 track2 = CreateWindow(TRACKBAR_CLASS, "Audio delay", | |
300 WS_CHILD | WS_VISIBLE | WS_TABSTOP | | |
301 WS_DISABLED | TBS_HORZ | | |
302 TBS_BOTTOM | TBS_NOTICKS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
303 165, 182, 245, 35, hwnd, |
23077 | 304 (HMENU) ID_TRACKBAR2, |
305 ((LPCREATESTRUCT) lParam) -> hInstance, | |
306 NULL); | |
307 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETRANGE, 1, MAKELONG(-1000, 1000)); | |
308 | |
309 /* cache */ | |
310 edit1 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "cache", | |
311 WS_CHILD | WS_VISIBLE | WS_DISABLED | | |
312 ES_LEFT | ES_AUTOHSCROLL, | |
34709
b74a8e55c632
Increase width of control for cache size in Win32 GUI.
ib
parents:
34707
diff
changeset
|
313 105, 225, 60, 20, hwnd, |
23077 | 314 (HMENU) ID_EDIT1, |
315 ((LPCREATESTRUCT) lParam) -> hInstance, | |
316 NULL); | |
317 SendMessage(edit1, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
318 | |
319 updown1 = CreateUpDownControl(WS_CHILD | WS_VISIBLE | | |
320 WS_DISABLED | UDS_SETBUDDYINT | | |
321 UDS_ARROWKEYS | UDS_NOTHOUSANDS, | |
34709
b74a8e55c632
Increase width of control for cache size in Win32 GUI.
ib
parents:
34707
diff
changeset
|
322 165, 225, 20, 20, hwnd, |
23077 | 323 ID_UPDOWN1, |
324 ((LPCREATESTRUCT) lParam) -> hInstance, | |
325 (HWND)edit1, 0, 0, 0); | |
34707 | 326 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETRANGE32, (WPARAM)32, (LPARAM)0x7fffffff); |
23077 | 327 |
328 /* autosync */ | |
329 edit2 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "autosync", | |
330 WS_CHILD | WS_VISIBLE | WS_DISABLED | | |
331 ES_LEFT | ES_AUTOHSCROLL, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
332 355, 225, 40, 20, hwnd, |
23077 | 333 (HMENU) ID_EDIT2, |
334 ((LPCREATESTRUCT) lParam) -> hInstance, | |
335 NULL); | |
336 SendMessage(edit2, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
337 | |
338 updown2 = CreateUpDownControl(WS_CHILD | WS_VISIBLE | | |
339 WS_DISABLED | UDS_SETBUDDYINT | | |
340 UDS_ARROWKEYS | UDS_NOTHOUSANDS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
341 395, 225, 20, 20, hwnd, |
23077 | 342 ID_UPDOWN2, |
343 ((LPCREATESTRUCT) lParam) -> hInstance, | |
344 (HWND)edit2, 0, 0, 0); | |
345 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETRANGE32, (WPARAM)0, (LPARAM)10000); | |
346 | |
347 while(video_out_drivers[i]) | |
348 { | |
349 const vo_info_t *info = video_out_drivers[i++]->info; | |
34610 | 350 if(!video_driver_list) listSet(&video_driver_list, (char *)info->short_name); |
23077 | 351 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); |
352 } | |
353 /* Special case for directx:noaccel */ | |
354 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_ADDSTRING, 0, (LPARAM) "directx:noaccel"); | |
355 SendMessage(vo_driver, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
356 | |
357 while(audio_out_drivers[j]) | |
358 { | |
359 const ao_info_t *info = audio_out_drivers[j++]->info; | |
360 if(!audio_driver_list) | |
361 { | |
362 // FIXME: default priority (i.e. order in audio_out_drivers) should be fixed instead | |
363 // if win32 as default is really desirable | |
34610 | 364 listSet(&audio_driver_list, "win32"/*(char *)info->short_name*/); |
23077 | 365 } |
366 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); | |
367 } | |
368 SendMessage(ao_driver, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
369 | |
370 /* priority list, i'm leaving out realtime for safety's sake */ | |
34163 | 371 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityLow)); |
372 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalBelow)); | |
373 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormal)); | |
374 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalAbove)); | |
375 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityHigh)); | |
23077 | 376 SendMessage(prio, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); |
377 | |
378 /* set our preferences on what we already have */ | |
379 if(video_driver_list) | |
380 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_SETCURSEL, | |
381 (WPARAM)SendMessage(vo_driver, CB_FINDSTRING, -1, | |
382 (LPARAM)video_driver_list[0]), 0); | |
383 | |
384 if(audio_driver_list) | |
385 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_SETCURSEL, | |
386 (WPARAM)SendMessage(ao_driver, CB_FINDSTRING, -1, | |
387 (LPARAM)audio_driver_list[0]), 0); | |
388 | |
389 if(vo_doublebuffering) | |
390 SendDlgItemMessage(hwnd, ID_DOUBLE, BM_SETCHECK, 1, 0); | |
391 if(vo_directrendering) | |
392 SendDlgItemMessage(hwnd, ID_DIRECT, BM_SETCHECK, 1, 0); | |
34087 | 393 if(!player_idle_mode) |
394 SendDlgItemMessage(hwnd, ID_IDLE, BM_SETCHECK, 1, 0); | |
23077 | 395 if(frame_dropping) |
396 SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_SETCHECK, 1, 0); | |
397 if(gtkAONorm) | |
398 SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_SETCHECK, 1, 0); | |
399 if(soft_vol) | |
400 SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_SETCHECK, 1, 0); | |
401 if(gtkAOExtraStereo) | |
402 { | |
403 SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 1, 0); | |
33555 | 404 if(!guiInfo.Playing) |
23077 | 405 { |
406 EnableWindow(track1, 1); | |
407 EnableWindow(track2, 1); | |
408 } | |
409 } | |
410 else gtkAOExtraStereoMul = 1.0; | |
411 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)stereopos); | |
412 | |
413 if(audio_delay) | |
414 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)delaypos); | |
415 | |
416 if(gtkCacheOn) { | |
417 SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 1, 0); | |
418 EnableWindow(edit1, 1); | |
419 EnableWindow(updown1, 1); | |
420 } | |
421 else gtkCacheSize = 2048; | |
422 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 0, (LPARAM)gtkCacheSize); | |
423 | |
424 if(gtkAutoSyncOn) { | |
425 SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 1, 0); | |
426 EnableWindow(edit2, 1); | |
427 EnableWindow(updown2, 1); | |
428 } | |
429 else gtkAutoSync = 0; | |
430 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync); | |
431 | |
34697 | 432 if(video_window) |
433 SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_SETCHECK, 1, 0); | |
23077 | 434 |
435 if(!osd_level) | |
436 SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 1, 0); | |
437 else if(osd_level == 1) | |
438 SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0); | |
439 else if(osd_level == 2) | |
440 SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 1, 0); | |
441 else if(osd_level == 3) | |
442 SendDlgItemMessage(hwnd, ID_OSD3, BM_SETCHECK, 1, 0); | |
443 | |
444 if(proc_priority) | |
445 SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, | |
446 (WPARAM)SendMessage(prio, CB_FINDSTRING, -1, | |
447 (LPARAM)proc_priority), 0); | |
448 | |
449 else SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, 2, 0); | |
450 | |
451 break; | |
452 } | |
453 case WM_CTLCOLORDLG: | |
454 case WM_CTLCOLOREDIT: | |
455 case WM_CTLCOLORBTN: | |
456 case WM_CTLCOLORSTATIC: | |
457 { | |
458 HDC hdc = (HDC)wParam; | |
459 SetBkMode(hdc, TRANSPARENT); | |
460 return (INT_PTR)SOLID_GREY; | |
461 } | |
462 break; | |
463 case WM_COMMAND: | |
464 { | |
465 switch (LOWORD(wParam)) | |
466 { | |
467 case ID_EXTRASTEREO: | |
468 { | |
469 if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
470 { | |
471 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 1); | |
472 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 1); | |
473 } else { | |
474 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 0); | |
475 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 0); | |
476 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0); | |
477 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0); | |
478 } | |
479 break; | |
480 } | |
481 case ID_CACHE: | |
482 { | |
483 if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
484 { | |
485 EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 1); | |
486 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 1); | |
487 } else { | |
488 EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 0); | |
489 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 0); | |
490 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 1, (LPARAM)2048); | |
491 } | |
492 break; | |
493 } | |
494 case ID_AUTOSYNC: | |
495 { | |
496 if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
497 { | |
498 EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 1); | |
499 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 1); | |
500 } else { | |
501 EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 0); | |
502 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 0); | |
503 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 1, (LPARAM)0); | |
504 } | |
505 break; | |
506 } | |
507 case ID_DEFAULTS: | |
508 { | |
509 set_defaults(); | |
510 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_SETCURSEL, | |
511 (WPARAM)SendMessage(vo_driver, CB_FINDSTRING, -1, (LPARAM)"directx"), 0); | |
512 | |
513 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_SETCURSEL, | |
514 (WPARAM)SendMessage(ao_driver, CB_FINDSTRING, -1, (LPARAM)"dsound"), 0); | |
515 | |
516 SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, | |
517 (WPARAM)SendMessage(prio, CB_FINDSTRING, -1, (LPARAM)proc_priority), 0); | |
518 | |
519 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0); | |
520 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0.0); | |
521 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 0, (LPARAM)gtkCacheSize); | |
522 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync); | |
523 SendDlgItemMessage(hwnd, ID_DOUBLE, BM_SETCHECK, 0, 0); | |
524 SendDlgItemMessage(hwnd, ID_DIRECT, BM_SETCHECK, 0, 0); | |
34087 | 525 SendDlgItemMessage(hwnd, ID_IDLE, BM_SETCHECK, 0, 0); |
23077 | 526 SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_SETCHECK, 0, 0); |
527 SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_SETCHECK, 0, 0); | |
528 SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_SETCHECK, 0, 0); | |
529 SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 0, 0); | |
530 SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 0, 0); | |
531 SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 0, 0); | |
34697 | 532 SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_SETCHECK, 1, 0); |
23077 | 533 SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 0, 0); |
534 SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0); | |
535 SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 0, 0); | |
536 SendDlgItemMessage(hwnd, ID_OSD3, BM_SETCHECK, 0, 0); | |
537 SendMessage(hwnd, WM_COMMAND, (WPARAM)ID_APPLY, 0); | |
538 break; | |
539 } | |
540 case ID_CANCEL: | |
541 DestroyWindow(hwnd); | |
542 return 0; | |
543 case ID_APPLY: | |
544 { | |
545 int strl; | |
33731
81f71d910333
Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents:
33725
diff
changeset
|
546 if(guiInfo.Playing) gui(GUI_SET_STATE, (void *)GUI_STOP); |
23077 | 547 |
548 /* Set the video driver */ | |
33298 | 549 free(video_driver_list[0]); |
23077 | 550 strl = SendMessage(vo_driver, CB_GETCURSEL, 0, 0); |
551 video_driver_list[0] = malloc(strl); | |
552 SendMessage(vo_driver, CB_GETLBTEXT, (WPARAM)strl, | |
553 (LPARAM)video_driver_list[0]); | |
554 | |
555 /* Set the audio driver */ | |
33298 | 556 free(audio_driver_list[0]); |
23077 | 557 strl = SendMessage(ao_driver, CB_GETCURSEL, 0, 0); |
558 audio_driver_list[0] = malloc(strl); | |
559 SendMessage(ao_driver, CB_GETLBTEXT, (WPARAM)strl, | |
560 (LPARAM)audio_driver_list[0]); | |
561 | |
562 /* Set the priority level */ | |
563 SendMessage(prio, CB_GETLBTEXT, (WPARAM)SendMessage(prio, CB_GETCURSEL, 0, 0), (LPARAM)procprio); | |
564 proc_priority = strdup(procprio); | |
565 | |
566 /* double buffering */ | |
567 if(SendDlgItemMessage(hwnd, ID_DOUBLE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
568 vo_doublebuffering = 1; | |
569 else vo_doublebuffering = 0; | |
570 | |
571 /* direct rendering */ | |
572 if(SendDlgItemMessage(hwnd, ID_DIRECT, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
573 vo_directrendering = 1; | |
574 else vo_directrendering = 0; | |
575 | |
34087 | 576 /* quit after playing */ |
577 if(SendDlgItemMessage(hwnd, ID_IDLE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
578 player_idle_mode = 0; | |
579 else player_idle_mode = 1; | |
580 | |
23077 | 581 /* frame dropping */ |
582 if(SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
583 frame_dropping = 1; | |
584 else frame_dropping = 0; | |
585 | |
586 /* normalize */ | |
587 if(SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
588 gtkAONorm = 1; | |
589 else gtkAONorm = 0; | |
590 | |
591 /* software mixer */ | |
592 if(SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
593 soft_vol = 1; | |
594 else soft_vol = 0; | |
595 | |
596 /* extra stereo */ | |
597 if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
598 gtkAOExtraStereo = 1; | |
599 else { | |
600 gtkAOExtraStereo = 0; | |
601 gtkAOExtraStereoMul = 10.0; | |
602 } | |
603 gtkAOExtraStereoMul = SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_GETPOS, 0, 0) / 10.0; | |
604 | |
605 /* audio delay */ | |
606 audio_delay = SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_GETPOS, 0, 0) / 100.0; | |
607 | |
608 /* cache */ | |
609 if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
610 gtkCacheOn = 1; | |
611 else gtkCacheOn = 0; | |
612 gtkCacheSize = SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_GETPOS32, 0, 0); | |
613 | |
614 /* autosync */ | |
615 if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
616 gtkAutoSyncOn = 1; | |
617 else gtkAutoSyncOn = 0; | |
618 gtkAutoSync = SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_GETPOS32, 0, 0); | |
619 | |
34697 | 620 /* video window */ |
621 if(SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
622 video_window = 1; | |
623 else video_window = 0; | |
23077 | 624 |
625 /* osd level */ | |
626 if(SendDlgItemMessage(hwnd, ID_NONE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
627 osd_level = 0; | |
628 else if(SendDlgItemMessage(hwnd, ID_OSD1, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
629 osd_level = 1; | |
630 else if(SendDlgItemMessage(hwnd, ID_OSD2, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
631 osd_level = 2; | |
632 else if(SendDlgItemMessage(hwnd, ID_OSD3, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
633 osd_level = 3; | |
634 | |
34163 | 635 MessageBox(hwnd, acp(MSGTR_PREFERENCES_Message), acp(MSGTR_MSGBOX_LABEL_Warning), MB_OK); |
23077 | 636 DestroyWindow(hwnd); |
637 break; | |
638 } | |
639 } | |
640 return 0; | |
641 } | |
642 } | |
643 return DefWindowProc(hwnd, iMsg, wParam, lParam); | |
644 } | |
645 | |
646 void display_prefswindow(gui_t *gui) | |
647 { | |
648 HWND hWnd; | |
649 HINSTANCE hInstance = GetModuleHandle(NULL); | |
650 WNDCLASS wc; | |
651 int x, y; | |
34163 | 652 if(FindWindow(NULL, acp(MSGTR_Preferences))) return; |
23077 | 653 wc.style = CS_HREDRAW | CS_VREDRAW; |
654 wc.lpfnWndProc = PrefsWndProc; | |
655 wc.cbClsExtra = 0; | |
656 wc.cbWndExtra = 0; | |
657 wc.hInstance = hInstance; | |
658 wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
659 wc.hIcon = gui->icon; | |
660 wc.hbrBackground = SOLID_GREY; | |
34163 | 661 wc.lpszClassName = acp(MSGTR_Preferences); |
23077 | 662 wc.lpszMenuName = NULL; |
663 RegisterClass(&wc); | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
664 x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (425 / 2); |
34087 | 665 y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (474 / 2); |
34163 | 666 hWnd = CreateWindow(acp(MSGTR_Preferences), |
667 acp(MSGTR_Preferences), | |
23077 | 668 WS_POPUPWINDOW | WS_CAPTION, |
669 x, | |
670 y, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
671 425, |
34087 | 672 474, |
23077 | 673 NULL, |
674 NULL, | |
675 hInstance, | |
676 NULL); | |
33638
dbca6aa18b50
Cast new user data value in SetWindowLongPtr() to LONG_PTR.
ib
parents:
33619
diff
changeset
|
677 SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui); |
23077 | 678 ShowWindow(hWnd, SW_SHOW); |
679 UpdateWindow(hWnd); | |
680 } |