Pelles C forum

C language => Windows questions => Topic started by: halsten on November 27, 2008, 12:00:02 PM

Title: Sticky Form
Post by: halsten on November 27, 2008, 12:00:02 PM
Hello,

Apparently the form I created in PellesC had became sticky so I can not move it around. Any ideas why that would happen?

Regards,
halsten
Title: Re: Sticky Form
Post by: JohnF on November 27, 2008, 04:50:19 PM
Do you mean a Dialog Box that is your apps window can't be moved? Try to be more concise.

John
Title: Re: Sticky Form
Post by: halsten on November 27, 2008, 08:06:19 PM
Yes, the Dialog Box became sticky and on top most as well. And I didn't write such code for those functions.

Regards,
halsten
Title: Re: Sticky Form
Post by: halsten on November 27, 2008, 08:57:02 PM
Here's the sample.

Regards,
halsten
Title: Re: Sticky Form
Post by: JohnF on November 27, 2008, 10:34:58 PM
If I comment out this, it is not sticky. You should be able to investigate and find the reason.


/*
case WM_SYSCOMMAND:
if (wParam == SC_MINIMIZE) {
MinimizeWndToTray(hwndDlg);
ShowNotifyIcon(g_hInstance, hwndDlg, TRUE);
SetWindowLong(hwndDlg, DWL_MSGRESULT, 0);
return TRUE;
}
return TRUE;
*/


John
Title: Re: Sticky Form
Post by: halsten on November 27, 2008, 11:41:48 PM
Okay, but if you comment those lines the form will still be TOP MOST. Any idea why that happens?

Regards,
halsten
Title: Re: Sticky Form
Post by: Stefan Pendl on November 28, 2008, 08:01:27 AM
Quote from: halsten on November 27, 2008, 11:41:48 PM
Okay, but if you comment those lines the form will still be TOP MOST. Any idea why that happens?
It is a system modal dialog, which is usually used for notifications that must be placed above all other windows.

If this is the main window of your application, remove the modal style too, since this only makes sense for support windows of an application window.

You may wish to take a look at the window styles at MSDN, they are found in the descriptions of CreateWindow and CreateWindowEx, be sure to check the win32 descriptions.
Title: Re: Sticky Form
Post by: halsten on November 28, 2008, 09:25:44 AM
Okay, thanks a lot for your help.

Regards,
halsten