IntPtr mwh = (IntPtr)Convert.ToInt32(handle);                         //ComboBox的句柄
int result = SendMessage(mwh, 0x014D, -1, selectStr);            //改变ComboBox的值,selectStr为预期的下拉框选项

int mwh_p = GetWindowLong(mwh, -8);                                   //获取ComboBox所属窗口的句柄
            
IntPtr mwh2 = (IntPtr)Convert.ToInt32(mwh_p);                      //转换ComboBox所属窗口的句柄

string cbn_selchange;

int cb_id = GetWindowLong(mwh, -12);                                    //获取ComboBox的控件ID

cbn_selchange = "0001" + string.Format("{0:X4}", cb_id);     

IntPtr s1 = (IntPtr)Convert.ToInt32(Tools.ToD(cbn_selchange, 16));

SendMessage(mwh2, 0x0111, s1, mwh);                    //给ComboBox所属窗口发送WM_COMMAND命令,第3个参数wParam是(CBN_SELCHANGE(高位) + 控件ID(低位))

 

SendMessage(mwh2, 0x0111, s1, mwh);可以参考SPY++捕捉的消息日志

 

GetWindowLong的参数可以参考:

http://blog.csdn.net/hnhyhongmingjiang/archive/2008/03/06/2154410.aspx

 

SendMessage的参数可以参考:

http://topic.csdn.net/t/20050713/18/4142641.html

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
相关资源
相似解决方案