- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had posted a message earlier regarding using a combo or an edit box depending on a set of radio buttons selected.Using 2 different boxes solved the problem but I am having problems during the initialization.I am unable to change the visibility options(having the edit box visible sometimes and the combo box visible at other times) when the dialog box first pops up.
The showwindow function works only from the call back routine so i tried explicitly calling the callback routine but it still doesn't work.
Any pointers on this?
--rswy
I had posted a message earlier regarding using a combo or an edit box depending on a set of radio buttons selected.Using 2 different boxes solved the problem but I am having problems during the initialization.I am unable to change the visibility options(having the edit box visible sometimes and the combo box visible at other times) when the dialog box first pops up.
The showwindow function works only from the call back routine so i tried explicitly calling the callback routine but it still doesn't work.
Any pointers on this?
--rswy
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can't use APIs in initialization phase (between DlgInit and DlgModal) due to architecture of DFLOGM. Namely, all APIs expect an existing window , but the dialog (and its controls) is not created prior to DlgModal, and then it's too late since it's modal.
To overcome that, the common trick is to use a special callback, called at dialog's initialization:
Note use of dialog ID. OnDlgInit has normal arguments (Dlg, ID, iEvent) and it's called immediately after the dialog is created but before it's displayed (roughly, imagine that it's called by DlgModal immediately). You can put all additional API stuff initialization there (ShowWindow, change dialog title via SetWindowText, use SendMessage for features not supported via DFLOGM etc.).
XFLOGM has DLG_VISIBLE extension just for that purpose.
Jugoslav
To overcome that, the common trick is to use a special callback, called at dialog's initialization:
EXTERNAL OnDlgInit ... DlgInit(... iSt=DlgSetSub(Dlg,IDD_DIALOG1,OnDlgInit) ... DlgModal(...
Note use of dialog ID. OnDlgInit has normal arguments (Dlg, ID, iEvent) and it's called immediately after the dialog is created but before it's displayed (roughly, imagine that it's called by DlgModal immediately). You can put all additional API stuff initialization there (ShowWindow, change dialog title via SetWindowText, use SendMessage for features not supported via DFLOGM etc.).
XFLOGM has DLG_VISIBLE extension just for that purpose.
Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page