如何在目前位置輸入特定字元? |
答題得分者是:rogan321
|
show
初階會員 發表:57 回覆:48 積分:31 註冊:2003-05-24 發送簡訊給我 |
|
rogan321
高階會員 發表:21 回覆:307 積分:200 註冊:2003-05-15 發送簡訊給我 |
Hi~show
dllee版大寫的這個範例可達到你的要求~~
http://delphi.ktop.com.tw/topic.php?topic_id=56498
//重點在這裡可抓住上個form的focus void __fastcall TFormKeyBoard::Timer1Timer(TObject *Sender) { // Try to find the foreground windows // http://delphi.ktop.com.tw/topic.php?TOPIC_ID=37920 再改良一下 HWND hwndThisActived=GetForegroundWindow(); if(hwndLastActived!=hwndThisActived) { if(hwndThisActived==this->Handle) { hwndThisActived=hwndLastActived; if(hwndLastActived!=0) SetForegroundWindow(hwndLastActived); } SetWindowPos(this->Handle,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); hwndLastActived=hwndThisActived; char LastActivedTitle[256]; GetWindowText(hwndLastActived,LastActivedTitle,256); this->Image1->Hint=AnsiString(LastActivedTitle); } if(bMouseDown==false && bMouseInForm==true) { POINT MousePos; if (GetCursorPos(&MousePos)) { if(this->Left > MousePos.x || this->Top > MousePos.y || this->Left this->Width < MousePos.x || this->Top this->Height < MousePos.y) { bMouseInForm=false; this->Color=clNavy;//clInactiveCaption; if(bStickLeft) this->Left=Screen->Width-3; // Hide else this->Left=3-this->Width; // Hide if(bMouseInXButton==true) { bMouseInXButton=false; ImageList1->GetBitmap(2,ImgBtnClose->Picture->Bitmap); ImgBtnClose->Invalidate(); } } } } } |
show
初階會員 發表:57 回覆:48 積分:31 註冊:2003-05-24 發送簡訊給我 |
|
rogan321
高階會員 發表:21 回覆:307 積分:200 註冊:2003-05-15 發送簡訊給我 |
引言: 感謝~^^ 但我有個問題出現... 我做出來的符號表(Form2)是透過Form1上一個button呼叫出來 然後我發現...我符號表按下去可以在其他程式如UltraEdit,notepad.. 其他程式出現符號,但就是沒辦法在我Form1上面任何欄位出現符號???? 另外 Btn0->Tag=VK_NUMPAD0; 如果我要出現一些特別符號,例如全形的逗點句號 Tag那邊要怎指?? thanks 發表人 - show 於 2004/12/24 12:06:38Hi~show 如果說你是同一隻程式那你大可不必如此麻煩,你在你的form2上btn中寫下如此類的判斷式即可~ bool IsEdit = Form1->ActiveControl->ClassNameIs("TMemo");//判斷form1最後作用的編輯視窗為何類別 if(IsEdit) Form1->Memo1->Lines->Add("加入的字串"); else \\其他處理.... \\如此特別字元也解決了 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |