diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-09-28 19:35:24 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-09-28 19:35:24 +0300 |
commit | 455ac435481558c09ee1824b1e6dcc43f277527d (patch) | |
tree | 641268a2117543cd1a66ec9c4b3e3d790170f22e /utils/winmm_drv/cpl/adlconfig.c | |
parent | 595a9dc35ad1c41dac96d7fd7e3b3c7ccaac9947 (diff) | |
parent | baefee8dbe094a05ae89b0f9b909d19982711dc7 (diff) | |
download | libADLMIDI-455ac435481558c09ee1824b1e6dcc43f277527d.tar.gz libADLMIDI-455ac435481558c09ee1824b1e6dcc43f277527d.tar.bz2 libADLMIDI-455ac435481558c09ee1824b1e6dcc43f277527d.zip |
Merge branch 'master' of github.com:Wohlstand/libADLMIDI
Diffstat (limited to 'utils/winmm_drv/cpl/adlconfig.c')
-rw-r--r-- | utils/winmm_drv/cpl/adlconfig.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/utils/winmm_drv/cpl/adlconfig.c b/utils/winmm_drv/cpl/adlconfig.c new file mode 100644 index 0000000..744fc14 --- /dev/null +++ b/utils/winmm_drv/cpl/adlconfig.c @@ -0,0 +1,101 @@ +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <cpl.h> + +#include "resource.h" + +#include "config_dialog.h" + +static HANDLE hModule = NULL; + +BOOL WINAPI DllMain( + PVOID hmod, + ULONG ulReason, + PCONTEXT pctx OPTIONAL +) +{ + if(ulReason != DLL_PROCESS_ATTACH) + { + return TRUE; + } + else + { + hModule = hmod; + } + + return TRUE; + + UNREFERENCED_PARAMETER(pctx); +} + +LONG APIENTRY CPlApplet( + HWND hwndCPL, // handle of Control Panel window + UINT uMsg, // message + LONG_PTR lParam1, // first message parameter + LONG_PTR lParam2 // second message parameter +) +{ + LPCPLINFO lpCPlInfo; + LPNEWCPLINFO lpNewCPlInfo; + LONG retCode = 0; + + switch (uMsg) + { + // first message, sent once + case CPL_INIT: + initAdlSetupBox(hModule, hwndCPL); + return TRUE; + + // second message, sent once + case CPL_GETCOUNT: + return 1L; + + // third message, sent once per app + case CPL_INQUIRE: + lpCPlInfo = (LPCPLINFO)lParam2; + lpCPlInfo->idIcon = IDI_ICON1; + lpCPlInfo->idName = IDC_DRIVERNAME; + lpCPlInfo->idInfo = IDC_DRIVERDESC; + lpCPlInfo->lData = 0L; + break; + + // third message, sent once per app + case CPL_NEWINQUIRE: + lpNewCPlInfo = (LPNEWCPLINFO)lParam2; + lpNewCPlInfo->dwSize = (DWORD) sizeof(NEWCPLINFO); + lpNewCPlInfo->dwFlags = 0; + lpNewCPlInfo->dwHelpContext = 0; + lpNewCPlInfo->lData = 0; + lpNewCPlInfo->hIcon = LoadIconW(hModule, (LPCTSTR)MAKEINTRESOURCEW(IDI_ICON1)); + lpNewCPlInfo->szHelpFile[0] = '\0'; + + LoadStringW(hModule, IDC_DRIVERNAME, lpNewCPlInfo->szName, 32); + LoadStringW(hModule, IDC_DRIVERDESC, lpNewCPlInfo->szInfo, 64); + break; + + // application icon selected + case CPL_SELECT: + break; + + // application icon double-clicked + case CPL_DBLCLK: + runAdlSetupBox(hModule, hwndCPL); + break; + + case CPL_STOP: + break; + + case CPL_EXIT: + cleanUpAdlSetupBox(hModule, hwndCPL); + break; + + default: + break; + } + + return retCode; + + UNREFERENCED_PARAMETER(lParam1); +} |