BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { hInst=(HINSTANCE)hModule; switch (ul_reason_for_call) {//--------------------------------------------------// case DLL_PROCESS_ATTACH: iInterfaceMode=iGetUserInterfaceMode(); // get interface on startup OpenGenInterface(); // open interface (can be changed in the config window) break; //--------------------------------------------------// case DLL_PROCESS_DETACH: CloseGenInterface(); // close interface break; //--------------------------------------------------// case DLL_THREAD_ATTACH: break; //--------------------------------------------------// case DLL_THREAD_DETACH: break; //--------------------------------------------------// } return TRUE; }
void OnIMode(HWND hW) { HWND hWC=GetDlgItem(hW,IDC_IMODE); int iM = ComboBox_GetCurSel(hWC); GetCDRInfos(hW,&iCD_AD,&iCD_TA,&iCD_LU); // get sel drive CloseGenInterface(); // close current interface iInterfaceMode=iM; // set new interface mode OpenGenInterface(); // open new interface ComboBox_SetCurSel(hWC,iInterfaceMode); // sel interface again (maybe it was not supported on open) EnumDrives(hW); // enum drives again }