Make your own free website on Tripod.com

Hiding the microhelp of a MDI frame (PB6, 7 Jan, 1999)

Back Up Next

Author: Philip Salgannik / Eric Aling (07 jan 1999)
Accessed:

A MDI frame has several childwindows inside itself. One of them is the MicroHelp. If we can find that one, we can hide it or show it again. So, this is what you'll do:

String 	ls_name, 
String	ls_pb_microhelp_name
ULong 	lul_hwnd
Integer li_rc

integer GW_HWNDNEXT 2
integer GW_CHILD 5
integer SW_SHOW = 5
integer SW_HIDE = 0
// the classname of the microhelpwindow is FNHELP60
ls_pb_microhelp_name = "FNHELP60"
// find the microhelp handle
// first get a handle of the child within the MDIframe 
lul_hwnd = GetWindow(Handle(this), GW_CHILD)
// Get the classname of the child. If it is the microhelp childwindow,
// exit the loop, otherwise get the next childwindow.
DO UNTIL lul_hwnd = 0
	ls_name = Space(25)
	li_rc = GetClassNameA(lul_hwnd, ls_name, Len(ls_name))
	If ls_name = ls_pb_microhelp_name Then
  		lul_hwnd_status = lul_hwnd
  		lul_hwnd = 0
	Else
		// get the next child window
  		lul_hwnd = GetWindow(lul_hwnd, GW_HWNDNEXT)
	End If
LOOP

If you are using PB5 you'll have to substitute the classname with "FNHELP050". You now have a handle to the microhelp childwindow. To hide this child window, you can use the ShowWindow API function.

if lul_hwnd_status > 0 then ShowWindow(lul_hwnd_status, SW_HIDE)

To show it again, call the ShowWindow function with SW_SHOW. The declarations of the external functions can be found in the API list. Many thanx to Philip Salgannik who put this tip in the newsgroup. Philip can be reached at psalgann@domainpharma.com

Back Up Next