
我想獲得份數數值的句柄,可是我怎么也獲得不了?
hPrinter = FindWindow(NULL, L"列印");
if (hPrinter)
{
HWND hwndChild = ::GetWindow(hPrinter, GW_CHILD); //列出所有控制元件
while (hwndChild)
{
GetWindowText(hwndChild, TempTitle, 20 * 2);
MessageBox(NULL, TempTitle, TempTitle, MB_OK);
hwndChild = ::GetWindow(hwndChild, GW_HWNDNEXT);
}
我用以上代碼遍歷整個視窗的句柄,但獲得的總是列印 & 取消 & 應用的控制元件句柄,也不會遍歷到份數的句柄,我通過SPY++看到ID是0x481,但我通過以下代碼依然不能獲得份數的句柄,也無法獲得要列印的實際份數。
HWND hCount = GetDlgItem(hPrinter, 0x481);
if (hCount)
MessageBox(NULL, L"Get hChild OK", L"Get hChild OK", MB_OK);
我的最終目的是想獲得要列印的實際份數,請大家指點,謝謝
uj5u.com熱心網友回復:
HWND hCount = GetDlgItem(hPrinter, 0x481);char name[40];
查查是什么 控制元件 ? GetClassName(hCount,name,40);
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/153518.html
標籤:基礎類
上一篇:EXCEL繪制表格并列印表格
