Re: [問題] pdf輸入密碼問題
我有參考別人的程式碼弄成功了,給需要的參考看看
以下為程式碼
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
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章