4.10 Beta 4
Code: Select all
Procedure Scintilla(EditorGadget.l,*scinotify.SCNotification)
EndProcedure
If OpenWindow(0,0,0,500,500,"Test",#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
If InitScintilla("scintilla.dll") = #False
End
EndIf
If CreateGadgetList(WindowID(0))
ScintillaGadget(0,20,20,460,460,@Scintilla())
EndIf
If CreateMenu(0,WindowID(0))
MenuTitle("File")
MenuItem(0,"New [Ctrl+N]")
MenuItem(1,"Open [Ctrl+O]")
MenuItem(2,"Save [Ctrl+S]")
MenuItem(3,"Save As")
MenuItem(4,"Save As Web Page")
MenuItem(5,"Exit [Esc]")
EndIf
Repeat
Event = WindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case 1
path$ = ""
SHGetSpecialFolderLocation_(WindowID(0),#CSIDL_PERSONAL,@path$)
file$ = OpenFileRequester("Please choose file to load",path$,"Word Document (*.doc)|*.doc",0)
dhToggleExceptions(#True)
oWord = dhCreateObject("Word.Application")
If oWord
dhCallMethod(oWord,"Documents.Open(%s)",@file$)
dhCallMethod(oWord,"Selection.WholeStory()")
dhCallMethod(oWord,"Selection.Copy()")
ScintillaSendMessage(0,#SCI_CLEARALL)
ScintillaSendMessage(0,#SCI_PASTE)
EndIf
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf