Re: [問題] pdf輸入密碼問題

看板C_and_CPP (C/C++)作者 (楓霧)時間16年前 (2009/04/18 13:09), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
我有參考別人的程式碼弄成功了,給需要的參考看看 以下為程式碼 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
文章代碼(AID): #19wM1ng7 (C_and_CPP)
文章代碼(AID): #19wM1ng7 (C_and_CPP)