Home > Back-end >  WinAPI child Windows add EDIT control problem, ask for help!
WinAPI child Windows add EDIT control problem, ask for help!

Time:10-20

Written in the Windows API interface, in a child window (hData) add an Edit control (hEdit), after the success to add, Edit controls but Edit controls can be selected, neither nor can edit the text , solving the reason, thank you!
The following is part of the child window and Edit code, error-free compiled through,


BOOL CreateDataWindow (HINSTANCE HINSTANCE)
{
//hData already in the previous statement;
If (hData!=NULL)
{
MessageBox (hData, TEXT (" You have already open these Windows "), TEXT (" Warnning "), MB_OK);
The BringWindowToTop (hData);
return FALSE;
}
hData=https://bbs.csdn.net/topics/CreateWindowEx (WS_EX_APPWINDOW,//"Origin" is a registered Win Calss
The TEXT (" Origin "),
The TEXT (" DataInput "),
WS_CAPTION | WS_SYSMENU | WS_CLIPSIBLINGS | WS_CHILD | WS_CLIPSIBLINGS,
300, 0,
500600,
HMain,
HMENU IDD_MAIN,
Hinstance,
(LPVOID) NULL);
If (hData=https://bbs.csdn.net/topics/=NULL)
return FALSE;
ShowWindow (hData, SW_SHOW);
The BringWindowToTop (hData);

//add controls,
{
LPTSTR lpszTrouble=TEXT (" the When in the Course of human Events ");


HWND hEdit=CreateWindow (WC_EDIT,
NULL,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER |
ES_RIGHT | ES_AUTOHSCROLL | ES_AUTOVSCROLL,
180200300, 50,
HData,
(HMENU) 106,
Hinst,
(LPVOID) NULL
);
If (hEdit==NULL)
return FALSE;
SendMessage (hEdit WM_SETTEXT, 0,
(LPARAM) lpszTrouble);


}
return TRUE;

}

CodePudding user response:

To a great god help me,,,,

CodePudding user response:

I with you to create edit code test, the generated edit is normal, is focused and can be right to left input,
Problems should be the CreateWindowEx created this hData form, oneself excluded under

CodePudding user response:

refer to the second floor sololie response:
edit code to test, I will create in you generate the edit is normal, is focused and can be right to left input,
Problems should be the CreateWindowEx created this hData form, oneself excluded under

First of all, thank you, my hData window is a child window, I will edit controls parent window is set to give priority to the window, edit display is normal, but it is generated to hData will be a problem, and will not choose to edit, will hData attribute is set to and will be unable to edit the main window and attributes, and seek counsel,,

CodePudding user response:

Help ah,,,
  • Related