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.

Dark GDK / How do you get DarkGDK to work internially?

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 16:24
I only know how to get darkGDK to work with itself, but how would you get it so that it works internially, like when you press up, the computer shuts down, or it comes up when the computer starts?

And is there a way of accesing the internet through darkGDK? Like it checks for something and if that something is true, it opens a web browser?

thanks for any help, especially for the first question.

~~Its not about what you know, its about how you figure it out.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 5th Jun 2008 17:06 Edited at: 5th Jun 2008 17:07
You can have Windows run any application that you want by adding that application to your Startup Group.

You will need to steal the keyboard to some greater extent than GDK does to use the kbd in the background.

There are several ways to access the Internet using Windows, but the simplest way is to use the WinHTTP functions. You already have all of the documentation necessary to use WinHTTP. It is not particularly difficult, but as with anything substantial, it takes some effort on your part to get it going.

That almost always involves and include file, and another library linkage.

Study it a bit, and if you want some sample code (iirc, there's plenty of it in the Windows docs.), I could provide a Win32 app, but...I'm not so sure on the GDK version. GDK does not like my system very much....it, and I are too old.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 17:30
Yeah, I didn't really mean DarkGDK, I really meant c++.

Quote: "I could provide a Win32 app, but..."


That would help a lot, though if it is too much of a problem, it isn't that huge of a deal. I really just wanted to know if it was possible.

Thanks for the help!

How would I get it so I can make a program that uses the internet?

~~Its not about what you know, its about how you figure it out.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 5th Jun 2008 17:49 Edited at: 5th Jun 2008 17:49
You can use either WinInet, or WinHTTP. WinInet can do HTTP, FTP, Gopher and some other protocols, iirc. WinHTTP is a very complete HTTP API. If you search for WinHTTP in MSVC help, you should find alot of documentation.

I will try to find time to write you a Win32 sample, but it is not exactly a simple matter. It takes some setup to get it going. I wrote one in DBPro a while back, and I know that others have also done this.

To use winhttp, add the library winhttp.lib and include winhttp.h That will get you started at least. You can do this in GDK, although you might end up wanting to open a non-GDK window for it. I am not certain about that, however. Anyway, WinHTTP apps begin the process by obtaining a session handle using the function WinHttpOpen. If you look up the function...there is a snippet of code to get you started. Next, using that handle you'd connect to a website using WinHttpConnect, which also has a substantial code snippet in the help file.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 18:36
Thanks for all the help!

I am going to try winHTTP, and see if I can get it working.

Quote: "I will try to find time to write you a Win32 sample, but it is not exactly a simple matter. It takes some setup to get it going. I wrote one in DBPro a while back, and I know that others have also done this.
"


It isn't really a problem, don't rush it. Also it doesn't have to be complicated, possibly something like opening the start menu.

Also, is there a way of opening OTHER programs, like microsoft word, and using those with GDK, or c++? Also, is there a way of getting GDK or c++ to type stuff, like make a macro that just types 12345 in microsoft word?

Thanks!

~~Its not about what you know, its about how you figure it out.~~
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 18:46
Quote: "You can use either WinInet, or WinHTTP. "

Do you use one of them? And also, where can you find a download of winHTTP? I tried looking for it, but I found a .dll file, and this website-
http://msdn.microsoft.com/en-us/library/aa384276(VS.85).aspx
doesn't even give you the download!

Thanks-
I think I will try winHTTP first, and see if it will do the things I need it to do.

~~Its not about what you know, its about how you figure it out.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 5th Jun 2008 18:56
You can use dbExecuteFile, or dbExecuteExecutable to execute a file in GDK. There are two main ways to do it in C++...WinExec, which is what the first GDK function appears to use, and CreateProcess, which seems to be what the second GDK function does.

You can fake up keypresses to another application if you know its window handle by posting WM_CHAR messages. You might also try using the Windows clipboard, too. Many of MS programs use OLE or DDE, which are advanced interprocess communications mechanisms.

The simplest way to get text into Word is to place the text in a file, and pass the filename as an argument to the dbExecuteFile function.

Word and all of Office expose an Application object that you can use from C++ to totally control them, including adding text to open documents. (In fact, Excel and Access are easily reachable from C++.)
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 19:03
Thanks, I don't know how you know all of this! I thought it would be really hard opening a different program.... It opens up tons of possibilities.

~~Its not about what you know, its about how you figure it out.~~
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 5th Jun 2008 19:14
hm... I tried dbExecuteFile, but it says char* pFilename1, char* pFilename2, and char* pFilename3....

What does this mean? I tried googling it, but no search results came up...

I know for the darkGDK.h file there is a information document that tells you what the different codes mean, like dbMoveobject moves the object forward.

Is there one for darkSDK?

Thanks again

~~Its not about what you know, its about how you figure it out.~~
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Jun 2008 22:44
Is DarkSDK included with DarkGDK? Do they have the same license?

If you can do any models for FW, reply to the FleetWars thread.

Click here!
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 6th Jun 2008 01:10
I don't even know where I got darkSDK.... i can't remember where I downloaded it.....

~~Its not about what you know, its about how you figure it out.~~
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 6th Jun 2008 02:56
DarkSDK is the old name for DarkGDK.


My site, for various stuff that I make.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 6th Jun 2008 03:45
Yeah, but there are different codes for the SDK then the GDK, like teh GDK doesn't have dbLoadAnimation ();

So is there an information thing for the SDK and it's codes?

~~Its not about what you know, its about how you figure it out.~~
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 8th Jun 2008 03:52
It's all the same thing. Parts of the GDK contain files that say SDK in them, but that is only because they haven't been renamed. DarkSDK was sold here before being released freely with VC++. When they partnered with Microsoft, the name was changed.


My site, for various stuff that I make.
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 8th Jun 2008 04:59 Edited at: 8th Jun 2008 05:02
Quote: "I only know how to get darkGDK to work with itself, but how would you get it so that it works internially, like when you press up, the computer shuts down, or it comes up when the computer starts?"


I'm not sure if I understood you right, but you mean if you press a button, the computer should shut down or you want it to run on startup?

The startup shouldn't be hard because DarkGDK has Registry editing functions built in. Try this (NOTE: Untested! Theoretically it should work). Say we had a game called My Game.


1st Parameter- Location of folder
2nd Parameter- Name of new key
3rd Parameter- Location of your game executable.

But, use caution. Playing around with the registry can result in a fatal computer crash.

Quote: "And is there a way of accesing the internet through darkGDK? Like it checks for something and if that something is true, it opens a web browser?"

I don't think there is.

But, you can use ASP.NET and set some user-dynamic global variables, store them in a server as a txt file, and use Winsock to download the text file, and use a file stream to interpret the text file.

For example-
A user purchases something from your site and the boolean global variable isBought is flagged true. The outcome is saved as bought.txt file in your server:


Then you would use a file stream to download bought.txt. If the string inside bought.txt == "isBought = True", then perform this action.

I'm sorry, I'm having a hard time explaining. Don't hesitate to ask if I made myself unclear.

dbPrint ( "Sig" );
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 8th Jun 2008 05:11
Quote: "
But, use caution. Playing around with the registry can result in a fatal computer crash.
"


I think I will keep that in mind. I DO NOT WANT THAT HAPPENING!

Other then that, I heard of winHTTP from jinzai, does anyone use that? I didn't necisarily mean darkGDK, I meant c++ in general.

Quote: "
I'm sorry, I'm having a hard time explaining. Don't hesitate to ask if I made myself unclear."


I have been there... I think you were clear enough for the time being, later I might ask some more questions.

Thanks

[img]C:\Users\Byron\Pictures\DGDK FORUM\Pics of screen\arena.jpg[/img]
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 8th Jun 2008 05:21
winHHTP is in the Platform SDK.

You #include "winhttp.h". Make sure you have referenced all the libs etc.

dbPrint ( "Sig" );
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 8th Jun 2008 05:36
wow, all these thing are starting to get me confused.

So winHTTP is a way of accesing the internet through c++?
I HAVE winHTTP already?

Thanks.

dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 8th Jun 2008 06:27
I'm sorry I'm confusing you. Simply put, if you have the Platform SDK (that includes the Windows SDK for Vista), you have winHTTP. All you have to do is include winhttp.h and make sure all its libs are referenced in Tools > Options > Directories. Because of my lack of ability to explain, I dug up a link for you- http://bbulkow.blogspot.com/2006/04/winhttp-and-visual-studio-2005-howto.html - it pretty much explains it all.

dbPrint ( "Sig" );
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 8th Jun 2008 13:39
Thanks, now I can acces the internet! Hopefuly....

Login to post a reply

Server time is: 2024-11-17 17:21:58
Your offset time is: 2024-11-17 17:21:58