mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 12:11:15 -06:00 
			
		
		
		
	eject button functionality
This commit is contained in:
		
							parent
							
								
									a01eec34f9
								
							
						
					
					
						commit
						b267e986fb
					
				
					 2 changed files with 7 additions and 5 deletions
				
			
		|  | @ -275,7 +275,7 @@ bool GUI_App::on_init_inner() | |||
|         this->obj_manipul()->update_if_dirty(); | ||||
| 
 | ||||
| 
 | ||||
| 		RemovableDriveManager::get_instance().update(wxGetLocalTime(), true); | ||||
| 		//RemovableDriveManager::get_instance().update(wxGetLocalTime(), true);
 | ||||
| 
 | ||||
| 
 | ||||
|         // Preset updating & Configwizard are done after the above initializations,
 | ||||
|  |  | |||
|  | @ -96,14 +96,16 @@ void RemovableDriveManager::eject_drive(const std::string &path) | |||
| 				return; | ||||
| 			} | ||||
| 			DWORD deviceControlRetVal(0); | ||||
| 			DeviceIoControl(handle, FSCTL_LOCK_VOLUME, nullptr, 0, nullptr, 0, &deviceControlRetVal, nullptr); | ||||
| 			DeviceIoControl(handle, FSCTL_DISMOUNT_VOLUME, nullptr, 0, nullptr, 0, &deviceControlRetVal, nullptr); | ||||
| 			BOOL error = DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, nullptr, 0, nullptr, 0, &deviceControlRetVal, nullptr); | ||||
| 			CloseHandle(handle); | ||||
| 			if (error == 0) | ||||
| 			{ | ||||
| 				CloseHandle(handle); | ||||
| 				std::cerr << "Ejecting " << mpath << " failed " << deviceControlRetVal << " " << GetLastError() << " \n"; | ||||
| 				return; | ||||
| 			} | ||||
| 
 | ||||
| 			CloseHandle(handle); | ||||
| 
 | ||||
| 			m_current_drives.erase(it); | ||||
| 			break; | ||||
|  | @ -198,7 +200,7 @@ INT_PTR WINAPI WinProcCallback(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP | |||
| 			DEVICE_NOTIFY_WINDOW_HANDLE // type of recipient handle
 | ||||
| 		); | ||||
| 		break; | ||||
| 	/*
 | ||||
| 	 | ||||
| 	case WM_DEVICECHANGE: | ||||
| 	{ | ||||
| 		if(wParam == DBT_DEVICEREMOVECOMPLETE) | ||||
|  | @ -207,7 +209,7 @@ INT_PTR WINAPI WinProcCallback(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP | |||
| 		} | ||||
| 	} | ||||
| 	break; | ||||
| 	*/ | ||||
| 	 | ||||
| 	default: | ||||
| 		// Send all other messages on to the default windows handler.
 | ||||
| 		lRet = DefWindowProc(hWnd, message, wParam, lParam); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Kocik
						David Kocik