Archived

This topic is now archived and is closed to further replies.

Mullvad

BUTTON control

Recommended Posts

Mullvad    122
Tja. My problem is I have created a window with a mdi child in it and now I want a Button on the mdi child. Heres the code I am using. hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "Start", BS_CENTER | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP, 0, 0, 75, 50, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL); if(hEdit == NULL) MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR); Why does the MessageBox come up when I start the program in stead of creating a button. I just get my mdi window up. PS. If you wondring so have I made this Button creation from a EDIT control creation thats why the name is hEdit but I thought it doesnt matter right? Mullvad

Share this post


Link to post
Share on other sites
Mullvad    122
When more questien. What is the easyest why to make a bmp picture as a backgrund insted of a mdichild window.
And how do you do so you get the code in color when you want it in the massages.

Mullvad

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Hi Mullvad, I think you would get far more replies if you can better illustrate the issues...no offense pls, it''s just my POV.

Share this post


Link to post
Share on other sites
Mullvad    122
I know what you mean but I doesnt have the problem above anymore I have fixed it. But I have an other problem. If you have a
RadioButton on a dialogbox and you want a text to come up when you presses the ok button. How shell I do. Now I want answer how you do it in API borland c++. I am tring to use a case but I dont know what to write like

case IDC_RADIOBUTTON1:
Messagebox(hwnd and everything else.

please help

Mullvad

Share this post


Link to post
Share on other sites
Colin Jeanne    1114
Using SendMessage() you send BM_GETCHECK like so:

LRESULT State;

State = SendMessage(your_buttons_hwnd , BM_GETCHECK, 0, 0);

Then you can see if State is equal to one of the button states as described on MSDN when you look up BM_GETCHECK.

NB: This is for radio buttons, check boxes, or 3State buttons. You said that you wanted to know the state of a radio button in a dialog and that is what this code applies to, NOT the original code in the first post of this thread.

Invader X
Invader''s Realm

Share this post


Link to post
Share on other sites