Print Page | Close Window

Additional buttons in FormTitelBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=15852
Printed Date: 25 June 2024 at 1:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Additional buttons in FormTitelBar
Posted By: Jean
Subject: Additional buttons in FormTitelBar
Date Posted: 15 December 2009 at 1:29am
How is it possible to have more buttons in a FormTitleBar?
I need such a button like the question mark button in the print dialog eg. from MS Word:



Is there an easy way to do this with CodeJock components?
There's a way over API but then the button is not skinned correct.
I guess the picture needs to be in a style file to fit with a selected style?

With WhatsThisButton I can show the button but I don't find an event for it. :(

I would appreciate it if someone had an advice...
Thanks,
Jean


-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0



Replies:
Posted By: Oleg
Date Posted: 15 December 2009 at 5:01am
Yes, In VB you can set WhatsThisButton to True
 
 
Here instruction from MSDN for next steps:
 
 
In design mode, open the form you want to enable "What's This?" Help for.

  1. Set the form's mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000APR\1033\foxhelp.chm::/html/lngwhatsthishelpproperty.htm - WhatsThisHelp property to true (.T.).

  2. To display a "What's This?" Help button in the form's title bar, set the form's mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000APR\1033\foxhelp.chm::/html/lngwhatsthisbuttonproperty.htm - WhatsThisButton property to true (.T.).

  3. To associate a "What's This?" Help topic with the form, set the form's mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000APR\1033\foxhelp.chm::/html/lngwhatsthishelpidproperty.htm - WhatsThisHelpID property to an ID number corresponding to a topic in your HTML Help file.

  4. To associate a "What's This?" Help topic with a specific control on the form, select the control and set its mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000APR\1033\foxhelp.chm::/html/lngwhatsthishelpidproperty.htm - WhatsThisHelpID property to an ID number corresponding to a topic in your HTML Help file.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Jean
Date Posted: 16 December 2009 at 2:40am
Thank you Oleg.

There are some limitations with the mk:@MSITStore:C:%5CProgram%20Files%5CMicrosoft%20Visual%20Studio%5CMSDN%5C2000APR%5C1033%5Cfoxhelp.chm::/html/lngwhatsthishelpproperty.htm - WhatsThisHelp :
-Works only with HTML Help. No custom actions programmable
-Help button is only visible if min and max buttons are invisible


I found a way with hooking, but I dont know if this is a "save way".
This code is built from samples I found in the internet.
Works with click on the help button and I try to listen to the F1 key. Doesn't work perfect.

Form (disable min and max button!):
Private Sub Form_Load()
  Call SetCBTHook
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  If IsHooked Then
    Call RemoveCBTHook
  End If
End Sub

Module (bas):
Option Explicit

Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long

Public Const WH_CBT = 5
Public Const WH_KEYBOARD = 2

Public Const HCBT_KEYSKIPPED = 7
Public Const HCBT_SYSCOMMAND = 8

Private hHook As Long
Private hKbdHook As Long

Public IsHooked As Boolean

Public Sub SetCBTHook()
  If Not IsHooked Then
    hHook = SetWindowsHookEx(WH_CBT, AddressOf CBTProc, 0, App.ThreadID)
    hKbdHook = SetWindowsHookEx(WH_KEYBOARD, AddressOf KbdProc, 0, App.ThreadID)
    IsHooked = True
  End If
End Sub

Public Sub RemoveCBTHook()
  Dim temp As Long
  temp = UnhookWindowsHookEx(hHook)
  temp = UnhookWindowsHookEx(hKbdHook)
  IsHooked = False
End Sub

Public Function CBTProc(ByVal uCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  If uCode = HCBT_SYSCOMMAND Then
    If wParam = 61824 Then
      CBTProc = -1
      MsgBox "Eigene Hilfe!"
    End If
  ElseIf uCode = HCBT_KEYSKIPPED Then
    Debug.Print wParam
      If wParam = 112 Then
        CBTProc = -1
        MsgBox "Eigene Hilfe!"
      End If
  End If 
  If CBTProc = -1 Then
    CBTProc = 1
  Else
    CBTProc = CallNextHookEx(hHook, uCode, wParam, lParam)
  End If
End Function

Public Function KbdProc(ByVal uCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  KbdProc = CallNextHookEx(hKbdHook, uCode, wParam, lParam)
End Function



-------------
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net