Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Doodle

Pages: [1]
1
Applications / Re: FAT Diskette with truncated long file name file
« on: October 31, 2021, 07:24:19 pm »
You might want to try the VFAT2EA tool (should be available on Hobbes).
That tries to read out the VFAT long names from the disk, and then creates OS/2-compatible .LONGNAME extended attributes from them. If it succeeds, you'll be able to see and use the long filenames from WPS.

2
Programming / Re: human readable config file handling - libs we have
« on: February 07, 2021, 05:45:39 pm »
In Doodle's Screen Saver, I've written my own (low-cost) function to parse simple text-based config files which contains lines formatted like 'key'='value' (that is what DSSaver uses to store its settings). To generate those text files, it's simple, just use fprintf() with proper format strings. To parse it, it's not that hard either.

For an example, check this:
https://github.com/OS2World/UTIL-WPS-Doodle-Screen-Saver/blob/master/SSCore.c#L337

3
Programming / Re: how to stay a window on top
« on: May 09, 2020, 11:40:02 pm »
Quote
I wonder why a Dialog Window has the behaviour I would like to have. Dialog Windows always stay on top above the main program (standard) window.

The Dialog Windows are created with a different API (WinCreateDialog), and their window procedure has to follow different rules (return if a message was processed or not). If it's not processed, a default dialog window procedure of the OS/2 system will handle the message, and that already has this logic implemented, that when the dialog window gets activated and shown, it disables its owner window for the time the dialog window is active. If a window is disabled (see WinEnableWindow API), the user cannot interact with it, so you cannot click on the main window if you have a child dialog window active.

It's quite nicely described in the Presentation Manager Programming Guide:
ftp://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/pc/os2/warp_ver_3/G25H-7103-00_OS2_WARP_V3_Presentation_Manager_Programming_Guide_The_Basics_Oct94.pdf

Focus on chapter 15-1 (Dialog Windows), most importantly on "modal" dialogs.


Quote
Do you have an idea how to turn off the system wide WS_TOPMOST flag after it has been set?

Sorry, I don't know. I never had to do that, but I always thought that removing the flag would be enough..

4
Programming / Re: how to stay a window on top
« on: May 09, 2020, 05:39:11 pm »
Hi Martin,

I afraid that OS/2 does not have such a built-in windows style that you're seeking. The WS_TOPMOST (as you've already found out) has a system-wide effect. It will be on top of all other windows (until another gets WS_TOPMOST, or another WS_TOPMOST window gets moved on top, etc...).

If you want to have your window to be above all your windows, but not foreign windows, I think that you have to implement your own logic in all of your window procedures to handle the case when Z-order changes (WM_ADJUSTWINDOWPOS message, IIRC), and every time your window would get on top, set your "app-topmost" window to be on top.

Doodle

5
Programming / Re: how to stay a window on top
« on: April 11, 2020, 12:19:29 pm »
Quote
Is 8 the right value for WS_TOPMOST ?

In my previous reply, I wrote:

Quote
For an example, please download the source code of DSSaver, and check one of the modules (preferable the Blank module, as that has the least additional code) on how it's done:
ftp://ftp.netlabs.org/pub/dssaver/dssaver_v20_srcbin.zip
Once unzipped, check the file Modules\Blank\Blank.c, search for lines containing "topmost", and you'll see how it's done in there.

Searching for lines containing "topmost" in that Blank.c file results these:

Code: [Select]
// Undocumented flag to make a window topmost:
#define WS_TOPMOST  0x00200000L

...

// Set WS_TOPMOST flag again!
WinSetWindowBits(hwnd, QWL_STYLE, WS_TOPMOST, WS_TOPMOST);

...

// Make window 'Always on top' because we'll be in real screensaver mode!
ulStyle = WS_VISIBLE | WS_TOPMOST;
hwndSaverWindow = WinCreateWindow(HWND_DESKTOP, SAVERWINDOW_CLASS, "Screen saver",
                                      ulStyle,
                                      0, 0,
                                      (int) WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN),
                                      (int) WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN),
                                      HWND_DESKTOP,
                                      HWND_TOP,
                                      0x9fff, // Some ID....
                                      NULL, NULL);


Hope this helps!

6
Programming / Re: how to stay a window on top
« on: April 09, 2020, 03:55:45 pm »
Once you set your window to be styled WS_TOPMOST, it gets above all other windows, even previous topmost ones.
Fortunately, when the Z-Order of the windows changes, the affected windows get a window message WM_ADJUSTWINDOWPOS, in which you can realize that some other app has gone above your window, and you can set your window to be topmost again then.

It's a bit risky, as when this meets other similar code, they will "fight" being topmost, and probably cause flicker and eat up CPU.

Still, this seems to work in DSSaver, as Dave has pointed out.

For an example, please download the source code of DSSaver, and check one of the modules (preferable the Blank module, as that has the least additional code) on how it's done:
ftp://ftp.netlabs.org/pub/dssaver/dssaver_v20_srcbin.zip
Once unzipped, check the file Modules\Blank\Blank.c, search for lines containing "topmost", and you'll see how it's done in there.

Good luck!

Pages: [1]