Skip to main content

[archive] threads

  • July 24, 2006
  • 2 replies
  • 0 views

[Migrated content. Thread originally posted on 24 July 2006]

Further to my original post regarding independent processes, I have been playing with threads recently in order to implement a 'diary reminder pop-up' process. I have had some success, but have now come to a probelm that I do not understand and cannot solve, so anyone who can help - I need it.

my main program on loading goes something like this

1......display main independent window link to thread modeless (not desroyed ) and in main thread

2......call log-on program (this program displays floating windows that are destroyed before exit)
........cancel log-on program

3......call diary pop-up program handle in thread diary-thread-handle

........the thread (thread 2) is started,the program loads correctly, displays an independent modeless window with link to thread and sits on an accept with before time

4......call menu program (this program display floating windows as required, all destroyed on exit. It also adds a menu bar to the main window which is destroyed on exit)
........loads correctly, allows window change to and from diary pop-up program
........cancels menu program

5......call program selected in the menu program (this program will display an independent window llink to thread modeless) destroys window before exit

........loads correctly, allows window change to and from diary pop-up program
........cancels program selected

6....... call menu program (effectively loops back to 4 above).

.........On the second call to this menu program, as soon as it tries to display a floating window it does it on the diary program window (thread 2) and not on main window in main thread. WHen it creates the menus, these are also on the diary window in thread 2.

I do not know why it loses the focus of the main thread window?

Regards
Keith

2 replies

[Migrated content. Thread originally posted on 24 July 2006]

Further to my original post regarding independent processes, I have been playing with threads recently in order to implement a 'diary reminder pop-up' process. I have had some success, but have now come to a probelm that I do not understand and cannot solve, so anyone who can help - I need it.

my main program on loading goes something like this

1......display main independent window link to thread modeless (not desroyed ) and in main thread

2......call log-on program (this program displays floating windows that are destroyed before exit)
........cancel log-on program

3......call diary pop-up program handle in thread diary-thread-handle

........the thread (thread 2) is started,the program loads correctly, displays an independent modeless window with link to thread and sits on an accept with before time

4......call menu program (this program display floating windows as required, all destroyed on exit. It also adds a menu bar to the main window which is destroyed on exit)
........loads correctly, allows window change to and from diary pop-up program
........cancels menu program

5......call program selected in the menu program (this program will display an independent window llink to thread modeless) destroys window before exit

........loads correctly, allows window change to and from diary pop-up program
........cancels program selected

6....... call menu program (effectively loops back to 4 above).

.........On the second call to this menu program, as soon as it tries to display a floating window it does it on the diary program window (thread 2) and not on main window in main thread. WHen it creates the menus, these are also on the diary window in thread 2.

I do not know why it loses the focus of the main thread window?

Regards
Keith
I have used 'display....... upon main-independent-window handle' to get over the display problems, but the focus is still on the wrong window (i.e. the diary process window in thread 2) and the menus are still being created on this incorrect window - can I change the focus?????? and why has the focus not gone to the correct parent window when the child window in the step 5. above is destroyed?
Regards
Keith

[Migrated content. Thread originally posted on 24 July 2006]

Further to my original post regarding independent processes, I have been playing with threads recently in order to implement a 'diary reminder pop-up' process. I have had some success, but have now come to a probelm that I do not understand and cannot solve, so anyone who can help - I need it.

my main program on loading goes something like this

1......display main independent window link to thread modeless (not desroyed ) and in main thread

2......call log-on program (this program displays floating windows that are destroyed before exit)
........cancel log-on program

3......call diary pop-up program handle in thread diary-thread-handle

........the thread (thread 2) is started,the program loads correctly, displays an independent modeless window with link to thread and sits on an accept with before time

4......call menu program (this program display floating windows as required, all destroyed on exit. It also adds a menu bar to the main window which is destroyed on exit)
........loads correctly, allows window change to and from diary pop-up program
........cancels menu program

5......call program selected in the menu program (this program will display an independent window llink to thread modeless) destroys window before exit

........loads correctly, allows window change to and from diary pop-up program
........cancels program selected

6....... call menu program (effectively loops back to 4 above).

.........On the second call to this menu program, as soon as it tries to display a floating window it does it on the diary program window (thread 2) and not on main window in main thread. WHen it creates the menus, these are also on the diary window in thread 2.

I do not know why it loses the focus of the main thread window?

Regards
Keith
I have used 'display....... upon main-independent-window handle' to get over the display problems, but the focus is still on the wrong window (i.e. the diary process window in thread 2) and the menus are still being created on this incorrect window - can I change the focus?????? and why has the focus not gone to the correct parent window when the child window in the step 5. above is destroyed?
Regards
Keith