ShowWindow
-
My minimized program doesn't display when an alarmfunction in the program call ShowWindow(hwnd, SW_MAXIMIZE); What's mising?:confused:
-
My minimized program doesn't display when an alarmfunction in the program call ShowWindow(hwnd, SW_MAXIMIZE); What's mising?:confused:
-
could you be more explicit ? maybe you should try
ShowWindow(hwnd,SW_SHOW)?
"Go as far as you can see,and when you get there you'll see further" - Unknown
I have done a windows prg with an alarm function (checking date and time), then i minimize the prg with the MINIMIZEBOX and the prg should activate and display the window at correct time and date, but it doesnt.t work, I have tried all kind of ShowWindod codes, i think there is something else i'm missing.
-
I have done a windows prg with an alarm function (checking date and time), then i minimize the prg with the MINIMIZEBOX and the prg should activate and display the window at correct time and date, but it doesnt.t work, I have tried all kind of ShowWindod codes, i think there is something else i'm missing.
-
can you show the code ?
"Go as far as you can see,and when you get there you'll see further" - Unknown
void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.
-
void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.
i think the problem is no in the
ShowWindow(..)
function, i'd suggest you to replace it with simpleMessageBox("")
function just to check that these functionsalarmchecknotesamling(..) , getTime(..)
are correctly implemented.void checkalarm()
{
getTime(date);
if (notesamling.alarmchecknotesamling (date))
{
MessageBox("Whatever");
}
}
"Go as far as you can see,and when you get there you'll see further" - Unknown
-
i think the problem is no in the
ShowWindow(..)
function, i'd suggest you to replace it with simpleMessageBox("")
function just to check that these functionsalarmchecknotesamling(..) , getTime(..)
are correctly implemented.void checkalarm()
{
getTime(date);
if (notesamling.alarmchecknotesamling (date))
{
MessageBox("Whatever");
}
}
"Go as far as you can see,and when you get there you'll see further" - Unknown
I have already tried that and it don't work. But the functions work when the prg window is active and displayed. Isn't true that the prg still working in minimized mode or is there any difference.
-
I have already tried that and it don't work. But the functions work when the prg window is active and displayed. Isn't true that the prg still working in minimized mode or is there any difference.
leifmikael wrote: Isn't true that the prg still working in minimized mode or is there any difference. Yes program will be working in minized Mode, instead of
SW_SHOW
trySW_RESTORE
."Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.
leifmikael wrote: ShowWindow(hwnd, SW_SHOW);} Is
hwnd
is global variable?. Have you checkhwnd
hold the valid value? TryIsWindow()
function to check wheatherhwnd
point to valid window or not"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
leifmikael wrote: ShowWindow(hwnd, SW_SHOW);} Is
hwnd
is global variable?. Have you checkhwnd
hold the valid value? TryIsWindow()
function to check wheatherhwnd
point to valid window or not"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
The problem was in the messages handling, i belive. I changed to PeekMessage from GetMessage. is this Ok? while (true) { if(PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&message); DispatchMessage(&message); } checkalarm(); // func.to check if the window is to restore } return message.wParam; } return message.wParam; }