http://bbs.csdn.net/topics/390472740
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
function TCFADODBStorage . OpenConnection: Boolean ;
procedure _FreeIMEWindow;
const
IME_WINDOW_CLASS = 'IME' ;
IME_WINDOW_TEXT = 'Default IME' ;
var
h : HWND;
pid : DWORD;
dh : HWND;
begin
h := FindWindow(IME_WINDOW_CLASS, IME_WINDOW_TEXT);
while IsWindow(h) do
begin
if GetWindowThreadProcessId(h, pid) = GetCurrentThreadId then
dh := h
else
dh := 0 ;
h := FindWindowEx( 0 , h, IME_WINDOW_CLASS, IME_WINDOW_TEXT);
if dh <> 0 then
DestroyWindow(dh);
end ;
end ;
begin
try
FConnection . ConnectionString := ConnectionString;
FConnection . Connected := True ;
if GetCurrentThreadId <> Global . MainThreadID then
_FreeIMEWindow;
except on E: Exception do
FLastErrorMessage := e . Message;
end ;
Result := FConnection . Connected;
end ;
|
|
|
![ysai](http://avatar.csdn.net/3/E/8/1_ysai.jpg) - 关注
- ysai
- ysai
- 本版等级:
|
#5 得分:0回复于: 2013-05-28 17:01:47
这破问题我找了好久原因,楼主赚到了
|