作者maplefog (枫雾)
看板C_and_CPP
标题Re: [问题] pdf输入密码问题
时间Sat Apr 18 13:09:04 2009
我有参考别人的程式码弄成功了,给需要的参考看看
以下为程式码
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShellExecute(Handle,"open","c:\\a.pdf",NULL,NULL,SW_MAXIMIZE);
Sleep(1000);
HWND LastEditHandle = ::GetForegroundWindow();
AttachThreadInput(GetCurrentThreadId(), GetWindowThreadProcessId
(LastEditHandle, NULL), true);
HWND hFocusWin = GetFocus();
AttachThreadInput(GetCurrentThreadId(), GetWindowThreadProcessId
(LastEditHandle, NULL), false);
int i;
Byte ch;
AnsiString str = "参考看看";
for( i = 1; i <= str.Length(); i++ )
{
ch = Byte(str[i]);
if( IsDBCSLeadByte(ch) )
PostMessage(hFocusWin, WM_IME_CHAR, MAKEWORD(Byte(str[++i]), ch), 0);
else
PostMessage(hFocusWin, WM_IME_CHAR, WORD(ch), 0);
}
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.118.207.32