Don Carlson
New Member
I am having a problem trying to restore a minimized window. I am using V9.1c on Win2K, regular GUI programs (not SO's). I have read similar posts on this site regarding this same problem, and have tried to implement the posted solutions, but have been unable to make it happen!
Here's the scenario: I have a menu program to runs child programs persistently. The user can return to the menu and run any number of programs, each of which opens in it's own window. If the user tries to run a program that is already running persistently, I run an internal procedure in the child program called ApplyEntry. Works great if the window has not been minimized. If it is minimized, nothing happens.
Originally, my ApplyEntry procedure looked like this
APPLY "entry" to mywidget in FRAME {&FRAME-NAME}.
Works great if the window has not been minimized.
So, I changed it to this:
DEFINE VARIABLE lv_lReturnCode AS LOGICAL NO-UNDO.
DEFINE VARIABLE hWindow AS HANDLE NO-UNDO.
ASSIGN hWindow = THIS-PROCEDURE:CURRENT-WINDOW.
ASSIGN hWindow:WINDOW-STATE = 3.
lv_lReturnCode = hWindow:MOVE-TO-TOP().
ASSIGN CURRENT-WINDOW = hWindow
THIS-PROCEDURE:CURRENT-WINDOW = hWindow.
APPLY "entry" TO mywidget IN FRAME {&frame-name}.
By itself this doesn't work. If I put a MESSAGE statement before the DEFINE statements, it works great!
Anybody out there got any ideas????
Thanks in advance!
Don Carlson, Programmer
Computer Software Associates, Inc.
Here's the scenario: I have a menu program to runs child programs persistently. The user can return to the menu and run any number of programs, each of which opens in it's own window. If the user tries to run a program that is already running persistently, I run an internal procedure in the child program called ApplyEntry. Works great if the window has not been minimized. If it is minimized, nothing happens.
Originally, my ApplyEntry procedure looked like this
APPLY "entry" to mywidget in FRAME {&FRAME-NAME}.
Works great if the window has not been minimized.
So, I changed it to this:
DEFINE VARIABLE lv_lReturnCode AS LOGICAL NO-UNDO.
DEFINE VARIABLE hWindow AS HANDLE NO-UNDO.
ASSIGN hWindow = THIS-PROCEDURE:CURRENT-WINDOW.
ASSIGN hWindow:WINDOW-STATE = 3.
lv_lReturnCode = hWindow:MOVE-TO-TOP().
ASSIGN CURRENT-WINDOW = hWindow
THIS-PROCEDURE:CURRENT-WINDOW = hWindow.
APPLY "entry" TO mywidget IN FRAME {&frame-name}.
By itself this doesn't work. If I put a MESSAGE statement before the DEFINE statements, it works great!
Anybody out there got any ideas????
Thanks in advance!
Don Carlson, Programmer
Computer Software Associates, Inc.