Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Windows and Icons

Author
Message
Pyro_guy
21
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 12th Jul 2004 00:47
Hey, two little problems which I have encountered recently

When I load an icon for my exe in the project manager, it appears and all seems to go well. When my program is compiled, the pallete of the icon changes, messing up the colours of my icon :s
I've tried using several different icons, each with the same result. You can grab my icon here http://www.davidjogle.pwp.blueyonder.co.uk/test2.ICO if you want to try it yourself.

Secondly, if I set my project to run in 'windowed' mode, and only use PRINT commands, I can scale my window while the text stays the same, just like the DoS prompt. However, as soon as I introduce anything remotely graphical, eg.the BOX command, I can scale the window, but the entire contents of that window are stretched also.

How can I add graphics, but still resize my window without distorting them? Or if this is not possible, how can I prevent the user resizing the window?

Thanks!

Screw the rules...what can i blow up?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Jul 2004 13:37 Edited at: 13th Jul 2004 13:05
About the icon, I believe that it must be a 256 colour image, 16x16 but I may be slightly off.

For the resizing of the window's problem, you can't stop that I'm afraid.

You may be able to do it via API calls if you konw how to ( I'm not sure if it's even possible ).

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Pyro_guy
21
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 12th Jul 2004 19:53
Yes, the title bar Icon should be 16x16 pixels, but the exe icon should be 32x32 pixels, like the one's on your desktop.
I'm not sure about the colours, but I've tried with 16 colour, 256 colour and 24 bit Bitmap images as well as using a program called 'Icon Studio' (by CoffeCup software) none of which seem change the end effect :s

Screw the rules...what can i blow up?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Jul 2004 23:17
Hmm, that's interesting

I've heard reports of DBP not liking the icon files.

What I suggest is compiling the exe and grab a resource editor, or an ico editor and apply the icon yourself - This is what I have done in the past ( an old habbit from having to change the icons on DBC exe's ).

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Pyro_guy
21
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 13th Jul 2004 00:04
I figured I may have to do this ah well

Anyway, could you explain your workaround for my window resize problems please? I'm still in the dark about that

Screw the rules...what can i blow up?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Jul 2004 13:09
Well, window's API functions are those that are in the Window's DLL's such as user32.dll kernel32.dll etc that contain commands for the control of windows gadgets and windows and other UI functions etc.

What you want to do is first, learn how to use DLL's, then learn how to call API functions ( can get a bit confusing if you don't understand the basics ).

I suggest going along to [href]www.allapi.net[/href] and having a look at some examples there.

As I said, I'm not fully sure if it is possible to restrict the resizing of window's, but I would say you could just detect the size of the window, and if it's not the size it should be, just set it back to what it should be

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 13th Jul 2004 15:32
Alternatively, you could take the short cut and use code that someone else has made (in this case 'The Winch') and placed in the CodeBase.

You can find it Here

Login to post a reply

Server time is: 2025-05-27 23:54:52
Your offset time is: 2025-05-27 23:54:52