NO

Author Topic: Sticky Form  (Read 5618 times)

halsten

  • Guest
Sticky Form
« 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

JohnF

  • Guest
Re: Sticky Form
« Reply #1 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

halsten

  • Guest
Re: Sticky Form
« Reply #2 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

halsten

  • Guest
Re: Sticky Form
« Reply #3 on: November 27, 2008, 08:57:02 PM »
Here's the sample.

Regards,
halsten

JohnF

  • Guest
Re: Sticky Form
« Reply #4 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.

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

John

halsten

  • Guest
Re: Sticky Form
« Reply #5 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
« Last Edit: November 28, 2008, 12:03:03 AM by halsten »

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Sticky Form
« Reply #6 on: November 28, 2008, 08:01:27 AM »
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.
---
Stefan

Proud member of the UltraDefrag Development Team

halsten

  • Guest
Re: Sticky Form
« Reply #7 on: November 28, 2008, 09:25:44 AM »
Okay, thanks a lot for your help.

Regards,
halsten