Delphi sends a WINDWOS Message control button (one of the buttons in the control Calculator)

Source: Internet
Author: User

[Delphi]View Plaincopyprint?
  1. Procedure TfrmmainBtnsendclick (sender:tobject);
  2. Var
  3. Hcalc, h1:cardinal;
  4. Begin
  5. WinExec (' calc ', SW_SHOWNORMAL); Run Calculator
  6. Hcalc: = FindWindow (' Scicalc ', nil);
  7. //Find the main window handle of calculator, see the class name through Spy + +
  8. H1: = FindWindowEx (Hcalc, 0, ' Button ', ' 9 ');
  9. //Find the handle to button 1 and see the various controls and their parent-child, sibling relationships through Spy + +
  10. SendMessage (Hcalc, Wm_command, Makewparam (GetDlgCtrlID (H1), bn_clicked), H1)
  11. End

http://blog.csdn.net/yanjiaye520/article/details/7942499

Delphi sends a WINDWOS Message control button (one of the buttons in the control Calculator)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.