7 const int kNumIOVSOptions
= 9;
8 const int kNumSIGVSOptions
= 7;
10 const std::string kIOVSOptions
[kNumIOVSOptions
] = {"32", "64", "128", "256", "512", "1024", "2048", "4096", "8192" };
11 const std::string kSIGVSOptions
[kNumSIGVSOptions
] = {"16", "32", "64", "128", "256", "512", "1024" };
13 // check the input and output devices, find matching srs
14 void PopulateSampleRateList(HWND hwndDlg
, RtAudio::DeviceInfo
* inputDevInfo
, RtAudio::DeviceInfo
* outputDevInfo
)
18 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_SR
,CB_RESETCONTENT
,0,0);
20 std::vector
<int> matchedSRs
;
22 for (int i
=0; i
<inputDevInfo
->sampleRates
.size(); i
++)
24 for (int j
=0; j
<outputDevInfo
->sampleRates
.size(); j
++)
26 if(inputDevInfo
->sampleRates
[i
] == outputDevInfo
->sampleRates
[j
])
27 matchedSRs
.push_back(inputDevInfo
->sampleRates
[i
]);
31 for (int k
=0; k
<matchedSRs
.size(); k
++)
33 wsprintf(buf
,"%i",matchedSRs
[k
]);
34 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_SR
,CB_ADDSTRING
,0,(LPARAM
)buf
);
37 LRESULT sridx
= SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_SR
, CB_FINDSTRINGEXACT
, -1, (LPARAM
)gState
->mAudioSR
);
38 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_SR
,CB_SETCURSEL
, sridx
, 0);
41 void PopulateAudioInputList(HWND hwndDlg
, RtAudio::DeviceInfo
* info
)
45 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_L
,CB_RESETCONTENT
,0,0);
46 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_RESETCONTENT
,0,0);
50 for (i
=0; i
<info
->inputChannels
-1; i
++)
52 // for (int i=0; i<info.inputChannels; i++) {
53 wsprintf(buf
,"%i",i
+1);
54 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_L
,CB_ADDSTRING
,0,(LPARAM
)buf
);
55 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_ADDSTRING
,0,(LPARAM
)buf
);
59 wsprintf(buf
,"%i",i
+1);
60 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_ADDSTRING
,0,(LPARAM
)buf
);
62 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_L
,CB_SETCURSEL
, gState
->mAudioInChanL
- 1, 0);
63 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_SETCURSEL
, gState
->mAudioInChanR
- 1, 0);
66 void PopulateAudioOutputList(HWND hwndDlg
, RtAudio::DeviceInfo
* info
)
70 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_L
,CB_RESETCONTENT
,0,0);
71 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_RESETCONTENT
,0,0);
75 // for (int i=0; i<info.outputChannels; i++) {
76 for (i
=0; i
<info
->outputChannels
-1; i
++)
79 wsprintf(buf
,"%i",i
+1);
80 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_L
,CB_ADDSTRING
,0,(LPARAM
)buf
);
81 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_ADDSTRING
,0,(LPARAM
)buf
);
85 wsprintf(buf
,"%i",i
+1);
86 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_ADDSTRING
,0,(LPARAM
)buf
);
88 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_L
,CB_SETCURSEL
, gState
->mAudioOutChanL
- 1, 0);
89 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_SETCURSEL
, gState
->mAudioOutChanR
- 1, 0);
92 // This has to get called after any change to audio driver/in dev/out dev
93 void PopulateDriverSpecificControls(HWND hwndDlg
)
96 int driverType
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_DRIVER
, CB_GETCURSEL
, 0, 0);
99 ComboBox_Enable(GetDlgItem(hwndDlg
, IDC_COMBO_AUDIO_IN_DEV
), FALSE
);
100 Button_Enable(GetDlgItem(hwndDlg
, IDC_BUTTON_ASIO
), TRUE
);
104 ComboBox_Enable(GetDlgItem(hwndDlg
, IDC_COMBO_AUDIO_IN_DEV
), TRUE
);
105 Button_Enable(GetDlgItem(hwndDlg
, IDC_BUTTON_ASIO
), FALSE
);
112 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_DEV
,CB_RESETCONTENT
,0,0);
113 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_DEV
,CB_RESETCONTENT
,0,0);
115 for (int i
= 0; i
<gAudioInputDevs
.size(); i
++)
117 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_DEV
,CB_ADDSTRING
,0,(LPARAM
)GetAudioDeviceName(gAudioInputDevs
[i
]).c_str());
119 if(!strcmp(GetAudioDeviceName(gAudioInputDevs
[i
]).c_str(), gState
->mAudioInDev
))
123 for (int i
= 0; i
<gAudioOutputDevs
.size(); i
++)
125 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_DEV
,CB_ADDSTRING
,0,(LPARAM
)GetAudioDeviceName(gAudioOutputDevs
[i
]).c_str());
127 if(!strcmp(GetAudioDeviceName(gAudioOutputDevs
[i
]).c_str(), gState
->mAudioOutDev
))
133 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_DEV
,CB_SETCURSEL
, outdevidx
, 0);
136 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_DEV
,CB_SETCURSEL
, indevidx
, 0);
138 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_DEV
,CB_SETCURSEL
, outdevidx
, 0);
140 RtAudio::DeviceInfo inputDevInfo
= gDAC
->getDeviceInfo(gAudioInputDevs
[indevidx
]);
141 RtAudio::DeviceInfo outputDevInfo
= gDAC
->getDeviceInfo(gAudioOutputDevs
[outdevidx
]);
143 PopulateAudioInputList(hwndDlg
, &inputDevInfo
);
144 PopulateAudioOutputList(hwndDlg
, &outputDevInfo
);
145 PopulateSampleRateList(hwndDlg
, &inputDevInfo
, &outputDevInfo
);
148 void PopulateAudioDialogs(HWND hwndDlg
)
150 PopulateDriverSpecificControls(hwndDlg
);
152 if (gState
->mAudioInIsMono
)
154 SendDlgItemMessage(hwndDlg
,IDC_CB_MONO_INPUT
,BM_SETCHECK
, BST_CHECKED
,0);
158 SendDlgItemMessage(hwndDlg
,IDC_CB_MONO_INPUT
,BM_SETCHECK
, BST_UNCHECKED
,0);
161 //Populate IOVS combobox
162 for (int i
= 0; i
< kNumIOVSOptions
; i
++)
164 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IOVS
,CB_ADDSTRING
,0,(LPARAM
)kIOVSOptions
[i
].c_str());
167 LRESULT iovsidx
= SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IOVS
, CB_FINDSTRINGEXACT
, -1, (LPARAM
)gState
->mAudioIOVS
);
168 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IOVS
, CB_SETCURSEL
, iovsidx
, 0);
170 //Populate SIGVS combobox
171 for (int i
= 0; i
< kNumSIGVSOptions
; i
++)
173 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_SIGVS
,CB_ADDSTRING
,0,(LPARAM
)kSIGVSOptions
[i
].c_str());
176 LRESULT sigvsidx
= SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SIGVS
, CB_FINDSTRINGEXACT
, -1, (LPARAM
)gState
->mAudioSigVS
);
177 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SIGVS
, CB_SETCURSEL
, sigvsidx
, 0);
180 bool PopulateMidiDialogs(HWND hwndDlg
)
182 if ( !gMidiIn
|| !gMidiOut
)
186 for (int i
=0; i
<gMIDIInputDevNames
.size(); i
++ )
188 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_DEV
,CB_ADDSTRING
,0,(LPARAM
)gMIDIInputDevNames
[i
].c_str());
191 LRESULT indevidx
= SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_DEV
,CB_FINDSTRINGEXACT
, -1, (LPARAM
)gState
->mMidiInDev
);
193 // if the midi port name wasn't found update the ini file, and set to off
196 strcpy(gState
->mMidiInDev
, "off");
201 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_DEV
,CB_SETCURSEL
, indevidx
, 0);
203 for (int i
=0; i
<gMIDIOutputDevNames
.size(); i
++ )
205 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_DEV
,CB_ADDSTRING
,0,(LPARAM
)gMIDIOutputDevNames
[i
].c_str());
208 LRESULT outdevidx
= SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_DEV
,CB_FINDSTRINGEXACT
, -1, (LPARAM
)gState
->mMidiOutDev
);
210 // if the midi port name wasn't found update the ini file, and set to off
213 strcpy(gState
->mMidiOutDev
, "off");
218 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_DEV
,CB_SETCURSEL
, outdevidx
, 0);
220 // Populate MIDI channel dialogs
222 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_CHAN
,CB_ADDSTRING
,0,(LPARAM
)"all");
223 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_CHAN
,CB_ADDSTRING
,0,(LPARAM
)"all");
227 for (int i
=0; i
<16; i
++)
229 wsprintf(buf
,"%i",i
+1);
230 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_CHAN
,CB_ADDSTRING
,0,(LPARAM
)buf
);
231 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_CHAN
,CB_ADDSTRING
,0,(LPARAM
)buf
);
234 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_IN_CHAN
,CB_SETCURSEL
, (LPARAM
)gState
->mMidiInChan
, 0);
235 SendDlgItemMessage(hwndDlg
,IDC_COMBO_MIDI_OUT_CHAN
,CB_SETCURSEL
, (LPARAM
)gState
->mMidiOutChan
, 0);
242 void PopulatePreferencesDialog(HWND hwndDlg
)
244 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_DRIVER
,CB_ADDSTRING
,0,(LPARAM
)"DirectSound");
245 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_DRIVER
,CB_ADDSTRING
,0,(LPARAM
)"ASIO");
246 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_DRIVER
,CB_SETCURSEL
, gState
->mAudioDriverType
, 0);
248 PopulateAudioDialogs(hwndDlg
);
249 PopulateMidiDialogs(hwndDlg
);
253 void PopulatePreferencesDialog(HWND hwndDlg
)
255 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_DRIVER
,CB_ADDSTRING
,0,(LPARAM
)"CoreAudio");
256 //SendDlgItemMessage(hwndDlg,IDC_COMBO_AUDIO_DRIVER,CB_ADDSTRING,0,(LPARAM)"Jack");
257 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_DRIVER
,CB_SETCURSEL
, gState
->mAudioDriverType
, 0);
259 PopulateAudioDialogs(hwndDlg
);
260 PopulateMidiDialogs(hwndDlg
);
264 WDL_DLGRET
PreferencesDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
271 PopulatePreferencesDialog(hwndDlg
);
272 memcpy(gTempState
, gState
, sizeof(AppState
)); // copy state to temp state
277 switch (LOWORD(wParam
))
280 if(memcmp(gActiveState
, gState
, sizeof(AppState
)) != 0) // if state is different try to change audio
284 EndDialog(hwndDlg
, IDOK
); // INI file will be changed see MainDialogProc
290 EndDialog(hwndDlg
, IDCANCEL
);
292 // if state has been changed reset to previous state, INI file won't be changed
293 if (!AudioSettingsInStateAreEqual(gState
, gTempState
)
294 || !MIDISettingsInStateAreEqual(gState
, gTempState
))
296 memcpy(gState
, gTempState
, sizeof(AppState
));
298 TryToChangeAudioDriverType();
305 case IDC_COMBO_AUDIO_DRIVER
:
306 if (HIWORD(wParam
) == CBN_SELCHANGE
)
309 v
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_DRIVER
, CB_GETCURSEL
, 0, 0);
311 if(v
!= gState
->mAudioDriverType
)
313 gState
->mAudioDriverType
= v
;
315 TryToChangeAudioDriverType();
318 strcpy(gState
->mAudioInDev
,GetAudioDeviceName(gAudioInputDevs
[0]).c_str());
319 strcpy(gState
->mAudioOutDev
,GetAudioDeviceName(gAudioOutputDevs
[0]).c_str());
322 gState
->mAudioOutChanL
= 1;
323 gState
->mAudioOutChanR
= 2;
325 PopulateAudioDialogs(hwndDlg
);
330 case IDC_COMBO_AUDIO_IN_DEV
:
331 if (HIWORD(wParam
) == CBN_SELCHANGE
)
333 int idx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IN_DEV
, CB_GETCURSEL
, 0, 0);
334 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IN_DEV
, CB_GETLBTEXT
, idx
, (LPARAM
) gState
->mAudioInDev
);
337 gState
->mAudioInChanL
= 1;
338 gState
->mAudioInChanR
= 2;
340 PopulateDriverSpecificControls(hwndDlg
);
344 case IDC_COMBO_AUDIO_OUT_DEV
:
345 if (HIWORD(wParam
) == CBN_SELCHANGE
)
347 int idx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_OUT_DEV
, CB_GETCURSEL
, 0, 0);
348 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_OUT_DEV
, CB_GETLBTEXT
, idx
, (LPARAM
) gState
->mAudioOutDev
);
351 gState
->mAudioOutChanL
= 1;
352 gState
->mAudioOutChanR
= 2;
354 PopulateDriverSpecificControls(hwndDlg
);
358 case IDC_COMBO_AUDIO_IN_L
:
359 if (HIWORD(wParam
) == CBN_SELCHANGE
)
361 gState
->mAudioInChanL
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IN_L
, CB_GETCURSEL
, 0, 0) + 1;
364 gState
->mAudioInChanR
= gState
->mAudioInChanL
+ 1;
365 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_SETCURSEL
, gState
->mAudioInChanR
- 1, 0);
370 case IDC_COMBO_AUDIO_IN_R
:
371 if (HIWORD(wParam
) == CBN_SELCHANGE
)
372 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_IN_R
,CB_SETCURSEL
, gState
->mAudioInChanR
- 1, 0); // TEMP
373 // gState->mAudioInChanR = (int) SendDlgItemMessage(hwndDlg, IDC_COMBO_AUDIO_IN_R, CB_GETCURSEL, 0, 0);
376 case IDC_COMBO_AUDIO_OUT_L
:
377 if (HIWORD(wParam
) == CBN_SELCHANGE
)
379 gState
->mAudioOutChanL
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_OUT_L
, CB_GETCURSEL
, 0, 0) + 1;
382 gState
->mAudioOutChanR
= gState
->mAudioOutChanL
+ 1;
383 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_SETCURSEL
, gState
->mAudioOutChanR
- 1, 0);
388 case IDC_COMBO_AUDIO_OUT_R
:
389 if (HIWORD(wParam
) == CBN_SELCHANGE
)
390 SendDlgItemMessage(hwndDlg
,IDC_COMBO_AUDIO_OUT_R
,CB_SETCURSEL
, gState
->mAudioOutChanR
- 1, 0); // TEMP
391 // gState->mAudioOutChanR = (int) SendDlgItemMessage(hwndDlg, IDC_COMBO_AUDIO_OUT_R, CB_GETCURSEL, 0, 0);
394 case IDC_CB_MONO_INPUT
:
395 if (SendDlgItemMessage(hwndDlg
,IDC_CB_MONO_INPUT
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
396 gState
->mAudioInIsMono
= 1;
398 gState
->mAudioInIsMono
= 0;
401 case IDC_COMBO_AUDIO_IOVS
: // follow through
402 case IDC_COMBO_AUDIO_SIGVS
:
404 if (HIWORD(wParam
) == CBN_SELCHANGE
)
406 int iovsidx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IOVS
, CB_GETCURSEL
, 0, 0);
407 int sigvsidx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SIGVS
, CB_GETCURSEL
, 0, 0);
409 if (atoi(kIOVSOptions
[iovsidx
].c_str()) < atoi(kSIGVSOptions
[sigvsidx
].c_str())) // if iovs < sigvs
411 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IOVS
, CB_GETLBTEXT
, iovsidx
, (LPARAM
) gState
->mAudioIOVS
);
412 strcpy(gState
->mAudioSigVS
, kSIGVSOptions
[0].c_str()); // set sigvs to minimum
413 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SIGVS
, CB_SETCURSEL
, -1, 0);
417 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_IOVS
, CB_GETLBTEXT
, iovsidx
, (LPARAM
) gState
->mAudioIOVS
);
418 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SIGVS
, CB_GETLBTEXT
, sigvsidx
, (LPARAM
) gState
->mAudioSigVS
);
422 case IDC_COMBO_AUDIO_SR
:
423 if (HIWORD(wParam
) == CBN_SELCHANGE
)
425 int idx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SR
, CB_GETCURSEL
, 0, 0);
426 SendDlgItemMessage(hwndDlg
, IDC_COMBO_AUDIO_SR
, CB_GETLBTEXT
, idx
, (LPARAM
) gState
->mAudioSR
);
430 case IDC_BUTTON_ASIO
:
431 if (HIWORD(wParam
) == BN_CLICKED
)
433 system("open \"/Applications/Utilities/Audio MIDI Setup.app\"");
435 if( gState
->mAudioDriverType
== DAC_ASIO
&& gDAC
->isStreamRunning()) // TODO: still not right
440 case IDC_COMBO_MIDI_IN_DEV
:
441 if (HIWORD(wParam
) == CBN_SELCHANGE
)
443 int idx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_IN_DEV
, CB_GETCURSEL
, 0, 0);
444 SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_IN_DEV
, CB_GETLBTEXT
, idx
, (LPARAM
) gState
->mMidiInDev
);
445 ChooseMidiInput( gState
->mMidiInDev
);
449 case IDC_COMBO_MIDI_OUT_DEV
:
450 if (HIWORD(wParam
) == CBN_SELCHANGE
)
452 int idx
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_OUT_DEV
, CB_GETCURSEL
, 0, 0);
453 SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_OUT_DEV
, CB_GETLBTEXT
, idx
, (LPARAM
) gState
->mMidiOutDev
);
454 ChooseMidiOutput( gState
->mMidiOutDev
);
458 case IDC_COMBO_MIDI_IN_CHAN
:
459 if (HIWORD(wParam
) == CBN_SELCHANGE
)
460 gState
->mMidiInChan
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_IN_CHAN
, CB_GETCURSEL
, 0, 0);
463 case IDC_COMBO_MIDI_OUT_CHAN
:
464 if (HIWORD(wParam
) == CBN_SELCHANGE
)
465 gState
->mMidiOutChan
= (int) SendDlgItemMessage(hwndDlg
, IDC_COMBO_MIDI_OUT_CHAN
, CB_GETCURSEL
, 0, 0);
479 void ClientResize(HWND hWnd
, int nWidth
, int nHeight
)
481 RECT rcClient
, rcWindow
;
483 int screenwidth
, screenheight
;
486 screenwidth
= GetSystemMetrics(SM_CXSCREEN
);
487 screenheight
= GetSystemMetrics(SM_CYSCREEN
);
488 x
= (screenwidth
/ 2) - (nWidth
/2);
489 y
= (screenheight
/ 2) - (nHeight
/2);
491 GetClientRect(hWnd
, &rcClient
);
492 GetWindowRect(hWnd
, &rcWindow
);
493 ptDiff
.x
= (rcWindow
.right
- rcWindow
.left
) - rcClient
.right
;
494 ptDiff
.y
= (rcWindow
.bottom
- rcWindow
.top
) - rcClient
.bottom
;
495 MoveWindow(hWnd
, x
, y
, nWidth
+ ptDiff
.x
, nHeight
+ ptDiff
.y
, FALSE
);
499 WDL_DLGRET
MainDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
507 if(!AttachGUI()) printf("couldn't attach gui\n");
510 ClientResize(hwndDlg
, GUI_WIDTH
, GUI_HEIGHT
);
511 //SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(NULL, MAKEINTRESOURCE(IDI_ICON1)));
512 //SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(NULL, MAKEINTRESOURCE(IDI_ICON1)));
515 CenterWindow(hwndDlg
);
518 ShowWindow(hwndDlg
,SW_SHOW
);
526 SWELL_PostQuitMessage(hwndDlg
);
531 DestroyWindow(hwndDlg
);
533 // case WM_GETDLGCODE: {
535 // lres = CallWindowProc(/*TODO GET PROC */, hWnd, WM_GETDLGCODE, wParam, lParam);
536 // if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN && wParam == VK_LEFT) {
537 // lres |= DLGC_WANTMESSAGE;
542 switch (LOWORD(wParam
))
545 DestroyWindow(hwndDlg
);
548 if(!gPluginInstance
->HostRequestingAboutBox())
551 sprintf(version
, BUNDLE_MFR
"\nBuilt on " __DATE__
);
552 MessageBox(hwndDlg
,version
, BUNDLE_NAME
, MB_OK
);
557 INT_PTR ret
= DialogBox(GetModuleHandle(NULL
), MAKEINTRESOURCE(IDD_DIALOG_PREF
), hwndDlg
, PreferencesDlgProc
);