[fpc-pascal] PTCGraph window location
James Richters
james.richters at productionautomation.net
Sat Mar 12 20:18:20 CET 2022
For my application, I want to put the window where it goes and not allow it to be moved. I am doing:
SetWindowLongPTR(graphicwindow, GWL_STYLE, GetWindowLong(graphicwindow, GWL_STYLE) AND not(WS_SIZEBOX) And not(WS_Caption));
WS_Caption is the title bar
And
WS_Seizebox is a border around the window that I don’t want either.
I could do all this stuff myself easy enough and get the desired result if there was just an option to create the PTCGraph window with WS_VISIBLE turned off.
I could move it, remove the title, and whatever then make it visible when I’m done, and the screen won’t be flickering with all kinds of window movements.
I change the title of the existing window without reopening the window with:
SetWindowTextA(graphicwindow,wintitletouse);
James
From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> On Behalf Of Nikolay Nikolov via fpc-pascal
Sent: Saturday, March 12, 2022 10:51 AM
To: fpc-pascal at lists.freepascal.org
Cc: Nikolay Nikolov <nickysn at gmail.com>
Subject: Re: [fpc-pascal] PTCGraph window location
On 3/12/22 15:54, James Richters via fpc-pascal wrote:
Is there some way I can set the location of the pctgraph window before it is created so it just pops up where I want it to be? I’m using Windows 10.
I’ve been re-locating it with SetWindowPos() which is ok if the window is going to be open for a while, but now I am trying to make a little program to display things and relocating the window is quite distracting.
It would also be nice to create the window without the title bar.
Currently, there's no way to do that. I'm planning to make it possible to change the title, without reopening the window, but I haven't thought about creating a window without a title, or moving it to a specific location. Btw, if the windows doesn't have a title, how can the user move it? Or do you want to move it manually, or just make it stay at a fixed location. These things are possible, but may be hard to do in a multi-platform way, e.g. in Linux, different window managers and desktop environments might ignore the location and place the window somewhere else. There are some crazy non-windows-like WMs there, like i3wm :)
Nikolay
James
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org <mailto:fpc-pascal at lists.freepascal.org>
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20220312/3de0a7b9/attachment-0001.htm>
More information about the fpc-pascal
mailing list