locked
Any Changes in EditBox between win10 1607 and win10 1903? RRS feed

  • Question

  • I have a Windows EditBox which allows to input 2 digits  in Win10 1607. However, after the OS is upgraded to 1903, for the same source code, only 1 digit can be input.  What changes have 1903 made to have such a difference?

    (if I change 35 to 36, it can allow to input 2 digits on 1903 though)

    #include<Windows.h>
    #include<imm.h>
    #include"resource.h"

    #define ID_TIMER 1
    TCHAR szAppName[] = TEXT("MenuDemo");

    LRESULT CALLBACK WndProc(HWND , UINT, WPARAM , LPARAM );
    HINSTANCE hInst;
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInstance, PSTR szCmdLine, int iCmdShow) {
    HWND hwnd;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc = WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wndclass.lpszMenuName = szAppName;
    wndclass.lpszClassName = szAppName;
    if (!RegisterClass(&wndclass)) {
    return 0;
    }
    hwnd = CreateWindow(szAppName, TEXT("Menu Demonstration"), WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, CW_USEDEFAULT,
    CW_USEDEFAULT, CW_USEDEFAULT,
    NULL, NULL, hInstance, NULL);
    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);
    while (GetMessage(&msg, NULL, 0, 0)) {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    return msg.wParam;
    }
    static void  at_InitBirth(HWND hWnd)
    {
    HWND demoHwnd;
    HFONT hFont;
    demoHwnd= CreateWindowEx(WS_EX_CLIENTEDGE,
    L"EDIT",
    NULL,
    WS_CHILD | WS_VISIBLE
    | WS_BORDER | ES_NUMBER | ES_RIGHT, 
    30,
    30,
    35,    // 36
    32,
    hWnd,
    (HMENU)1,
    hInst,
    NULL);
    hFont = CreateFont((int)22,                        
    0,                                   
    0,                                 
    0,                              
    900,                                     
    0,                                  
    0,                                 
    0,                                 
    SHIFTJIS_CHARSET,                  
    OUT_DEFAULT_PRECIS,                 
    CLIP_DEFAULT_PRECIS,                
    DEFAULT_QUALITY,                                 
    DEFAULT_PITCH | FF_DONTCARE,        
    L"MS PGothic");              
    SendMessage(demoHwnd, WM_SETFONT,
    (WPARAM)hFont, FALSE);
    SendMessage(demoHwnd,
    EM_LIMITTEXT, 2, 0);
    }
    LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
    static HMENU hMenuMain, hMenuEdit, hMenuFile;
    HINSTANCE hInstance;
    switch (message) {
    case WM_CREATE:
    at_InitBirth(hwnd);
    return 0;
    case WM_COMMAND:
    break;
    case WM_DESTROY:
    PostQuitMessage(0);
    return 0;
    }
    return DefWindowProc(hwnd, message, wParam, lParam);
    }

    Tuesday, December 29, 2020 6:42 AM

All replies

  • forum migrated to mentioned below forum 

    https://docs.microsoft.com/en-us/answers/index.html

    please marked as answer if issue resolved

    Tuesday, December 29, 2020 9:21 AM