Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help without ATL or MFC Pin
TheGreatAndPowerfulOz21-Dec-05 9:46
TheGreatAndPowerfulOz21-Dec-05 9:46 
Questiondisassembly Pin
devvvy20-Dec-05 17:23
devvvy20-Dec-05 17:23 
AnswerRe: disassembly Pin
The NULL Developer21-Dec-05 0:20
professionalThe NULL Developer21-Dec-05 0:20 
GeneralRe: disassembly Pin
devvvy21-Dec-05 16:02
devvvy21-Dec-05 16:02 
GeneralRe: disassembly Pin
devvvy21-Dec-05 16:27
devvvy21-Dec-05 16:27 
QuestionHooking Explorer.exe Pin
ragavan20-Dec-05 17:19
ragavan20-Dec-05 17:19 
QuestionCListCtrl display long text problem. Pin
Zyraph20-Dec-05 16:29
Zyraph20-Dec-05 16:29 
QuestionModeless Property Sheet (Win32) Pin
VeRtRX20-Dec-05 8:22
VeRtRX20-Dec-05 8:22 
Hi,

I am trying to get a modeless property sheet running.
I am using the PropertySheet() function to start the property sheet + also add PSH_MODELESS to make it a modeless dialog.

I am receiving the return value of the PropertySheet() function to get the propsheet window handle.
I think this all works fine. The dialog appears and the tabs which are in look okay as well. The thing now is that it cannot be closed anymore correctly or behaves weird.

The strange thing with the property sheet is that there is no way to pass a Message Proc to the property sheet (as far as i have seen), so i had to put some message loop myself after creating the dialog. This is how it looks:

<code>
MSG Msg;
while(GetMessage(&Msg, NULL, 0, 0))
{
if(!IsDialogMessage(mainHwnd, &Msg))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);

HWND pageHandle = PropSheet_GetCurrentPageHwnd(mainHwnd);
if (pageHandle == NULL || (Msg.message == WM_COMMAND && Msg.wParam == IDCANCEL))
{
for (int i=0; i<mPropertySheets.GetLength(); ++i)
PropSheet_RemovePage(mainHwnd, 0, NULL);

EndDialog(mainHwnd, 1);

break;
}
}
}
</code>

If i don't put the "if (pageHandle == NULL..." in then i am not able to close the modeless dialog Frown | :( And if i put that in it sometimes works and sometimes i have to press the "OK" button 10 times till it recognizes it.


I hope anyone can help me. I would appreciate it a lot!

Thanks in advance for your time.

- Benjamin
Questionreceiving windows messages Pin
Roy K20-Dec-05 8:18
Roy K20-Dec-05 8:18 
GeneralRe: receiving windows messages Pin
Ward20-Dec-05 9:44
Ward20-Dec-05 9:44 
GeneralRe: receiving windows messages Pin
Roy K20-Dec-05 13:10
Roy K20-Dec-05 13:10 
AnswerRe: receiving windows messages Pin
Ward20-Dec-05 19:51
Ward20-Dec-05 19:51 
QuestionRe: receiving windows messages Pin
David Crow20-Dec-05 10:16
David Crow20-Dec-05 10:16 
QuestionCSliderCtrl - dotted focus rect Pin
AJ12320-Dec-05 7:32
AJ12320-Dec-05 7:32 
AnswerRe: CSliderCtrl - dotted focus rect Pin
0verflow14-Oct-12 20:21
0verflow14-Oct-12 20:21 
QuestionHome-grown tooltip window Pin
#realJSOP20-Dec-05 7:14
mve#realJSOP20-Dec-05 7:14 
AnswerRe: Home-grown tooltip window Pin
PJ Arends20-Dec-05 7:36
professionalPJ Arends20-Dec-05 7:36 
QuestionGetSysColor Weirdness Pin
#realJSOP20-Dec-05 6:59
mve#realJSOP20-Dec-05 6:59 
AnswerRe: GetSysColor Weirdness Pin
Jack Puppy20-Dec-05 7:20
Jack Puppy20-Dec-05 7:20 
GeneralRe: GetSysColor Weirdness Pin
#realJSOP20-Dec-05 7:58
mve#realJSOP20-Dec-05 7:58 
GeneralRe: GetSysColor Weirdness Pin
PJ Arends20-Dec-05 8:15
professionalPJ Arends20-Dec-05 8:15 
GeneralRe: GetSysColor Weirdness Pin
#realJSOP20-Dec-05 10:37
mve#realJSOP20-Dec-05 10:37 
QuestionCTreeCtrl Pin
Ivan Cachicatari20-Dec-05 6:39
Ivan Cachicatari20-Dec-05 6:39 
AnswerRe: CTreeCtrl Pin
RChin20-Dec-05 9:54
RChin20-Dec-05 9:54 
AnswerRe: CTreeCtrl Pin
Jack Puppy20-Dec-05 10:46
Jack Puppy20-Dec-05 10:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.