Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3729: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3731: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3732: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3733: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
ubercode.com • View topic - How do I automatically display a window when a program start

How do I automatically display a window when a program start

Display a window. Automatically run code. Prevent an application from being closed.

How do I automatically display a window when a program start

Postby uberdroid on Wed Jan 14, 2009 10:15 pm

The most important point to remember is that the function or window called Main always runs first when the program begins. Therefore a function called Main is run first, or a window called Main is always shown first (a program cannot have both). So to automatically display a window when the application starts, just make sure the window is called Main.

This happens automatically whenever you use the Developer Environment to create a new program. By choosing the program type 'Main Window', the Developer Environment will automatically generate the main window for you. Here is the code it generates:
Code: Select all
  // App1.rc
  Main DIALOG 0,0,240,160
  STYLE DS_MODALFRAME|WS_POPUP|WS_CAPTION|WS_SYSMENU|DS_CENTER
  CAPTION "Main"
  BEGIN
  END

  // App1.cls
  Ubercode 1 class App1 

  public callback function main(in  EventId:integer
                                    ControlObj:control
                                    Key:integer
                                out Cancel:boolean)
  code
    select EventId
    case LOAD_EVENT =>
         // Dialog/Editwindow object was loaded
    case COMMAND_EVENT =>
         // Pushbutton/Bitmapbutton/Menuitem/Radiobutton/Checkbox selected
    case CHANGE_EVENT =>
         // Edit/Scrollbar/Listbox/Combobox/Iconlist was changed
    case UNLOAD_EVENT =>
         // Dialog/Editwindow was closed
    end select
  end function

  end class

The "app1.rc" file contains the layout of the main window, and the "app1.cls" file contains the code for the main window.

It is also possible to display a window when the application starts running, even if the window is not called Main. To make this work, create the window you want to show at start-up, make sure Main is declared as a proper function, and in the code of Main call Show(MyWindow) where MyWindow is the start-up window you created.
uberdroid
PostRobot
 
Posts: 38
Joined: Wed Jan 14, 2009 4:36 am

Return to Applications and Classes

Who is online

Users browsing this forum: No registered users and 1 guest

cron