1. You need to hook the select item function from inventory to get the itemID and to process the Shift + click.
2. You need to identify the target windows. (Warehouse,Shop,Compouse,Improve...)
- The easy way is to hook MoveWindow to get this.
3. You need to identify the target window childs by id.
- You can use Spy++ to get this.
4. Send click on target window:
Code:
int CDlgActions::InventorySelectProcess()
{
if ((GetAsyncKeyState(VK_SHIFT) & 0x8000) == 0)
return 1;
if (IsWindowEnabled(ShophWnd) && IsWindowVisible(ShophWnd))
SendClick(ShophWnd, 0x610);
else if (IsWindowEnabled(ImprovehWnd) && IsWindowVisible(ImprovehWnd))
{
if (SelectedItemId == 1088000 || SelectedItemId == 1088001 || SelectedItemId == 1088002)
SendClick(ImprovehWnd, 0x65D);
else
SendClick(ImprovehWnd, 0x65C);
}
.....
}
Code:
void CDlgActions::SendClick(HWND hWnd, int id)
{
HWND hWndButton = GetDlgItem(hWnd, id);
if (IsWindowEnabled(hWndButton) && IsWindowVisible(hWndButton))
{
PostMessage(hWndButton, WM_LBUTTONDOWN, 2, 0);
PostMessage(hWndButton, WM_LBUTTONUP, 2, 0);
}
}