mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[utf8] added ComboBox_GetLBTextU() to maspi_utf8.h
This commit is contained in:
		
							parent
							
								
									5216eac9f2
								
							
						
					
					
						commit
						4f3ebdf92c
					
				
					 1 changed files with 21 additions and 1 deletions
				
			
		
							
								
								
									
										22
									
								
								msapi_utf8.h
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								msapi_utf8.h
									
										
									
									
									
								
							|  | @ -44,7 +44,7 @@ extern "C" { | ||||||
| 
 | 
 | ||||||
| #define sfree(p) do {if (p != NULL) {free((void*)(p)); p = NULL;}} while(0) | #define sfree(p) do {if (p != NULL) {free((void*)(p)); p = NULL;}} while(0) | ||||||
| #define wconvert(p)     wchar_t* w ## p = utf8_to_wchar(p) | #define wconvert(p)     wchar_t* w ## p = utf8_to_wchar(p) | ||||||
| #define walloc(p, size) wchar_t* w ## p = calloc(size, sizeof(wchar_t)) | #define walloc(p, size) wchar_t* w ## p = (wchar_t*)calloc(size, sizeof(wchar_t)) | ||||||
| #define wfree(p) sfree(w ## p) | #define wfree(p) sfree(w ## p) | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  | @ -243,6 +243,26 @@ static __inline BOOL SetDlgItemTextU(HWND hDlg, int nIDDlgItem, const char* lpSt | ||||||
| 	return ret; | 	return ret; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static __inline int ComboBox_GetLBTextU(HWND hCtrl, int index, char* lpString) | ||||||
|  | { | ||||||
|  | 	int size; | ||||||
|  | 	DWORD err = ERROR_INVALID_DATA; | ||||||
|  | 	wchar_t* wlpString; | ||||||
|  | 	if (lpString == NULL) | ||||||
|  | 		return CB_ERR; | ||||||
|  | 	size = (int)SendMessageW(hCtrl, CB_GETLBTEXTLEN, (WPARAM)index, (LPARAM)0); | ||||||
|  | 	if (size < 0) | ||||||
|  | 		return size; | ||||||
|  | 	wlpString = (wchar_t*)calloc(size, sizeof(wchar_t)); | ||||||
|  | 	size = (int)SendMessageW(hCtrl, CB_GETLBTEXT, (WPARAM)index, (LPARAM)wlpString); | ||||||
|  | 	err = GetLastError(); | ||||||
|  | 	if (size > 0) | ||||||
|  | 		wchar_to_utf8_no_alloc(wlpString, lpString, size+1); | ||||||
|  | 	wfree(lpString); | ||||||
|  | 	SetLastError(err); | ||||||
|  | 	return size; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| static __inline HANDLE CreateFileU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, | static __inline HANDLE CreateFileU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, | ||||||
| 								   LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, | 								   LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, | ||||||
| 								   DWORD dwFlagsAndAttributes,  HANDLE hTemplateFile) | 								   DWORD dwFlagsAndAttributes,  HANDLE hTemplateFile) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue