| 上一篇主題 :: 下一篇主題   | 
	
	
	
		| 發表人 | 
		內容 | 
	
	
		ckp6250
 
 
  註冊時間: 2004-07-30 文章: 1645
 
  第 1 樓
  | 
		
			
				 發表於: 星期日 五月 09, 2010 1:36 pm    文章主題: VFP 如何判斷作業系統是32位元或64位元? | 
				     | 
			 
			
				
  | 
			 
			
				OS()  函數只能秀出 windows 的版本,但看不出是32或64位元。
 
那一個函數可以做到呢? | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ckp6250
 
 
  註冊時間: 2004-07-30 文章: 1645
 
  第 2 樓
  | 
		
			
				 發表於: 星期日 五月 09, 2010 10:31 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				感謝 lurommou 指點
 
第二個網址的範例,很適合 VFP 的環境 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		张三
 
 
  註冊時間: 2010-06-08 文章: 15
 
  第 3 樓
  | 
		
			
				 發表於: 星期三 六月 09, 2010 11:51 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				* 如何秀出 Windows 作業系統是32或64位元
 
 
* First determine if IsWow64Process function exists in the OS we're running under
 
DECLARE Long GetModuleHandle IN WIN32API STRING lpModuleName
 
DECLARE Long GetProcAddress IN WIN32API Long hModule, String lpProcName
 
llIsWow64ProcessExists = (GetProcAddress(GetModuleHandle("kernel32"),"IsWow64Process") <> 0)
 
 
 
llIs64BitOS = .F.
 
IF llIsWow64ProcessExists 
 
	DECLARE Long GetCurrentProcess IN WIN32API 
 
	DECLARE Long IsWow64Process IN WIN32API Long hProcess, Long @ Wow64Process
 
	lnIsWow64Process = 0
 
	* IsWow64Process function return value is nonzero if it succeeds 
 
	* The second output parameter value will be nonzero if VFP application is running under 64-bit OS 
 
	IF IsWow64Process( GetCurrentProcess(), @lnIsWow64Process) <> 0
 
		llIs64BitOS = (lnIsWow64Process <> 0)
 
	ENDIF	
 
ENDIF	
 
? llIs64BitOS
 
 
谢谢 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ckp6250
 
 
  註冊時間: 2004-07-30 文章: 1645
 
  第 4 樓
  | 
		
			
				 發表於: 星期四 六月 10, 2010 10:02 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 感謝張三指教! | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		张三
 
 
  註冊時間: 2010-06-08 文章: 15
 
  第 5 樓
  | 
		
			
				 發表於: 星期四 六月 10, 2010 9:15 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				或者简单一点
 
*
 
- 谢谢
 
*
 
Declare Integer IsWow64Process In WIN32API ;
 
  Integer hProcess, Integer @ Wow64Process
 
Declare Integer GetCurrentProcess In WIN32API
 
*
 
Local lnWin64, IsWin64
 
lnWin64 = 0
 
Try
 
  IsWow64Process( GetCurrentProcess(), @lnWin64)
 
ENDTRY
 
*
 
IsWin64 = ( m.lnWin64 != 0 ) 
 
*
 
MESSAGEBOX( m.IsWin64 ) | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		 |