zoukankan      html  css  js  c++  java
  • Win32 API (2012/11/4)

    一.HiliteMenuItem

    The HiliteMenuItem function highlights or removes the highlighting from an item in a menu bar.

    image

    就是这种状态

    Menu API的设计原则都是父项负责对子项的操作

    二.菜单状态

    UINT uState=pSubMenu->GetMenuState(ID_TEST_MENU,MF_BYCOMMAND);
    BOOL bChecked= uState&MF_CHECKED;
    

    从这张表可以看到菜单所有的状态

    image

    三.GetDC和GetWindowDC的区别

    • The GetWindowDC function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.
    • The GetDC function retrieves a handle to a display device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC.
    • The GetDCEx function retrieves a handle to a display device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC.

      This function is an extension to the GetDC function, which gives an application more control over how and whether clipping occurs in the client area.

    四.WM_ACTIVATE 消息

    The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.

    参考:

    http://www.cnblogs.com/afarmer/archive/2009/12/21/1629329.html

    五.MapWindowPoints

    可以用于计算相对两个窗口之间的坐标距离的计算和转换ClientToScreen

    http://blog.csdn.net/fengbangyue/article/details/5617778

    六.ExtCreatePen

    Ext代表Extension扩展的意思,属于CreatePen的加强版,属于C语言函数没有C++语法扩展所特有的函数名特征

    image

    七.GetWindowPlacement && SetWindowPlacement

    The GetWindowPlacement function retrieves the show state and the restored, minimized, and maximized positions of the specified window.

    image

    WINDOWPLACEMENT placement={0};
    placement.length=sizeof(WINDOWPLACEMENT);
    GetWindowPlacement(&placement);
    placement.rcNormalPosition.left=1;
    SetWindowPlacement(&placement);
    

    八.ShowOwnedPopups

    The ShowOwnedPopups function shows or hides all pop-up windows owned by the specified window.

    Remarks

    ShowOwnedPopups shows only windows hidden by a previous call to ShowOwnedPopups. For example, if a pop-up window is hidden by using the ShowWindow function, subsequently calling ShowOwnedPopups with the fShow parameter set to TRUE does not cause the window to be shown.

  • 相关阅读:
    java中 this和super的差别
    Servlet对文件的读写操作
    Android通过反射打造能够存储不论什么对象的万能SharedPreferences
    Solr5.3.1 SolrJ查询索引结果
    spring mvc form表单提交乱码
    多表利用DIH批量导入数据并建立索引注意事项
    【转】Solr从数据库导入数据(DIH)
    【转】solr+ajax智能拼音详解---solr跨域请求
    跨域请求获取Solr json检索结果并高亮显示
    Solr5.3.1通过copyField设置多个field(字段)同时检索
  • 原文地址:https://www.cnblogs.com/Clingingboy/p/2753464.html
Copyright © 2011-2022 走看看