Example of loading a DLL (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: [IGNORE] sig test
Next thread: Telnet vs HTTP?

Re: Serializable ... kind of   -   Jan Erik Moström <
  Example of loading a DLL   -   Aaron Ballman

Example of loading a DLL
Date: 06.05.02 21:22 (Mon, 06 May 2002 15:22:16 -0500)
From: Aaron Ballman
This shows an example of loading "User32.dll" and using it:

#IF targetWin32 then

declare Function EnableMenuItem Lib "User32" (hMenu as Integer,
IDEnableItem as Integer, enable as Integer) as Integer
declare Function GetMenu Lib "User32" (hWnd as Integer) as Integer
declare Function GetSubMenu Lib "User32" (hMenu as Integer, ID as Integer)
as Integer

const MF_BYPOSITION = &H400
const MF_BYCOMMAND = &H0

const MF_ENABLED = &H0
const MF_GRAYED = &H1
const MF_DISABLED = &H2

Dim myMenu as Integer
Dim whichOne As Integer
Dim ret As Integer
Dim theMenu as Integer

myMenu = GetMenu(window1.WinHWND) ' get the main menu
theMenu = GetSubMenu(myMenu, 0) ' get the file submenu

whichOne = 0 'enable the first menu item in the file menu

ret = EnableMenuItem(theMenu, whichOne, BitwiseOr(MF_BYPOSITION,

If you have troubles with it, let me know, I'll see if I can drudge up
something else.