What do I need to effectively create gdiplus application under Windows.

Wojciech Sobiesiak 96 Reputation points
2023-04-22T14:13:49.19+00:00

What do I need to effectively create gdiplus application under Windows (I have pure dev c++ 6.3)? What to install and where? I need to use "gdiplusgraphics.h and gdiplus.h" to fill windows with color and display editable text on them. I found "WM_CTLCOLOREDIT" option but it completly destroys edit options, no visible cursor when move it overwrite items next to the place where letter should be. /now it display in wright way but blinks/

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,738 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Castorix31 85,371 Reputation points
    2023-04-22T14:58:48.4166667+00:00

    to fill windows with color and display editable text on them. I found "WM_CTLCOLOREDIT" ...

    You must return a Brush handle in WM_CTLCOLOREDIT (where you can set SetTextColor & SetBkColor) User's image

    or RichEdit control with WS_EX_TRANSPARENT for real transparency : User's image


  2. Wojciech Sobiesiak 96 Reputation points
    2023-04-22T19:09:58.0166667+00:00

    111111

    0 comments No comments

  3. Wojciech Sobiesiak 96 Reputation points
    2023-04-22T21:47:47.7233333+00:00
    	while(GetMessage(&msg, NULL, 0, 0) > 0) { 
    
    		TranslateMessage(&msg);
    
    	
    		DispatchMessage(&msg); 
    
    if(msg.message==WM_KEYDOWN && msg.wParam==VK_BACK){
    
    
    RECT a={0,0,300,300};
    
    InvalidateRect(okna_plikowe[0],&a,FALSE);
    
     }
    	}
    
    xD xD xD
    
    0 comments No comments

  4. Minxin Yu 11,756 Reputation points Microsoft Vendor
    2023-04-26T05:36:19.3133333+00:00

    Hi, @Wojciech Sobiesiak I noticed you are using dev c++ 6.3. Will the code work fine in VS2022?

    Use hide and show to refresh editbox content

        case WM_CREATE:
        {HWND textfield = CreateWindow(L"EDIT", L"Editable Text!", WS_CHILD | WS_VISIBLE | WS_VSCROLL |
            ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL|WS_BORDER, 500, 100, 300, 300, hWnd, (HMENU)ID, NULL, NULL); }
        break;
        case WM_CTLCOLOREDIT:
            SetBkMode((HDC)wParam, TRANSPARENT);
            return (LRESULT)GetStockObject(NULL_BRUSH);
    
    
    case WM_COMMAND:
            {
            if (HIWORD(wParam) == EN_CHANGE)
            {
                ShowWindow(HWND(lParam), SW_HIDE);
                ShowWindow(HWND(lParam), SW_SHOW);
                SetFocus(HWND(lParam));
            }
    

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.