Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Skin Framework
  New Posts New Posts RSS Feed - Additional buttons in FormTitelBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Additional buttons in FormTitelBar

 Post Reply Post Reply
Author
Message
Jean View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 December 2006
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jean Quote  Post ReplyReply Direct Link To This Post Topic: Additional buttons in FormTitelBar
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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 WhatsThisHelp property to true (.T.).

  2. To display a "What's This?" Help button in the form's title bar, set the form's WhatsThisButton property to true (.T.).

  3. To associate a "What's This?" Help topic with the form, set the form's 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 WhatsThisHelpID property to an ID number corresponding to a topic in your HTML Help file.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Jean View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 December 2006
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jean Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2009 at 2:40am
Thank you Oleg.

There are some limitations with the 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.