Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (NnamueN, 1 invisible), 1,489 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 2 of 4 1 2 3 4
Re: Win API with Lite-C Pure Mode [Re: RedPhoenix] #151745
09/03/07 11:32
09/03/07 11:32
Joined: May 2007
Posts: 175
Germany
dblade Offline
Member
dblade  Offline
Member

Joined: May 2007
Posts: 175
Germany
Great Idea but if you want to create a big application with many menus you may have a lot of graphics and so on the design is one of the hardest parts (with GIMP).
With the WinAPI you have to write a lot of code but all looks clean then and you can use it with every resolution

Alternative create your images and use the great A6GUI created by BloodLine.

Re: Win API with Lite-C Pure Mode [Re: dblade] #151746
09/03/07 12:24
09/03/07 12:24
Joined: Aug 2006
Posts: 78
A
amadeu Offline OP
Junior Member
amadeu  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 78
Hi.

thank you. it works.
But if I want to call one function when I click in Open or quit, How I could do this?

Re: Win API with Lite-C Pure Mode [Re: amadeu] #151747
09/03/07 14:59
09/03/07 14:59
Joined: May 2007
Posts: 175
Germany
dblade Offline
Member
dblade  Offline
Member

Joined: May 2007
Posts: 175
Germany
Thats difficult in pure-mode i think
Will take a while to solfe this problem
I'll look for a way buut i can't promise anything maybe other users know something?

LiteC is a young language and noone except the creator knows all possibilitys

Re: Win API with Lite-C Pure Mode [Re: dblade] #151748
09/03/07 15:39
09/03/07 15:39
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
Please look into my post, this is exactly what I was speaking of. When clicking on a menuitem in the menu, the API sends a Message to the engine window, but it's difficult to receive this Message without having the sourcecode of the hole engine I think, because you can't implement a message receiver for those messages that easy. In Legacy mode that could may be done, but at least I don't know how

Re: Win API with Lite-C Pure Mode [Re: RedPhoenix] #151749
09/03/07 17:39
09/03/07 17:39
Joined: Aug 2006
Posts: 78
A
amadeu Offline OP
Junior Member
amadeu  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 78
hi

ok.

I will wait for your solution.

thanks

Re: Win API with Lite-C Pure Mode [Re: amadeu] #151750
09/05/07 09:06
09/05/07 09:06
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You need to hook into the engine's message loop for retrieving messages. The ScanMessage pointer can be used for that. It's a pointer in the ev struct that you can set to your own message interpreter function.

http://manual.conitec.net/prog_sending.html

Re: Win API with Lite-C Pure Mode [Re: jcl] #151751
09/05/07 09:07
09/05/07 09:07
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
Interesting I'll look into it, if I have success I'll post it here.

Re: Win API with Lite-C Pure Mode [Re: RedPhoenix] #151752
09/08/07 14:02
09/08/07 14:02
Joined: Aug 2006
Posts: 78
A
amadeu Offline OP
Junior Member
amadeu  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 78
hi

Did you get it?

Thx

Re: Win API with Lite-C Pure Mode [Re: jcl] #151753
09/18/07 19:15
09/18/07 19:15
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline
Member
yorisimo  Offline
Member
Y

Joined: Mar 2007
Posts: 197
Could you provide some more information about how to use ScanMessage. I've looked in the manual, at the Lite-C legacy examples, and the GStudio include files and I'm still having trouble. I have some questions about the engine window that is created by default when using Lite-C pure mode (I'll just call it Engine Window)
All my questions refer to Lite-C Pure mode.
1.Does the Engine Window automatically check for messages using GetMessage?
2.Is the Engine Window created using the WNDCLASS or WNDCLASSEX class and CreateWindow or CreateWindowEx?
3.Is the lpfnWndProc member of one of those classes set to ScanMessage by default?
Or do i need to use SetWindowLong, or some other Win API function to change the Window Procedure function?
4.I figured out I can use SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_SIZEBOX); ShowWindow(hWnd,SW_SHOW); to activate the maximize button and make the window sizeable. I also know how to get the current client area using GetClientRect() which I can use to adjust the resolution to mathch the resolution to the client area. However It seems video_set() affects window style, so the maximize button becomes inactive. What does video_set use to adjust the window resolution and why is it affecting the style?

I've included some code so it might be easier for you to find where I've made mistakes or if I'm totally on the wrong track. It runs, but nothing happens when you select the menu items, or click in the engine window. I put a beep in the ScanMessage function to see if it ever gets called--It doesn't!. So how do I use ScanMessage?! (Where/when/how does ScanMessage get called?)

Code:
 
#include <acknex.h>
#include <default.c>
#include <windows.h>

function ScanMessage(UINT message, WPARAM wParam, LPARAM lParam);

function main()
{
wait(1);

HMENU menu=CreateMenu();
HMENU hSubMenu=CreateMenu();
InsertMenu(hSubMenu,0,MF_BYPOSITION|MF_STRING,1,"BEEP");
InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,2,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"File");

//SetWindowLong(hWnd,GWL_WNDPROC, &ScanMessage); //(Causes Crash with or without '&')

//Change Window style to activate Maximize button
SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_SIZEBOX);
SetMenu(hWnd,menu);
ShowWindow(hWnd,SW_SHOW);

// I'm not sure if this part is already taken care of somewhere?
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);

wait(1);
}
///////////////////////////////
}

function ScanMessage(UINT message, WPARAM wParam, LPARAM lParam){
error("here");
switch(message){
case WM_LBUTTONDOWN:
MessageBox(NULL, "L mouse down","info", MB_OK);
break;
case WM_RBUTTONDOWN:
MessageBox(NULL, "R mouse down","info", MB_OK);
break;
case WM_COMMAND:
switch(wParam){
case 1: beep(); break;
case 2: sys_exit(NULL);
}
default:
MessageBox(NULL, "default","info", MB_OK);
}
return;
}



Re: Win API with Lite-C Pure Mode [Re: yorisimo] #151754
09/20/07 15:05
09/20/07 15:05
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline
Member
yorisimo  Offline
Member
Y

Joined: Mar 2007
Posts: 197
Has anyone used ScanMessage successfully for tapping into the engine window message loop? Could you post some hints/examples of how to use it?

Page 2 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1