Is it possible via BMax?
BMax String->do something->show string value if you press control+v in a programm like Notepad or Word.
Anyone like to show me the coden path and get the good carma poeple get for enlighting poor other?
Any thoughts welcome too...dont even have a clue how to begin interaction BMax<->WinXP.
for win32, take a look at
Using the Clipboard on MSDN.
Ah, clipboard.
Thank you, showed me the direction.
Uff, a crashcours in WinUI.
To open a simple win32 window i would need functions from BMax Pup.mod-> User32.bmx
What i couldnt find out is the difference between
createwindowexA() and createwindowexW().
In the msdn library i only could find createwindowex()?
if it ends in A it's the ASCII version, if it ends in W, it's the UNICODE version
"for win32, take a look at Using the Clipboard on MSDN."
I still haven't seen any examples of using the Win32 API from within Bmax, although I assume it's not too difficult. (I've done API window creation and event loops, etc.)
A nice tutorial would be very welcome, or even a "skeleton event-loop" Win32 program would be handy.
Russell
Cool, thank you.
Yes, a tutorial would be handy.
I would prefer a tut of how to get a MSDN Library function into BMax, like Mr.Birdie did.
Or how to use a C++ function in BMax tutorial..
Here are two functions for clipboard text read and write:
' clipboard copy/paste text example
Extern "Win32"
Function OpenClipboard%(hwnd%)
Function CloseClipboard%()
Function EmptyClipboard%()
Function IsClipboardFormatAvailable%(format%)
Function GetClipboardData%(format%)
Function SetClipboardData(format%, hMem:Byte Ptr)
Function GlobalAlloc:Byte Ptr(uflags%,bytes%)
Function GlobalFree(buf:Byte Ptr)
End Extern
' -----------------------------------------------
Print "Clipboard Test."
Print "~~~~~~~~~~~~~~~"
Print "Enter a message for the clipboard."
Print "Alternatively, leave BLANK to read clipboard."
a$=Input$(">")
If a$=""
a$=ReadClipboardText$()
Print a$
Else
WriteClipboardText a$
Print "Text sent to clipboard. Open NotePad and paste!"
EndIf
Print Chr$(13)+"---------------------------------"
a$=Input$("Press RETURN to end ...")
End
' -----------------------------------------------
Function WriteClipboardText(txt$)
Const CF_TEXT=1
If txt$="" Return
If OpenClipboard(0)
EmptyClipboard
Local p:Byte Ptr= GlobalAlloc(GMEM_FIXED,Len(txt)+1)
For Local i=0 Until Len(txt)
p[i]=txt[i]
Next
p[Len(txt)+1]=0
SetClipboardData CF_TEXT, p
CloseClipboard
GlobalFree p
EndIf
End Function
Function ReadClipboardText$()
Const CF_TEXT = 1
Local txt$ , cpd%
If OpenClipboard(0)
If IsClipboardFormatAvailable(CF_TEXT)
cbd=GetClipBoardData(CF_TEXT)
txt=txt.FromCString(Byte Ptr cbd)
EndIf
CloseClipboard
EndIf
Return txt
End Function(Thanks to Birdie for his help)