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 Discussion / How use the User32.dll to CreateWindow?

Author
Message
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 24th Jan 2005 08:39 Edited at: 24th Jan 2005 09:18
I don't know how to convert the c coding for the Create Window command in the User32.dll to the call dll function in DB. How would you do it. I saw an example a long time ago, but I have not been able to find it again.

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 24th Jan 2005 14:39
Post up the code you have, and we can help you out

Want to do want to create a window for anyway?

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 24th Jan 2005 22:11
I don't have any code. I was asking for the code to use when doing



and so on. I don't know the code for the call dll command after that.

Don't let life get you down, it will only get better.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Jan 2005 00:53
what kind of window are you trying to create?

"eureka" - Archimedes
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 25th Jan 2005 04:16
Here is the command I need help on.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp

It is on the link.

Don't let life get you down, it will only get better.
Sol462
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 25th Jan 2005 05:54
you need more than that function if i am correct. theres some variables and defining the window class. hope that helps

coffee + monkeys + creativity = games
Operation Pineapple - Multiplayer FPS WIP
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 25th Jan 2005 07:33
I know.
That is what I need help on. I am not that good in C and need some help figuring it out.

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 25th Jan 2005 19:12
You still haven't answered the Question of what window you are trying to make.

There a whole host of different things you do with the Creat Window command, for example, you can make a normal, Windows style window, or you can make a button, and the list goes on.
Tell us what you're trying to do, exatcly what you want it for, and we may be able to help, but, if you don't, then we're going to have a very difficult time.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 25th Jan 2005 20:36 Edited at: 26th Jan 2005 07:49
All I really want to know is how to specify that and what I am suppose to put there.

Like to set the display mode you would


What would be the darkbasic code for this. The syntax.



It does not matter what type of window. Just give me an example of how to use it.

Don't let life get you down, it will only get better.
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 26th Jan 2005 07:50
Anyone?

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Jan 2005 09:08
So, you want to change the screen resolution?

Or, do you want to make a whole new window, that looks like the DBP window, and change its resolution?

Because, as I said, there are heaps of different types of windows you can make.

Also, you're better off using the CreateWindowEx function, instead of the CreateWindow function, as it is superceded.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 26th Jan 2005 20:30
It does not matter. Lets use CreateWindowEx then. Just pick a type of window. All I want is an example code of how to use the dll to create a window with that command.

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 27th Jan 2005 03:57
Well, ok.

Here's some button code I posted just the other day. It uses CreateWindowEx

http://forum.thegamecreators.com/?m=forum_view&t=46659&b=10

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 27th Jan 2005 04:40
If you could post what each thing in the CreateWindowEx command does, it would be much appreciated.

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 27th Jan 2005 13:05
It's all explained on MSDN.

I can't explain it any better than that.
You're going to have to research the structures and Macros ( if any ) that it needs, which are ALL Linked to from the function page, or are easily available via a simple search of MSDN.

I never knew anything of API when I first started either, and it was dawnting, but it's really quite easy once you get your head around how it asks for pointers to strings, not the strings themselves etc

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 27th Jan 2005 20:13
No.
I mean like what would be the code for it in DB. I can basicly understand the VisualBasic code on MSDN. I only thing is, I am having trouble converting to from VisualBasic to DB. That is what I need help on.

Don't let life get you down, it will only get better.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 27th Jan 2005 21:54
Yeah, you would have a bit of a problem, because LPCTSTR ~ translates to VB's String data type, but DB's String data type is a char[] array..

The best thing you can do, is make either a VB or a C wrapper DLL for the function.

I only do VB, and I couldn't get vbAdvance to work with DBCe so... (makes rocket-shooting and exploding noises)

Avatar - white cat in a snowstorm. Look closely.
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 28th Jan 2005 04:35
JessTicular was able to do it and it is possible.

This is what I think it is.
This what I need help on.

dwExStyle=The style of the window or the layout
lpClassName=?
lpWindowName=The name of the window
dwStyle=Another style command for the window
x=The x coordinate of the window
y=The y coordinate of the window
nWidth=The width of the window
nHeight=The height of the window
hWndParent=?(I think it has something to do with the parent window)
hMenu=?
hInstance=?
lpParam=?

If anyone can help me understand the ones with ?, I will apriciate it.

Don't let life get you down, it will only get better.
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 28th Jan 2005 07:38
Simple example code for the correct way to do this would be nice also. I have tried many times to get this to work and can't. This is the first time using a dll to create a window and can't get it to work.

Don't let life get you down, it will only get better.
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 28th Jan 2005 22:49
Can anyone help?

Don't let life get you down, it will only get better.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Jan 2005 09:46
I posted a link up there, a few posts back to where I made some functions that deal with buttons.

The code, everything works, except the pointers to strings, which I didn't convert to MemBlocks because it can get messy, and leave memory footprints behind unnecessarily.

If you disect my button code there, you'll see I use the CreateWindowEx function, and pass it all the parameters it needs, so all you have to do is work out the method of getting pointers to strings using MemBlocks.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!

Login to post a reply

Server time is: 2025-05-29 05:47:05
Your offset time is: 2025-05-29 05:47:05