Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Hello everyone, I have designed an RPG online game that cannot expand the input  (Read 1004 times)

0 Members and 1 Guest are viewing this topic.

skyddr8511

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Hello everyone, I have designed an RPG online game that cannot expand the input method candidate window in full screen mode. No matter what setting I try, it cannot expand, but it works normally on other engines and can display input method candidate windows. This is my code. Please provide suggestions

void   StartInDrawText(int sX, int sY, uint32 iLen, char* pBuffer, bool bIsHide, int right)
{
        m_InputStatus = TRUE;
        m_iInputX = sX;
        m_iInputY = sY;
        m_pInputBuffer = pBuffer;
        ZeroMemory(m_cEdit, sizeof(m_cEdit));
        m_inputMaxLen = iLen;
        m_iInputX2 = right;
   G_hEditWnd = CreateWindow(RICHEDIT_CLASS, NULL, WS_POPUP | ES_SELFIME, sX - 5, sY - 1, iLen * 12, 16, g_window, (HMENU)0, g_instance, NULL);

        SetWindowText(G_hEditWnd, m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_EXLIMITTEXT, 0, iLen - 1);
        SendMessage(G_hEditWnd, EM_SETLANGOPTIONS, 0, ~IMF_AUTOFONT);
        COMPOSITIONFORM composform;
        composform.dwStyle = CFS_POINT;
        composform.ptCurrentPos.x = sX;
        composform.ptCurrentPos.y = sY;
        HIMC hImc = ImmGetContext(g_window);
        ImmSetCompositionWindow(hImc, &composform);
        int StrLen = strlen(m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_SETSEL, StrLen, StrLen);

 
}

skyddr8511

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Hello everyone, I have designed an RPG online game that cannot expand the input method candidate window in full screen mode. No matter what setting I try, it cannot expand, but it works normally on other engines and can display input method candidate windows. This is my code. Please provide suggestions

void   StartInDrawText(int sX, int sY, uint32 iLen, char* pBuffer, bool bIsHide, int right)
{
        m_InputStatus = TRUE;
        m_iInputX = sX;
        m_iInputY = sY;
        m_pInputBuffer = pBuffer;
        ZeroMemory(m_cEdit, sizeof(m_cEdit));
        m_inputMaxLen = iLen;
        m_iInputX2 = right;
   G_hEditWnd = CreateWindow(RICHEDIT_CLASS, NULL, WS_POPUP | ES_SELFIME, sX - 5, sY - 1, iLen * 12, 16, g_window, (HMENU)0, g_instance, NULL);

        SetWindowText(G_hEditWnd, m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_EXLIMITTEXT, 0, iLen - 1);
        SendMessage(G_hEditWnd, EM_SETLANGOPTIONS, 0, ~IMF_AUTOFONT);
        COMPOSITIONFORM composform;
        composform.dwStyle = CFS_POINT;
        composform.ptCurrentPos.x = sX;
        composform.ptCurrentPos.y = sY;
        HIMC hImc = ImmGetContext(g_window);
        ImmSetCompositionWindow(hImc, &composform);
        int StrLen = strlen(m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_SETSEL, StrLen, StrLen);

 
}


I tried, SetWindowPos(G_hEditWnd, HWND_TOPMOST, sX - 5, sY - 1, iLen * 12, 16, SWP_NOACTIVATE);
I have also tried GPT's answer, but it cannot solve the problem. The input method is still blocked by the SFML game window. Request assistance.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11038
    • View Profile
    • development blog
    • Email
I assume you mean IME.
SFML doesn't really provide any specific support for IME and as I've never worked with it, I can't really give you more insights either.

If possible can you describe the problem a bit more? "cannot expand" isn't very descript and I'm not sure what it means exactly.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

skyddr8511

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
For example, in the game shown in the image, which uses the ddraw engine, the smart input method's candidate window is not blocked. What is the reason for this? How can this issue be resolved? Thank you for your reply. I may have described the issue incorrectly earlier. In full-screen mode, the smart input method cannot display the candidate window because it is blocked by SFML.

skyddr8511

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
 I have tried modifying the SFML window DLL source code to create the window, force the window to be at the bottom, and adjust the window layer, but the issue still persists and cannot be resolved.
   
Quote
    m_handle = CreateWindowEx(NULL,className, title.toWideString().c_str(), WS_POPUP, left, top, width, height, NULL, NULL, GetModuleHandle(NULL), NULL);
   SetWindowPos(m_handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
@eXpl0it3r
« Last Edit: November 28, 2024, 06:05:32 pm by skyddr8511 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11038
    • View Profile
    • development blog
    • Email
As said, I don't know anything about IME, so won't be able to help you much with it.
You might find more knowable people on StackOverflow or similar.

You could try and see if it makes a difference if you provide the SFML window as parent window to the one you're creating.
You can get the native handle from an SFML window with getSystemHandle()
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/