Why can´t I make my window to stay on top of all apps window

I want my window to stay on top of other applications windows regardless if
PtWindowToFront is called by some other application.

This is what I do:

int main(int argc, char* argv[])
{
PtWidget_t * window;
PtArg_t args[1];

if (( window = PtAppInit(NULL, &argc, argv, 0, NULL)) == NULL)
exit(1);

// Size
PhDim_t dim = {100, 50};
PtSetResource(window, Pt_ARG_DIM, &dim, 0);

// Location
PhPoint_t pos = {200, 100};
PtSetResource(window, Pt_ARG_POS, &pos, 0);

// Force window to be in front
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE,
Ph_WM_FFRONT);
PtSetResource(window, Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);

PtSetArg(&args[0], Pt_ARG_TEXT_STRING, “Press to exit”, 0);
PtCreateWidget(PtButton, window, 1, args);

PtRealizeWidget(window);

PtMainLoop();

return 0;
}

The window still disappears when another applications window comes up. What
is wrong?

Hi,
I Think by using Ph_WM_STATE_ISFRONT bit, you can make it out.

With Best Regards,
Suresh Kumar. Kavula


“Jens Burö” <jensburo@hotmail.com> wrote in message
news:cg1ga5$t5s$1@inn.qnx.com

I want my window to stay on top of other applications windows regardless
if
PtWindowToFront is called by some other application.

This is what I do:

int main(int argc, char* argv[])
{
PtWidget_t * window;
PtArg_t args[1];

if (( window = PtAppInit(NULL, &argc, argv, 0, NULL)) == NULL)
exit(1);

// Size
PhDim_t dim = {100, 50};
PtSetResource(window, Pt_ARG_DIM, &dim, 0);

// Location
PhPoint_t pos = {200, 100};
PtSetResource(window, Pt_ARG_POS, &pos, 0);

// Force window to be in front
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE,
Ph_WM_FFRONT);
PtSetResource(window, Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);

PtSetArg(&args[0], Pt_ARG_TEXT_STRING, “Press to exit”, 0);
PtCreateWidget(PtButton, window, 1, args);

PtRealizeWidget(window);

PtMainLoop();

return 0;
}

The window still disappears when another applications window comes up.
What
is wrong?