Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
#Include "scintilla_gb.inc"
%ID_Button = 500
%ID_Sci = 1000
Global hDlg,hLib,hSci As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,300,400, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %ID_Button, "Load", 10,10,100,20
hLib = LoadLibrary("SCILEXER.DLL")
Control Add "Scintilla", hDlg, %ID_Sci, "", 10,40,280,340, %WS_Child Or %WS_Visible Or %WS_Border
Control Handle hDlg, %ID_Sci To hSci
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local temp$
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %ID_Button
Open "default.txt" For Binary As #1
Get$ #1, Lof(1), temp$
Close #1
SendMessage hSci, %SCI_SetText, 0, StrPtr(temp$)
End Select
Case %WM_Destroy
If hLib Then FreeLibrary hLib 'free the Scintilla library
End Select
End Function
'gbs_00500
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm