第18部分(第3/5 頁)
le;
begin
hDesktop:=FindWindow('Progman';nil);
ShowWindow(hDesktop;SW_HIDE); //隱藏桌面
end;
procedure TForm1。Button2Click(Sender: TObject);
var hDesktop:Thandle;
begin
hDesktop:=FindWindow('Progman';nil);
ShowWindow(hDesktop;SW_SHOW); //顯示桌面
end;
procedure TForm1。Button3Click(Sender: TObject);
begin
close;
end
104;Q:應用 Microsoft TTS 語音引擎的 Delphi 語言例項
A:建立一個單窗體工程,新增一個 Edit 和 2 個 Button 控制元件,分別命名為 Edit1、btnSpeak、btnStop。然後安裝引用 TTS 的 vtxtauto。tlb 類庫檔案,方法是點選選單“工程…Import Type Library”,點“add”按鈕,然後選中 Windowsspeech 下的 Vtxtauto。tlb 檔案,放入安裝包後,再將其新增成 Delphi 的一個 Unit,自動產生的名字為“VTxtAuto_TLB”。然後,在主 Unit 的 Uses 裡引用 VTxtAuto_TLB,即在 Uses 後新增字串“VTxtAuto_TLB”。最後參考以下程式碼:
……
procedure TfrmSpeech。FormCreate(Sender: TObject);
begin
vtxt:=CoVTxtAuto_。Create;
vtxt。Register('';'Speech');
Edit1。Text:='I am a chinese; I love my homeland very much; and you?'
end;
procedure TfrmSpeech。btnSpeakClick(Sender: TObject);
begin
vtxt。Speed:=100;
vtxt。Speak(trim(Edit1。Text);10);
end;
procedure TfrmSpeech。btnStopClick(Sender: TObject);
begin
vtxt。StopSpeaking;
end;
end。
第六卷 第一章
?1;Q:怎樣把別人網頁上的背景音樂儲存下來?
A:瀏覽該網頁後;在你的 WindowsTemporary Internet Files 資料夾下可以找到該背景音樂的快取檔案,複製出來即可使用。如果還是找不見該檔案,可以開啟網頁的原始檔,找到音樂檔案的 URL 路徑,用“螞蟻”等 FTP 軟體進行下載。
2;Q:避免有人從你分幀的主頁的幀中徑直進入網站;而不是從 index。htm 中進入?
A:在幀中的網頁的〈head〉〈/head〉之間加入以下指令碼程式碼:
〈Script language=〃JavaScript〃〉
if (top==self)
self。location。href=〃index。htm〃;
〈/Script〉
這樣;當有人從幀中進入網站時;就會自動重定向到主頁檔案 index。htm。
3。Q:怎樣防止別人把你的網頁
本章未完,點選下一頁繼續。