No announcement yet.

how to autolaunch a subroutine at the opening of a DDT?

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to autolaunch a subroutine at the opening of a DDT?

    Hi all friends

    I would like to launch a subroutine or function whenever a DDT program got started, how to do this?

    can we call that routine in the CASE %WM_INITDIALOG of the CALLBACK FUNCTION dlgproc()
    or kinda something like that?

  • #2
    DIALOG POST CB.HNDL, %WM_USER + 500, 0, 0

    CASE %WM_USER + 500
    'routine instead of google


    • #3
      WM_INITDIALOG occurs before the dialog is shown and is the spot you want.
      • If it is a quick subroutine (< 1 second) then it's perfect place to run directly from WM_INITDIALOG (think setting up initial variables, etc.)
      • If it will take a few seconds (1-3) then the method suggested by Mike Doty could work (think loading a small database)
      • If the routine may take long (>3 seconds) then you might want to start the routine as it's own thread from WM_INITDIALOG (loading a larger database in the background)
      It all depends on how long you want the client to wait before they see and can actually interact with the program.
      <b>George W. Bleck</b>
      <img src=''>


      • #4
        Thank you Mike, that did the trick

        Thank you George, for the explanation, but I also found that there is another category for OpenGL graphics to auto-launch is using a timer
        That the Mike's method could not work on OpenGL graphics, but if we use a timer, only then it did the job.