My file viewer doesn't work with 5.30

Just starting out? Need help? Post your questions and find answers here.
User avatar
STARGÅTE
Addict
Addict
Posts: 2084
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

My file viewer doesn't work with 5.30

Post 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 ?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
skywalk
Addict
Addict
Posts: 3994
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: My file viewer doesn't work with 5.30

Post by skywalk »

My specific calls to FindWindowEx() work in x86 but your snippet does not.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My file viewer doesn't work with 5.30

Post 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.
Last edited by luis on Mon Jul 28, 2014 10:01 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Kiffi
Addict
Addict
Posts: 1357
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: My file viewer doesn't work with 5.30

Post 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)
Image

Greetings ... Kiffi
Hygge
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My file viewer doesn't work with 5.30

Post 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.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Bisonte
Addict
Addict
Posts: 1232
Joined: Tue Oct 09, 2007 2:15 am

Re: My file viewer doesn't work with 5.30

Post 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.
PureBasic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: My file viewer doesn't work with 5.30

Post 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. ;)
User avatar
Bisonte
Addict
Addict
Posts: 1232
Joined: Tue Oct 09, 2007 2:15 am

Re: My file viewer doesn't work with 5.30

Post by Bisonte »

Danilo wrote:It destroys the user's clipboard. The clipboard is controlled by the user, just keep that in mind. ;)
sssssssssssssst. :mrgreen:

Code: Select all

OldMessage.s = GetClipBoardText()
SetClipboardText(Message)
HandleIDESci=Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
SendMessage_(HandleIDESci, #WM_PASTE,0,0)
SetClipBoardText(OldMessage)
PureBasic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: My file viewer doesn't work with 5.30

Post by Danilo »

Bisonte wrote:sssssssssssssst. :mrgreen:

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...
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: My file viewer doesn't work with 5.30

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply