Page 1 of 1
My file viewer doesn't work with 5.30
Posted: Mon Jul 28, 2014 5:44 pm
by STARGÅTE
I have wrote my own file viewer, to convert binary file to a data section, but now (with IDE PB 5.30) this code returns zero:
Code: Select all
Debug FindWindowEx_(FindWindowEx_(0, 0, 0, "PureBasic 5.30 (x64)"), 0, "Scintilla", 0)
; Result: 0
Same on 5.22:
Code: Select all
Debug FindWindowEx_(FindWindowEx_(0, 0, 0, "PureBasic 5.22 LTS (x64)"), 0, "Scintilla", 0)
; Result: 1510896
What was changed with PB 5.30 ?
Re: My file viewer doesn't work with 5.30
Posted: Mon Jul 28, 2014 6:11 pm
by skywalk
My specific calls to FindWindowEx() work in x86 but your snippet does not.
Re: My file viewer doesn't work with 5.30
Posted: Mon Jul 28, 2014 7:38 pm
by luis
Code: Select all
i = FindWindowEx_(0, 0, 0, "PureBasic 5.30 (x64)")
Debug Hex(i)
i = FindWindowEx_(i, 0, "PureSplitter", 0)
Debug Hex(i)
i = FindWindowEx_(i, 0, "PureContainer", 0)
Debug Hex(i)
i = FindWindowEx_(i, 0, "Scintilla", 0)
Debug Hex(i)
STARGÅTE wrote:
What was changed with PB 5.30 ?
It seems the scintilla window was a direct child before, and now for some reason it isn't.
Maybe these containers also explains why the new IDE flashes (
under some conditions) when the tools panel hides itself, at least on Windows.
Re: My file viewer doesn't work with 5.30
Posted: Mon Jul 28, 2014 7:51 pm
by Kiffi
on my machine:
Code: Select all
i = FindWindowEx_(0, 0, 0, "PureBasic 5.30 (x64)")
Debug Hex(i)
i = FindWindowEx_(i, 0, "PureSplitter", 0)
Debug Hex(i)
i = FindWindowEx_(i, 0, "PureSplitter", 0)
Debug Hex(i)
i = FindWindowEx_(i, 0, "PureContainer", 0)
Debug Hex(i)
i = FindWindowEx_(i, 0, "Scintilla", 0)
Debug Hex(i)
Greetings ... Kiffi
Re: My file viewer doesn't work with 5.30
Posted: Mon Jul 28, 2014 7:56 pm
by luis
@kiffi
Right, it depends on the IDE configuration.
If I don't set the tools panel to auto hide then I have one more parent like you.
Looks like it's better to not rely on a fixed sequence anymore but to enumerate all the child windows and select the right one with the Scintilla class.
Re: My file viewer doesn't work with 5.30
Posted: Tue Aug 05, 2014 5:24 am
by Bisonte
if you want only paste text... this one from falsam is nice (simple and effective) :
Code: Select all
SetClipboardText(Message)
HandleIDESci=Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
SendMessage_(HandleIDESci, #WM_PASTE,0,0)
I done this with your Bin2Data from the german forum and it works with 5.30 now.
Re: My file viewer doesn't work with 5.30
Posted: Tue Aug 05, 2014 6:02 am
by Danilo
Bisonte wrote:if you want only paste text... this one from falsam is nice (simple and effective) :
Code: Select all
SetClipboardText(Message)
HandleIDESci=Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
SendMessage_(HandleIDESci, #WM_PASTE,0,0)
It destroys the user's clipboard. The clipboard is controlled by the user, just keep that in mind.

Re: My file viewer doesn't work with 5.30
Posted: Tue Aug 05, 2014 6:07 am
by Bisonte
Danilo wrote:It destroys the user's clipboard. The clipboard is controlled by the user, just keep that in mind.

sssssssssssssst.
Code: Select all
OldMessage.s = GetClipBoardText()
SetClipboardText(Message)
HandleIDESci=Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
SendMessage_(HandleIDESci, #WM_PASTE,0,0)
SetClipBoardText(OldMessage)
Re: My file viewer doesn't work with 5.30
Posted: Tue Aug 05, 2014 6:15 am
by Danilo
Bisonte wrote:sssssssssssssst.
Code: Select all
OldMessage.s = GetClipBoardText()
SetClipboardText(Message)
HandleIDESci=Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
SendMessage_(HandleIDESci, #WM_PASTE,0,0)
SetClipBoardText(OldMessage)
I just wanted to remind you that the user controls the clipboard, and applications only
use it on user's request. For example, the user copies an image, then uses your tool,
and then she wants to paste the image... but it is lost, because an application destroyed
it without user request. Never mind...
Re: My file viewer doesn't work with 5.30
Posted: Tue Aug 05, 2014 2:28 pm
by IdeasVacuum
.... it doesn't matter if the clipboard is used, this is a developer's tool and in this case the developer is focused on producing a Data Section, so not going to need to be 'holding' anything on the clipboard - especially since, they will know the tool is using the clipboard.
I regularly use Stargate's excellent app. For PB5.30 I have simply been creating a separate .pbi in PB5.22.