Advertisement

BUTTON control

Started by February 06, 2002 11:57 AM
6 comments, last by Mullvad 22 years, 9 months ago
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
Mullvad
When more questien. What is the easyest why to make a bmp picture as a backgrund insted of a mdichild window.
Mullvad
Advertisement
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
Mullvad
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.
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
Mullvad
Look up BM_GETCHECK. If you send it to the button you can find out if the button is checked, not checked, or indeterminate.

Invader X
Invader''s Realm
Advertisement
How do you use that funktion??
I doesnt understand whats writen in msdn.

Mullvad
Mullvad
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

This topic is closed to new replies.

Advertisement