Pb-toolbar-Set Font

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.