I wanted to write with pb115, but I thought that the earlier versions of Pb could not be opened, so I used pb8.
1. Create a pb8_toolbar Project
2. Create a menu: m_main and add these menus.
+ File
+ ---- New
+ ---- Open
+ Edit
3. Set "new" and "open" toolbaritemtext and toolbaritemname
4. Create a window: w_main. Choose m_menu from menu.
5. define these functions in global extetrnal funnal.
// These two are windows APIs
Function long findwindowexa (long hparent, long hchildafter, string lpszclass, string lpszwindow) Library "user32.dll"
Function long getwindowlonga (long hwnd, integer index) Library "user32.dll"
// This is a pb api. Library "pbvm80.dll" should correspond to its own Pb version.
// The parameters need to be studied. Sybase does not provide: handle of the first toolbar, second font name, third font size, fourth unclear, and fifth unclear.
Function long fn_toolbarsetfont (long unknown, string fontname, long fontsize, long unknown1, string Str) Library "pbvm80.dll"
6. In w_main-open
Long ll_null, ll_hwndtoolbar, ll_hwnd, ll_ptoolbar
String ls_windowname
Setnull (ls_windowname)
Setnull (ll_null)
// Is_toolbarclassname = "fnfixedbar90"
Try
Ll_hwnd = handle (w_main) // ll_hwnd = handle (this)
// Obtain the toolbar object of Pb. fnfixedbar80 corresponds to the Pb version.
Ll_hwndtoolbar = find1_wexa (ll_hwnd, ll_null, "fnfixedbar80", ls_windowname)
If ll_hwndtoolbar> 0 then
Ll_ptoolbar = getwindowlonga (ll_hwndtoolbar, 0)
Fn_toolbarsetfont (ll_ptoolbar, "", 20, 0, "12345678 ")//
End if
Catch (throwable ex)
Signalerror (-1, "call API function to set toolbar font failed .")
End try
Long ll_null, ll_hwndtoolbar, ll_hwnd, ll_ptoolbar
String ls_windowname
Setnull (ls_windowname)
Setnull (ll_null)
Resource Link
Http://download.csdn.net/source/2233701