Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Programming
author message
os/2 dialogs
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
arr
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 85
since: 26 Jan, 2004
1. os/2 dialogs
Reply to this topic with quote Modify your message
last updated at 10 Apr, 2004 03:19 (1 times)
I believe I already know the answer to this but I was wondering if it is possible to programmatically change the system menu icon of an individual os/2 dialog window or is that icon fixed and cannot be changed?

regards,
arr

Date: 10 Apr, 2004 on 02:43
ChrisR
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://members.home.nl/cwroossien/
posts: 125
since: 04 Feb, 2004
2. Re:os/2 dialogs
Reply to this topic with quote Modify your message
Thats very complicated..
You need some kind of tsr or class witch just sits and checks and waits for certain windows to open..
Most programs have more than one windows.. if fact some have dozens of windows..
And you need a list of window-names with coresponding icons..
When you have a good resource editor its a lot easier to change the icons in the programs/dlls itself..
Chris
Date: 10 Apr, 2004 on 13:57
arr
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 85
since: 26 Jan, 2004
3. Re:os/2 dialogs
Reply to this topic with quote Modify your message
Let me go into some more detail on this, I am using drdialog and I was wondering if there was a way with REXX and an api call at run-time to change the system menu icon of an individual dialog to another icon. It's not a big deal if it cannot be done, was just wondering if it was possible or is it a system-wide fixed thing with os/2's dialog box engine. Just wondering if someone new off hand; if not, I will check through my vp api docs to see myself. No big deal.

regards,
arr

Date: 10 Apr, 2004 on 19:09
zoron
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 37
since: 19 Oct, 2003
4. Re:os/2 dialogs
Reply to this topic with quote Modify your message
I am not that familar with DrDialog but it looks like its window functions do not provide any method to change the system icon. So you would need to use either a rexx dll or an external program to do this. VP provides an example rexx dll in rexxext.pas, gcc also has some sample code.

To load and change the icon you would use WinLoadPointer & WM_SETICON eg:
(* attach the icon, if any *)
hicon := WinLoadPointer( HWND_DESKTOP, NULLHANDLE, usResID );
if hicon <> NULLHANDLE then
WinSendMsg( hwnd, WM_SETICON, MPFROMLONG( hicon ), 0 )

To find the window handle of your dialog you could use WinBeginEnum to find all the open programs and then match on the dialog name or process id.

I do not know whether it is possible to add additional (icon) resources to a DrDialog res file, you may need to experiment a little.

Where you call your new function from within your drrexx program will depend on what you want to do. You could try adding it to the init routine but whether this works would depend on where in the dialog creation process (before, during or after) the init stuff is read.

Just some ideas.

Date: 13 Apr, 2004 on 09:52
arr
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 85
since: 26 Jan, 2004
5. Re:os/2 dialogs
Reply to this topic with quote Modify your message
Thanks zoron, I'll give that a try. No, there doesn't seem to be a way at design time to change the system menu icon so that's what I was looking to do it with code at run-time using api calls.

regards,
arr

Date: 13 Apr, 2004 on 12:45
zoron
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 37
since: 19 Oct, 2003
6. Re:os/2 dialogs
Reply to this topic with quote Modify your message
I did actually try changing the icon with an external program called from the init event and it worked ok.

In my earlier post I suggested adding the icon resource to the drrexx program it should really be in a dll or external program so you can access it easily.

Date: 15 Apr, 2004 on 19:48
os/2 dialogs
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004