Hi all,
I am writing a utility app which has a parent window and a child editbox window.
For educational purposes I have written the whole thing from ground up.
I have something like :
class myparentclass
{ public:
blah blah....
private:
class EDITBOX *myeditbox;
blah blah....
};
as my parent class header.
My editbox is created as follows :
edithwnd = CreateWindowEx ( WS_EX_CLIENTEDGE,"edit",text,
WS_CHILD|WS_DISABLED|WS_BORDER,
x, y, w, h,parent,
(HMENU)ID_EDITBOX,dllinstance,
NULL
);
(Initially created disabled and invisible)
This all works as planned until I realised that I didn't want the user messing around with the app. while the editbox
was active.
I first of all tried EnableWindow(parenthwnd,FALSE);
only to discover that this also disables the editbox window
(because it's a child ??).
Next, I tried to hook the WM_ENABLE message sent following the EnableWindow() call in order to force the editbox to be enabled but this didn't work either.
Finally, I tried changing the editbox type to WS_POPUP but this caused a UAE (probably because of some difference in the window styles that I am unaware of).
I feel that I'm missing the obvious here - can anyone shed some light on how to make an editbox modal ?
Thanks.
I am writing a utility app which has a parent window and a child editbox window.
For educational purposes I have written the whole thing from ground up.
I have something like :
class myparentclass
{ public:
blah blah....
private:
class EDITBOX *myeditbox;
blah blah....
};
as my parent class header.
My editbox is created as follows :
edithwnd = CreateWindowEx ( WS_EX_CLIENTEDGE,"edit",text,
WS_CHILD|WS_DISABLED|WS_BORDER,
x, y, w, h,parent,
(HMENU)ID_EDITBOX,dllinstance,
NULL
);
(Initially created disabled and invisible)
This all works as planned until I realised that I didn't want the user messing around with the app. while the editbox
was active.
I first of all tried EnableWindow(parenthwnd,FALSE);
only to discover that this also disables the editbox window
(because it's a child ??).
Next, I tried to hook the WM_ENABLE message sent following the EnableWindow() call in order to force the editbox to be enabled but this didn't work either.
Finally, I tried changing the editbox type to WS_POPUP but this caused a UAE (probably because of some difference in the window styles that I am unaware of).
I feel that I'm missing the obvious here - can anyone shed some light on how to make an editbox modal ?
Thanks.