请问谁有windows消息的详细说明,例如Message的Msg,更准确的说windows的message的编号,一条消息的编号在MSDN中能不能找到????

解决方案 »

  1.   

    微软定义的消息都可以在MSDN里面找说明
      

  2.   

    那么我想问一下窗口右上角的最大化和最小化的鼠标单击消息的编号我怎么找,我在MSDN中查找一下好像没有编号,请高手执教,给高分!!!!!!!
      

  3.   

    微软定义的标准消息肯定能在MSDN中找到,比如你说的就是:WM_SYSCOMMAND消息中的
    SC_MAXIMIZE
    窗口最大化
    SC_MINIMIZE
    窗口最小化在Delphi中有很多其他种类消息,不一定能在MSDN中找到的!比如VCL自定义消息。
      

  4.   

    unit Unit1;interfaceuses
      Windows, Messages, Forms;type
      TForm1 = class(TForm)
      private
        { Private declarations }
        procedure wmsyscommand(var msg:Tmessage);message WM_syscommand;  //最小化,最大化...等按钮单击消息
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.wmsyscommand(var msg:Tmessage);
    begin
      case msg.WParam of
           SC_MAXIMIZE :
             begin
               ShowWindow(FindWindow('Shell_TrayWnd',nil),SW_SHOW);
               Form1.Top := 0;
               Form1.Left := 0;
               Form1.Width := GetSystemMetrics(SM_CXSCREEN);
               Form1.Height := GetSystemMetrics(SM_CYSCREEN);
             end;
           else
           inherited;  //响应其他消息  end;
    end;
      

  5.   

    我所问的是用GetMessage或PeekMessage怎样获得消息的Msg,它们在程序的什么地方调用来拦截消息!!!请高手执教!!!给高分!!!
      

  6.   

    GetMessage是从消息队列中取得的,,这个消息队列是由Windows操作系统维护的。在程序的进入点获取然后分发消息的。
      

  7.   

    这是用VC的Win32项目的入口函数WinMain,
    所有的程序,只要是Windows窗口类应用程序,都要有一个WinMain函数,它相当于标准C里面的main,希望能对你有所帮助。int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPTSTR    lpCmdLine,
                         int       nCmdShow)
    {
      MSG msg;
    HACCEL hAccelTable; // 初始化全局字符串
    LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
    LoadString(hInstance, IDC_FIRST, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance);//注册类 // 执行应用程序初始化:
    if (!InitInstance (hInstance, nCmdShow)) 
    {
    return FALSE;
    } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_FIRST); // 主消息循环:
    while (GetMessage(&msg, NULL, 0, 0)) 
    {
    if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
    {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    } return (int) msg.wParam;
    }
      

  8.   

    WM_SYSCOMMAND 
    A window receives this message when the user chooses a command from the window menu (also known as the System menu or Control menu) or when the user chooses the Maximize button or Minimize button.WM_SYSCOMMAND  
    uCmdType = wParam;        // type of system command requested 
    xPos = LOWORD(lParam);    // horizontal postion, in screen coordinates 
    yPos = HIWORD(lParam);    // vertical postion, in screen coordinates