不用任何控制項作出XP風格的程式 |
|
ddy
站務副站長 發表:262 回覆:2105 積分:1169 註冊:2002-07-13 發送簡訊給我 |
XP 風格是現在很流行的風格界面,你是否發現自己以BCB 6(含) /Delphi 6(含)以下的所開發的程式,在XP上執行無法顯示xp 風格 要在自己的程式中實現Windows XP的視覺效果,就要給程式增加一個說明文件。這個說明文件可以是程式的資源檔案,也可以是同路徑下的文件。 這個說明文件是一個XML文件。它讓Windows XP在鏈結資料時決定使用哪種版本的comctl32.dll。
這個XML文件含有你編寫的程式的資訊和使用的comctrl32.dll版本資訊。 僅參考下列網站,整理如下
http://www.codeproject.com/csharp/dotnetvisualstyles.asp
http://www.cx66.com/cxgzs/program/delphi/910.htm (1) 建立一個叫themed.manifest的文字檔案
< ?xml version="1.0" encoding="UTF-8" standalone="yes"?> < assembly manifestVersion="1.0"> < assemblyIdentity name="Your.Application.Name.Here" ------應用程式的名稱 processorArchitecture="x86" version="1.0.0.0" type="win32"/> < description> WindowsXP Shell< /description> < dependency> < dependentAssembly> < assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /> < /dependentAssembly> < /dependency> < /assembly>(2) 將文中description標記的內容和assemblyIdentity標記的"name"改寫成你的應用稱式的名稱。然後將文件存檔。 (3) 創建一個資源檔案來指向上面的文件,資源檔案名爲 例:XPStyle.RC 內容如下:1 24 "themed.manifest" (4) 現在要用Delphi的資源編譯器(brcc32.exe)來編譯XPStyle.rc。 在命令行鍵入指令: brcc32 XPStyle.rc 編譯之後生成XPStyle.res文件。 (5) 在應用程式中包含這個資源檔案,並在{$R *.DFM}之後注明{$R XPStyle.res}。 (6) 編譯程式並運行。 (7) 測試程式是否正常。 注意,有些元件,如TGroupBox, TSpeedButton等不支援XP模式。 如果使用TListView元件,請閱讀《TListView在XP中的補丁程式》 大家試試看吧~~~ --【KTop SNG新聞現場】--記者:ddy----------------------------------------- 請各位市民做好資源回收與垃圾分類,讓不良標題與不當發言在KTop 市消失 ------------------------------------------------------------------------- 發表人 - ddy 於 2002/12/04 10:03:54 |
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
這是從MSXML v4.0 Help中截取的內容,給大家參考參考
=============================================
Microsoft XML Core Services (MSXML) 4.0 Creating a Manifest for Your Application
To deploy applications that use MSXML 4.0 to computers running Windows XP, you must create an application manifest and deploy it with your application. To create a manifest for your application
Copy this sample manifest and paste it into any text editor. < ?xml version="1.0" encoding="UTF-8" standalone="yes"? > < assembly manifestVersion="1.0" > < assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Microsoft.Windows.mysampleApp" type="win32" / > < description >Your app description here< /description > < dependency > < dependentAssembly > < assemblyIdentity type="win32" name="Microsoft.MSXML2" version="4.0.0.0" processorArchitecture="X86" publicKeyToken="4495b64144ccf1df" language="*" / > < /dependentAssembly > < /dependency > < /assembly >After you have pasted the sample code above, you must update it as appropriate for your application. To do this, change the featured values (those in bold in the sample code) of the first |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |