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.

Code Snippets / Windows API Code

Author
Message
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 29th Jul 2005 17:52 Edited at: 29th Jul 2005 19:30
I am remaking my editor via calls to the stand windows DLLs (kernel32.dll,user32.dll,comdlg32.dll). The code I am posting is the included functions from my slowly progressing WinAPI.dba source file.



I will be adding to this code. I will update this message as I do.

[Edit]Updated code.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 29th Jul 2005 18:18 Edited at: 29th Jul 2005 18:18
Nice, Keaz .

I haven't updated my Ion Extension Pack to be like this yet, but note that your code could also work like this:



The globals can be declared inside a function - as long as they are actually in a subroutine that is called from a function. The 'str$(' command causes globals to not be able to be declared directly in a function. This subroutine method also works properly for dimming arrays in a function.

You could also have a disableWinAPI() to save dll space if the user needs it (such as if they left the level editor and are playing the game)

I'm also wondering, what should the standard be for loaded dlls? 'DLLNAMEnum' or your 'DLLNAME'. I'll update Ion Extesion to be compatible.

I also think that separating the GetFree into each type is easier to read and more 'DBpro' like.

You can include any Ion Extension functions in here or any of the message calls that I posted back at the old DarkBlue thread.

Good luck!

-Xol

Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 29th Jul 2005 18:22
Keaz, if you don't want your functions to increase the EXE size to 10 MBs, you could try using the 'MAKE MEMORY' commands in the core set and pointers - it's a little harder than using memblocks (which are still hard), but would save a lot of space.

-Xol

Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 29th Jul 2005 18:45 Edited at: 29th Jul 2005 19:32
I'm not too worried about exe sizes yet, but I'll look into that. I plan on accessing more than just the API DLLs which is why I use my current naming format. The "32" is added because some DLLs in the future might be 64 etc... and I plan to use the full name of every dll I access. I did GetFree the way I did because I wanted the user to have to remeber less functions and make it easier to add more later and I don't like using alot of "_" except where necessary. It's just personal preference really.

P.S. I also don't think seperate load/enable commands are necessary.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 29th Jul 2005 21:09
The separate commands aren't really necessary. I use the '_'s in Ion Extension so that I will be able to implement them as commands in IonRay IDE.

'MAKE MEMORY' is better because most apps don't need all command sets - using these instead of memblocks (which drag in all command sets) can save up to 9 megabytes!

-Xol

Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 30th Jul 2005 00:02
Keaz,
Sorry, I didn't really make myself clear in my first post. Ion Extension uses 'user32num' rather than 'user32'. It would be better if we standardized these so that both packs are compatible.

-Xol

Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 30th Jul 2005 00:16
No problem I'm not making a "pack" I will change my extra functions to the style of your pack post them on your thread.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 30th Jul 2005 00:30
Thanks . I'll be glad to include yours and will give you makor mention in the credits.

I'vwe changed my initialization of the winAPI to a subroutine now, like your APIglobals.

-Xol

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th Jul 2005 19:16 Edited at: 30th Jul 2005 19:29
Sorry Keaz wrong post.

can some kill the source file nothing to do with this thread.

I'm not getting you down am I, Ho Look! another fancy Door?
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 1st Aug 2005 01:45 Edited at: 1st Aug 2005 23:15
This post is just to let people know I've resarted this API project and I'm making an include source code set. I've attached the current progress to this post. As I develop my new editor this code will slowly get updated. It has some functionality already. I'm currently working on it to support the extended set of standard gadgets (Those declared by InitCommonControlsEx). Currently it has basic windows, style, postion, and size commands. It requires the use of memblocks at the moment so your exe will be at least 5 Mb and use extra Ram resources, but I may provide a non memblock set eventually. Well enjoy and I hope you learn something.

Update: I've almost finished ReBar Controls. I can now make the rebar container. The only thing I have left now is the ReBar band stuff to add, subtract, and control the bands.

2nd Update: I'm having trouble with the rebar messages. As soon as the problem is worked out I'll post the new code.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!

Attachments

Login to view attachments
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 2nd Aug 2005 00:03 Edited at: 2nd Aug 2005 00:34
Not all the bugs are worked out yet but, I have had success with rebars. At the moment there still is much support, but all that's left is finetuning and cleaning the code up. Just compile the project to see a rebar working in dbpro. Feel free to play with the code. and look at the other functions.

P.S. The code requires Windows NT/XP/2000 and IE 5.0+ in order to run properly.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!

Attachments

Login to view attachments
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 2nd Aug 2005 00:14 Edited at: 2nd Aug 2005 00:14
Here's a small screenie of it in action:


Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!

Attachments

Login to view attachments
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 2nd Aug 2005 01:29 Edited at: 2nd Aug 2005 01:31
Keaz, I got the 'MAKE MEMORY' command working! !
The app will only crash if you try to write to a location outside of the 'MAKE MEMORY' range. I've put dwords in, and you should be able to easily implement these commands into your API code
Here is the source. Simply cut and paste this into the editor for a great demo!


[EDIT] I'll try to get rebars to work with this - should be easy - I can't afford the 9MBs added to my EXE from using memblocks for so simple tasks as writing DWORDs. [/EDIT]

-Xol

Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 2nd Aug 2005 02:36
Well memblocks and other 3D functions will be used in my code. When it's all said and done my exe will be at least 10Mb. I will worry about trimming it down once it's fully functional. I've also got a few other tricks planned to make working with the API and making GUI's simpler.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 2nd Aug 2005 02:37
Anyway have fun with the rebars I don't know how well they will work with Blue but compatibility issues can be fixed. As you can see my initialization code has grown as well.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 2nd Aug 2005 04:33
Yes, it's best to stick with memblocks - I'm having difficulties porting rebars over to core memory commands.

-Xol

Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 3rd Aug 2005 21:59 Edited at: 4th Aug 2005 01:04
This is an update to let everyone know my API project is progressing and I have finished to the creation code for:

Edit: Updated Control List.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!

Login to post a reply

Server time is: 2024-05-19 03:54:38
Your offset time is: 2024-05-19 03:54:38