Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -2514,6 +2514,29 @@ |
2515 | 2515 | return level;
|
2516 | 2516 | }
|
2517 | 2517 |
|
| 2518 | +LRESULT CALLBACK LoadingCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 2519 | +{
|
| 2520 | + HWND *hWndReturn = (HWND*)lParam;
|
| 2521 | + switch (Msg)
|
| 2522 | + {
|
| 2523 | + case WM_INITDIALOG:
|
| 2524 | + *hWndReturn = hWnd;
|
| 2525 | + return TRUE;
|
| 2526 | + case WM_USER+1:
|
| 2527 | + DestroyWindow(hWnd);
|
| 2528 | + return TRUE;
|
| 2529 | + default:
|
| 2530 | + return FALSE;
|
| 2531 | + }
|
| 2532 | +}
|
| 2533 | +
|
| 2534 | +DWORD WINAPI ProgressThread(LPVOID hWndOut)
|
| 2535 | +{
|
| 2536 | + DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_LOADING), NULL, (DLGPROC)LoadingCallback, (LPARAM)hWndOut);
|
| 2537 | + ExitThread(0);
|
| 2538 | + return 0;
|
| 2539 | +}
|
| 2540 | +
|
2518 | 2541 | LRESULT CALLBACK DXGLCfgCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
2519 | 2542 | {
|
2520 | 2543 | PIXELFORMATDESCRIPTOR pfd =
|
— | — | @@ -2583,9 +2606,14 @@ |
2584 | 2607 | int newtab;
|
2585 | 2608 | DWORD dpisupport;
|
2586 | 2609 | TCITEM tab;
|
| 2610 | + int progresscount;
|
| 2611 | + HWND hProgressWnd;
|
2587 | 2612 | switch (Msg)
|
2588 | 2613 | {
|
2589 | 2614 | case WM_INITDIALOG:
|
| 2615 | + hProgressWnd = NULL;
|
| 2616 | + CreateThread(NULL, 0, ProgressThread, &hProgressWnd, 0, NULL);
|
| 2617 | + while (hProgressWnd == NULL) Sleep(10);
|
2590 | 2618 | hDialog = hWnd;
|
2591 | 2619 | tristate = FALSE;
|
2592 | 2620 | maxapps = 128;
|
— | — | @@ -3216,6 +3244,7 @@ |
3217 | 3245 | // Add installed programs
|
3218 | 3246 | current_app = 1;
|
3219 | 3247 | appcount = 1;
|
| 3248 | + progresscount = 1;
|
3220 | 3249 | regbuffersize = 1024;
|
3221 | 3250 | regbuffer = (LPTSTR)malloc(regbuffersize * sizeof(TCHAR));
|
3222 | 3251 | RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\DXGL\\Profiles"), 0, NULL, 0, KEY_READ, NULL, &hKeyBase, NULL);
|
— | — | @@ -3225,6 +3254,9 @@ |
3226 | 3255 | keysize2 = keysize;
|
3227 | 3256 | i = 0;
|
3228 | 3257 | while (RegEnumKeyEx(hKeyBase, i, keyname, &keysize2, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
| 3258 | + progresscount++;
|
| 3259 | + i = 0;
|
| 3260 | + while (RegEnumKeyEx(hKeyBase, i, keyname, &keysize2, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
3229 | 3261 | {
|
3230 | 3262 | keysize2 = keysize;
|
3231 | 3263 | i++;
|
— | — | @@ -3360,6 +3392,8 @@ |
3361 | 3393 | EnableWindow(GetDlgItem(hTabs[0], IDC_DPISCALE), FALSE);
|
3362 | 3394 | }
|
3363 | 3395 | if(token) CloseHandle(token);
|
| 3396 | + SendMessage(hProgressWnd, WM_USER+1, 0, 0);
|
| 3397 | + SetForegroundWindow(hWnd);
|
3364 | 3398 | return TRUE;
|
3365 | 3399 | case WM_MEASUREITEM:
|
3366 | 3400 | switch(wParam)
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -243,13 +243,16 @@ |
244 | 244 |
|
245 | 245 |
|
246 | 246 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
247 | | -IDD_LOADING DIALOG 0, 0, 246, 41
|
248 | | -STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
249 | | -EXSTYLE WS_EX_WINDOWEDGE
|
| 247 | +//IDD_LOADING DIALOG 0, 0, 246, 41
|
| 248 | +IDD_LOADING DIALOG 0, 0, 68, 18
|
| 249 | +STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_POPUP
|
| 250 | +EXSTYLE WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW
|
| 251 | +CAPTION "DXGL Config"
|
250 | 252 | FONT 8, "Ms Shell Dlg"
|
251 | 253 | {
|
252 | | - LTEXT "Loading profiles...", 0, 95, 10, 56, 8, SS_LEFT, WS_EX_LEFT
|
253 | | - CONTROL "", IDC_PROGRESS, PROGRESS_CLASS, 0, 7, 20, 232, 14, WS_EX_LEFT
|
| 254 | +// LTEXT "Loading profiles...", 0, 95, 10, 56, 8, SS_LEFT, WS_EX_LEFT
|
| 255 | +// CONTROL "", IDC_PROGRESS, PROGRESS_CLASS, 0, 7, 20, 232, 14, WS_EX_LEFT
|
| 256 | + LTEXT "Please wait...", 0, 13, 4, 43, 9, SS_LEFT, WS_EX_LEFT
|
254 | 257 | }
|
255 | 258 |
|
256 | 259 |
|
Index: dxglcfg/resource.h |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | #define IDB_DXGLINV64 312
|
56 | 56 |
|
57 | 57 | // Controls - Progress Dialog
|
58 | | -#define IDC_PROGRESS 1101
|
| 58 | +//#define IDC_PROGRESS 1101
|
59 | 59 |
|
60 | 60 | // Controls - Display Tab
|
61 | 61 | #define IDC_VIDMODE 2001
|