View Full Version : Remove window title from app, how to ?
qwerty
10-10-2007, 04:10 AM
strange request, why is not important, just if it is possible before i chase my tail around !!
i would like to open a text file in notepad (or the users default text file handler) .... but i need the window title text to be blank or edit out a specific word in the title.
for example, i open a text file in AMS using File.Run, no problem this opens the text file in note pad, and places the files full path in the window title, in that title lets say it has "Qwerty" as a folder, i'd like to replace that with "hidden" ... or simply remove the title text completely.
is this possible, or would it be easier for me to find a different approach to displaying the text ? .. i cant use Dialog.SplashMessage becasue of the volume of text involved, it must be able to scroll down
TIA
Eagle
10-10-2007, 05:06 AM
have you considered using the 'debug' window - actions instead
has auto horiz and vert scroll bars.
I can provide some code here that can obtain the window handle to
the debug window so you can manipulate it like any other window via
ams window actions.. eg you can set-change the debug 'window title', size etc
http://www.indigorose.com/forums/showthread.php?t=20955&highlight=debug+window
qwerty
10-10-2007, 05:18 AM
i hadn't thought of that, i will have a peek and see if it does what i need :yes
RizlaUK
10-10-2007, 05:30 AM
cant you just set the window title after after you open noptepad ?
qwerty
10-10-2007, 05:53 AM
i'd need to affectively do it before opening notepad, becasue of a protection timer running, basically if a certain string is found in the title of any window, it's closed, this can be instantaneous or upto 500 miliseconds, too hit and miss to rely on changing after notepad or default app is opened
the debug thing looks a posibility, just need to strip the example down to the my basic requirements
qwerty
10-10-2007, 06:35 AM
dam, that was so close, i can get it to do what i want, but i have more than one of these "info" text files, and they could be opened one after another, and unfortunately i cant get the title to switch from the one initially set :(
RizlaUK
10-10-2007, 06:37 AM
ok, well if you want i could make you a text window (dll popup), it would be basic editor type window with no buttons that you have full control of, set the text and title,
or the debug window might be just as easy, its up to you
Aftertought: do you own xDialog, if so you could use the multiline input popup
qwerty
10-10-2007, 06:48 AM
i'm still playing with the debug window thing at the moment, as i like the re-sizable option, however after changing the details/size once, if i open another text file via the same method, while i can clear the contents i cant seem to reset the debug window atributes, even if i close it and then re-open it :(
i only have the free xDialog lite, so dont know the script code for that multiline input popup your talking of, you got a fast example and i'll see if it looks easier/better than what i am playing with now.
dll popup sounds interesting, but really it's not worth putting you out for... this is all mu own fault anyway, for scripting a window close command if a certain string is found in the window title and then realising i need to access a path that has this sting in it :lol
RizlaUK
10-10-2007, 07:04 AM
ok, well i have a prototype here so it wont take me to long to knock something up for you, it gives me something to do and if it helps you then im happy, check back in 20 mins :yes
RizlaUK
10-10-2007, 08:25 AM
ok, here you go
this is a custom (read only) debug window, you can set window size, title, text, and type (tool window), you can disable the app (or not) while the debug is shown
let me know if you need any thing changed
Eagle
10-10-2007, 09:06 AM
nice one Dean,
fwiw
here's a better example of manipulating the builtin Debug Window:
(check the global functions in project)
RizlaUK
10-10-2007, 09:49 AM
you know, iv never used the ams debug window, i had assumed it was like the pb debug (only works from the compiler) so i never used it, i always use dialog.message, but i can see checking my sqlite stuff will be a lot easier with the debug window
your example thought me something to :yes
qwerty
10-10-2007, 10:32 AM
thanks guys,
i had to nip out for a bit, and just got back so i've grabbed your examples and will have a look after dinner
thanks again for the replies and help :)
i'll post back my thoughts later
qwerty
10-10-2007, 11:07 AM
ok, i've got it .... just some minor stuff to iron out.
@RizlaUK - i like stand alone things usually so my first inkling was to try your tool, and i will keep it because it will be usefull, especially if i want a dialog message without the annoying audio of the AMS standard message boxes
But, for this particular project, it fails as i could not read the text in from file to it, it just returned blank, the text is a "notes and revision history" text file, so the object displaying needs to be able to accept a wide ranging input of text formatting, and scroll bars will be needed.
@Eagle - thank you, i was working along the same lines as what you have there in your example, but i was having the issue of the title not being updated, and having another example to compare, i could see where i went wrong, i was calling for the debug window handle more than once, and then in my code it was still refered to as "debug" at one point insteadof by the handle, and that was causing my issues, all looks good now, just one small issue.....
as i said, all is good now, except that if i load new text and new title into an existingly visible Debug window, it scrolls the text to the bottom, much in the sam manner as if you had appended it to the end of the existing text, this isnt happening, so i dont fully understand why it is doing this ... i assume it is because the print command is much the same as paste in windows and it will place the cursor at the end.
I have a couple of thoughts on this, ranging from changing the order of events (add text, change title,, change size) to ensure that the text one isnt last or maybe close the debug window make the changes then show it (as the first instance seems to work ok) to using a send keys cntl+home command straight after calling the debug window to move the cursor to the top :p
weither way.... thank you guys very much for your help with this :)
qwerty
10-10-2007, 12:44 PM
ok, i know know why my code was slower than yours when it came to calling the debug window, placement of this line is crucial, as it will slow all sorts of things down, including the page timer :(
-- Get Debug Window Handle --
nDBHwnd = Debug.GetWindow(); -- a global var (call once only)
this is causing me a slight headache in respects as to where to put it, as a lot of my code for this is in the global section. because the text files are being displayed from the task tray icon menu, i've tried in on-preload and on-show, and it messes with the project speed, i'm thinking to hide it's affects by trying to do this while the splash image is displayed during pre-load, that might work, it certainly makes a difference depending on where you put it in the script
as for the other thing about adding new text to the debug window and it being positioned at the end of the file, closing the window then making the changes and re-opening it sorted that out :p... i added "Debug.ShowWindow(false);" into the Debug.SetText Function
RizlaUK
10-10-2007, 02:11 PM
nDBHwnd = Debug.GetWindow(); -- a global var (call once only)
i would put that line before the 1st call for the debug window
or if its all run from global functions, at the start of the first function that uses the debug window, try something like this
if not nDBHwnd then
nDBHwnd = Debug.GetWindow();
end
qwerty
10-10-2007, 02:36 PM
before first call made it very slow to to load, also, as there are 5 menu options that could call that i struggled to find a common point as i dont know which would be called first (and didnt think of your simple solution!) so .....
i tried before the menu was called in the global functions, it crippled the display time for the tray menu, it was like having a delay setting in there :lol
i settled on putting it in the on-preload, at around the time of the splash image and it seems a good fit in there
RizlaUK
10-10-2007, 03:14 PM
well, im glad you found a working solution :yes
Eagle
10-11-2007, 09:28 AM
nice to have a reasonable result.
would be handy if IR coder team add some similar configuarable control actions to the Debug Window
like:
Debug.GetWindowHandle()
better still:
Debug.GetProperties
Debug.SetProperties
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.