1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| //---------------------------------------------------------------------------
void __fastcall TBeginningCPPMainForm::OpenDialog1Show(TObject *Sender)
{
TRect ParentRect;
_WINDOWS_::GetClientRect(_WINDOWS_::GetParent(OpenDialog1->Handle), &ParentRect);
HWND TmpCheckBox = CreateWindow("BUTTON", "Lecture Seule",
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_MULTILINE,
ParentRect.Width() - 80,
1,
80,
34,
_WINDOWS_::GetParent(OpenDialog1->Handle),
NULL,
HInstance,
NULL);
OpenDialog1->Tag = (int)TmpCheckBox;
}
//---------------------------------------------------------------------------
void __fastcall TBeginningCPPMainForm::Button2Click(TObject *Sender)
{
OpenDialog1->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TBeginningCPPMainForm::OpenDialog1Close(TObject *Sender)
{
if (OpenDialog1->Tag)
{
HWND TmpCheckBox = (HWND)OpenDialog1->Tag;
if (SendMessage(TmpCheckBox, BM_GETCHECK, 0, 0) == BST_CHECKED)
ShowMessage("Coché !");
DestroyWindow(TmpCheckBox);
OpenDialog1->Tag = 0;
}
}
//--------------------------------------------------------------------------- |
Partager