Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
declare function GetSystemMenu, RemoveMenu
EQU MF_BYPOSITION$ TO 1024
hwnd = Get_Property( @window, 'HANDLE')
system_menu_hwnd = GetSystemMenu ( hwnd, 0)
rv = RemoveMenu (system_menu_hwnd, 6, MF_BYPOSITION$)
 

 

Using the handle of the window, the program gets the handle of the system menu (the menu with the Close menu item in it) by calling GetSystemMenu().  Then the Close menu item, the 6th item in the menu, is removed by calling RemoveMenu().

...

  1. Log out of the application.

  2. Log into the SYSPROG application.

  3. Add a row, (call it DLL_APICALLS_USER32), with the first line as USER32 and containing the declaration for RemoveMenu().  The declaration for GetSystemMenu() is not needed because it is declared in DLL_USER32, the DLL declarations shipped with OpenInsight  We will be adding declarations for other API functions in other examples.  The record contains at least the following lines:

 

  1. Code Block
    USER32
    ULONG STDCALL RemoveMenu ( HANDLE, ULONG, ULONG)
    //...other declarations in USER32 to follow...

...

  1. Save  the row.

...

  1. Run Declare_FCNS at the System Editor Exec Line to create the declaration header, as shown below:

 

  1. Code Block
    RUN DECLARE_FCNS 'DLL_APICALLS_USER32'

...

...

  1. Exit the editor.

...

  1. Log out of SYSPROG.

...

  1. Log into your application.

...

  1. Run the window.

The window should run, displaying as shown in the previous topic.

...