zoukankan      html  css  js  c++  java
  • 调用win32 api 函数SendMessage() 实现消息直接调用

    简单的调用例子, 适合初学者学习,当然 我也是初学者.

     1 #include <windows.h>
     2 #include <stdio.h>
     3 #include <stdlib.h>
     4 
     5 #define dim(x) (sizeof()/sizeof(x[0]))
     6 
     7 int main()
     8 {
     9     system("color 5b");
    10 /*    system("mode con cols=60 lines=8");*/
    11     system("title Kill Window");
    12     char sName[80] = {0};
    13     HWND hWnd = 0;
    14 
    15     puts("====--------------====");
    16     puts("==== QQ 702368956 ====");
    17     puts("====--------------====");
    18     while (1)
    19     {
    20         printf("Help You Kill it: ");
    21         gets(sName);
    22         hWnd = FindWindow(NULL, sName);
    23         if (hWnd)
    24         {
    25             SendMessage(hWnd, WM_CLOSE, 0, 0);
    26             break;
    27         }
    28         else
    29         {
    30             printf("    没有找到窗口...
    
    ");
    31             continue;
    32         }
    33     }
    34     return 0;
    35 }
  • 相关阅读:
    平衡的括号(栈)
    二叉树遍历
    Ohana Cleans Up0101
    Missing number
    Django框架之模板层
    Django框架之路由层、视图层
    Django框架
    Django初识
    前端之bootstrap
    前端之BOM、DOM
  • 原文地址:https://www.cnblogs.com/qq702368956/p/4945923.html
Copyright © 2011-2022 走看看