線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1207
推到 Plurk!
推到 Facebook!

FindWindow的問題

尚未結案
chance
一般會員


發表:19
回覆:9
積分:5
註冊:2003-08-18

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-09-15 16:49:22 IP:210.68.xxx.xxx 未訂閱
各位大大好!小弟在此有幾個問題想要請教…… 小弟在貴版上找到了一些FindWindow的資訊,因此也學會了一點FindWindow 但是小弟還是有一個問題,下列是小弟的程式碼: find =NULL; find=::FindWindow("CabinetWClass",NULL); if (::IsWindow(find)) { count ; kick=kick "網路上的芳鄰 "; } 小弟想要做的是「網路上的芳鄰」有否被執行…… 但是,若是我們打開了「我的電腦」…之類, 程式一樣會偵測到我們正在使用「網路上的芳鄰」, 因為「我的電腦」的Classname一樣是「CabinetWClass」, 這就讓小弟很困擾了。試問,我們要如何在不開啟工作列的情況之下知道 我們開的是網芳還是我的電腦呢??
gemi0305
版主


發表:81
回覆:564
積分:629
註冊:2003-05-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-09-15 20:49:49 IP:61.224.xxx.xxx 未訂閱
FindWindow還可以這樣用
gemi0305
版主


發表:81
回覆:564
積分:629
註冊:2003-05-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-09-15 20:53:21 IP:61.224.xxx.xxx 未訂閱
The FindWindow function retrieves the handle to the top-level window  whose class name and window name match the specified strings. This  function does not search child windows.  HWND FindWindow( LPCTSTR lpClassName, // pointer to class name LPCTSTR lpWindowName // pointer to window name ); Parameters lpClassName Points to a null-terminated string that specifies the class name or is an atom that identifies the class-name string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpClassName; the high-order word must be zero. lpWindowName Points to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match. Return Values If the function succeeds, the return value is the handle to the window that has the specified class name and window name. If the function fails, the return value is NULL. To get extended error information, call GetLastError. 之前你的程式是抓ClassName,其實FindWindow也可以抓WindowName, 很有彈性的 國泰平安
系統時間:2024-05-08 6:03:54
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!