SFML community forums

Help => Window => Topic started by: skyddr8511 on November 24, 2024, 02:18:40 pm

Title: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: skyddr8511 on November 24, 2024, 02:18:40 pm
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);

 
}
Title: Re: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: skyddr8511 on November 24, 2024, 02:22:04 pm
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.
Title: Re: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: eXpl0it3r on November 28, 2024, 02:04:09 pm
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.
Title: Re: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: skyddr8511 on November 28, 2024, 05:59:18 pm
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.
Title: Re: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: skyddr8511 on November 28, 2024, 06:00:32 pm
 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
Title: Re: Hello everyone, I have designed an RPG online game that cannot expand the input
Post by: eXpl0it3r on November 29, 2024, 10:06:36 am
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()