摘抄自文档,其中的函数需要以后花时间看

向 WinMain 添加功能

  1. 首先,在 WinMain 函数内部创建 WNDCLASSEX 类型的窗口类结构。 此结构包含有关窗口的信息,如应用程序图标、窗口的背景色、在标题栏中显示的名称、窗口过程函数的名称等等。典型的 WNDCLASSEX 结构如下:

    1. WNDCLASSEX wcex;
    2.  
    3. wcex.cbSize = sizeof(WNDCLASSEX);
    4. wcex.style = CS_HREDRAW | CS_VREDRAW;
    5. wcex.lpfnWndProc = WndProc;
    6. wcex.cbClsExtra = 0;
    7. wcex.cbWndExtra = 0;
    8. wcex.hInstance = hInstance;
    9. wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    10. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    11. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    12. wcex.lpszMenuName = NULL;
    13. wcex.lpszClassName = szWindowClass;
    14. wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    1. WNDCLASSEX wcex;
    2.  
    3. wcex.cbSize = sizeof(WNDCLASSEX);
    4. wcex.style = CS_HREDRAW | CS_VREDRAW;
    5. wcex.lpfnWndProc = WndProc;
    6. wcex.cbClsExtra = 0;
    7. wcex.cbWndExtra = 0;
    8. wcex.hInstance = hInstance;
    9. wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    10. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    11. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    12. wcex.lpszMenuName = NULL;
    13. wcex.lpszClassName = szWindowClass;
    14. wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));

    有关此结构的字段解释,请参见 WNDCLASSEX

  2. 现在已经创建了窗口类,接下来您必须注册它。使用 RegisterClassEx 函数,并将窗口类结构作为参数传递:

    1. if (!RegisterClassEx(&wcex))
    2. {
    3. MessageBox(NULL,
    4. _T("Call to RegisterClassEx failed!"),
    5. _T("Win32 Guided Tour"),
    6. NULL);
    7.  
    8. return 1;
    9. }
    1. if (!RegisterClassEx(&wcex))
    2. {
    3. MessageBox(NULL,
    4. _T("Call to RegisterClassEx failed!"),
    5. _T("Win32 Guided Tour"),
    6. NULL);
    7.  
    8. return 1;
    9. }
  3. 现在已经注册了您自己的类,接下来创建窗口。使用 CreateWindow 函数,如下所示:

    1. static TCHAR szWindowClass[] = _T("win32app");
    2. static TCHAR szTitle[] = _T("Win32 Guided Tour Application");
    3. // The parameters to CreateWindow explained:
    4. // szWindowClass: the name of the application
    5. // szTitle: the text that appears in the title bar
    6. // WS_OVERLAPPEDWINDOW: the type of window to create
    7. // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    8. // 500, 100: initial size (width, length)
    9. // NULL: the parent of this window
    10. // NULL: this application dows not have a menu bar
    11. // hInstance: the first parameter from WinMain
    12. // NULL: not used in this application
    13. HWND hWnd = CreateWindow(
    14. szWindowClass,
    15. szTitle,
    16. WS_OVERLAPPEDWINDOW,
    17. CW_USEDEFAULT, CW_USEDEFAULT,
    18. 500, 100,
    19. NULL,
    20. NULL,
    21. hInstance,
    22. NULL
    23. );
    24. if (!hWnd)
    25. {
    26. MessageBox(NULL,
    27. _T("Call to CreateWindow failed!"),
    28. _T("Win32 Guided Tour"),
    29. NULL);
    30.  
    31. return 1;
    32. }
    1. static TCHAR szWindowClass[] = _T("win32app");
    2. static TCHAR szTitle[] = _T("Win32 Guided Tour Application");
    3. // The parameters to CreateWindow explained:
    4. // szWindowClass: the name of the application
    5. // szTitle: the text that appears in the title bar
    6. // WS_OVERLAPPEDWINDOW: the type of window to create
    7. // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    8. // 500, 100: initial size (width, length)
    9. // NULL: the parent of this window
    10. // NULL: this application dows not have a menu bar
    11. // hInstance: the first parameter from WinMain
    12. // NULL: not used in this application
    13. HWND hWnd = CreateWindow(
    14. szWindowClass,
    15. szTitle,
    16. WS_OVERLAPPEDWINDOW,
    17. CW_USEDEFAULT, CW_USEDEFAULT,
    18. 500, 100,
    19. NULL,
    20. NULL,
    21. hInstance,
    22. NULL
    23. );
    24. if (!hWnd)
    25. {
    26. MessageBox(NULL,
    27. _T("Call to CreateWindow failed!"),
    28. _T("Win32 Guided Tour"),
    29. NULL);
    30.  
    31. return 1;
    32. }

    此函数返回 HWND,它是某个窗口的句柄。有关更多信息,请参见 Windows 数据类型

  4. 创建了窗口后,我们可以使用以下代码将其显示在屏幕上:

    1. // The parameters to ShowWindow explained:
    2. // hWnd: the value returned from CreateWindow
    3. // nCmdShow: the fourth parameter from WinMain
    4. ShowWindow(hWnd,
    5. nCmdShow);
    6. UpdateWindow(hWnd);
    1. // The parameters to ShowWindow explained:
    2. // hWnd: the value returned from CreateWindow
    3. // nCmdShow: the fourth parameter from WinMain
    4. ShowWindow(hWnd,
    5. nCmdShow);
    6. UpdateWindow(hWnd);

    到目前为止,此窗口还不会显示,因为我们尚未实现 WndProc 函数。

  5. WinMain 的最后一步是消息循环。 此循环的用途是侦听操作系统发送的消息。应用程序收到消息后,将该消息调度到 WndProc 函数,以便进行处理。 消息循环类似于:

     
    以带有颜色区分的格式查看复制到剪贴板打印
    1. MSG msg;
    2. while (GetMessage(&msg, NULL, 0, 0))
    3. {
    4. TranslateMessage(&msg);
    5. DispatchMessage(&msg);
    6. }
    7.  
    8. return (int) msg.wParam;
    1. MSG msg;
    2. while (GetMessage(&msg, NULL, 0, 0))
    3. {
    4. TranslateMessage(&msg);
    5. DispatchMessage(&msg);
    6. }
    7.  
    8. return (int) msg.wParam;

    有关消息循环中使用的结构和函数的更多信息,请参见 MSGGetMessageTranslateMessageDispatchMessage

    您刚才完成的步骤为大多数 Win32 应用程序所共用。有关此应用程序所需要的 include 指令和全局变量声明,请参见本主题末尾的完整代码 示例

    此时, WinMain 函数应该与下面的内容类似:

    1. int WINAPI WinMain(HINSTANCE hInstance,
    2. HINSTANCE hPrevInstance,
    3. LPSTR lpCmdLine,
    4. int nCmdShow)
    5. {
    6. WNDCLASSEX wcex;
    7.  
    8. wcex.cbSize = sizeof(WNDCLASSEX);
    9. wcex.style = CS_HREDRAW | CS_VREDRAW;
    10. wcex.lpfnWndProc = WndProc;
    11. wcex.cbClsExtra = 0;
    12. wcex.cbWndExtra = 0;
    13. wcex.hInstance = hInstance;
    14. wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    15. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    16. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    17. wcex.lpszMenuName = NULL;
    18. wcex.lpszClassName = szWindowClass;
    19. wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    20.  
    21. if (!RegisterClassEx(&wcex))
    22. {
    23. MessageBox(NULL,
    24. _T("Call to RegisterClassEx failed!"),
    25. _T("Win32 Guided Tour"),
    26. NULL);
    27.  
    28. return 1;
    29. }
    30.  
    31. hInst = hInstance; // Store instance handle in our global variable
    32.  
    33. // The parameters to CreateWindow explained:
    34. // szWindowClass: the name of the application
    35. // szTitle: the text that appears in the title bar
    36. // WS_OVERLAPPEDWINDOW: the type of window to create
    37. // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    38. // 500, 100: initial size (width, length)
    39. // NULL: the parent of this window
    40. // NULL: this application dows not have a menu bar
    41. // hInstance: the first parameter from WinMain
    42. // NULL: not used in this application
    43. HWND hWnd = CreateWindow(
    44. szWindowClass,
    45. szTitle,
    46. WS_OVERLAPPEDWINDOW,
    47. CW_USEDEFAULT, CW_USEDEFAULT,
    48. 500, 100,
    49. NULL,
    50. NULL,
    51. hInstance,
    52. NULL
    53. );
    54.  
    55. if (!hWnd)
    56. {
    57. MessageBox(NULL,
    58. _T("Call to CreateWindow failed!"),
    59. _T("Win32 Guided Tour"),
    60. NULL);
    61.  
    62. return 1;
    63. }
    64.  
    65. // The parameters to ShowWindow explained:
    66. // hWnd: the value returned from CreateWindow
    67. // nCmdShow: the fourth parameter from WinMain
    68. ShowWindow(hWnd,
    69. nCmdShow);
    70. UpdateWindow(hWnd);
    71.  
    72. // Main message loop:
    73. MSG msg;
    74. while (GetMessage(&msg, NULL, 0, 0))
    75. {
    76. TranslateMessage(&msg);
    77. DispatchMessage(&msg);
    78. }
    79.  
    80. return (int) msg.wParam;
    81. }
    1. int WINAPI WinMain(HINSTANCE hInstance,
    2. HINSTANCE hPrevInstance,
    3. LPSTR lpCmdLine,
    4. int nCmdShow)
    5. {
    6. WNDCLASSEX wcex;
    7.  
    8. wcex.cbSize = sizeof(WNDCLASSEX);
    9. wcex.style = CS_HREDRAW | CS_VREDRAW;
    10. wcex.lpfnWndProc = WndProc;
    11. wcex.cbClsExtra = 0;
    12. wcex.cbWndExtra = 0;
    13. wcex.hInstance = hInstance;
    14. wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    15. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    16. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    17. wcex.lpszMenuName = NULL;
    18. wcex.lpszClassName = szWindowClass;
    19. wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    20.  
    21. if (!RegisterClassEx(&wcex))
    22. {
    23. MessageBox(NULL,
    24. _T("Call to RegisterClassEx failed!"),
    25. _T("Win32 Guided Tour"),
    26. NULL);
    27.  
    28. return 1;
    29. }
    30.  
    31. hInst = hInstance; // Store instance handle in our global variable
    32.  
    33. // The parameters to CreateWindow explained:
    34. // szWindowClass: the name of the application
    35. // szTitle: the text that appears in the title bar
    36. // WS_OVERLAPPEDWINDOW: the type of window to create
    37. // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    38. // 500, 100: initial size (width, length)
    39. // NULL: the parent of this window
    40. // NULL: this application dows not have a menu bar
    41. // hInstance: the first parameter from WinMain
    42. // NULL: not used in this application
    43. HWND hWnd = CreateWindow(
    44. szWindowClass,
    45. szTitle,
    46. WS_OVERLAPPEDWINDOW,
    47. CW_USEDEFAULT, CW_USEDEFAULT,
    48. 500, 100,
    49. NULL,
    50. NULL,
    51. hInstance,
    52. NULL
    53. );
    54.  
    55. if (!hWnd)
    56. {
    57. MessageBox(NULL,
    58. _T("Call to CreateWindow failed!"),
    59. _T("Win32 Guided Tour"),
    60. NULL);
    61.  
    62. return 1;
    63. }
    64.  
    65. // The parameters to ShowWindow explained:
    66. // hWnd: the value returned from CreateWindow
    67. // nCmdShow: the fourth parameter from WinMain
    68. ShowWindow(hWnd,
    69. nCmdShow);
    70. UpdateWindow(hWnd);
    71.  
    72. // Main message loop:
    73. MSG msg;
    74. while (GetMessage(&msg, NULL, 0, 0))
    75. {
    76. TranslateMessage(&msg);
    77. DispatchMessage(&msg);
    78. }
    79.  
    80. return (int) msg.wParam;
    81. }

向 WndProc 添加功能

  1. WndProc 函数的用途是处理应用程序接收的消息。 通常使用 Switch 函数实现此操作。

    我们将处理的第一个消息是 WM_PAINT 消息。 当必须更新应用程序窗口的一部分时,应用程序会收到此消息。首次创建窗口时,必须更新整个窗口,并传递此消息以指示此操作。

    当处理 WM_PAINT 消息时,首先应做的是调用 BeginPaint,最后应做的是调用 EndPaint。 在这两个函数调用之间,您可以处理所有的逻辑,以在窗口中排列文本、按钮和其他控件。对于此应用程序,我们在窗口中显示字符串“Hello, World!”。若要显示文本,请使用 TextOut 函数,也可以使用drawtext函数如下所示:

    1. PAINTSTRUCT ps;
    2. HDC hdc;
    3. TCHAR greeting[] = _T("Hello, World!");
    4.  
    5. switch (message)
    6. {
    7. case WM_PAINT:
    8. hdc = BeginPaint(hWnd, &ps);
    9.  
    10. // Here your application is laid out.// For this introduction, we just print out "Hello, World!"
    11. // in the top left corner.TextOut(hdc,
    12. 5, 5,
    13. greeting, _tcslen(greeting));
    14. // End application-specific layout section.EndPaint(hWnd, &ps);
    15. break;
    16. }
    1. PAINTSTRUCT ps;
    2. HDC hdc;
    3. TCHAR greeting[] = _T("Hello, World!");
    4.  
    5. switch (message)
    6. {
    7. case WM_PAINT:
    8. hdc = BeginPaint(hWnd, &ps);
    9.  
    10. // Here your application is laid out.// For this introduction, we just print out "Hello, World!"
    11. // in the top left corner.TextOut(hdc,
    12. 5, 5,
    13. greeting, _tcslen(greeting));
    14. // End application-specific layout section.EndPaint(hWnd, &ps);
    15. break;
    16. }
  2. 应用程序通常会处理许多其他消息,如 WM_CREATEWM_DESTROY。 一个简单而完整的 WndProc 函数如下:

    1. LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    2. {
    3. PAINTSTRUCT ps;
    4. HDC hdc;
    5. TCHAR greeting[] = _T("Hello, World!");
    6.  
    7. switch (message)
    8. {
    9. case WM_PAINT:
    10. hdc = BeginPaint(hWnd, &ps);
    11.  
    12. // Here your application is laid out.// For this introduction, we just print out "Hello, World!"
    13. // in the top left corner.TextOut(hdc,
    14. 5, 5,
    15. greeting, _tcslen(greeting));
    16. // End application specific layout section.EndPaint(hWnd, &ps);
    17. break;
    18. case WM_DESTROY:
    19. PostQuitMessage(0);
    20. break;
    21. default:
    22. return DefWindowProc(hWnd, message, wParam, lParam);
    23. break;
    24. }
    25.  
    26. return 0;
    27. }
    28.  
    29. 完整代码:

    #include <windows.h>
    #include <stdlib.h>
    #include <string.h>
    #include <tchar.h>

    // Global variables

    // The main window class name.static TCHAR szWindowClass[] = _T("win32app");

    // The string that appears in the application's title bar.static TCHAR szTitle[] = _T("Win32 Guided Tour Application");

    HINSTANCE hInst;

    // Forward declarations of functions included in this code module:
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

    int WINAPI WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
    {
    WNDCLASSEX wcex;

    wcex.cbSize = sizeof(WNDCLASSEX);
    wcex.style = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc = WndProc;
    wcex.cbClsExtra = 0;
    wcex.cbWndExtra = 0;
    wcex.hInstance = hInstance;
    wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName = NULL;
    wcex.lpszClassName = szWindowClass;
    wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));

    if (!RegisterClassEx(&wcex))
    {
    MessageBox(NULL,
    _T("Call to RegisterClassEx failed!"),
    _T("Win32 Guided Tour"),
    NULL);

    return 1;
    }

    hInst = hInstance; // Store instance handle in our global variable

    // The parameters to CreateWindow explained:
    // szWindowClass: the name of the application
    // szTitle: the text that appears in the title bar
    // WS_OVERLAPPEDWINDOW: the type of window to create
    // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    // 500, 100: initial size (width, length)
    // NULL: the parent of this window
    // NULL: this application does not have a menu bar
    // hInstance: the first parameter from WinMain
    // NULL: not used in this application
    HWND hWnd = CreateWindow(
    szWindowClass,
    szTitle,
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, CW_USEDEFAULT,
    500, 100,
    NULL,
    NULL,
    hInstance,
    NULL
    );

    if (!hWnd)
    {
    MessageBox(NULL,
    _T("Call to CreateWindow failed!"),
    _T("Win32 Guided Tour"),
    NULL);

    return 1;
    }

    // The parameters to ShowWindow explained:
    // hWnd: the value returned from CreateWindow
    // nCmdShow: the fourth parameter from WinMain
    ShowWindow(hWnd,
    nCmdShow);
    UpdateWindow(hWnd);

    // Main message loop:
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }

    return (int) msg.wParam;
    }

    //
    // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
    //
    // PURPOSE: Processes messages for the main window.//
    // WM_PAINT - Paint the main window
    // WM_DESTROY - post a quit message and return
    //
    //
    LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
    PAINTSTRUCT ps;
    HDC hdc;
    TCHAR greeting[] = _T("Hello, World!");

    switch (message)
    {
    case WM_PAINT:
    hdc = BeginPaint(hWnd, &ps);

    // Here your application is laid out.// For this introduction, we just print out "Hello, World!"
    // in the top left corner.TextOut(hdc,
    5, 5,
    greeting, _tcslen(greeting));
    // End application-specific layout section.EndPaint(hWnd, &ps);
    break;
    case WM_DESTROY:
    PostQuitMessage(0);
    break;
    default:
    return DefWindowProc(hWnd, message, wParam, lParam);
    break;
    }

    return 0;
    }

    1.  

win32手动创建windows窗口的,小记的更多相关文章

  1. Direct3D 12 创建windows窗口

    之前列出了计算机图形学的计划,现在开始这一阶段的学习,首先是Windows窗口的创建. 创建windows窗口 环境: 1. Visual Studio 2015 新建项目 创建工程项目完成,确定为窗 ...

  2. 创建windows窗口

    from tkinter import * win=Tk()                                       #创建窗口对象 win.title("我的第一个gu ...

  3. DirectDraw创建Windows窗口

    KWindow.h  KWindow.cpp KDDrawWindow.cpp #define STRICT #define WIN32_LEAN_AND_MEAN #include <wind ...

  4. WTL之手动编写框架窗口

    新版博客已经搭建好了,有问题请访问 htt://www.crazydebug.com 本人是一个实践主义者,不罗嗦上一篇工程搭建好以后,这一篇就开始写代码,写之前再说几句,如果你熟悉MFC分析过MFC ...

  5. win32 api Windows窗口的创建

    windows窗口的创建有以下几个步骤: 1.创建注册窗口类 2.创建窗口句柄 3.显示更新窗口 4.消息循环 1.创建注册窗口类 所谓创建窗口类就是定义一个WNDCLASS类对象,并将该对象进行初始 ...

  6. 使用Win32 API创建不规则形状&带透明色的窗口

    前一阵突然想起了9月份电面某公司实习时的二面题,大概就是说怎么用Win32 API实现一个透明的窗口,估计当时我的脑残答案肯定让面试官哭笑不得吧.所以本人决定好好研究下这个问题.经过一下午的摸索,基本 ...

  7. win32 htmlayout点击按钮创建新窗口,以及按钮图片样式

    最近在做一个C++ win32的桌面图形程序,我不是C++程序员,做这个只是因为最近没什么java的活. windows api,之前接触的时候,还是大学,那时用这个开发打飞机游戏纯粹是娱乐.现在基本 ...

  8. [转]用多线程方法实现在MFC/WIN32中调用OpenGL函数并创建OpenGL窗口

    原文链接: 1.用多线程方法实现在MFC/WIN32中调用OpenGL函数并创建OpenGL窗口 2.Windows MFC 两个OpenGL窗口显示与线程RC问题

  9. WIN32 API ------ 最简单的Windows窗口封装类

    1 开发语言抉择 1.1 关于开发Win32 程序的语言选择 C还是C++ 在决定抛弃MFC,而使用纯Win32 API 开发Window桌面程序之后,还存在一个语言的选择,这就是是否使用C++.C+ ...

随机推荐

  1. windows 7 下找不到 Chart控件问题

    1.网上下载 Microsoft Chart Control, version 6.0 插件 2.注册.由于windows 7 的权限问题注册会失败,因为注册控件需要管理员的权限,在开始菜单的附件下面 ...

  2. Css中常用中文字体的Unicode编码对照

    在网页制作中,最常用的恐怕是字体属性了,在调整页面兼容的时候,也常常发现字体名称的原因导致不兼容或乱码,下面给出几种常用字体的ucicode编码对照,方便使用. 宋体 SimSun \5B8B\4F5 ...

  3. C# winform程序如何打包64位安装程序

    故事背景: 原来在客户电脑上工作的很正常的程序,在客户将其操作系统从32位换为64位之后,出现了不能正常使用的问题. --------------------------- 解决办法: 1:将解决方案 ...

  4. 新策略构思 dual thrust

    根据dual truest的策略,因为是针对日线级别的.同理我们可以根据60分钟级别开发出一套策略,等有时间写在下面

  5. 遇到tomcat端口被占用问题解决方案

    1) 启动Eclipse的Tomcat5.0时,报以下错误: 2)根据以上提示显示:Tomcat Server 的8080端口已经被占用.查看它被哪个占用,方法如下: 3)可以看到占用此端口的PID为 ...

  6. magento jQuery冲突N种方法

    在做修改模板的时候在page中加入jquery库发现原本自带的js冲突 商品无法加入购物车,很多js都没有效果 这是jQuery和magento自带prototype的冲突解决版本有很多种,说个简单点 ...

  7. IOS开发-当遇到tableView整体上移时的解决方案

    方案一在使用了navigationController后,当界面进行跳转往返后,时而会出现tableView上移的情况,通常会自动上移64个像素,那么这种情况,我们可以关闭tableView的自动适配 ...

  8. 深入解析Javascript闭包

    首先给个例子: function PfnOuter(){ var num=999; function PfnInner(){ alert(num); } return PfnInner; } var ...

  9. day15_集合第一天

    1.集合体系 红色为今天所学 Collection                          (接口)|--List                       (接口) 元素有序,可以重复 ...

  10. ThreadPoolExecutor机制探索-我们到底能走多远系列(41)

    我们到底能走多远系列(41) 扯淡: 这一年过的不匆忙,也颇多感受,成长的路上难免弯路,这个世界上没人关心你有没有变强,只有自己时刻提醒自己,不要忘记最初出发的原因. 其实这个世界上比我们聪明的人无数 ...