window handles in windows

You must understand the Game Editor concepts, before post here.

window handles in windows

Postby themightymekon » Fri Jan 09, 2015 3:16 pm

Hi There,

I am a newcomer, but read most of what I found, so I understood the concept, from previous knowledge of C etc.

I did not have time for a thorough search of the forum, but I wonder if one can use a command to get a handle on a window, or a dll etc.

if NOT is it possible to run a .JS or .VBS file in windows xp. ?????

I only intend to do this on my own use games, to allow me to use the windows scripting host tech to supply commands that are not in Game editor. The solution can be stored in a file by the .JS, which then send a message to the game window to say it is there. The GED can be scripted to pick the data up from the file and maybe delete it after its read ? The .JS itself could be written to the script file by the GED, and maybe the .JS script RUN by a sent hotkey ?That is, if there is still no RUN/EXECUTE in GE.

Also , I only found a page of HTML on scripting, AND there seems to be no complete list of commands reference.
If I spoke wrong, I apologise for it. Please give me the link to that info so that anyone landing here can go right there?

Thanks for a nice easy IDE , by the way !

:D
User avatar
themightymekon
 
Posts: 40
Joined: Sat May 10, 2014 11:29 am
Score: 2 Give a positive score

Re: window handles in windows

Postby skydereign » Sat Jan 10, 2015 4:19 am

themightymekon wrote:I did not have time for a thorough search of the forum, but I wonder if one can use a command to get a handle on a window, or a dll etc.

Nothing like that is built into gE. You would have to write your own program to run along side gameEditor to get functionality like that.

themightymekon wrote:if NOT is it possible to run a .JS or .VBS file in windows xp. ?????

You can execute javascript files using Node.js or PhantomJS. As for vbs files a quick google search implies the answer is yes.

themightymekon wrote:The GED can be scripted to pick the data up from the file and maybe delete it after its read ?

gE cannot delete files right now, though if you are already having your own program running alongside gE it can easily delete the file for you.

themightymekon wrote:Also , I only found a page of HTML on scripting, AND there seems to be no complete list of commands reference.

If you mean a reference for functions in gE there is. http://game-editor.com/docs/script_reference.htm
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: window handles in windows

Postby themightymekon » Tue Jan 13, 2015 3:36 pm

:idea:

Thanks for the prompt reply, skydereign

I am embarrassed by my lack of knowledge about windows programming in general :roll:

After starting this thread, I read up on JavaScript, which seems closer syntax to GED C script. I wrote two programs in Jscript form, in a plain text editor, then I saved each as a JS file.

Working from easiest I made a messagebox typing 'Hello' when the JS is clicked on the D/top.

Then I wrote a 2nd script which creates a file, writes into it a message [without opening any editor], then close that file.

I click that file's icon on D/top where it appears, and my favourite editor Associated in Xp with TXT FILES [I don't use Notepad]

displays the file correctly. I read that there are commands to read in data from a resource file -- which can be a TXT -- into a running GE Game.
This indicates it will be possible to construct a c Script function, in GE Editor, which can display any parts of that text as Text Actor objects, so that one may moving animate them in various displays. So the output from another running program which may put script into a file, can be animated in a GE window.

That leaves me with the reverse problem to solve. Which is for GE to write results into a file, for input to another running program, or maybe if there is a SendMessage, or such, can circumvent this need.

When I right drag an icon in my Windows explorer D/top or any folder, I get a menu, popup, and choose "Create a Shortcut" which leaves a shortcut at the target drop. The difference is this. Right click onto a shortcut gives a different properties form, in which you can fix a windows hotkey to execute this shortcut. It also allows one to add arguments{parameters} in its command.


If there is a means of sending keystrokes to windows, I imagine one may excite this hotkey, and launch the shortcut which opens the original file. Perhaps you GEDs know and can tell me how that is done in the c Script?

I speak all this from memory of my home laptop, which is not on the internet. With my memory loss, this may all be wrong. I contacted the forum from a public dumb terminal, where I can not verify my assertions.
User avatar
themightymekon
 
Posts: 40
Joined: Sat May 10, 2014 11:29 am
Score: 2 Give a positive score

Re: window handles in windows

Postby bat78 » Tue Feb 03, 2015 8:36 am

Game Editor is pretty much about Games, not "windows programming".
Windows programming refers to the usage of WinAPI for Windows-alike shell. (DOS 16bit / 32bit or Windows cmd shell 32bit / 64bit)
But in game-editor, libraries are pre-included. You are able to take advantage of the following standard libraries:
  • stdio.h / fopen, freopen, fprintf, sprintf, sscanf, fscanf, fread, fwrite, fgetc, fgets, fputc, fputs, ftell, fseek, fclose, feof, NULL, EOF, SEEK_SET, SEEK_CUR, SEEK_END, FILE, size_t /
  • stdlib.h / malloc, free, calloc, realloc, atoi, atol, atof, rand, abs, NULL, size_t /
  • string.h / strlen, strcpy, strncpy, strcmp, strncmp, memcpy, memmove, memset, strcat, strchr, NULL, size_t /
  • math.h / acos, cos, sin, tan, asin, atan, atan2, ceil, floor, cosh, sinh, tanh, exp, frexp, ldexp, log, log10, modf, pow, sqrt, fmod, abs /

Game Editor engine disable some functions like printf because of the stdin and stdout disassembly. And some other functions that are reasonably irrelevant.

The "Game Editor Window" is actually a SDL window. You have no direct real-time access to SDL functions so you can not "get handle to it" (considering you want to do something with it). Otherwise.. the literal HANDLE to a window you can only achieve with WinAPI functions for obtaining window handle, but not in this environment, because as I said, you can not include 3rd party libraries powered by dlls or standart ones. You can not use stdin and stdout and call the core. (win32 shell for e.g)

Game-Editor isn't an IDE. It is not Integrated. Game-Editor is an "Open Source Multi-Platform Non-Internationalized SDL-based Engine for 2D Non-Object-Oriented C89-powered Game Creation written in C++ and suitable for Windows"
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: window handles in windows

Postby themightymekon » Sat Feb 28, 2015 12:36 pm

Thanks , and sorry for delays,

I actually understand most of that and I am sure it is good to refer to. Just one thing though. Will you please expand the acronyms for those of us not in the know? --

> Game-Editor isn't an IDE. It is not Integrated. Game-Editor is an "Open Source Multi-Platform Non-Internationalized SDL-based Engine for 2D Non-Object-Oriented C89-powered Game Creation written in C++ and suitable for Windows"

Regards ,

themightymekon
User avatar
themightymekon
 
Posts: 40
Joined: Sat May 10, 2014 11:29 am
Score: 2 Give a positive score

Re: window handles in windows

Postby bat78 » Sat Feb 28, 2015 7:25 pm

I would not, normally, because it is off-topic and you can just type it in google and get detailed information on the second.
But since I have nothing else to do anyway..

SDL is multimedia library that stands for "Simple DirectMedia Layer" (as much as I remember).
And IDE is Integrated Development Environment. A program, dedicated for developers. It consists of a Text Editor, tools, compiler and debugger.

By the way, if you are a good programmer, you will not program in IDE. If you so much want to program in IDE, then create your own, that does everything you want.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: window handles in windows

Postby themightymekon » Mon Mar 16, 2015 2:33 pm

Thanks bat78 for your good information and advice.

Time to close this thread now and ask more questions.

themightymekon

:D
User avatar
themightymekon
 
Posts: 40
Joined: Sat May 10, 2014 11:29 am
Score: 2 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron