George McCoy
2004-04-24 13:51:06 UTC
I'm writing DDT apps with the latest version of powerbasic for windows.
Two things puzzle me.
How do I make the focus stay on the control where the user leaves it when
minimizing the dialog? I have a little address book, based on the
Powerbasic sample. The screen has a series of labels and textboxes. The
first of these contains the person's first name. If I move to a different
textbox, the company name, for example, and then I minimize the app; when I
return to it the focus returns to the first name textbox. How can I prevent
this? I got close once by storing the value of cbctl when the wm_command
message is received, then setting focus when the wm_setfocus message is
received. I think the focus sets where I want it and then the dialog
receives another windows message that puts it right back to the top of the
dialog. I believe the decimal value of this offending message is 309.
Can anyone suggest anything or show me where I can find an example?
I have a little text editor. It's a richedit control in a ddt dialog box.
When User closes the app, I'd like to ask if he really wants to quit, using
the msgbox() function. I can get the message to appear if I trap either the
wm_close or wm_destroy message but I don't know how to abort the close if
User clicks the no button in my message box. How is this done?
Thanks very much for any suggestions on these items.
George
Two things puzzle me.
How do I make the focus stay on the control where the user leaves it when
minimizing the dialog? I have a little address book, based on the
Powerbasic sample. The screen has a series of labels and textboxes. The
first of these contains the person's first name. If I move to a different
textbox, the company name, for example, and then I minimize the app; when I
return to it the focus returns to the first name textbox. How can I prevent
this? I got close once by storing the value of cbctl when the wm_command
message is received, then setting focus when the wm_setfocus message is
received. I think the focus sets where I want it and then the dialog
receives another windows message that puts it right back to the top of the
dialog. I believe the decimal value of this offending message is 309.
Can anyone suggest anything or show me where I can find an example?
I have a little text editor. It's a richedit control in a ddt dialog box.
When User closes the app, I'd like to ask if he really wants to quit, using
the msgbox() function. I can get the message to appear if I trap either the
wm_close or wm_destroy message but I don't know how to abort the close if
User clicks the no button in my message box. How is this done?
Thanks very much for any suggestions on these items.
George